/* =========================================================
   ZŠ Podbělohorská – statický mock-up
   ========================================================= */

:root {
  --accent: #b3121b;          /* školní červená – linky, ohraničení, ikony (podle barvy webu školy #920000) */
  --accent-btn: #920000;      /* tlačítka – bílý text 9,4 : 1 */
  --accent-hover: #6b0000;    /* hover tlačítek i odkazů */
  --edu-btn: #1e7b34;         /* zelené tlačítko EduPage – bílý text 5,3 : 1 */
  --edu-hover: #14532a;
  --accent-on-dark: #ff8080;  /* akcentový text na černém pozadí – 8 : 1 */
  --black: #000;
  --ink: #141414;
  --text: #666;
  --bg: #f5f5f5;
  --nav: #e1e1e1;
  --band: #dedede;
  --border: #c4c4c4;
  --panel: #f2f2f2;
  --ease: cubic-bezier(.77, 0, .175, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);   /* objevení a zmizení (mobilní menu) */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* --header-h nastavuje script.js podle skutečné výšky lepivé hlavičky; fallback = běžná výška */
  scroll-padding-top: calc(var(--header-h, 60px) + 12px);
}

body {
  margin: 0;
  font-family: "Noto Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg) var(--noise);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  margin: 0 0 .5em;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.15;
  color: var(--ink);
}
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

p { margin: 0 0 1em; }

a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; transition: color .3s var(--ease); }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 16px; top: -48px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
}
.skip-link:focus { top: 8px; }

/* ---------- Tlačítka ---------- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border: 0;
  border-radius: 2px;
  background: var(--accent-btn);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background-color .3s var(--ease);
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-edu { background: var(--edu-btn); }
.btn-edu:hover { background: var(--edu-hover); }

/* ---------- Hlavička ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: 0 1px 0 var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-right: auto;
  text-decoration: none;
  color: var(--ink);
}
.brand img { flex: none; width: auto; height: 40px; object-fit: contain; object-position: left; } /* na úzkém mobilu se logo zmenší, ale nedeformuje */
.header-btns, .nav-toggle { flex: none; }
.header-btns { display: flex; gap: 8px; }
.brand-text strong { /* název školy je přímo v logu – text ponecháme jen pro čtečky obrazovky */
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.brand-text small { display: none; font-size: 12px; color: var(--text); }

.header-contact { display: none; }

.header-btn { padding: 8px 10px; font-size: 12px; }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--nav);
  cursor: pointer;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform .3s var(--ease), background-color .3s var(--ease);
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before,
.nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

/* Menu – mobil */
.main-nav {
  display: none;
  background: var(--nav);
  border-top: 1px solid var(--border);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.main-nav.is-open { display: block; }
/* Mobilní menu (pod 768 px): otevření 200 ms (prolnutí + sjetí o 8 px), zavření 150 ms stejnou cestou zpět.
   Prohlížeče bez @starting-style / přechodu display otevřou a zavřou naráz jako dřív. */
@media (max-width: 47.99em) {
  .main-nav {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), display 150ms allow-discrete;
  }
  .main-nav:not(.is-open) { pointer-events: none; } /* zavírající se menu už nechytá klepnutí */
  .main-nav.is-open {
    opacity: 1;
    transform: none;
    transition-duration: 200ms;
  }
  @starting-style {
    .main-nav.is-open { opacity: 0; transform: translateY(-8px); }
  }
}
/* Omezený pohyb: bez posunu, jen prolnutí 150 ms oběma směry.
   !important + vyšší specificita (.main-nav) přebije globální „*, *::before, *::after { transition: none !important; }“. */
@media (max-width: 47.99em) and (prefers-reduced-motion: reduce) {
  .main-nav,
  .main-nav.is-open {
    transform: none;
    transition: opacity 150ms var(--ease-out), display 150ms allow-discrete !important;
  }
}
.nav-inner { padding: 0; }

.menu,
.submenu { list-style: none; margin: 0; padding: 0; }

.menu a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  transition: color .3s var(--ease), background-color .3s var(--ease);
}
.menu a:hover { color: var(--accent-hover); background: var(--panel); }
.submenu a {
  padding-left: 32px;
  font-weight: 400;
  background: var(--panel);
}

/* ---------- Hero ---------- */
/* Fotku mění škola v administraci → kontrast textu (WCAG 1.4.3) musí platit i pro čistě bílou fotku:
   černý překryv aspoň 0,6 všude pod textem (#fff 5,7 : 1, #eee 4,9 : 1). Mobil: jednotný překryv,
   od 48em přechod zleva (viz media query níže). */
.hero {
  display: flex;
  align-items: center;
  min-height: 360px;
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, .6)),
    var(--hero-img, url("https://images.unsplash.com/photo-1580582932707-520aed937b7b?auto=format&fit=crop&w=1800&q=70")) center / cover no-repeat,
    #141414;
}
.hero-inner { width: 100%; padding-top: 40px; padding-bottom: 40px; }
.hero h1 {
  max-width: 18ch;
  color: #fff;
  text-shadow: 0 0 5px #000;
}
.hero p {
  max-width: 40em;
  margin-bottom: 1.5em;
  color: #eee;
  text-shadow: 0 0 5px #000;
}

/* ---------- Dlaždice ---------- */
.tiles-band {
  background: var(--band) var(--noise);
  padding: 24px 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  text-decoration: none;
  background: #222;
}
.tile { background-size: cover; background-position: center; }
.tile-1 { background-image: url("https://images.unsplash.com/photo-1513542789411-b6a5d4f31634?auto=format&fit=crop&w=600&q=70"); }
.tile-2 { background-image: url("https://images.unsplash.com/photo-1588075592806-bbe6da990469?auto=format&fit=crop&w=600&q=70"); }
.tile-3 { background-image: url("https://images.unsplash.com/photo-1596997000103-e597b3ca50df?auto=format&fit=crop&w=600&q=70"); }
.tile-4 { background-image: url("https://images.unsplash.com/photo-1510127034890-ba27508e9f1c?auto=format&fit=crop&w=600&q=70"); }
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, .35));
  transition: background .3s var(--ease);
}
.tile:hover::before { background: rgba(0, 0, 0, .15); }
.tile-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 14px;
  border-top: 2px solid var(--accent);
  background: rgba(20, 20, 20, .6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  transition: min-height .3s var(--ease);
}
.tile:hover .tile-caption,
.tile:focus-visible .tile-caption { min-height: 72px; }

/* ---------- Sekce ---------- */
.section { padding: 48px 0; }
.section-alt { background: var(--panel); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-head {
  margin-bottom: 24px;
  text-align: center;
}
.section-head h2 { margin-bottom: .25em; }
.more-link {
  display: inline-block;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

/* ---------- Aktuality ---------- */
.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--black);
  color: #ccc;
  overflow-wrap: anywhere; /* dlouhé slovo z CMS jinak roztáhne sloupec mřížky */
  transition: opacity .3s var(--ease);
}
.card:hover { opacity: .8; }
.card-img { aspect-ratio: 16 / 9; position: relative; overflow: hidden; }
/* strana PDF jako náhled: výřez (object-position) a přiblížení (scale) z administrace */
.card-img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: var(--pos-m, center); transform-origin: var(--pos-m, center); transform: scale(var(--zoom-m, 1)); }
@media (min-width: 64em) {
  /* od 64em jsou karty čtvercové – výřez „Počítač“ */
  .card-img > img { object-position: var(--pos, center); transform-origin: var(--pos, center); transform: scale(var(--zoom, 1)); }
}
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px; }
.card h3 { margin-bottom: .3em; color: #fff; }
.card h3 a { color: #fff; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card h3 a:focus-visible { outline: none; }
.card:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.card-date { margin-bottom: .6em; font-size: 13px; color: #bbb; }
.card-text { font-size: 14px; line-height: 1.5; color: #ddd; }
.card-more {
  margin-top: auto;
  color: var(--accent-on-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Ilustrační fotky (Unsplash) */
.ph { background-color: #1f1f1f; background-size: cover; background-position: center; background-repeat: no-repeat; }
.ph-a { background-image: url("https://images.unsplash.com/photo-1545048702-79362596cdc9?auto=format&fit=crop&w=800&q=70"); }
.ph-b { background-image: url("https://images.unsplash.com/photo-1509062522246-3755977927d7?auto=format&fit=crop&w=600&q=70"); }
.ph-c { background-image: url("https://images.unsplash.com/photo-1633526543814-9718c8922b7a?auto=format&fit=crop&w=600&q=70"); }
.ph-d { background-image: url("https://images.unsplash.com/photo-1506917728037-b6af01a7d403?auto=format&fit=crop&w=600&q=70"); }
.ph-e { background-image: url("https://images.unsplash.com/photo-1549896869-ca27eeffe4fb?auto=format&fit=crop&w=600&q=70"); }
.ph-jidelna { background-image: url("https://images.unsplash.com/photo-1556543365-e08680c86612?auto=format&fit=crop&w=900&q=70"); }
.ph-druzina { background-image: url("https://images.unsplash.com/photo-1460788150444-d9dc07fa9dba?auto=format&fit=crop&w=900&q=70"); }

/* ---------- Feature řádky ---------- */
.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}
.feature + .feature { margin-top: 48px; }
.feature-media {
  min-height: 220px;
  height: 100%;
  border-bottom: 2px solid var(--accent);
}
.feature-media:has(.feature-logo) {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom: 2px solid var(--accent);
}
.feature-logo { max-height: 240px; width: auto; }

/* Odrážky v rámečku (.panel) vypadají jako .check-list – editor tak píše obyčejný seznam */
.check-list, .prose .panel ul { margin: 0 0 1em; padding: 0; list-style: none; }
.check-list li, .prose .panel ul > li {
  position: relative;
  padding: 6px 0 6px 20px;
  border-bottom: 1px solid var(--border);
}
.check-list li::before, .prose .panel ul > li::before {
  content: "";
  position: absolute;
  left: 0; top: 15px;
  width: 8px; height: 8px;
  background: var(--accent);
}

/* ---------- Školní rok / tabulky ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
}

.hours {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1em;
  font-size: 14px;
}
.hours th,
.hours td {
  height: 36px;
  padding: 6px 0;
  border-bottom: 1px solid #828282;
  vertical-align: middle;
}
.hours th {
  padding-right: 16px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
}
.hours td { text-align: right; }

/* ---------- Kontakty ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.contact-card {
  padding: 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  font-size: 14px;
}
.contact-card h3 { font-size: 16px; }
.contact-card p:last-child { margin-bottom: 0; }
.contact-role {
  margin-bottom: .4em;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
}
.contact-card a,
.panel a { overflow-wrap: break-word; } /* e-maily: script.js vkládá <wbr> před „@“ */

/* ---------- Patička ---------- */
.site-footer {
  background: #d6d6d6 var(--noise);
  border-top: 2px solid #adadad;
  color: #444;
  font-size: 14px;
  padding-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.footer-title { font-size: 16px; margin-bottom: 1em; }
/* Mřížka plněná po sloupcích: položka N vlevo a vpravo sdílí řádek → sloupce lícují i při zalomení dlouhé položky */
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(var(--rows, 5), auto); grid-auto-flow: column; column-gap: 24px; }
.footer-links a {
  display: inline-block;
  padding: 10px 0;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 13px;
}
.footer-links a:hover { text-decoration: underline; }
.footer-ext { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; margin-top: 20px; }
.footer-ext .btn { min-width: 140px; text-align: center; } /* EduPage a Strava pod sebou stejně široké */
.footer-link-ext { font-weight: 700; }
.hours-footer td,
.hours-footer th { color: var(--ink); }
.footer-bottom {
  margin-top: 32px;
  padding-bottom: 16px;
  font-size: 12px;
}
.footer-bottom p { margin: 0; padding-top: 16px; border-top: 1px solid #adadad; }

/* =========================================================
   Tablet a výš (48em = 768px)
   ========================================================= */
@media (min-width: 48em) {
  html { scroll-padding-top: calc(var(--header-h, 128px) + 12px); }

  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  h3 { font-size: 20px; }

  .header-top { min-height: 84px; gap: 20px; }
  .brand img { height: 56px; }
  .brand-text small { display: block; white-space: nowrap; padding-left: 12px; border-left: 1px solid var(--border); line-height: 1.35; }

  .header-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 13px;
    line-height: 1.5;
  }
  .header-contact a { display: inline-block; min-height: 24px; line-height: 24px; text-decoration: none; font-weight: 700; } /* cíl min. 24 × 24 px (WCAG 2.5.8) */
  .header-contact a:hover { color: var(--accent-hover); }

  .header-btns { flex-direction: column; gap: 6px; } /* na PC pod sebou, stejně široká */
  .header-btn { padding: 6px 24px; font-size: 14px; text-align: center; }
  .nav-toggle { display: none; }

  .main-nav {
    display: block;
    max-height: none;
    overflow: visible;
  }
  .nav-inner { padding: 0 16px; }
  .menu { display: flex; flex-wrap: wrap; }
  .menu > li { position: relative; }
  .menu > li > a {
    height: 48px;
    min-height: 0;
    padding: 0 10px;
    border-bottom: 0;
    font-size: 12px;
  }
  .menu > li:first-child > a { padding-left: 0; }
  .menu > li > a:hover { background: transparent; }
  .has-sub > a::after {
    content: "";
    margin-left: 6px;
    border: 4px solid transparent;
    border-top-color: currentColor;
    transform: translateY(2px);
  }

  .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-top: 2px solid var(--accent);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .has-sub:hover > .submenu,
  .has-sub:focus-within > .submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .submenu a {
    min-height: 44px;
    padding: 0 16px;
    background: #fff;
    font-size: 13px;
    font-weight: 700;
  }
  .submenu li:last-child a { border-bottom: 0; }

  /* Překryv ≥ 0,6 až kousek za pravý okraj textu: text končí na 16 + 640 px od okraje kontejneru (max. 1140 px),
     tj. na max(656px, 50% + 86px); vpravo od něj fotka prosvítá jako dřív. Na desktopu je nadpis
     na jeden řádek delší → --hero-shade posouvá hranici (viz 64em). */
  .hero {
    min-height: 500px;
    background-image:
      linear-gradient(90deg, rgba(0, 0, 0, .75) 0%, rgba(0, 0, 0, .6) var(--hero-shade, max(680px, 50% + 110px)), rgba(0, 0, 0, .15) max(100%, 1000px)),
      var(--hero-img, url("https://images.unsplash.com/photo-1580582932707-520aed937b7b?auto=format&fit=crop&w=1800&q=70"));
  }

  .tiles { grid-template-columns: repeat(4, 1fr); }

  .section { padding: 64px 0; }

  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .card-featured { grid-column: 1 / -1; }

  .feature { grid-template-columns: 1fr 2fr; gap: 40px; }
  .feature:nth-of-type(even) { grid-template-columns: 2fr 1fr; }
  .feature:nth-of-type(even) .feature-media { order: 2; }
  .feature-media { min-height: 280px; }

  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-card-wide { grid-column: 1 / -1; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Desktop (64em = 1024px)
   ========================================================= */
@media (min-width: 64em) {
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }

  .menu > li > a { padding: 0 16px; font-size: 14px; }

  /* Nadpis hero na jeden řádek (cca 40 znaků verzálkami ≈ 950 px při 34 px); překryv 0,6 pod celým nadpisem */
  .hero { --hero-shade: max(1000px, 50% + 420px); }
  .hero h1 { max-width: none; font-size: 34px; }

  /* Aktuality: 3 čtvercové karty vedle sebe, fotka vyplní zbytek nad textem */
  .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-featured { grid-column: auto; }
  .card { aspect-ratio: 1; overflow: hidden; }
  .card-img { aspect-ratio: auto; flex: 1; min-height: 0; }
  .card-body { flex: 0 0 auto; }
  .card-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }

  .contact-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-card-wide { grid-column: span 3; }

  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* =========================================================
   PODSTRÁNKY – společné komponenty
   ========================================================= */

/* Aktivní položka menu */
.menu a[aria-current="page"],
.menu .is-active > a { color: var(--accent-hover); }
.submenu a[aria-current="page"] { background: var(--panel); }

/* Hlavička podstránky */
.page-head {
  position: relative;
  padding: 40px 0 32px;
  color: #fff;
  /* Text může být přes celou šířku → překryv nikde pod 0,68: i na čistě bílé fotce
     #fff 7,8 : 1, #eee 6,7 : 1, drobečková navigace #ccc 4,9 : 1 (WCAG 1.4.3) */
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .8), rgba(0, 0, 0, .68)),
    var(--page-img, url("https://images.unsplash.com/photo-1580582932707-520aed937b7b?auto=format&fit=crop&w=1800&q=60")) center / cover no-repeat,
    #141414;
  border-bottom: 2px solid var(--accent);
}
.page-head h1 { margin: 0; color: #fff; text-shadow: 0 0 5px #000; }
.page-head .lead { margin: .5em 0 0; max-width: 46em; color: #eee; }
.breadcrumb { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.breadcrumb li + li::before { content: "/"; margin-right: 4px; color: #aaa; }
.breadcrumb a { color: #fff; text-decoration: none; }
.breadcrumb a:hover { color: #fff; text-decoration: underline; }
.breadcrumb [aria-current] { color: #ccc; }

/* Rozvržení: boční podmenu + obsah */
.page-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 32px; padding-bottom: 64px; }
.subnav { align-self: start; min-width: 0; background: #fff; border: 1px solid var(--border); border-top: 2px solid var(--accent); }
.subnav-title { margin: 0; padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.subnav ul { margin: 0; padding: 0; list-style: none; }
.subnav a { display: block; padding: 10px 16px; border-bottom: 1px solid var(--panel); font-size: 14px; font-weight: 700; text-decoration: none; color: var(--ink); }
.subnav a:hover { background: var(--panel); color: var(--accent-hover); }
.subnav a[aria-current="page"] { background: var(--panel); box-shadow: inset 3px 0 0 var(--accent); }

/* Textový obsah */
.prose { min-width: 0; color: #444; }
.prose > *:first-child { margin-top: 0; }
.prose h2 { margin: 1.6em 0 .6em; padding-bottom: .3em; border-bottom: 2px solid var(--accent); font-size: 22px; }
.prose h3 { margin: 1.4em 0 .5em; font-size: 18px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose img { max-width: 100%; height: auto; }
.prose a { overflow-wrap: break-word; } /* break-word nezmenšuje min. šířku – tabulky se posouvají místo lámání */
a[href^="tel:"] { white-space: nowrap; }

/* Datové tabulky */
.table-wrap { overflow-x: auto; margin: 0 0 1.5em; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.data-table caption { padding: 0 0 8px; text-align: left; font-weight: 700; color: var(--ink); }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.data-table thead th { background: var(--ink); color: #fff; font-size: 12px; text-transform: uppercase; border-bottom: 2px solid var(--accent); }
.data-table tbody tr:nth-child(even) { background: #fafafa; }
.data-table tbody th { color: var(--ink); }
/* Telefony, e-maily, data a časy se nelámou uvnitř údaje – tabulka se raději posune v .table-wrap */
.data-table td, .prose .data-table a { overflow-wrap: normal; word-break: keep-all; }
.data-table a,
.data-table td:first-child,
.data-table th[scope="row"] ~ td,
.data-table td.is-short { white-space: nowrap; }

/* Upozornění / info box */
.notice { margin: 0 0 1.5em; padding: 16px 20px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--accent); }
.notice > *:last-child { margin-bottom: 0; }

/* Seznam dokumentů */
.doc-list { margin: 0 0 1.5em; padding: 0; list-style: none; }
.doc-list li { margin: 0; border-bottom: 1px solid var(--border); }
.doc-list a { display: flex; align-items: center; gap: 12px; padding: 12px 4px; text-decoration: none; color: var(--ink); font-weight: 700; }
.doc-list a:hover { background: #fff; color: var(--accent-hover); }
.doc-badge { flex: 0 0 auto; min-width: 40px; padding: 3px 6px; background: var(--accent-btn); color: #fff; font-size: 11px; font-weight: 900; text-align: center; text-transform: uppercase; border-radius: 2px; }
.doc-meta { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text); }

/* Časté dotazy / rozbalovací bloky */
.faq details { margin-bottom: 8px; background: #fff; border: 1px solid var(--border); }
.faq summary { padding: 14px 16px; cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent-btn); font-weight: 900; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq details[open] summary::after { content: "–"; }
.faq .faq-body { padding: 14px 16px; }
.faq .faq-body > *:last-child { margin-bottom: 0; }

/* Články (aktuality) */
.article { padding: 24px; margin-bottom: 24px; background: #fff; border: 1px solid var(--border); border-top: 2px solid var(--accent); } /* odsazení pod hlavičku řeší scroll-padding-top na html */
.article h2 { margin: 0 0 .3em; padding: 0; border: 0; font-size: 22px; }
.article-date { margin-bottom: 1em; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text); }
.year-heading { margin: 40px 0 16px; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; color: var(--text); }
.archive-list { margin: 0; padding: 0; list-style: none; columns: 1; }
.archive-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.archive-list time { display: inline-block; min-width: 7em; font-weight: 700; color: var(--ink); }

/* Galerie / karty odkazů */
.link-cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 1.5em; }
.link-card { display: block; padding: 20px; background: #000; color: #ddd; text-decoration: none; border-top: 2px solid var(--accent); transition: opacity .3s var(--ease); }
.link-card:hover { opacity: .85; color: #fff; }
.link-card strong { display: block; margin-bottom: .3em; color: #fff; font-size: 16px; text-transform: uppercase; }
.link-card span { font-size: 13px; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 1.5em; }
.gallery-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }

@media (min-width: 48em) {
  .page-head { padding: 56px 0 40px; }
  .link-cards { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .archive-list { columns: 2; column-gap: 32px; }
}
@media (min-width: 64em) {
  .page-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
  .page-layout.no-sidebar { grid-template-columns: 1fr; }
  .subnav { position: sticky; top: calc(var(--header-h, 133px) + 17px); }
  .link-cards { grid-template-columns: repeat(3, 1fr); }
}

/* ===== ÚVODNÍ STRÁNKA ===== */
/* Nejbližší termíny */
.dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dates > li { display: flex; }
.date-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  color: var(--text);
  text-decoration: none;
  transition: border-color .3s var(--ease);
}
.date-card:hover { border-color: var(--accent); color: var(--text); }
.date-card:hover .date-card-label { color: var(--accent-hover); }
.date-card-date {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink);
  line-height: 1;
}
.date-card-day { font-size: 32px; font-weight: 900; }
.date-card-month { font-size: 14px; font-weight: 700; text-transform: uppercase; }
.date-card-label {
  font-size: 15px;
  font-weight: 900;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--ink);
  transition: color .3s var(--ease);
}
.date-card-meta { margin-top: 4px; font-size: 13px; }

/* Rychlý kontakt */
.contact-band {
  background: var(--band) var(--noise);
  border-top: 2px solid var(--accent);
  padding: 32px 0;
}
.contact-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
}
.contact-strip-title { margin: 0; font-size: 18px; }
.contact-strip-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-strip-item { display: flex; flex-direction: column; }
.contact-strip-role {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #444;
}
.contact-strip-item a {
  display: inline-block;
  padding: 4px 0;
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: break-word;
}
.contact-strip-btn { justify-self: start; }

@media (min-width: 48em) {
  .date-card { padding: 20px; }
  .date-card-day { font-size: 40px; }
  .date-card-label { font-size: 16px; }
  .contact-strip-list { grid-template-columns: repeat(2, 1fr); gap: 16px 32px; }
}
@media (min-width: 64em) {
  .dates { grid-template-columns: repeat(4, 1fr); }
  .contact-strip { grid-template-columns: auto 1fr auto; gap: 32px; }
  .contact-strip-list { grid-template-columns: repeat(3, auto) 1fr; gap: 32px; }
}


/* =========================================================
   PODSTRÁNKY – doplňky (dříve inline <style> v jednotlivých stránkách)
   ========================================================= */
/* =========================================================
   Extrahováno z <style> bloků podstránek (aktuality, gdpr,
   kontakty, zakladni-informace) – připojit na konec style.css
   ========================================================= */

/* Boční podmenu: vnořené položky (2. úroveň, např. roky v archivu aktualit; odpovídá vnořenému menu z CMS) */
.subnav li li a { padding-left: 28px; font-weight: 400; }

/* Archiv článků: zástupný text místo data u položek bez data („bez data“) – zarovnaný jako sloupec <time> */
.archive-list .no-date { display: inline-block; min-width: 7em; font-weight: 700; color: var(--text); }

/* Panel: první prvek (obvykle nadpis) bez horního odsazení */
.prose .panel > :first-child { margin-top: 0; }

/* Panel: nadpis h2 uvnitř panelu vypadá jako mezititulek (bez podtržení), když panel stojí hned pod h1 */
.prose .panel h2 { margin-bottom: .5em; padding-bottom: 0; border-bottom: 0; font-size: 18px; }

/* Panely pod sebou mimo mřížku .two-col (např. projekty EU) – mezera mezi nimi */
.prose > .panel + .panel { margin-top: 16px; }

/* Vložený obsah (iframe – mapa, video) přes celou šířku obsahu */
.embed { display: block; width: 100%; height: 360px; margin: 0 0 1em; border: 1px solid var(--border); }

/* =========================================================
   UX AUDIT – úpravy čitelnosti a mobilu
   ========================================================= */

/* Čitelná délka řádku v textu podstránek (~70 znaků); tabulky a komponenty zůstávají přes celou šířku */
.prose > p, .prose > ul, .prose > ol, .prose .article > p { max-width: 72ch; }
.prose { font-size: 16px; line-height: 1.65; }

/* Mobil + tablet: boční podmenu jako vodorovný pruh „štítků“, aby obsah začínal hned pod hlavičkou */
@media (max-width: 63.99em) {
  .subnav { border: 0; background: transparent; }
  .subnav-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .subnav > ul { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scroll-padding-inline: 16px; }
  .subnav > ul > li { flex: none; }
  .subnav a { padding: 10px 14px; border: 1px solid var(--border); background: #fff; white-space: nowrap; border-bottom: 1px solid var(--border); }
  .subnav a[aria-current="page"] { background: var(--ink); color: #fff; box-shadow: none; border-color: var(--ink); }
  .subnav li li { display: none; } /* vnořené položky (roky v archivu) jen na desktopu */

  /* Tabulky: při vodorovném posunu zůstává první sloupec (den, jméno, datum) vidět */
  .data-table tr > :first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: inset -1px 0 0 var(--border); }
  .data-table tbody tr:nth-child(even) > :first-child { background: #fafafa; }
  .data-table thead tr > :first-child { background: var(--ink); }
}

/* Seznamy dokumentů a odrážek v textu: bez odsazení a omezení šířky z .prose ul */
.prose .doc-list { padding-left: 0; max-width: none; }
.prose .check-list { padding-left: 0; }

/* Patička: na tabletu a výš už menu v 1 sloupci s kompaktnějšími řádky */
@media (min-width: 48em) {
  .footer-links { display: block; }
  .footer-links a { padding: 5px 0; }
}
/* Patička na desktopu: menu ve 2 sloupcích – vyrovná výšku se sloupci Kontakt a Zvonění */
@media (min-width: 64em) {
  .footer-links { display: grid; column-gap: 32px; }
}

/* Karty uvnitř textu podstránky: nadpis bez okraje z .prose h3 */
.prose .contact-card h3,
.prose .panel h3 { margin-top: 0; }
.prose .contact-grid { margin-bottom: 1.5em; }

/* Rychlý kontakt na mobilu a tabletu ve 2 sloupcích, e-mail přes celou šířku (desktop: jedna řada) */
@media (max-width: 63.99em) {
  .contact-strip-list { grid-template-columns: repeat(2, 1fr); }
  .contact-strip-item:last-child { grid-column: 1 / -1; }
}

/* Velmi úzké telefony (do 360 px): termíny v jednom sloupci, ať se dlouhá slova nelámou */
@media (max-width: 22.4em) {
  .dates { grid-template-columns: minmax(0, 1fr); }
}
