/*
 * ZS Ustek - responzivni doplnek ke style9.css
 * Vytvoreno pro stavajici sablony (PHP 5.6 kompatibilni, zadny zasah do PHP).
 * DESKTOP: puvodni vzhled ponechan beze zmen; vsechny upravy nize jsou
 * omezeny na sirku 1179 px a mene.
 */

#mobileNavBar { display: none; }
#mobileTopBrand { display: none; }


@media screen and (max-width: 1179px) {
  /* Horni nizky pruh: skutecny widget GTranslate je v HTML pred logem.
     Mobilne neni plovouci - vlajecky patri do tohoto pruhu. */
  body > .gtranslate_wrapper {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 20;
    display: flex !important;
    align-items: center;
    /* Od leveho okraje: prvni ceska vlajka se nikdy neoreze. */
    justify-content: flex-start;
    gap: 4px;
    width: 100% !important;
    max-width: 900px;
    min-height: 44px;
    height: auto !important;
    margin: 0 auto !important;
    padding: 6px 12px 6px 20px !important;
    scroll-padding-left: 20px;
    background: #fff;
    border-bottom: 1px solid #dedede;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    box-sizing: border-box;
  }
  /* Nektere verze GTranslate vytvareji i vnitrni obal s vlastnim posunem. */
  body > .gtranslate_wrapper > div,
  body > .gtranslate_wrapper > span {
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    flex: 0 0 auto;
  }
  body > .gtranslate_wrapper a {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  body > .gtranslate_wrapper img {
    vertical-align: middle;
    max-height: 26px;
    width: auto;
  }
  #mobileTopBrand {
    display: block;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 4px 14px 2px;
    background: #f8f8f8;
  }
  .mobileBrandLogoWrap {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
  }
  .mobileBrandLogoWrap a {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    text-decoration: none;
  }
  .mobileBrandLogo {
    display: block;
    width: 70%;
    max-width: 320px;
    min-width: 170px;
    height: auto;
    max-height: 70px;
    object-fit: contain;
  }


  html { box-sizing: border-box; -webkit-text-size-adjust: 100%; }
  *, *:before, *:after { box-sizing: inherit; }
  html, body { max-width: 100%; width: 100%; }
  body {
    margin: 0;
    min-width: 0;
    background: #eeeeee;
    color: #414141;
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: break-word;
  }

  /* Mobilni hlavicka: bez loga, sovy, kontaktu a ikon, ale se svatky a odpoctem. */
  #container {
    width: 100%; min-width: 0; min-height: 0;
    background: none;
  }
  #header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    align-content: flex-start;
    gap: 6px 14px;
    position: relative;
    max-width: 900px;
    width: 100%; height: auto;
    padding: 4px 14px 8px;
    margin: 0 auto;
    background: #f8f8f8;
    border-bottom: 3px solid #ba3450;
  }
  /* Prvky zustavaji v HTML a na desktopu; mobil je nezobrazuje. */
  #header > a:first-child,
  #sova,
  #headerText .kontakt,
  #znakSponzor00, #znakSponzor11, #znakSponzor22, #znakSponzor33,
  #znakAI, #znakSponzor, #znak {
    display: none !important;
  }
  #headerText {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
    float: none;
    width: 100%; min-width: 0; height: auto;
    margin: 0; padding: 0;
  }
  #headerText .svatky, #headerText .odpocet {
    grid-column: 1 / -1;
    display: block;
    float: none;
    width: 100%; min-width: 0; height: auto;
    margin: 0;
    overflow-wrap: anywhere;
  }
  #headerText .svatky {
    padding: 9px 12px;
    color: #555;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.6;
    background: #fff;
    border: 1px solid #dfdfdf;
    border-radius: 8px;
  }
  #headerText .jidelna {
    display: inline;
    float: none;
    font-size: 13px;
  }
  #headerText .svatky .headHome {
    display: inline-block;
    float: none;
    margin: 3px 0 0;
    padding: 0;
  }
  #headerText .svatky .headHome a { display: inline-block; }
  #headerText .headerFrame {
    min-height: 0;
    height: auto;
    padding: 0;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 8px;
  }
  #headerText .odpocet {
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
  }
  #headerText .odpocet .padding { padding: 10px 12px; }
  #headerText .odpocetHodiny { display: none; }

  /* Tlacitko menu: bez JavaScriptu zustane puvodni menu normalne pristupne. */
  #container2 {
    display: flex;
    flex-direction: column;
    width: 100%; max-width: 900px;
    margin: 0 auto;
    padding: 0 14px 20px;
  }
  html.mobile-js #mobileNavBar { display: flex; }
  #mobileNavBar {
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
    min-height: 56px;
    width: 100%;
    margin: 10px 0 12px;
    padding: 6px 8px;
    background: #454545;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.13);
  }
  #mobileNavToggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 14px 8px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 6px;
    background: #b62f4b;
    color: #fff;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
  }
  .mobileNavBars { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 20px; height: 21px; }
  .mobileNavBars span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }
  #mobileNavToggle:focus, #mobileNavToggle:hover { outline: 2px solid #f8d6df; outline-offset: 2px; }
  .mobileNavHome {
    color: #fff;
    text-decoration: underline;
    padding: 9px 6px;
    font-size: 14px;
    text-align: right;
  }
  .mobileNavHome:hover, .mobileNavHome:focus { color: #fff; }
  html.mobile-js #leftMenu { display: none; }
  html.mobile-js.mobile-menu-open #leftMenu { display: block; }

  /* Levy sloupec preusporadan na plnou sirku bez duplikace navigace. */
  #leftMenu {
    display: block;
    float: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0 0 14px;
    padding: 12px;
    background: #fff;
    border: 1px solid #dedede;
    border-radius: 9px;
    box-shadow: 0 2px 7px rgba(0,0,0,.04);
  }
  #leftMenu > div, #leftMenu > form, #leftMenu > .boxes,
  #menuKorona, #menuKontakt, #menuKuk, #menuJidelnaAI, #menuOnline,
  #menu1, #menu2, #menu22, #menu3, #menu4, #menu5 {
    float: none;
    width: 100%; max-width: 100%;
    height: auto;
    padding: 0;
    margin: 0 0 10px;
    background: none;
  }
  #leftMenu .menuTitle,
  #menuJidelnaAI .menuTitle, #menuKuk .menuTitle, #menuKorona .menuTitle,
  #menuKontakt .menuTitle, #menuOnline .menuTitle,
  #menu1 .menuTitle, #menu2 .menuTitle, #menu22 .menuTitle,
  #menu3 .menuTitle, #menu4 .menuTitle, #menu5 .menuTitle {
    position: static;
    display: block;
    height: auto; min-height: 43px;
    line-height: 1.45;
    margin: 0;
    padding: 10px 12px;
    color: #373737;
    font-size: 15px;
    background: #eee;
    border-radius: 6px;
    cursor: pointer;
  }
  #menu2 .menuTitle, #menu22 .menuTitle { padding-left: 12px; }
  #menu1 .menuTitle img, #menu3 .menuTitle img,
  #menu4 .menuTitle img, #menu5 .menuTitle img { margin: 0 8px 0 0; }
  #menuJidelnaAI .menuTitle a, #menuKuk .menuTitle a,
  #menuKontakt .menuTitle a, #menuKorona .menuTitle a,
  #menuOnline .menuTitle a, #menu2 .menuTitle a, #menu22 .menuTitle a {
    position: static;
    display: block;
    width: 100%; max-width: 100%; height: auto;
    min-height: 0; line-height: 1.45;
    padding: 0;
    margin: 0;
    background: none;
    color: #343434 !important;
    font-size: 15px !important;
    font-weight: 700;
  }
  #menu1 .obsah, #menu2 .obsah, #menu22 .obsah,
  #menu3 .obsah, #menu4 .obsah, #menu5 .obsah {
    width: 100%; max-width: 100%;
    padding: 0 0 6px;
    background: #fafafa;
    border-radius: 0 0 6px 6px;
  }
  #menu1 .obsah .padding, #menu2 .obsah .padding,
  #menu22 .obsah .padding, #menu3 .obsah .padding,
  #menu4 .obsah .padding, #menu5 .obsah .padding {
    padding: 6px 8px;
    background: none;
  }
  #menu1 .obsah a, #menu2 .obsah a, #menu22 .obsah a,
  #menu3 .obsah a, #menu4 .obsah a, #menu5 .obsah a {
    display: block;
    position: relative;
    left: auto !important;
    width: 100%; max-width: 100%;
    height: auto; min-height: 42px;
    line-height: 1.35;
    padding: 10px 10px 10px 14px;
    margin: 0;
    border-bottom: 1px solid #ececec;
    color: #a32d48;
    font-size: 15px;
    white-space: normal;
  }
  #menuJidelnaAI .jidelnaAIbox {
    width: 100%; max-width: 100%; height: auto;
    margin: 0; padding: 8px;
  }
  #menuJidelnaAI .jidelnaAIbox a {
    position: static;
    display: block;
    height: auto !important;
    line-height: normal !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  #menuJidelnaAI .aiFotoNahled {
    display: block;
    max-width: 100%; width: 145px !important; height: auto;
    margin: 0 auto !important;
  }
  #leftMenu .boxes {
    width: 100%;
    margin: 12px 0;
    padding: 10px;
    text-align: center;
    overflow: hidden;
  }
  #leftMenu .boxes > iframe { max-width: 100%; }
  #leftMenu .search input[type='text'] {
    width: 100%; max-width: 220px;
    min-height: 30px;
    background-color: #fff;
  }
  #leftMenu .search table { width: 100%; }
  #leftMenu .search td:first-child { width: 100%; }
  #leftMenu .search td { padding: 0 3px; }

  /* Obsah: stejny text, HTML, odkazy a fotky - jen tekute rozmery. */
  #content {
    width: 100%; max-width: 100%; min-width: 0;
    margin: 0;
    padding: 0;
  }
  #textNadpis {
    width: 100%; max-width: 100%; height: auto; min-height: 0;
    margin: 0 0 10px;
    padding: 0 2px;
    line-height: 1.4;
    background: none;
  }
  #textNadpis h1 {
    position: static;
    width: 100%; height: auto;
    margin: 0; padding: 0;
    color: #333;
    font-size: 23px;
    line-height: 1.3;
    overflow: visible;
    overflow-wrap: break-word;
  }
  #text {
    display: block;
    width: 100%; max-width: 100%; min-width: 0;
    min-height: 0;
    padding: 16px 0 26px;
    margin: 0;
    background: #fff;
    border: 1px solid #dadada;
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0,0,0,.04);
    color: #444;
    font-size: 16px;
    line-height: 1.55;
  }
  #text .marginText {
    width: auto;
    max-width: 100%; min-width: 0;
    margin: 0 18px;
    padding: 0;
    overflow-wrap: anywhere;
  }
  #text .marginText img,
  #text .marginText svg,
  #text .marginText canvas,
  #text .marginText video,
  #text .marginText object,
  #text .marginText embed,
  #text .marginText iframe,
  .titlefoto {
    max-width: 100% !important;
  }
  #text .marginText img, .titlefoto { height: auto; }
  #text .marginText video { height: auto; }
  #text .marginText iframe { min-height: 180px; }
  #text .marginText a { overflow-wrap: anywhere; }
  #text .marginText h1, #text .marginText h2, #text .marginText h3 {
    max-width: 100%;
    line-height: 1.35;
    overflow-wrap: break-word;
  }
  #text .marginText pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #text .marginText ul, #text .marginText ol { padding-left: 24px; }
  #text .marginText hr { max-width: 100%; }
  #text .marginText table { max-width: 100%; }
  .mobile-table-scroll {
    display: block;
    width: 100%; max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 8px 0 14px;
    border-radius: 4px;
  }
  .mobile-table-scroll > table { max-width: none; }
  .mobile-table-scroll > table#rozvrh { width: 680px; min-width: 680px; }
  .mobile-table-scroll > table:not(#rozvrh) { min-width: 0; }
  #text .marginText table td, #text .marginText table th { overflow-wrap: normal; }
  #text .marginText .mobile-table-scroll table td,
  #text .marginText .mobile-table-scroll table th { overflow-wrap: break-word; }
  .kontaktform { width: 100%; max-width: 100%; padding: 12px; }
  .kontaktform input:not([type='hidden']), .kontaktform textarea,
  .kontaktform select { max-width: 100%; }
  .kontaktform input[type='text'], .kontaktform input[type='email'],
  .kontaktform textarea { width: 100%; }
  .kontaktform input[name='capt'] { width: 110px; }
  .kontaktform input[type='submit'] { width: auto; min-width: 100px; min-height: 44px; }
  .nabidkaPDF a.my {
    width: 100%; max-width: 310px;
    min-height: 50px; height: auto;
    padding: 5px 12px;
    margin: 8px auto;
    line-height: 1.5;
  }
  .nabidkaPDF img {
    float: none;
    width: 140px; max-width: 100%;
    margin: 10px auto;
  }
  #news { padding: 12px 12px 12px 46px; background-position: 7px 8px; }
  .infoBox { min-height: 41px; height: auto; line-height: 1.6; padding: 9px; }
  .zpet { height: auto; line-height: 1.5; margin: 10px 2px; }
  .zpet img { margin-left: 6px; }
  .aktivita { font-size: 15px; line-height: 1.5; }
  .aktivita a { font-size: 15px; }
  #textAktivita p { text-indent: 0; }
  #text .marginText .share-buttons { margin: 18px 0; }
  #search1, #search2 { max-width: 100%; overflow-wrap: anywhere; }
  #pagination_number, #pagination_number2 { max-width: 100%; overflow-x: auto; }

  /* Galerie zachovaji puvodni obrazky a odkazy, jsou ale dotykove. */
  #fotogalerie, .fotogalerie-krouzek {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
  }
  #fotogalerie .onefoto, .fotogalerie-krouzek .onefoto {
    float: none;
    flex: 0 1 160px;
    width: 160px; max-width: calc(50% - 5px);
    height: 126px;
    margin: 0;
  }
  #fotogalerie .ramecek, .fotogalerie-krouzek .ramecek,
  #fotogalerie .onefoto .ramecek .hover,
  .fotogalerie-krouzek .onefoto .ramecek .hover { width: 100%; max-width: 100%; }
  #fotogalerie img, .fotogalerie-krouzek img { max-width: 100%; max-height: 100%; }

  /* Paticka se zalamuje, ale zustavaji vsechny puvodni odkazy. */
  #footer {
    width: 100%; height: auto;
    min-height: 90px;
    margin-top: 20px;
    padding: 12px 14px;
    background: #393939;
  }
  #foot {
    width: 100%; max-width: 900px;
    margin: 0 auto;
    color: #ededed;
    font-size: 13px;
    line-height: 1.6;
  }
  #foot .left, #foot .right {
    display: block;
    float: none;
    width: 100%;
    margin: 0;
    padding: 6px 0;
    line-height: 1.6;
    overflow-wrap: anywhere;
  }
  #foot a { text-decoration: underline; }
  #foot .right img { vertical-align: middle; max-width: 90px; height: auto; }
  #headervanoce { left: 0; top: 0; max-width: 180px; background-size: contain; }
  #footervanoce { max-width: 100%; }
  .vlajkaSvatek { left: 0; max-width: 120px; height: auto; }
}

@media screen and (max-width: 430px) {
  #header { padding: 10px 10px 12px; gap: 5px 8px; }
  #headerText { gap: 8px; }
  #headerText .svatky { font-size: 13px; }
  #container2 { padding: 0 9px 16px; }
  #text .marginText { margin: 0 12px; }
  #textNadpis h1 { font-size: 21px; }
  #mobileNavBar { margin-top: 8px; }
  .mobileNavHome { font-size: 13px; }
  #leftMenu { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  #mobileNavBar, #mobileNavToggle { scroll-behavior: auto; transition: none; }
}
