/* =========================================
   MŠ Zahrádka — Design v6
   Sky blue + sunny yellow
========================================= */

:root {
  --primary: #1d6fa5;
  --primary-deep: #14507a;
  --primary-soft: #6fb3e0;
  --yellow: #ffc93c;
  --yellow-light: #fff6d9;

  --cream: #f7fafd;
  --paper: #ffffff;
  --ink: #1f2937;
  --ink-muted: #5b6472;
  --line: rgba(29, 111, 165, 0.12);

  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --shadow: 0 4px 24px rgba(20, 80, 122, 0.08);
  --shadow-lg: 0 20px 50px rgba(20, 80, 122, 0.12);

  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Outfit', system-ui, sans-serif;

  --wrap: min(1120px, calc(100% - 2.5rem));
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--primary-deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

#main {
  flex: 1 0 auto;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  background:
    linear-gradient(rgba(10, 38, 58, 0.35), rgba(10, 38, 58, 0.35)),
    url("../images/hero.jpg") 50% 60% / cover no-repeat;
}

@media (max-width: 768px) and (orientation: portrait) {
  body::before {
    background:
      linear-gradient(rgba(10, 38, 58, 0.35), rgba(10, 38, 58, 0.35)),
      url("../images/hero-portrait.jpg") 40% 60% / cover no-repeat;
  }
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

ul {
  list-style: none;
}

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

/* Skip link — first thing in the tab order, parked above the viewport until it
   takes focus. Deliberately not display:none or visibility:hidden: either one
   drops it out of the tab order and out of the accessibility tree, which is the
   single thing it exists to be in. The z-index clears the sticky .site-header
   (z-index 100), which comes later in the DOM and would otherwise cover it. */
.skip-link {
  position: fixed;
  top: -4rem;
  left: 0.5rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-deep);
  background: var(--paper);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.5rem;
}

/* <main> carries tabindex="-1" only so the skip link can land focus on it. A ring
   drawn around the whole page would say nothing useful about where the caret went. */
#main:focus {
  outline: none;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex-shrink: 0;
}

.brand img {
  width: auto;
  height: 44px;
  object-fit: contain;
}

/* The school name as real text beside the mark. The logo draws the name too,
   but at 44px tall that lettering is ~6px high and reads as decoration only —
   this is the copy people actually see, and the only one search engines and
   screen readers get (the img carries alt="" so the name isn't announced twice). */
.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.3;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--primary-deep);
  white-space: nowrap;
}

.brand-place {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  white-space: nowrap;
}

@media (min-width: 769px) {
  :root {
    --header-h: 120px;
  }

  .brand img {
    height: 100px;
  }

  .brand-name {
    font-size: 1.5rem;
  }

  .brand-place {
    font-size: 0.85rem;
  }
}

@media (max-width: 299px) {
  .brand-place {
    display: none;
  }
}

/* ---------- Navigation ---------- */

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-list>li {
  position: relative;
}

.nav-list>li>a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: var(--radius-pill);
}

.nav-list>li>a:not(.nav-cta) {
  position: relative;
}

.nav-list>li>a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--yellow));
  border-radius: var(--radius-pill);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-list>li>a:not(.nav-cta):hover {
  color: var(--primary-deep);
}

.nav-list>li>a:not(.nav-cta):hover::after {
  transform: scaleX(1);
}

.nav-list>li>a:not(.nav-cta).is-active {
  color: var(--primary-deep);
  font-weight: 600;
}

.nav-list>li>a:not(.nav-cta).is-active::after {
  transform: scaleX(1);
}

.nav-cta {
  margin-left: 0.35rem;
  background: var(--primary) !important;
  color: var(--paper) !important;
}

.nav-cta:hover {
  background: var(--primary-deep) !important;
  color: var(--paper) !important;
}

.caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.caret-right {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
}

/* Dropdown — level 1 */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 210px;
  padding: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 50;
}

@media (min-width: 769px) {
  .nav-dropdown:hover>.dropdown-menu,
  .nav-dropdown:focus-within>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }

  /* Wide enough that long titles wrap over one or two lines instead of four,
     which keeps even a ten-item section short enough to show in full. */
  .dropdown-menu {
    width: max-content;
    max-width: min(340px, calc(100vw - 2rem));
  }

  .dropdown-submenu>.dropdown-menu {
    max-width: min(380px, calc(100vw - 2rem));
  }

  /* Set by main.js when a flyout is taller than the space below the header —
     only on menus with no submenus of their own, so nothing gets clipped. */
  .dropdown-menu.is-scrollable {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.dropdown-menu li {
  margin-bottom: 2px;
}

.dropdown-menu li:last-child {
  margin-bottom: 0;
}

.dropdown-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-muted);
  border-radius: 8px;
}

.dropdown-menu a:hover {
  background: var(--yellow-light);
  color: var(--primary-deep);
}

.dropdown-menu a.is-active {
  background: var(--yellow-light);
  color: var(--primary-deep);
  font-weight: 600;
}

/* Submenu — level 2 */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu>.dropdown-menu {
  top: 0;
  left: calc(100% + 4px);
  transform: translateX(8px);
  margin-left: 0;
}

/* Flipped to the left of its parent by main.js when it would run off-screen. */
.dropdown-submenu>.dropdown-menu.flip-left {
  left: auto;
  right: calc(100% + 4px);
  transform: translateX(-8px);
}

@media (min-width: 769px) {
  .dropdown-submenu:hover>.dropdown-menu,
  .dropdown-submenu:focus-within>.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--primary-deep);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Shared typography ---------- */

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.eyebrow a {
  color: inherit;
}

.eyebrow a:hover {
  color: var(--primary-deep);
  text-decoration: underline;
}

.eyebrow span {
  margin: 0 0.15rem;
  opacity: 0.55;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--primary-deep);
}

h2 {
  font-size: clamp(1.45rem, 3.2vw, 1.75rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.15rem, 2.6vw, 1.35rem);
}

h4 {
  font-size: 1.05rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.section-head h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  margin-top: 0.35rem;
}

.section-head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 560px;
  margin-inline: auto;
  margin-bottom: 2.5rem;
}

.section-desc {
  margin-top: 0.75rem;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

/* ---------- Prose (rich text: content + content_html) ---------- */

.prose h3 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  color: var(--primary-deep);
}

.prose p {
  margin-bottom: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.7;
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: var(--primary-deep);
}

.prose em {
  font-style: italic;
  color: var(--ink-muted);
}

.prose ul,
.prose ol {
  margin-bottom: 0.85rem;
  padding-left: 1.5rem;
  color: var(--ink-muted);
  line-height: 1.7;
}

.prose ul {
  list-style: disc;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.35rem;
}

.prose li>ul,
.prose li>ol {
  margin-bottom: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--primary-deep);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--primary-deep);
  background: var(--paper);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ---------- Hero ---------- */

.hero {
  padding: clamp(2rem, 5vw, 3rem) 0;
  background: radial-gradient(55% 48% at 22% 50%, rgba(10, 40, 40, 0.4), rgba(10, 40, 40, 0));
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--paper);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
  font-size: clamp(1.65rem, 4.2vw, 2.5rem);
  margin-bottom: 0.7rem;
}

.hero-lead {
  font-size: 1.06rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  max-width: 30rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.6rem;
}

.hero .btn-primary {
  background: var(--yellow);
  color: var(--primary-deep);
}

.hero .btn-primary:hover {
  background: #ffd766;
}

/* ---------- Vision hero ---------- */

.vision-hero {
  background: radial-gradient(60% 60% at 50% 50%, rgba(10, 38, 58, 0.5), rgba(10, 38, 58, 0));
}

.vision-hero-inner {
  max-width: 70ch;
  margin: 0 auto;
  text-align: center;
}

.vision-hero-inner .eyebrow {
  margin-bottom: 0.9rem;
  color: var(--yellow);
}

.vision-hero-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.2rem, 3.2vw, 1.45rem);
  line-height: 1.45;
  color: var(--paper);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.vision-hero-text::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin: 1.35rem auto 0;
  border-radius: var(--radius-pill);
  background: var(--yellow);
}

/* ---------- News (one per line) ---------- */

.news {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.news .section-head h1 {
  color: var(--paper);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.3);
}

.subscribe-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary-deep);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.subscribe-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.news-row {
  display: flex;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.news-row--important {
  box-shadow: var(--shadow), inset 4px 0 0 var(--yellow);
}

.news-row-date {
  flex: 0 0 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.35rem 0.75rem;
  border-right: 1px solid var(--line);
}

.news-row-date time {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-align: center;
}

.news-row-body {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-row-body h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--primary-deep);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
}

.badge-important {
  background: var(--yellow);
  color: var(--primary-deep);
}

.badge-updated {
  background: #d1fae5;
  color: #065f46;
}

.pdf-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
}

.pdf-link,
.doc-link,
.xls-link,
.web-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.85rem 0.45rem 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  max-width: 100%;
}

.pdf-link:hover,
.doc-link:hover,
.xls-link:hover,
.web-link:hover {
  background: var(--yellow-light);
  border-color: var(--yellow);
  color: var(--primary-deep);
  box-shadow: var(--shadow);
}

/* A rich-text editor can put a class on <a>, but cannot nest a <span> inside it,
   so the badge is drawn as a pseudo-element — the class alone is enough:
   <a class="pdf-link" href="…">label</a>. The class picks the badge, so it can
   be set by hand whatever the file name says. */
.pdf-badge,
.pdf-link::before,
.doc-link::before,
.xls-link::before,
.web-link::before {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: #dc2626;
  border-radius: 5px;
}

.pdf-link::before {
  content: "PDF";
}

.doc-link::before {
  content: "DOC";
  background: var(--primary);
}

.xls-link::before {
  content: "XLS";
  background: #157349;
}

/* Heading blue rather than a file colour: this one leaves the site, it does
   not download anything. */
.web-link::before {
  content: "WEB";
  background: var(--primary-deep);
}

/* Hand-written markup that carries a real <span class="pdf-badge"> keeps it;
   drop the generated one so the two don't double up. */
.pdf-link:has(.pdf-badge)::before,
.doc-link:has(.pdf-badge)::before,
.xls-link:has(.pdf-badge)::before,
.web-link:has(.pdf-badge)::before {
  content: none;
}

.pdf-badge--xlsx {
  background: #157349;
}

.pdf-badge--doc {
  background: var(--primary);
}

.pdf-badge--web {
  background: var(--primary-deep);
}

/* Inside rich text, .prose a would otherwise underline the whole chip and
   recolour it. */
.prose .pdf-link,
.prose .doc-link,
.prose .xls-link,
.prose .web-link {
  color: var(--ink);
  text-decoration: none;
}

.prose .pdf-link:hover,
.prose .doc-link:hover,
.prose .xls-link:hover,
.prose .web-link:hover {
  color: var(--primary-deep);
}

.news-excerpt {
  font-size: 0.925rem;
  color: var(--ink-muted);
  margin-top: 0.15rem;
}

/* news_text is rich text, so it can carry its own paragraphs/links (.prose).
   The row body already spaces its children with a flex gap. */
.news-excerpt> :last-child {
  margin-bottom: 0;
}

/* ---------- Diet menu ---------- */

.menu-section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.menu-week {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
}

.menu-day {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: box-shadow 0.2s ease;
}

.menu-day:hover {
  box-shadow: var(--shadow);
}

.menu-day h3 {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--yellow-light);
}

.menu-day dl {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.menu-day dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.15rem;
}

.menu-day dd {
  font-size: 0.875rem;
  color: var(--ink);
  line-height: 1.45;
}

.menu-day--today {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow);
}

.menu-day--today h3 {
  border-bottom-color: var(--yellow);
}

.today-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: var(--yellow);
  color: var(--primary-deep);
  border-radius: var(--radius-pill);
}

.menu-allergens {
  font-size: 0.78em;
  color: #6e7580;
}

.menu-day--holiday {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--cream);
}

.menu-holiday-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.menu-section .prose {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* Shown instead of a week grid when nobody has filled the menu in yet. */
.menu-empty {
  margin: 1.5rem 0 0;
  padding: 1.15rem 1.35rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-muted);
}

/* ---------- Subsection title ---------- */

.subsection-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-deep);
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

/* The date range beside a "Tento týden" / "Příští týden" label. Lighter and lower
   contrast than the label, so the two read as one line rather than two headings. */
.subsection-date {
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.subsection-date::before {
  content: "— ";
}

/* ---------- O MŠ section ---------- */

.o-ms-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--yellow-light) 0%, var(--cream) 100%);
}

.gallery-section-title {
  margin: 3rem 0 1.25rem;
  color: var(--primary-deep);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--yellow);
}

.gallery-section-title:has(+ .gallery-section-desc) {
  margin-bottom: 0.75rem;
}

.gallery-section-desc {
  margin-bottom: 1.25rem;
  max-width: 70ch;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

/* Rich text: the editor's own tags carry the spacing, so drop the trailing one. */
.gallery-section-desc> :last-child {
  margin-bottom: 0;
}

.gallery-section-desc>h2,
.gallery-section-desc>h3,
.gallery-section-desc>h4 {
  margin-top: 0;
}

.gallery-block+.gallery-block {
  margin-top: 0.5rem;
}

.gallery-group {
  margin-bottom: 2rem;
}

.gallery-class-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-deep);
  margin-bottom: 0.75rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.1rem;
}

.photo-grid--wide {
  grid-template-columns: repeat(7, 1fr);
}

.photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 8px;
  border: 3px solid var(--paper);
  box-shadow: 0 2px 8px rgba(20, 80, 122, 0.10);
  background: var(--paper);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.photo-thumb:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(20, 80, 122, 0.18);
}

.photo-thumb:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  border-radius: 5px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

@media (max-width: 480px) {

  .photo-grid,
  .photo-grid--wide {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Download-the-whole-gallery link under a photo grid (see _init.php).
   .btn is inline-flex, so the icon, the label and the meta are three flex
   items with their whitespace stripped -- gap puts the spacing back. */
.gallery-download {
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  text-decoration: none;
}

.gallery-download-meta {
  font-weight: 400;
  color: var(--ink-muted);
}

@media (max-width: 480px) {

  /* Wraps to two lines on a narrow phone rather than shrinking the tap target. */
  .gallery-download {
    flex-wrap: wrap;
    row-gap: 0.15rem;
  }
}

/* ---------- Video gallery ---------- */

.video-grid {
  display: grid;
  /* Two columns at most, so a player never drops below half the content width.
     The min track is the exact width of a 2-column track (50% minus half the
     gap), which leaves no room for a third column. */
  grid-template-columns: repeat(auto-fill, minmax(calc(50% - 0.625rem), 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.video-item {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(20, 80, 122, 0.10);
}

.video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  object-fit: contain;
}

.video-item figcaption {
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.video-fallback {
  padding: 1rem;
  color: var(--ink-muted);
}

/* Formats the browser can't decode (.avi) fall back to a download link. */
.video-download {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  color: var(--primary-deep);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease;
}

.video-download:hover {
  background: var(--yellow-light);
}

.video-download:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: -3px;
}

.video-download-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--yellow);
}

.video-download-icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 0.2rem;
  border-left: 0.7rem solid var(--primary-deep);
  border-top: 0.45rem solid transparent;
  border-bottom: 0.45rem solid transparent;
}

.video-download small {
  display: block;
  font-weight: 400;
  color: var(--ink-muted);
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Library (book list) ---------- */

.book-list {
  display: grid;
  /* min(100%, …) keeps a single card from overflowing a narrow phone. */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
  padding-left: 0;
  list-style: none;
}

.book {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 0.9rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Covers are ~90×125 thumbnails of differing aspect ratio, so the column is
   fixed and the height follows the image. */
.book>img,
.book-cover img {
  flex: 0 0 5.5rem;
  width: 5.5rem;
  height: auto;
  border-radius: 6px;
  background: var(--cream);
  box-shadow: 0 2px 8px rgba(20, 80, 122, 0.18);
}

.book-cover {
  flex: 0 0 5.5rem;
}

.book-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Two classes deep so these win over .prose p inside rich text. */
.book .book-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--primary-deep);
  margin-bottom: 0;
}

.book .book-author {
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--ink-muted);
  margin-bottom: 0;
}

/* Editor-entered text with no class on it still sits tight in the card. */
.book .book-info p {
  margin-bottom: 0;
}

/* ---------- Nav section (link-hub pages) ---------- */

.nav-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--yellow-light) 0%, var(--cream) 100%);
}

.nav-links {
  display: flex;
  flex-direction: column;
  list-style: none;
  max-width: 480px;
  border-top: 1px solid var(--line);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0.5rem 0.8rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-deep);
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  transition: color 0.2s ease, border-left-color 0.2s ease, background 0.2s ease;
}

.nav-link::after {
  content: '›';
  font-size: 1.2rem;
  line-height: 1;
  color: var(--ink-muted);
  opacity: 0.5;
  transition: transform 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.nav-link:hover {
  color: var(--primary);
  border-left-color: var(--yellow);
  background: rgba(255, 201, 60, 0.06);
}

.nav-link:hover::after {
  color: var(--primary);
  opacity: 1;
  transform: translateX(3px);
}

/* ---------- Stub sections (placeholder content) ---------- */

.stub-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.stub-section > .wrap,
.menu-section > .wrap {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* ---------- Password gate (protected content) ---------- */

.protected-gate {
  max-width: 480px;
  margin: 1.5rem auto;
  padding: 1.75rem clamp(1.25rem, 4vw, 2rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.protected-gate h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--primary-deep);
  margin-bottom: 1.25rem;
}

.protected-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}

.protected-form label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.protected-form input[type="password"] {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.protected-form input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-soft);
  background: var(--paper);
}

.protected-error {
  font-size: 0.9rem;
  font-weight: 600;
  color: #b3261e;
}

.protected-form .btn {
  align-self: flex-start;
  margin-top: 0.4rem;
  cursor: pointer;
}

/* ---------- Contact ---------- */

.contact-section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--yellow-light) 0%, var(--cream) 100%);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 680px;
  margin: 0 auto;
}

.contact-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
}

.contact-block--blue {
  border-left: 4px solid var(--primary);
}

.contact-block--yellow {
  border-left: 4px solid var(--yellow);
}

.contact-block-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.contact-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
}

.contact-block--blue .contact-icon {
  background: var(--line);
  color: var(--primary);
}

.contact-block--yellow .contact-icon {
  background: var(--yellow-light);
  color: var(--primary-deep);
}

.contact-block-head h2,
.contact-block-head h3 {
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary-deep);
}

.contact-block p {
  font-size: 0.925rem;
  color: var(--ink-muted);
  line-height: 1.55;
}

.contact-block a {
  color: var(--primary-deep);
  font-weight: 600;
}

.contact-block a:hover {
  color: var(--primary);
}

.table-scroll {
  overflow-x: auto;
}

.contact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.contact-table th,
.contact-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.contact-table th {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.contact-table td {
  color: var(--ink-muted);
}

.contact-table tr:last-child td {
  border-bottom: none;
}


@media (max-width: 640px) {}

/* ---------- Footer ---------- */

.site-footer {
  background: linear-gradient(transparent, rgba(50, 50, 50, 0.50));
}

.footer-bar-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 0 2rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--paper);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.footer-bar-inner p {
  font-weight: 600;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
}

.footer-legal a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 3px;
}

.footer-legal a:hover {
  color: var(--paper);
  text-decoration-color: var(--paper);
}

/* ---------- Newsletter (aktuality-emailem.php) ---------- */

.newsletter-panel {
  max-width: 34rem;
}

.newsletter-panel h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--primary-deep);
  margin-bottom: 0.75rem;
}

.newsletter-panel p {
  margin-bottom: 1rem;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.5rem 0;
}

.newsletter-form label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-muted);
}

.newsletter-form input[type="email"] {
  width: 100%;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--primary-soft);
  background: var(--paper);
}

.newsletter-form .btn {
  align-self: flex-start;
  margin-top: 0.4rem;
  cursor: pointer;
}

.newsletter-web {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.newsletter-note {
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.newsletter-error {
  font-size: 0.95rem;
  font-weight: 600;
  color: #b3261e;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .menu-week {
    grid-template-columns: repeat(2, 1fr);
  }

  .menu-day--today {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: var(--shadow-lg);
  }

  .site-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-list>li>a {
    padding: 0.75rem 1rem;
    width: 100%;
  }

  .nav-list>li>a:not(.nav-cta)::after {
    left: 1rem;
    right: 1rem;
  }

  .nav-cta {
    margin-left: 0;
    text-align: center;
    justify-content: center;
  }

  /* Mobile dropdown — accordion */
  .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    padding: 0 0 0 1rem;
    min-width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  /* Generous cap: it only exists so the accordion has something to animate
     towards — the longest section (Foto → Spolupráce s Jasmínem, with a
     submenu open inside it) has to fit under it in full. */
  .nav-dropdown.is-open>.dropdown-menu,
  .dropdown-submenu.is-open>.dropdown-menu {
    max-height: 2000px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
  }

  .dropdown-submenu>.dropdown-menu {
    padding-left: 1rem;
    border-left: 2px solid var(--yellow-light);
    margin-left: 0.5rem;
  }

  .dropdown-menu a {
    padding: 0.65rem 0.85rem;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .news-row {
    flex-direction: column;
  }

  .news-row-date {
    flex: none;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 1.25rem;
    justify-content: flex-start;
  }

  .hero {
    padding: 1.5rem 0;
  }

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

  .hero-actions {
    margin-top: 1.2rem;
  }

  /* Both buttons on one row at 390px. min-height holds the 44px touch target the
     trimmed padding would otherwise give up. */
  .hero-actions .btn {
    padding: 0.6rem 1.1rem;
    min-height: 44px;
  }

  .stub-section > .wrap,
  .menu-section > .wrap {
    width: 100%;
    border-radius: 0;
  }

  .news-row {
    margin-inline: -1.25rem;
    border-inline: none;
    border-radius: 0;
  }
}

@media (max-width: 520px) {
  .menu-week {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {

  .contact-table--stack,
  .contact-table--stack tbody,
  .contact-table--stack tr,
  .contact-table--stack td {
    display: block;
    width: 100%;
  }

  .contact-table--stack tr {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
  }

  .contact-table--stack tr:last-child {
    border-bottom: none;
  }

  .contact-table--stack td {
    padding: 0.1rem 0;
    border-bottom: none;
    white-space: normal;
  }
}
