/* web.css – vzhled webu ZBZS Odolov. Barvy se mění jen v proměnných hned níže.
   Výchozí je mobil, od 600 px tablet, od 1024 px logo a menu vlevo, obsah vpravo. */
:root {
  --primarni: #a5101d;
  --tmava: #7d0c15;
  --akcent: #e4b75d;
  --akcent-svetly: #f3d9a4;
  --text: #12203d;
  --tlumeny: #5d6880;
  --pozadi: #f6f2f3;
  --plocha: #fff;
  --jemna: #f9e8eb;
  --poznamka: #fcf4e2;
  --okraj: #e6dcdf;
  --stin: 0 2px 10px rgba(18, 32, 61, .07);
  --zaobleni: 14px;
  --pismo: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Základ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--pozadi); border-top: 5px solid var(--primarni);
  color: var(--text); font: 400 1rem/1.65 var(--pismo); overflow-wrap: break-word;
}
.rozvrzeni { flex: 1 0 auto; }
img, video { max-width: 100%; height: auto; }
iframe { max-width: 100%; border: 0; }
a { color: var(--primarni); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--tmava); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primarni); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .5em; }
h1 { font-size: 1.75rem; font-weight: 800; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p, ul, ol, blockquote, figure, table { margin: 0 0 1em; }
blockquote { border-left: 4px solid var(--okraj); padding: .2rem 0 .2rem 1rem; color: var(--tlumeny); }
.preskocit { position: absolute; left: .5rem; top: -10rem; z-index: 200; padding: .7rem 1rem; border-radius: 8px; background: var(--text); color: #fff; font-weight: 700; }
.preskocit:focus { top: .5rem; color: #fff; }

/* Hlavička na mobilu: logo + Menu, pod tím dispečink, pod tím menu */
.hlavicka {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem .75rem;
  grid-template-areas: "logo tlacitko" "dispecink dispecink" "menu menu";
  padding: .6rem 1rem .75rem; background: var(--plocha); border-bottom: 1px solid var(--okraj);
}
.logo { grid-area: logo; display: flex; align-items: center; gap: .65rem; min-width: 0; color: var(--text); text-decoration: none; }
.logo img { width: 52px; height: 52px; flex: none; }
.logo-nazev { font-weight: 800; line-height: 1.2; }
.logo-podnazev { display: none; }
.logo:hover { color: var(--text); text-decoration: underline; }

.dispecink {
  grid-area: dispecink; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 .6rem;
  min-height: 48px; padding: .45rem 1rem; border-radius: 10px; background: var(--tmava); color: #fff; text-decoration: none;
}
.dispecink::before {
  content: ""; width: 1.4rem; height: 1.4rem; flex: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f3d9a4' d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dispecink-popisek { color: var(--akcent-svetly); font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.dispecink-cislo { font-size: 1.4rem; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.dispecink:hover { background: var(--primarni); color: #fff; }

.menu-tlacitko {
  grid-area: tlacitko; display: none; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .9rem;
  border: 2px solid var(--text); border-radius: 10px; background: var(--plocha); color: var(--text);
  font: 700 1rem/1 var(--pismo); cursor: pointer;
}
.menu-tlacitko::before { content: ""; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
.menu-tlacitko[aria-expanded="true"] { background: var(--text); color: #fff; }
.js .menu-tlacitko { display: inline-flex; }

/* Bez JavaScriptu je menu vidět vždy, s ním až po stisku tlačítka Menu */
.menu { grid-area: menu; }
.js .menu { display: none; }
.js .menu.otevrene { display: block; }
.menu ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; margin: 0; padding: 0; list-style: none; }
.menu a {
  display: flex; align-items: center; height: 100%; min-height: 44px; padding: .4rem .75rem; border-radius: 8px;
  background: var(--pozadi); color: var(--text); font-weight: 600; line-height: 1.25; text-decoration: none;
}
.menu a:hover { background: var(--jemna); color: var(--tmava); }
.menu a.aktivni, .menu a[aria-current="page"] { background: var(--primarni); color: #fff; }

/* Obsah */
main { display: block; min-width: 0; padding: 1.25rem 1rem 2rem; background: var(--plocha); }
.clanek-hlavicka { margin-bottom: 1.25rem; }
.clanek-datum { margin: 0 0 .35rem; color: var(--primarni); font-size: .95rem; font-weight: 700; }
.zpet, .vse { margin-top: 2rem; font-weight: 700; }
.zpet a::before { content: "← "; }
.vse a::after { content: " →"; }

/* Třídy z těla článku (SPEC 2.7) */
.vlevo { text-align: left; }
.vpravo { text-align: right; }
.stred { text-align: center; }
.poznamka, .note-box { padding: .75rem 1rem; border-left: 4px solid var(--akcent); border-radius: 8px; background: var(--poznamka); }
.obrazek-vlevo, .obrazek-vpravo { display: block; margin: .3rem auto 1rem; }
/* <font color> ze starého webu: červená jako odkazy, kontrast AA */
.stranka-text font[color] { color: var(--primarni); }

/* Tabulky, mapy */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--okraj); text-align: left; vertical-align: top; }
th { background: var(--pozadi); }
tr:last-child td { border-bottom: 0; }
.stranka-text iframe { width: 100%; height: 24rem; border-radius: var(--zaobleni); }

/* Galerie a videa */
.galerie, .videa { margin: 2rem 0; }
.galerie-mrizka {
  display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
}
.galerie figure { margin: 0; }
.galerie .foto { display: block; overflow: hidden; border-radius: 10px; background: var(--pozadi); }
.galerie .foto img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.galerie .foto:hover img { filter: brightness(1.08); }
figcaption { margin-top: .3rem; color: var(--tlumeny); font-size: .875rem; line-height: 1.4; }
.video { position: relative; height: 0; padding-top: 56.25%; margin-bottom: 1rem; overflow: hidden; border-radius: var(--zaobleni); background: #000; }
.video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.video-soubor { display: block; width: 100%; max-height: 80vh; margin-bottom: 1rem; border-radius: var(--zaobleni); background: #000; }

/* Navigace ve vzpomínkách a článcích (předchozí = starší, další = novější) */
.clanek-navigace { display: grid; gap: .6rem; margin: 2rem 0 0; }
.clanek-navigace a { display: block; padding: .75rem 1rem; border: 1px solid var(--okraj); border-radius: var(--zaobleni); color: var(--text); font-weight: 700; text-decoration: none; }
.clanek-navigace a::before { display: block; color: var(--primarni); font-size: .85rem; font-weight: 600; }
.predchozi::before { content: "← Předchozí vzpomínka"; }
.dalsi { text-align: right; }
.dalsi::before { content: "Další vzpomínka →"; }
.stranka-clanek .predchozi::before { content: "← Předchozí článek"; }
.stranka-clanek .dalsi::before { content: "Další článek →"; }
.clanek-navigace a:hover { border-color: var(--primarni); color: var(--tmava); }

/* Filtr archivu a aktualit (rok + hledání) má smysl jen s JavaScriptem; bez něj zůstanou odkazy na roky */
.filtr, .archiv-vysledek, .js .archiv-skok { display: none; }
.js .filtr { display: flex; flex-direction: column; gap: .75rem; margin: 1.5rem 0 .25rem; padding: .75rem 1rem; border: 1px solid var(--okraj); border-radius: var(--zaobleni); background: var(--pozadi); }
.js .archiv-vysledek { display: block; min-height: 1.65em; margin: 0 0 .5rem; color: var(--tlumeny); }
.filtr-pole { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.filtr-hledat { flex: 1 1 auto; }
.filtr label { flex: none; min-width: 4.2rem; color: var(--tmava); font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.filtr select, .filtr input { width: 100%; min-width: 0; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--tlumeny); border-radius: 10px; background: var(--plocha); color: var(--text); font: inherit; }
.filtr select { width: auto; max-width: 100%; }
.filtr select:focus-visible, .filtr input:focus-visible { border-color: var(--primarni); }
.archiv-rok h2, .aktuality-rok h2 { margin: 1.75rem 0 .75rem; padding-bottom: .3rem; border-bottom: 2px solid var(--jemna); }
.archiv-odkaz, .archiv-skok { font-weight: 700; }
.karty {
  display: grid; gap: .75rem; margin: 0 0 1rem; padding: 0; list-style: none;
  grid-template-columns: minmax(0, 1fr);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}
.karty[hidden] { display: none; }
.karta a {
  display: flex; flex-direction: column; gap: .2rem; height: 100%; padding: .85rem 1rem;
  border: 1px solid var(--okraj); border-radius: var(--zaobleni); background: var(--plocha);
  color: var(--text); text-decoration: none; overflow-wrap: anywhere;
}
.karta a:hover { border-color: var(--primarni); box-shadow: var(--stin); }
.karta-datum, .karta-typ { align-self: flex-start; padding: 0 .5rem; border-radius: 6px; font-size: .8rem; font-weight: 700; }
.karta-datum { background: var(--jemna); color: var(--tmava); }
.karta-typ { background: var(--akcent); color: var(--text); }
.karta-nadpis { color: var(--tmava); font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.karta a:hover .karta-nadpis { text-decoration: underline; }
.karta-perex { color: var(--tlumeny); font-size: .92rem; line-height: 1.5; }
.karta-ukazka, .aktualita-ukazka { margin-top: .3rem; padding-top: .35rem; border-top: 1px dashed var(--okraj); color: var(--text); font-size: .88rem; line-height: 1.5; }
.karta-ukazka mark, .aktualita-ukazka mark { padding: 0 .1em; border-radius: 3px; background: var(--akcent-svetly); color: var(--text); }

/* Aktuality a úvod */
.archiv-skok { margin-top: 1rem; }
.archiv-skok ul { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0 0; padding: 0; list-style: none; }
.archiv-skok a { display: inline-block; padding: 0 .45rem; border: 1px solid var(--primarni); border-radius: 999px; font-size: .875rem; font-weight: 700; text-decoration: none; }
.archiv-skok a:hover { background: var(--primarni); color: #fff; }
.aktualita { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--okraj); scroll-margin-top: 1rem; }
.aktualita h3 { margin-top: 0; color: var(--tmava); }
.aktuality-rok > .aktualita:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.nejnovejsi { margin: 0 0 2rem; padding: 1rem; border-radius: var(--zaobleni); background: var(--pozadi); }
.nejnovejsi h2 { margin-top: 0; }
.nejnovejsi .vse { margin: .5rem 0 0; }

/* Patička */
.paticka { background: var(--tmava); color: #fff; font-size: .95rem; }
.paticka-obsah { max-width: 80rem; margin: 0 auto; padding: 1.5rem 1rem 1.75rem; }
.paticka p { margin: 0 0 .9rem; }
.paticka a { color: #fff; }
.paticka a:hover { color: var(--akcent-svetly); }
.paticka :focus-visible { outline-color: var(--akcent); }
.paticka-telefon { font-weight: 800; white-space: nowrap; }
.paticka .paticka-rok { margin: 0; color: var(--akcent-svetly); }

/* Prohlížeč fotek (vytváří ho web.js) */
.prohlizec-otevreny, .prohlizec-otevreny body { overflow: hidden; }
.prohlizec {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3.5rem .75rem .75rem; background: #0b1020; color: #fff;
}
.prohlizec[hidden], .prohlizec button[hidden] { display: none; }
.prohlizec-ramec { display: flex; flex-direction: column; align-items: center; min-height: 0; max-width: 100%; margin: 0; }
.prohlizec-obrazek { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 10rem); max-height: calc(100dvh - 10rem); border-radius: 6px; background: #222; }
.prohlizec-popisek { max-width: 50rem; margin-top: .6rem; color: #fff; font-size: 1rem; text-align: center; }
.prohlizec-ovladani { display: flex; align-items: center; gap: 1rem; margin-top: .75rem; }
.prohlizec-pocitadlo { min-width: 9rem; margin: 0; font-weight: 600; text-align: center; }
.prohlizec button {
  min-width: 48px; min-height: 48px; padding: 0 .8rem; border: 2px solid rgba(255, 255, 255, .7); border-radius: 999px;
  background: rgba(255, 255, 255, .1); color: #fff; font: 700 1.6rem/1 var(--pismo); cursor: pointer;
}
.prohlizec button:hover { background: rgba(255, 255, 255, .25); }
.prohlizec :focus-visible { outline-color: var(--akcent); outline-offset: 3px; }
.prohlizec-zavrit { position: absolute; top: .5rem; right: .75rem; }

/* Tablet: od 600 px */
@media (min-width: 600px) {
  .hlavicka { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "logo dispecink tlacitko" "menu menu menu"; padding: .75rem 1.5rem; }
  .logo { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: .75rem; }
  .logo img { grid-row: span 2; width: 64px; height: 64px; }
  .logo-nazev { align-self: end; font-size: 1.1rem; }
  .logo-podnazev { display: block; align-self: start; color: var(--tlumeny); font-size: .8rem; line-height: 1.3; }
  .dispecink { flex-direction: column; gap: 0; padding: .35rem 1rem; }
  .dispecink::before { display: none; }
  .menu ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .js .filtr { flex-direction: row; align-items: center; gap: 1.5rem; }
  .filtr-rok label { min-width: 0; }
  main { padding: 1.75rem 1.5rem 2.5rem; }
  h1 { font-size: 2rem; }
  .clanek-navigace { grid-template-columns: 1fr 1fr; }
  .clanek-navigace .dalsi { grid-column: 2; }
  .obrazek-vlevo { float: left; max-width: 45%; margin: .3rem 1.25rem 1rem 0; }
  .obrazek-vpravo { float: right; max-width: 45%; margin: .3rem 0 1rem 1.25rem; }
  .clanek-text::after, .stranka-text::after, .aktualita-text::after { content: ""; display: table; clear: both; }
  .paticka-obsah { display: flex; flex-wrap: wrap; gap: 0 3rem; padding: 1.75rem 1.5rem; }
  .paticka-rok { flex-basis: 100%; }
}

/* Úzký mobil: široká tabulka se posouvá sama, ne celá stránka */
@media (max-width: 599px) {
  table { display: block; overflow-x: auto; }
  th, td { padding: .45rem .4rem; }
  .stranka-text th, .stranka-text td { white-space: nowrap; }
  .clanek-text td a, .aktualita-text td a { overflow-wrap: anywhere; }
  .prohlizec-ovladani { gap: .5rem; }
  .prohlizec-pocitadlo { min-width: 0; }
}

/* Desktop: od 1024 px logo a menu vlevo, obsah vpravo */
@media (min-width: 1024px) {
  body { font-size: 1.0625rem; }
  .rozvrzeni { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); gap: 2rem; align-items: start; width: 100%; max-width: 80rem; margin: 0 auto; padding: 1.75rem 1.5rem 2.5rem; }
  .hlavicka { display: block; padding: 0; border: 0; background: none; }
  .logo { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1.25rem 1rem 1rem; border: 1px solid var(--okraj); border-radius: var(--zaobleni); background: var(--plocha); text-align: center; }
  .logo img { width: 120px; height: 120px; margin-bottom: .35rem; }
  .dispecink { margin: .9rem 0; padding: .7rem 1rem; }
  .dispecink-cislo { font-size: 1.6rem; }
  .js .menu-tlacitko { display: none; }
  .menu, .js .menu { display: block; padding: .5rem; border: 1px solid var(--okraj); border-radius: var(--zaobleni); background: var(--plocha); }
  .menu ul { display: block; }
  .menu li + li { margin-top: 2px; }
  .menu a { padding: .55rem .85rem; border-left: 4px solid transparent; border-radius: 6px; background: none; }
  .menu a:hover { background: var(--jemna); }
  .menu a.aktivni, .menu a[aria-current="page"] { border-left-color: var(--primarni); background: var(--jemna); color: var(--tmava); }
  main { padding: 2rem 2.5rem 2.75rem; border: 1px solid var(--okraj); border-radius: var(--zaobleni); box-shadow: var(--stin); }
  h1 { font-size: 2.25rem; }
  .prohlizec { padding: 3.5rem 1.5rem 1rem; }
}

/* Plynulé přechody jen tam, kde si uživatel neomezil pohyb */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .menu a, .karta a, .dispecink, .clanek-navigace a { transition: background-color .15s, border-color .15s, box-shadow .15s; }
}

@media print {
  .menu, .menu-tlacitko, .preskocit { display: none; }
}
