/* =========================================================
   Chata Rozbřezka — design system
   Mobile-first. Žádné runtime image discovery, statická galerie.
   ========================================================= */

:root {
  /* Barvy */
  --bg: #f4f1ea;
  --paper: #fbf9f5;
  --ink: #1e241f;
  --ink-soft: #2a3329;
  --muted: #5e655f;
  --forest: #173022;
  --forest-soft: #2b4a38;
  --forest-deep: #0c1b13;
  --accent: #b58a52;
  --accent-soft: #f2e4cf;
  --card: #ffffff;
  --line: rgba(23, 48, 34, 0.14);
  --line-strong: rgba(23, 48, 34, 0.28);

  /* Tlumení / stíny */
  --shadow-sm: 0 1px 2px rgba(14, 29, 20, 0.06);
  --shadow-md: 0 6px 18px rgba(14, 29, 20, 0.08);
  --shadow-lg: 0 14px 40px rgba(14, 29, 20, 0.16);

  /* Geometrie */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --max: 1180px;

  /* Spacing */
  --gap-1: 0.4rem;
  --gap-2: 0.7rem;
  --gap-3: 1rem;
  --gap-4: 1.4rem;
  --gap-5: 2rem;
  --gap-6: 3rem;

  /* Typografie */
  --font-display: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --font-text: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Bottom safe area na mobilu pro sticky CTA */
  --mobile-cta-h: 0px;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-text);
  background:
    radial-gradient(circle at 20% -20%, #ffffff 0%, var(--bg) 55%) no-repeat fixed,
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* na mobilu necháme místo pro sticky CTA */
  padding-bottom: var(--mobile-cta-h);
}

img,
picture,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentColor;
}

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

button {
  font: inherit;
  color: inherit;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0.5rem;
  background: var(--forest);
  color: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  z-index: 100;
  text-decoration: none;
  font-weight: 700;
}

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

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 249, 245, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner,
.section-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: var(--gap-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.3vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  color: var(--forest);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  background: var(--forest);
  color: var(--accent-soft);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 800;
  transform: translateY(-1px);
}

.topnav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
}

.topnav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--forest);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topnav-toggle[aria-expanded="true"] .topnav-toggle-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.topnav-toggle[aria-expanded="true"] .topnav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.topnav-toggle[aria-expanded="true"] .topnav-toggle-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.topnav {
  display: none;
  width: 100%;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0 0.8rem;
  order: 99;
}

.topnav.is-open {
  display: flex;
}

.topnav a {
  display: block;
  padding: 0.75rem 0.6rem;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}

.topnav a:hover,
.topnav a.is-active {
  color: var(--forest);
  background: rgba(23, 48, 34, 0.08);
}

.topnav-cta {
  background: var(--forest);
  color: #fff !important;
  text-align: center;
  margin-top: 0.3rem;
}

.topnav-cta:hover {
  background: var(--forest-soft);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  width: min(var(--max), calc(100% - 2rem));
  margin: var(--gap-3) auto var(--gap-5);
  border-radius: clamp(18px, 4vw, 32px);
  overflow: hidden;
  min-height: 78svh;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  background: linear-gradient(135deg, #526356, #2f4235);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10, 20, 14, 0.05) 0%, rgba(10, 20, 14, 0.55) 60%, rgba(10, 20, 14, 0.85) 100%),
    linear-gradient(125deg, rgba(10, 20, 14, 0.35), transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: end;
  gap: var(--gap-3);
  padding: clamp(1.1rem, 5vw, 3rem);
  color: #f6f6f0;
  min-height: 78svh;
}

.pill {
  align-self: start;
  display: inline-flex;
  gap: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--forest);
}

.hero h1 {
  color: #f6f6f0;
  font-size: clamp(1.9rem, 6vw, 3.8rem);
  line-height: 1.05;
  max-width: 16ch;
}

.lead {
  margin: 0;
  max-width: 56ch;
  color: rgba(244, 246, 240, 0.94);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1.1rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease;
  white-space: nowrap;
}

@media (hover: hover) {
  .btn:hover {
    transform: translateY(-1px);
  }
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-soft);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: #e9d8bf;
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f9fbf6;
  border-color: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.18);
}

.btn-ghost {
  background: transparent;
  color: #f6f6f0;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ---------- Layout ---------- */
section {
  margin: var(--gap-5) 0;
}

.section-header {
  display: grid;
  gap: 0.35rem;
  margin-bottom: var(--gap-3);
}

.muted {
  color: var(--muted);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: clamp(1.1rem, 3.5vw, 1.8rem);
  box-shadow: var(--shadow-sm);
}

.card-soft {
  background: var(--paper);
}

.card h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 0.6rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap-3);
}

.checklist {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.checklist li {
  padding-left: 1.5rem;
  position: relative;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  background: var(--forest-soft);
  border-radius: 50%;
}

/* ---------- Facts ---------- */
.facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.fact {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
  background: var(--card);
  display: grid;
  gap: 0.1rem;
  box-shadow: var(--shadow-sm);
}

.fact strong {
  display: block;
  font-size: 1.15rem;
  color: var(--forest);
  font-family: var(--font-display);
  font-weight: 700;
}

.fact span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* ---------- Slideshow ---------- */
.slideshow {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: var(--gap-3);
}

.slideshow-stage {
  position: relative;
  border: 0;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #d8ded8;
  cursor: zoom-in;
  width: 100%;
  aspect-ratio: 4 / 3;
  box-shadow: inset 0 0 0 1px rgba(23, 48, 34, 0.08);
}

.slideshow-frame {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-areas: "stack";
}

.slideshow-frame > picture,
.slideshow-frame > img {
  grid-area: stack;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.slideshow-frame > picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slideshow-frame > picture.is-active,
.slideshow-frame > img.is-active {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .slideshow-frame > picture,
  .slideshow-frame > img {
    transition: none;
  }
}

.slideshow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--forest);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease;
}

@media (hover: hover) {
  .slideshow-nav:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.04);
  }
}

.slideshow-prev {
  left: 0.6rem;
}

.slideshow-next {
  right: 0.6rem;
}

.slideshow-meta {
  position: absolute;
  z-index: 3;
  left: 0.6rem;
  bottom: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(10, 20, 14, 0.66);
  color: #f1f3ec;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.slideshow-counter {
  letter-spacing: 0.04em;
}

.slideshow-zoom {
  display: none;
  align-items: center;
  gap: 0.3rem;
  border-left: 1px solid rgba(255, 255, 255, 0.4);
  padding-left: 0.6rem;
}

.slideshow-zoom svg {
  display: block;
}

.slideshow-controls {
  margin-top: var(--gap-2);
  display: flex;
  justify-content: center;
}

.chip-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--forest);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.chip-button[aria-pressed="true"] {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.chip-button[aria-pressed="true"] .chip-button-icon svg path {
  d: path("M6 5h4v14H6zm8 0h4v14h-4z");
}

.chip-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slideshow-thumbs {
  margin-top: var(--gap-3);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.slideshow-thumb {
  position: relative;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background: #dbe1db;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.18s ease, transform 0.18s ease;
}

.slideshow-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slideshow-thumb.is-active {
  outline-color: var(--accent);
}

@media (hover: hover) {
  .slideshow-thumb:hover {
    transform: translateY(-1px);
  }
}

/* ---------- Ceník ---------- */
.prices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.price {
  display: grid;
  gap: 0.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  padding: 1rem 1.1rem;
}

.price-label {
  font-size: 0.92rem;
  color: var(--muted);
  font-weight: 600;
}

.price strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 4vw, 1.7rem);
  color: var(--forest);
}

.price-unit {
  font-size: 0.92rem;
  color: var(--muted);
}

.price-accent {
  background: var(--forest);
  color: #f1f3ec;
  border-color: var(--forest);
}

.price-accent .price-label,
.price-accent .price-unit {
  color: rgba(241, 243, 236, 0.8);
}

.price-accent strong {
  color: var(--accent-soft);
}

/* ---------- Lokalita ---------- */
.location-grid {
  list-style: none;
  margin: var(--gap-3) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.location-item {
  display: grid;
  gap: 0.1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.location-item strong {
  color: var(--forest);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.location-item span {
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- CTA blok ---------- */
.cta-block {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.12), transparent 50%),
    linear-gradient(130deg, var(--forest) 0%, var(--forest-soft) 60%, #365f43 100%);
  color: #eef4ed;
  border-radius: clamp(18px, 3vw, 28px);
  padding: clamp(1.3rem, 4.5vw, 2.4rem);
  box-shadow: var(--shadow-lg);
}

.cta-block h2 {
  color: #f6f6f0;
  font-size: clamp(1.45rem, 3.2vw, 2.2rem);
  max-width: 26ch;
}

.cta-block p {
  margin: 0.55rem 0 0;
  color: rgba(238, 244, 237, 0.88);
}

.cta-actions {
  margin-top: var(--gap-3);
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

/* ---------- Mobile sticky CTA ---------- */
.mobile-cta {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: calc(0.9rem + env(safe-area-inset-bottom));
  z-index: 25;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--forest);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.mobile-cta:hover {
  background: var(--forest-soft);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: var(--gap-5);
  padding: var(--gap-4) 0 var(--gap-5);
  background: var(--paper);
}

.footer-inner {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
  display: grid;
  gap: var(--gap-3);
  font-size: 0.95rem;
}

.footer-meta {
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 14, 10, 0.94);
  padding: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 0.5rem;
  touch-action: pan-y;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-figure {
  margin: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.lightbox-frame {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.lightbox-frame img {
  max-width: 100%;
  max-height: calc(100svh - 6rem);
  width: auto;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
}

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #17251b;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.lightbox-close {
  position: absolute;
  top: calc(0.75rem + env(safe-area-inset-top));
  right: calc(0.75rem + env(safe-area-inset-right));
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #17251b;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.lightbox-counter {
  position: absolute;
  left: 50%;
  bottom: calc(0.6rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #e7eee8;
  background: rgba(10, 20, 13, 0.7);
}

/* =========================================================
   Breakpointy (mobile-first → tablet → desktop)
   ========================================================= */

/* od ~520 px: thumby ve více sloupcích, lepší facts */
@media (min-width: 32rem) {
  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .slideshow-thumbs {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .prices,
  .location-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* od ~46 rem (~736 px): tablet a víc - schovat mobilní bottom CTA, otevřít hlavní nav */
@media (min-width: 46rem) {
  :root {
    --mobile-cta-h: 0px;
  }
  .topnav-toggle {
    display: none;
  }
  .topnav {
    display: flex;
    flex-direction: row;
    width: auto;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    order: initial;
  }
  .topnav a {
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
  }
  .topnav-cta {
    margin-top: 0;
    padding-inline: 1rem;
  }
  .mobile-cta {
    display: none;
  }

  .facts {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .slideshow-thumbs {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  .prices {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .location-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .slideshow-zoom {
    display: inline-flex;
  }
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

/* od ~60 rem (~960 px): split layout pro O chatě, větší slideshow */
@media (min-width: 60rem) {
  .split {
    grid-template-columns: 1.15fr 0.85fr;
  }
  .slideshow-stage {
    aspect-ratio: 16 / 10;
  }
  .slideshow-prev {
    left: 1rem;
  }
  .slideshow-next {
    right: 1rem;
  }
  .slideshow-nav {
    width: 50px;
    height: 50px;
  }
}

/* od ~75 rem: maximální komfort hero */
@media (min-width: 75rem) {
  .hero {
    min-height: 72vh;
  }
}

/* na mobilu vyhradíme prostor pro sticky CTA */
@media (max-width: 45.99rem) {
  :root {
    --mobile-cta-h: 5.5rem;
  }
}

/* schovat sticky CTA, když je otevřená galerie (kryje akce) */
.lightbox:not([hidden]) ~ .mobile-cta {
  display: none;
}

/* ---------- Tisk ---------- */
@media print {
  .topbar,
  .mobile-cta,
  .slideshow-nav,
  .slideshow-controls,
  .slideshow-meta,
  .lightbox {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
  .card,
  .cta-block {
    box-shadow: none;
    border: 1px solid #999;
  }
}
