/* Hochzeitsgalerie Luisa & Max — Mobile first */
:root {
  --paper: #faf6f0;
  --ink: #33302b;
  --muted: #8b8377;
  --green: #5c6650;
  --green-dark: #4a5341;
  --berry: #b94a62;
  --line: #e7dfd3;
  --radius: 12px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- Code-Eingabe (Gate) ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper);
  padding: 24px;
}
.gate[hidden] { display: none; }
.gate-card { max-width: 380px; width: 100%; text-align: center; }
.gate-card h1 { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 2.2rem; margin-bottom: 4px; }
.gate-card p { color: var(--muted); margin-bottom: 20px; }
.gate-card input {
  width: 100%; padding: 14px 16px; font-size: 1.05rem; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink); outline: none;
}
.gate-card input:focus { border-color: var(--green); }
.gate-error { color: var(--berry); font-size: .9rem; margin-top: 10px; min-height: 1.3em; }

/* ---------- Hero ---------- */
.hero {
  position: relative; height: 100svh; min-height: 540px;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(20,18,15,.18) 0%, rgba(20,18,15,0) 30%, rgba(20,18,15,0) 45%, rgba(20,18,15,.62) 100%);
}
.hero-text {
  position: relative; z-index: 1; text-align: center; color: #fff;
  padding: 0 20px calc(52px + env(safe-area-inset-bottom));
  text-shadow: 0 1px 14px rgba(0,0,0,.35);
}
.hero-text .datum {
  font-size: .82rem; letter-spacing: .32em; text-transform: uppercase;
  margin-bottom: 10px; opacity: .95;
}
.hero-text h1 {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: clamp(3rem, 11vw, 5.2rem); line-height: 1.05;
}
.hero-text .sub { margin-top: 12px; font-size: .95rem; opacity: .9; }
.hero-scroll {
  position: absolute; z-index: 1; bottom: calc(10px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  color: #fff; opacity: .85; animation: bob 2.2s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translate(-50%,0);} 50% { transform: translate(-50%,7px);} }

/* ---------- Upload-Bereich ---------- */
.upload {
  max-width: 640px; margin: 0 auto; padding: 48px 22px 42px; text-align: center;
}
.upload h2, .galerie-kopf h2 {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 2rem; margin-bottom: 8px;
}
.upload p { color: var(--muted); margin-bottom: 22px; }
.upload .name-row { margin-bottom: 14px; }
.upload input[type="text"] {
  width: 100%; max-width: 380px; padding: 13px 16px; font-size: 1rem; text-align: center;
  border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); outline: none;
}
.upload input[type="text"]:focus { border-color: var(--green); }

#countdown p { color: var(--muted); margin-bottom: 22px; }
.cd-zahlen {
  display: flex; justify-content: center; gap: 18px;
}
.cd-zahlen div { min-width: 58px; }
.cd-zahlen span {
  display: block;
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 2.4rem; line-height: 1.1; color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.cd-zahlen small {
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}

.btn-upload {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--green); color: #fff; border: none;
  padding: 16px 30px; border-radius: 999px; font-size: 1.06rem; font-weight: 600;
  box-shadow: 0 6px 18px rgba(92,102,80,.32);
  transition: transform .12s ease, background .12s ease;
}
.btn-upload:active { transform: scale(.97); background: var(--green-dark); }

.visi-row { margin-top: 16px; font-size: .92rem; color: var(--muted); display: none; }
.visi-row.sichtbar { display: block; }
.visi-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

.upload-status { margin-top: 20px; text-align: left; max-width: 420px; margin-left: auto; margin-right: auto; }
.upload-item {
  padding: 8px 0 10px; border-bottom: 1px solid var(--line); font-size: .92rem;
}
.upload-item:last-child { border-bottom: none; }
.upload-item .zeile { display: flex; align-items: center; gap: 10px; }
.upload-item .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .balken {
  margin-top: 6px; height: 4px; border-radius: 999px;
  background: var(--line); overflow: hidden;
}
.upload-item .fuellung {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--green); transition: width .25s ease;
}
.upload-item.fehler .fuellung { background: var(--berry); }
.upload-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: none; }
.upload-item.laeuft .dot { background: var(--green); animation: pulse 1s infinite; }
.upload-item.fertig .dot { background: var(--green); }
.upload-item.fehler .dot { background: var(--berry); }
.upload-item .pct { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Galerie ---------- */
.galerie-kopf {
  max-width: 1200px; margin: 0 auto; padding: 10px 22px 18px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.galerie-kopf .anzahl { color: var(--muted); font-size: .9rem; }
.trenner { border: none; border-top: 1px solid var(--line); max-width: 120px; margin: 0 auto; }

.galerie { max-width: 1200px; margin: 0 auto; padding: 0 14px 60px; }
.album-nav {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 8px 14px;
}
.album-nav[hidden] { display: none; }
.album-chip {
  text-decoration: none; color: var(--green-dark);
  border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 7px 14px; font-size: .85rem;
}
.album-kopf { padding: 30px 8px 2px; }
.album-kopf h3 {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 1.55rem;
}
.album-sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.btn-hero {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; color: var(--green-dark); font-size: .9rem;
}
#heroStatus { margin-left: 8px; }
.visi-row select {
  font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; padding: 8px 14px; margin-left: 6px;
}
.zeit-chip {
  display: flex; align-items: center; gap: 16px;
  margin: 28px 6px 14px;
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 1.2rem; color: var(--green-dark);
}
.zeit-chip span { text-align: center; max-width: 75%; }
.zeit-chip::before, .zeit-chip::after {
  content: ""; flex: 1; border-top: 1px solid var(--line);
}
.foto-grid { column-count: 2; column-gap: 10px; }
@media (min-width: 700px) { .foto-grid { column-count: 3; } }
@media (min-width: 1050px) { .foto-grid { column-count: 4; } }

.foto {
  position: relative; break-inside: avoid; margin-bottom: 10px;
  border-radius: 10px; overflow: hidden; background: #eee7db;
  border: none; padding: 0; width: 100%; display: block;
}
.foto img { width: 100%; border-radius: 10px; }
.foto.video img { transition: opacity .35s ease; }
.play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(22,20,17,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.dauer-chip {
  position: absolute; bottom: 8px; right: 8px;
  background: rgba(22,20,17,.65); color: #fff;
  font-size: .7rem; padding: 2px 8px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.foto .badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(185,74,98,.92); color: #fff;
  font-size: .68rem; padding: 3px 9px; border-radius: 999px; letter-spacing: .04em;
}
.galerie-leer { text-align: center; color: var(--muted); padding: 30px 20px 10px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(22,20,17,.96);
  flex-direction: column;
}
.lightbox.offen { display: flex; }
.lb-bild {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 14px; touch-action: pan-y;
}
.lb-bild img, .lb-bild video { max-width: 100%; max-height: 100%; border-radius: 6px; object-fit: contain; }
.lb-leiste {
  display: flex; align-items: center; gap: 14px; color: #d8d2c8;
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom)); font-size: .9rem;
}
.lb-leiste .meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-leiste a, .lb-leiste button {
  color: #fff; background: rgba(255,255,255,.12); border: none;
  border-radius: 999px; padding: 9px 16px; text-decoration: none; font-size: .88rem;
}
.lb-leiste button.loeschen { background: rgba(185,74,98,.85); display: none; }
.lb-leiste button.loeschen.sichtbar { display: inline-block; }
.lb-zu {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px;
  background: rgba(255,255,255,.14); color: #fff; border: none;
  width: 42px; height: 42px; border-radius: 50%; font-size: 1.25rem; line-height: 1;
}
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); color: #fff; border: none;
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.3rem;
  display: none;
}
@media (min-width: 700px) { .lb-nav { display: block; } }
.lb-nav.zurueck { left: 14px; }
.lb-nav.weiter { right: 14px; }

/* ---------- Footer ---------- */
.footer {
  text-align: center; color: var(--muted); font-size: .85rem;
  padding: 26px 20px calc(30px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.footer .herz { color: var(--berry); }
