/* ============================================================
   40. Geburtstag — Einladungsseite
   Warm-rustikal mit festlichem Akzent · mobile-first
   Fonts: Fraunces (Display) + Nunito (Body)
   ============================================================ */

:root {
  --cream:   #f7f1e6;
  --cream-2: #efe5d2;
  --ink:     #2a2017;
  --muted:   #5c4f3d;   /* dunkler für Kontrast auf Creme (>4.5:1) */
  --green:   #44552f;
  --green-d: #34421f;
  --wood:    #6f5532;
  --wood-d:  #57411f;
  --accent:  #d8772f;
  --accent-d:#b75e1c;   /* dunkler für Label-Kontrast auf Creme */
  --white:   #fffdf8;
  --shadow:  0 10px 30px rgba(42, 32, 23, 0.16);
  --radius:  18px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2 {
  font-family: var(--font-display);
  line-height: 1.12;
  font-weight: 600;
  font-optical-sizing: auto;
}

/* Sichtbarer Fokus für Tastatur-Navigation (a11y) */
a:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Layout-Helfer: zentrierte Inhaltsspalte ---------- */
main { overflow: hidden; }

section {
  padding: 3.25rem 1.4rem;
  max-width: 700px;
  margin-inline: auto;
}

section h2 {
  font-size: 1.85rem;
  margin: 0 0 1.1rem;
  color: var(--green-d);
}

/* Abwechselnde, dezent abgesetzte Abschnitte */
.location { background: var(--cream-2); max-width: none; }
.location > * { max-width: 700px; margin-inline: auto; }
.rsvp { background: var(--green); color: var(--white); max-width: none; text-align: center; }
.rsvp > * { max-width: 700px; margin-inline: auto; }
.rsvp h2 { color: var(--white); }

/* ============================ HERO ============================ */
.hero {
  position: relative;
  min-height: 100vh;       /* Fallback für ältere Browser */
  min-height: 100svh;      /* berücksichtigt mobile Browserleisten */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  padding: 2rem 1.4rem;
  background: linear-gradient(rgba(28,22,16,0.42), rgba(28,22,16,0.58)),
              url("images/hero.jpg") center/cover no-repeat;
}

.hero__overlay { max-width: 640px; }

.hero__kicker {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.92;
}

.hero__age {
  font-family: var(--font-display);
  margin: -0.5rem 0;
  font-size: clamp(8rem, 40vw, 15rem);
  font-weight: 900;
  /* Achsen fix pinnen, damit Chrome/Firefox/Safari die "40" identisch rendern.
     font-optical-sizing:auto wählt sonst je Browser ein anderes opsz. */
  font-optical-sizing: none;
  font-variation-settings: "opsz" 144, "wght" 900;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 8px 36px rgba(0,0,0,0.5);
}

.hero__title {
  margin: 0.3rem 0 1.1rem;
  font-size: clamp(1.7rem, 7vw, 2.8rem);
  font-style: italic;
  font-weight: 400;
}

.hero__date {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--accent);
  color: var(--white);
  display: inline-block;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* ========================== INVITE =========================== */
.invite { text-align: center; }
.invite h2 { font-size: 1.7rem; color: var(--wood-d); font-style: italic; font-weight: 400; }
.invite p { font-size: 1.18rem; color: var(--muted); max-width: 60ch; margin-inline: auto; }

/* ========================= LOCATION ========================== */
.location__gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.gallery__item {
  display: block;
  padding: 0;
  border: none;
  background: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  position: relative;
}
.gallery__item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(42, 32, 23, 0);
  transition: background 0.2s ease;
}
.gallery__item:hover::after,
.gallery__item:focus-visible::after { background: rgba(42, 32, 23, 0.18); }
.gallery__item:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.location__gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.gallery__item:hover img { transform: scale(1.05); }

/* ========================= LIGHTBOX ========================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(20, 15, 10, 0.92);
}
.lightbox[hidden] { display: none; }

.lightbox__figure {
  margin: 0;
  max-width: 88vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.lightbox__img {
  max-width: min(88vw, 1000px);
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox__caption {
  color: rgba(255, 253, 248, 0.92);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  font-family: var(--font-body);
  max-width: 88vw;
  overflow-wrap: anywhere;
}

.lightbox__close,
.lightbox__nav {
  flex: none;
  background: rgba(255, 253, 248, 0.14);
  color: var(--white);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.18s ease;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255, 253, 248, 0.28); }
.lightbox__close:focus-visible,
.lightbox__nav:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  font-size: 2rem;
}

.lightbox__counter {
  position: absolute;
  top: 1rem;
  left: 1rem;
  margin: 0;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.14);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.lightbox__nav {
  display: none; /* mobil ausgeblendet — dort wird per Swipe geblättert */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2.2rem;
}
.lightbox__nav--prev { left: 1.5rem; }
.lightbox__nav--next { right: 1.5rem; }

@media (min-width: 720px) {
  .lightbox__nav {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

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

/* ========================= DIRECTIONS ======================== */
.directions { text-align: center; }
.directions__address {
  font-size: 1.22rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 1.5rem;
}

/* ========================== FACTS ============================ */
.facts__list { list-style: none; margin: 0; padding: 0; }
.facts__list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--cream-2);
  font-size: 1.12rem;
}
.facts__list li:last-child { border-bottom: none; }
.facts__list span {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-d);
  font-weight: 800;
  margin-bottom: 0.2rem;
}

/* =========================== RSVP ============================ */
.rsvp p { font-size: 1.15rem; opacity: 0.95; }
.rsvp__buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.7rem;
}

/* ========================== BUTTONS ========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 56px;
  padding: 0.9rem 1.7rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
  width: 100%;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn__icon { flex: none; }

.btn--yes {
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow);
}
.btn--yes:hover { background: var(--accent-d); }

.btn--no {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.7);
}
.btn--no:hover { background: rgba(255,255,255,0.14); }

.btn--map {
  background: var(--wood);
  color: var(--white);
  box-shadow: var(--shadow);
  max-width: 380px;
  margin-inline: auto;
}
.btn--map:hover { background: var(--wood-d); }

/* ========================== FOOTER =========================== */
.footer {
  text-align: center;
  padding: 2.2rem 1.4rem 2.8rem;
  color: var(--muted);
  font-size: 1.18rem;
  font-family: var(--font-display);
  font-style: italic;
}

/* ====================== DESKTOP (≥720px) ===================== */
@media (min-width: 720px) {
  body { font-size: 19px; }

  section { padding: 4.75rem 2rem; }
  section h2 { font-size: 2.2rem; }

  .hero { min-height: 100vh; min-height: 100svh; }

  .location__gallery {
    grid-template-columns: repeat(3, 1fr);
  }
  .location__gallery img { height: 210px; }

  .rsvp__buttons {
    flex-direction: row;
    justify-content: center;
  }
  .btn { width: auto; min-width: 240px; }
  .btn--map { width: auto; }
}

/* ================== REDUCED MOTION (a11y) =================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .btn:hover { transform: none; }
}
