/* =========================================================================
   LAYOUT — mřížka, sekce, hlavička, patička
   ========================================================================= */

/* ---------- KONTEJNERY --------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--w-page);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--wide { max-width: var(--w-wide); }
.wrap--text { max-width: var(--w-text); }
.wrap--flush { padding-inline: 0; }

.section { padding-block: var(--sp-section); }
.section--sm { padding-block: var(--sp-section-sm); }
.section--tight { padding-block: 0 var(--sp-section); }

.section--sand   { background: var(--bg-sunken); }
.section--white  { background: var(--bg-surface); }
.section--turf   { background: var(--bg-invert); color: var(--text-invert); }

.section--turf h1, .section--turf h2, .section--turf h3, .section--turf h4 {
  color: var(--c-white);
}

/* ---------- HLAVIČKA SEKCE ----------------------------------------------- */
.sec-head { max-width: 46rem; margin-bottom: var(--sp-xl); }
.sec-head--center { margin-inline: auto; text-align: center; }

.sec-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2xs);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-turf-700);
  margin-bottom: var(--sp-sm);
}

/* Krátká lajna před štítkem — hlavní motiv webu */
.sec-head__eyebrow::before {
  content: "";
  width: 1.75rem;
  height: var(--line-w-thin);
  background: currentColor;
  flex: none;
}

.section--turf .sec-head__eyebrow { color: var(--c-turf-300); }

.sec-head__title { margin-bottom: var(--sp-sm); }

.sec-head__lede {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text-body);
  max-width: var(--w-text);
}

.section--turf .sec-head__lede { color: var(--c-turf-100); }
.sec-head--center .sec-head__lede { margin-inline: auto; }

/* ---------- MŘÍŽKY ------------------------------------------------------- */
.grid { display: grid; gap: var(--sp-md); }

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

@media (min-width: 40rem) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid { gap: var(--sp-lg); }
}

@media (min-width: 62rem) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Automatická mřížka — karty se zalamují samy */
.grid--auto {
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
}

/* ---------- STŘÍDAVÝ ZIG-ZAG (sportoviště) -------------------------------
   Ne mřížka stejných kartiček, ale střídání foto/text. */
.zigzag { display: grid; gap: var(--sp-2xl); }

.zigzag__item {
  display: grid;
  gap: var(--sp-lg);
  align-items: center;
}

@media (min-width: 56rem) {
  .zigzag { gap: var(--sp-3xl); }
  .zigzag__item {
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4.5rem);
  }
  /* Liché položky mají foto vpravo, sudé vlevo */
  .zigzag__item:nth-child(even) .zigzag__media { order: -1; }
}

@media (min-width: 75rem) {
  .zigzag__item { grid-template-columns: 1.05fr 1fr; }
  .zigzag__item:nth-child(even) { grid-template-columns: 1fr 1.05fr; }
}

/* ---------- PRUH S WEBY ŠKOLY --------------------------------------------
   Nad hlavičkou, záměrně NEsticky — po odscrollování zmizí a nezabírá místo.
   Pod 48rem se skrývá: na displejích kolem 360×640 px má hero jen pár pixelů
   rezervy a pruh by shodil tlačítko poptávky pod ohyb. Tam jsou odkazy
   dostupné v rozbalovacím menu. */
.orgbar {
  display: none;
  background: var(--c-turf-900);
  color: var(--c-turf-100);
  font-size: var(--fs-2xs);
}

@media (min-width: 48rem) {
  .orgbar { display: block; }
}

.orgbar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2xs) var(--sp-sm);
  min-height: 2.25rem;
  padding-block: var(--sp-3xs);
}

.orgbar__label {
  font-weight: var(--fw-semi);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--c-turf-300);
  flex: none;
}

.orgbar__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2xs) var(--sp-md);
  min-width: 0;
}

.orgbar__link {
  display: inline-block;
  padding-block: 0.25rem;
  color: var(--c-sand-100);
  text-decoration: none;
  white-space: nowrap;
}

.orgbar__link:hover {
  color: var(--c-white);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.orgbar :focus-visible { outline-color: var(--c-turf-300); }

/* ---------- HLAVIČKA WEBU ------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--bg-page) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: var(--bw) solid transparent;
  transition: border-color var(--t-base) var(--ease),
              box-shadow var(--t-base) var(--ease);
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg-page); }
}

.site-header[data-scrolled="true"] {
  border-bottom-color: var(--border);
  box-shadow: var(--sh-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  min-height: var(--header-h);
}

@media (min-width: 62rem) {
  .site-header__inner { min-height: var(--header-h-lg); }
}

/* Logo */
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2xs);
  text-decoration: none;
  color: var(--text-strong);
  /* Logo se smí zmenšit — jinak dlouhý podtitul vytlačí tlačítko
     mobilního menu mimo obrazovku. */
  flex: 0 1 auto;
  min-width: 0;
  margin-right: auto;
}

.brand:hover { color: var(--text-strong); }

.brand__mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  color: var(--c-turf-800);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand__name {
  font-size: var(--fs-base);
  font-weight: var(--fw-black);
  letter-spacing: var(--ls-tight);
  color: var(--text-strong);
  white-space: nowrap;
}

.brand__sub {
  font-size: var(--fs-3xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Na úzkých displejích podtitul nezkracujeme, ale schováme — název
   ubytovny sám o sobě stačí a tlačítko menu zůstane dosažitelné. */
@media (max-width: 34rem) { .brand__sub { display: none; } }

/* Hlavní navigace */
.nav { display: none; }

@media (min-width: 62rem) {
  .nav { display: flex; align-items: center; gap: var(--sp-3xs); }
}

.nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--tap);
  padding-inline: var(--sp-xs);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-body);
  text-decoration: none;
  border-radius: var(--r-sm);
  transition: color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}

.nav__link:hover {
  color: var(--c-turf-800);
  background: var(--c-turf-50);
}

/* Aktivní stránka — bílá lajna pod odkazem */
.nav__link[aria-current="page"] { color: var(--c-turf-800); font-weight: var(--fw-semi); }

.nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: var(--sp-xs);
  right: var(--sp-xs);
  bottom: 0.375rem;
  height: var(--line-w-thin);
  background: var(--c-turf-800);
  border-radius: var(--r-full);
}

/* Kontakt v hlavičce */
.header-contact {
  display: none;
  align-items: center;
  gap: var(--sp-2xs);
}

@media (min-width: 48rem) { .header-contact { display: flex; } }

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3xs);
  height: var(--tap);
  padding-inline: var(--sp-xs);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  color: var(--c-turf-800);
  text-decoration: none;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

.header-phone:hover { background: var(--c-turf-50); color: var(--c-turf-900); }
.header-phone svg { width: 1rem; height: 1rem; flex: none; }

@media (max-width: 62rem) { .header-phone__num { display: none; } }

/* Přepínač mobilního menu */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  flex: none;
  border-radius: var(--r-sm);
  color: var(--text-strong);
  transition: background-color var(--t-fast) var(--ease);
}

.nav-toggle:hover { background: var(--c-turf-50); }

@media (min-width: 62rem) { .nav-toggle { display: none; } }

.nav-toggle__bars { width: 1.375rem; height: 1rem; position: relative; }

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--line-w-thin);
  background: currentColor;
  border-radius: var(--r-full);
  transition: transform var(--t-base) var(--ease),
              opacity var(--t-fast) var(--ease);
}

.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle__bars span:nth-child(3) { bottom: 0; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  top: 50%; transform: translateY(-50%) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  bottom: 50%; transform: translateY(50%) rotate(-45deg);
}

/* Mobilní zásuvka */
.drawer {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: var(--z-drawer);
  background: var(--bg-page);
  padding: var(--sp-md) 0 var(--sp-2xl);
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity var(--t-base) var(--ease),
              transform var(--t-base) var(--ease),
              visibility var(--t-base) var(--ease);
}

.drawer[data-open="true"] {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 62rem) { .drawer { display: none; } }

.drawer__list { display: flex; flex-direction: column; }

.drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  padding: var(--sp-sm) 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semi);
  color: var(--text-strong);
  text-decoration: none;
  border-bottom: var(--bw) solid var(--border-soft);
}

.drawer__link[aria-current="page"] { color: var(--c-turf-800); }

.drawer__link svg { width: 1.125rem; height: 1.125rem; color: var(--text-mute); }

.drawer__foot {
  display: grid;
  gap: var(--sp-xs);
  margin-top: var(--sp-lg);
}

/* Weby školy v mobilním menu — náhrada za pruh, který se na malých
   displejích skrývá. */
.drawer__sites {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-md);
  border-top: var(--bw) solid var(--border);
}

.drawer__sites-title {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: var(--sp-2xs);
}

.drawer__site-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3xs);
  min-height: var(--tap);
  padding-block: var(--sp-2xs);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-body);
  text-decoration: none;
}

.drawer__site-link:hover { color: var(--c-turf-800); }
.drawer__site-link svg { width: 0.8125rem; height: 0.8125rem; opacity: 0.6; flex: none; }

body[data-drawer-open="true"] { overflow: hidden; }

/* ---------- PATIČKA ------------------------------------------------------ */
.site-footer {
  background: var(--bg-invert);
  color: var(--c-turf-100);
  padding-block: var(--sp-2xl) var(--sp-lg);
  font-size: var(--fs-sm);
}

.site-footer a { color: var(--c-white); text-decoration-color: rgba(255,255,255,0.35); }
.site-footer a:hover { color: var(--c-turf-300); }

.site-footer__grid {
  display: grid;
  gap: var(--sp-xl);
  grid-template-columns: 1fr;
  padding-bottom: var(--sp-xl);
  border-bottom: var(--bw) solid rgba(255, 255, 255, 0.14);
}

@media (min-width: 44rem) {
  .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 68rem) {
  .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--sp-lg); }
}

.site-footer__title {
  font-size: var(--fs-2xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--c-turf-300);
  margin-bottom: var(--sp-sm);
}

.site-footer__list { display: grid; gap: var(--sp-2xs); }

.site-footer__brand { max-width: 26rem; }

.site-footer__brand .brand__name { color: var(--c-white); font-size: var(--fs-lg); }
.site-footer__brand .brand__sub { color: var(--c-turf-300); }
.site-footer__brand .brand__mark { color: var(--c-turf-300); }

.site-footer__note {
  margin-top: var(--sp-sm);
  color: var(--c-turf-100);
  line-height: var(--lh-normal);
}

/* Pruh s ostatními weby školy — popisky odlišují, který web je který,
   zvlášť u dvou ubytoven se snadno zaměnitelnými názvy. */
.site-footer__sites {
  padding-block: var(--sp-lg);
  border-bottom: var(--bw) solid rgba(255, 255, 255, 0.14);
}

.sites {
  display: grid;
  gap: var(--sp-md);
}

@media (min-width: 44rem) {
  .sites { grid-template-columns: repeat(3, 1fr); gap: var(--sp-lg); }
}

.sites__link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3xs);
  font-weight: var(--fw-semi);
  color: var(--c-white);
  text-decoration: none;
  line-height: var(--lh-snug);
}

.sites__link:hover { color: var(--c-turf-300); text-decoration: underline; }
.sites__link svg { width: 0.875rem; height: 0.875rem; flex: none; opacity: 0.65; }

.sites__desc {
  margin-top: var(--sp-3xs);
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
  color: var(--c-turf-300);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-xs) var(--sp-md);
  justify-content: space-between;
  align-items: center;
  padding-top: var(--sp-md);
  font-size: var(--fs-xs);
  color: var(--c-turf-300);
}

.site-footer dl { display: grid; gap: var(--sp-3xs); }
.site-footer dt { color: var(--c-turf-300); font-size: var(--fs-xs); }
.site-footer dd { margin: 0; }
