/* ==========================================================================
   Layerivo — experience page (QR-scanned standalone page)
   Shares tokens/fonts with css/style.css. Mobile-first.
   ========================================================================== */

body.exp-body {
  background: var(--color-bg);
}

/* ---------- Fixed header ---------- */
.exp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.exp-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-2);
}

.exp-brand {
  grid-column: 1;
  justify-self: start;
  /* Fixed brand typeface — deliberately NOT var(--font-display), so the
     "Layerivo" wordmark stays visually constant across every theme instead
     of rendering in a different typeface per experience. */
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.exp-brand span {
  color: var(--color-accent-dark);
}

/* ---------- QR-scan trigger buttons ---------- */
.exp-scan-btn {
  appearance: none;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-primary-dark);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.exp-scan-btn:hover,
.exp-scan-btn:focus-visible {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.exp-scan-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.exp-header .exp-scan-btn {
  grid-column: 2;
  justify-self: center;
}

@media (max-width: 420px) {
  .exp-header .exp-scan-btn__label {
    display: none;
  }

  /* Icon-only state below 420px — keep the tap target at the 44px
     accessibility minimum even though the button visually shrinks to
     just the icon. */
  .exp-header .exp-scan-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }
}

/* ---------- Fullscreen QR-scan overlay ---------- */
.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #0b0f0c;
}

.scan-overlay[hidden] {
  display: none;
}

.scan-overlay__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  color: #fff;
}

.scan-overlay__title {
  font-weight: 600;
  font-size: 0.95rem;
}

.scan-overlay__close {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-overlay__viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}

.scan-overlay__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-overlay__frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(70vw, 280px);
  height: min(70vw, 280px);
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 20px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.scan-overlay__focus-ring {
  position: absolute;
  width: 64px;
  height: 64px;
  margin-left: -32px;
  margin-top: -32px;
  border: 2px solid #fff;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.4);
}

.scan-overlay__focus-ring--active {
  opacity: 1;
  transform: scale(1);
  transition: transform 0.25s ease-out, opacity 0.5s ease-in 0.2s;
}

.scan-overlay__status {
  margin: 0;
  text-align: center;
  color: #fff;
  padding: var(--space-2) var(--space-3) var(--space-3);
  font-size: 0.9rem;
}

/* ---------- Hero image ---------- */
.exp-hero {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-primary-tint);
}

.exp-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Uniform bottom vignette across every experience — the 6 hero photos come
   from different sources/styles, this gives them one consistent "frame"
   regardless of theme colors, so the card grid reads as one system. */
.exp-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0) 45%);
  pointer-events: none;
}

/* ---------- Content ---------- */
.exp-main {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-3) var(--space-6);
}

.exp-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-dark);
}

.exp-title {
  margin-top: 0.4rem;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  font-weight: 700;
  color: var(--color-primary-dark);
}

.exp-subtitle {
  margin-top: 0.5rem;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--color-primary);
}

/* ---------- Audio player ---------- */
.exp-audio-wrap {
  margin-top: var(--space-3);
}

.exp-audio {
  width: 100%;
  border-radius: 999px;
}

/* ---------- Story text ---------- */
.exp-story {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ---------- CTA (optional per-experience, e.g. online ticket purchase) ---------- */
.exp-cta {
  margin-top: var(--space-4);
}

.exp-cta[hidden] {
  display: none;
}

/* ---------- Species carousel (multi-species experiences, e.g. 03 — pillangóház) ----------
   Desktop/tablet: arrow buttons flanking the hero image. Mobile: touch swipe
   on the whole card (image + text + audio), arrows hidden — see media query
   below. Dots (species count indicator) are shown at every width. */
.exp-carousel__arrow {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-primary-dark);
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: background 0.15s ease, transform 0.15s ease;
}

.exp-carousel__arrow svg {
  width: 22px;
  height: 22px;
}

.exp-carousel__arrow:hover,
.exp-carousel__arrow:focus-visible {
  background: #fff;
}

.exp-carousel__arrow--prev { left: var(--space-2); }
.exp-carousel__arrow--next { right: var(--space-2); }

.exp-carousel__arrow[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .exp-carousel__arrow {
    display: none;
  }
}

.exp-carousel__dots {
  margin-top: 0.4rem;
  display: flex;
  gap: 0.5rem;
}

.exp-carousel__dot {
  appearance: none;
  border: none;
  background: var(--color-border);
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.exp-carousel__dot:hover,
.exp-carousel__dot:focus-visible {
  background: var(--color-primary);
}

.exp-carousel__dot.is-active {
  background: var(--color-primary);
  transform: scale(1.3);
}

/* ---------- Language switcher ---------- */
.exp-langs {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lang-switch {
  appearance: none;
  border: 1.5px solid transparent;
  background: transparent;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  filter: grayscale(35%);
  transition: opacity 0.15s ease, filter 0.15s ease, border-color 0.15s ease,
    background 0.15s ease, transform 0.15s ease;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  opacity: 0.85;
  filter: grayscale(0%);
  border-color: var(--color-border);
}

.lang-switch.is-active {
  opacity: 1;
  filter: grayscale(0%);
  border-color: var(--color-primary);
  background: var(--color-primary-tint);
  transform: scale(1.08);
}

/* ---------- Footer ---------- */
.exp-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.exp-footer__logo {
  border-radius: 4px;
  flex-shrink: 0;
}

@media (min-width: 600px) {
  .exp-hero { aspect-ratio: 16 / 9; }
}

/* Desktop/non-mobile: cap the hero so it doesn't dwarf an average monitor
   and force scrolling just to reach the story below it. */
@media (min-width: 900px) {
  .exp-hero {
    max-width: 760px;
    margin: var(--space-4) auto 0;
    border-radius: var(--radius-lg);
  }
}

/* ==========================================================================
   Theme variant — Vadaspark (01 — Kito, az elefánt)
   Nyitott, természetközeli hangulat, meleg földtónusú paletta.
   Scoped to body.theme-vadaspark, csak ezt az experience oldalt érinti.
   ========================================================================== */
body.theme-vadaspark {
  --color-bg: #f2e7d4;
  --color-surface: #fbf5e9;
  --color-text: #3a2c1e;
  --color-text-muted: #74624b;
  --color-primary: #95552e;
  --color-primary-dark: #6e3f21;
  --color-primary-tint: #eddabb;
  --color-accent: #c98a2e;
  --color-accent-dark: #8d5d1a;
  --color-border: #e2cda3;
}

.theme-vadaspark .exp-header {
  background: rgba(242, 231, 212, 0.92);
}

.theme-vadaspark .exp-scan-btn {
  border-radius: var(--radius-md);
}

.theme-vadaspark .exp-hero {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

@media (min-width: 900px) {
  .theme-vadaspark .exp-hero {
    border-radius: var(--radius-lg);
  }
}

/* ==========================================================================
   Theme variant — Tropicárium (02 — A tüskésrája)
   Víz-motívum, hűvös kék/türkiz paletta, kerekded modern tipográfia.
   ========================================================================== */
body.theme-tropicarium {
  --color-bg: #e6f4f5;
  --color-surface: #ffffff;
  --color-text: #0f2f36;
  --color-text-muted: #4d7480;
  --color-primary: #0d7787;
  --color-primary-dark: #0a5f6e;
  --color-primary-tint: #cdeef2;
  --color-accent: #1fb6c9;
  --color-accent-dark: #0f7582;
  --color-border: #bfe4e8;

  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.theme-tropicarium .exp-header {
  background: rgba(230, 244, 245, 0.92);
}

.theme-tropicarium .exp-title {
  font-weight: 600;
}

.theme-tropicarium .exp-hero {
  border-radius: 0 0 50% 50% / 0 0 28px 28px;
}

@media (min-width: 900px) {
  .theme-tropicarium .exp-hero {
    border-radius: var(--radius-lg);
  }
}

/* ==========================================================================
   Theme variant — Lepkeház (03 — A pillangóház)
   Üvegház-hangulat, világos pasztell, botanikus-lepke keverék, könnyed
   szerif cím + kerekded talpatlan törzsszöveg.
   ========================================================================== */
body.theme-lepkehaz {
  --color-bg: #fbf3fa;
  --color-surface: #fffaff;
  --color-text: #3b2a42;
  --color-text-muted: #7d6783;
  --color-primary: #9555ab;
  --color-primary-dark: #6e3f80;
  --color-primary-tint: #f1def0;
  --color-accent: #f2a6c1;
  --color-accent-dark: #c2396c;
  --color-border: #ecd7ea;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.theme-lepkehaz .exp-header {
  background: rgba(251, 243, 250, 0.92);
}

.theme-lepkehaz .exp-title {
  font-size: clamp(1.8rem, 7vw, 2.5rem);
  font-style: italic;
}

/* ==========================================================================
   Theme variant — Tanösvény (04 — a több száz éves tölgy)
   Erdei, fa-textúra hangulat, tájékoztató-tábla érzés: szögletesebb formák,
   robusztus talpas cím.
   ========================================================================== */
body.theme-tanosveny {
  --color-bg: #efe9dc;
  --color-surface: #f8f4ea;
  --color-text: #2e2417;
  --color-text-muted: #6b5c46;
  --color-primary: #55401f;
  --color-primary-dark: #362810;
  --color-primary-tint: #ded0b0;
  --color-accent: #5c7a3a;
  --color-accent-dark: #435c29;
  --color-border: #d8c9a3;

  --font-display: "Roboto Slab", Georgia, serif;
  --font-body: "PT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.theme-tanosveny .exp-header {
  background: rgba(239, 233, 220, 0.92);
}

.theme-tanosveny .exp-hero,
.theme-tanosveny .exp-audio,
.theme-tanosveny .exp-scan-btn {
  border-radius: 4px;
}

@media (min-width: 900px) {
  .theme-tanosveny .exp-hero {
    border-radius: 4px;
  }
}

/* ==========================================================================
   Theme variant — Botanikus kert (05 — a húsevő növény)
   Friss zöld/üvegház paletta, ragadozó-motívumú vörös ékezet-szín,
   modern szerif cím.
   ========================================================================== */
body.theme-botanikuskert {
  --color-bg: #eef7ea;
  --color-surface: #ffffff;
  --color-text: #1b2e18;
  --color-text-muted: #56705a;
  --color-primary: #297c44;
  --color-primary-dark: #1d5c31;
  --color-primary-tint: #d7efd9;
  --color-accent: #c23b4a;
  --color-accent-dark: #9c2836;
  --color-border: #cbe6cd;

  --font-display: "DM Serif Display", Georgia, serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.theme-botanikuskert .exp-header {
  background: rgba(238, 247, 234, 0.92);
}
