/* ============================================================
   Photobox Gallery – Public Pages
   Ruhig, editorial, „Fotos zuerst". Warme Neutrals + Bernstein.
   ============================================================ */

body { background: var(--color-surface-2); }
main { display: block; }

/* ── Navigation ─────────────────────────────────────────────── */
.public-nav {
  height: var(--nav-height, 56px);
  background: color-mix(in oklch, var(--color-surface) 85%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}
.public-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--sp-4);
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text) !important;
  text-decoration: none !important;
  letter-spacing: -.02em;
}
.nav-logo img { height: 30px; width: auto; }
.nav-logo svg { color: var(--color-primary); }

.nav-links { display: flex; align-items: center; gap: var(--sp-1); }
.nav-link {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-text-2);
  border-radius: var(--r-md);
  transition: background var(--t), color var(--t);
  text-decoration: none !important;
}
.nav-link:hover { background: var(--color-surface-3); color: var(--color-text); }

/* Nav controls (Sprache / Theme) — sichtbar auf hellem Grund */
.nav-controls { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.nav-ctl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 var(--sp-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  color: var(--color-text-2);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.nav-ctl:hover { color: var(--color-text); border-color: var(--color-text-muted); background: var(--color-surface-3); }
.nav-ctl.is-icon { width: 32px; padding: 0; }

/* ── Footer ─────────────────────────────────────────────────── */
.public-footer {
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--sp-8) 0;
  background: var(--color-surface);
  margin-top: var(--sp-16);
}
.public-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.footer-links { display: flex; align-items: center; gap: var(--sp-6); flex-wrap: wrap; }
.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--t);
}
.footer-links a:hover { color: var(--color-text); }
.footer-powered { font-size: var(--text-xs); color: var(--color-text-muted); }
.footer-powered a { color: inherit; }
.footer-powered a:hover { color: var(--color-primary); }

/* ── Hero ───────────────────────────────────────────────────── */
/* Ohne Bild: ruhiger, typografischer Kopf auf warmem Grund.
   Mit Bild (.hero-bg vorhanden): dunkle Bühne, heller Text. */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  overflow: hidden;
}
.hero-content { position: relative; z-index: 2; width: 100%; padding: var(--sp-16) 0 var(--sp-12); }
.hero-content h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -.035em;
  line-height: 1.08;
  margin-bottom: var(--sp-3);
}
.hero-content p {
  font-size: var(--text-lg);
  color: var(--color-text-2);
  max-width: 560px;
  line-height: 1.6;
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transform: scale(1.04);
}
.hero-overlay { position: absolute; inset: 0; z-index: 1; }

/* Bild-Variante */
.hero:has(.hero-bg) { min-height: 380px; align-items: flex-end; background: oklch(0.16 0.006 75); }
.hero:has(.hero-bg) .hero-overlay {
  background: linear-gradient(to top, oklch(0.12 0.01 75 / .82) 0%, oklch(0.12 0.01 75 / .28) 45%, oklch(0.12 0.01 75 / .12) 100%);
}
.hero:has(.hero-bg) .hero-content h1 { color: #fff; }
.hero:has(.hero-bg) .hero-content p { color: rgba(255,255,255,.86); }

/* ── Events Grid ────────────────────────────────────────────── */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--sp-5);
}
.event-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none !important;
  transition: box-shadow var(--t-med), border-color var(--t-med), transform var(--t-med);
  color: var(--color-text);
}
.event-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border);
  transform: translateY(-2px);
}
.event-card-cover {
  aspect-ratio: 3 / 2;
  background: var(--color-surface-3);
  overflow: hidden;
  position: relative;
}
.event-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }
.event-card:hover .event-card-cover img { transform: scale(1.035); }
.event-card-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-border);
  background: var(--color-surface-3);
}
.event-card-body { padding: var(--sp-4) var(--sp-4) var(--sp-5); flex: 1; }
.event-card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--color-text);
  letter-spacing: -.015em;
  line-height: 1.3;
}
.event-card-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  display: flex; align-items: center; gap: var(--sp-2);
}

.event-featured-badge {
  position: absolute; top: 8px; left: 8px; z-index: 10;
  background: var(--color-primary); color: var(--color-on-primary);
  font-size: 0.68rem; font-weight: 700; padding: 3px 9px;
  border-radius: var(--r-full); text-transform: uppercase; letter-spacing: .05em;
}

/* ── Neutrale Landing (keine Galerien gelistet) ─────────────── */
.landing-hint {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  padding: var(--sp-10) var(--sp-6);
}
.landing-hint-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--r-xl);
  background: var(--color-primary-bg);
  color: var(--color-primary-text);
  display: flex; align-items: center; justify-content: center;
}
.landing-hint-icon svg { width: 28px; height: 28px; }
.landing-hint h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--color-text);
  margin-bottom: var(--sp-3);
}
.landing-hint p {
  font-size: var(--text-base);
  color: var(--color-text-2);
  line-height: 1.6;
}

/* ── Gallery Header ─────────────────────────────────────────── */
.gallery-body { background: var(--color-surface); }
.gallery-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--sp-8) 0 var(--sp-6);
}
.gallery-header .container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.gallery-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 4px;
  line-height: 1.15;
}
.gallery-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex; align-items: center; gap: var(--sp-3);
}
.gallery-meta span + span::before { content: "·"; margin-right: var(--sp-3); color: var(--color-border); }
.gallery-actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* Filter / Auswahl-Toolbar */
.gallery-toolbar {
  background: color-mix(in oklch, var(--color-surface) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border-subtle);
  padding: var(--sp-3) 0;
  position: sticky;
  top: var(--nav-height, 56px);
  z-index: 50;
}
.gallery-toolbar .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
}
.filter-group {
  display: flex; align-items: center; gap: 2px;
  background: var(--color-surface-3);
  border-radius: var(--r-md);
  padding: 3px;
  flex-wrap: wrap;
}
.filter-btn {
  height: 30px; padding: 0 var(--sp-4);
  font-size: var(--text-xs); font-weight: 500;
  border-radius: 6px; border: none;
  background: transparent; color: var(--color-text-2);
  cursor: pointer; transition: background var(--t), color var(--t); white-space: nowrap;
}
.filter-btn:hover { color: var(--color-text); }
.filter-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
}

/* ── Masonry Photo Grid ─────────────────────────────────────── */
.photo-grid { columns: 4; column-gap: 6px; padding: var(--sp-4) 0 var(--sp-8); }
@media (max-width: 1100px) { .photo-grid { columns: 3; } }
@media (max-width: 700px)  { .photo-grid { columns: 2; column-gap: 5px; } }
@media (max-width: 400px)  { .photo-grid { columns: 1; } }

.photo-item {
  break-inside: avoid;
  margin-bottom: 6px;
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  background: var(--color-surface-3);
  display: block;
  text-decoration: none !important;
  box-shadow: 0 1px 2px oklch(0.3 0.02 75 / .04);
}
.photo-item img { width: 100%; height: auto; display: block; transition: transform var(--t-med), filter var(--t-med); }
.photo-item:hover img { transform: scale(1.03); filter: brightness(.94); }
.photo-item-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, oklch(0.15 0.01 75 / .55) 0%, transparent 55%);
  opacity: 0; transition: opacity var(--t);
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: var(--sp-3); gap: var(--sp-2);
}
.photo-item:hover .photo-item-overlay { opacity: 1; }
/* runde Icon-Buttons auf dem Bild */
.photo-item-overlay .btn {
  height: 32px; width: 32px; padding: 0;
  border-radius: var(--r-full);
  background: color-mix(in oklch, var(--color-surface) 92%, transparent);
  border: none; color: var(--color-text);
  box-shadow: var(--shadow-sm); backdrop-filter: blur(4px);
}
.photo-item-overlay .btn:hover { background: var(--color-surface); }

/* ── Lightbox (eigen, offline-tauglich) ─────────────────────── */
.lb {
  position: fixed; inset: 0; z-index: 1000;
  display: none;
  background: oklch(0.14 0.006 75 / .96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity var(--t-med);
}
.lb.open { display: block; opacity: 1; }
.lb-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 64px 72px;
}
.lb-img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px oklch(0 0 0 / .5);
  user-select: none;
  animation: lb-in var(--t-med) var(--ease);
}
@keyframes lb-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

.lb-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5);
  color: oklch(0.96 0.004 80);
  z-index: 2;
  background: linear-gradient(to bottom, oklch(0.12 0.01 75 / .55), transparent);
}
.lb-counter { font-size: var(--text-sm); font-variant-numeric: tabular-nums; letter-spacing: .04em; opacity: .9; }
.lb-tools { display: flex; align-items: center; gap: var(--sp-2); }
.lb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: none; border-radius: var(--r-full);
  background: oklch(1 0 0 / .10); color: #fff;
  cursor: pointer; transition: background var(--t);
}
.lb-btn:hover { background: oklch(1 0 0 / .20); }
.lb-btn svg { width: 20px; height: 20px; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
}
.lb-prev { left: max(var(--sp-4), env(safe-area-inset-left)); }
.lb-next { right: max(var(--sp-4), env(safe-area-inset-right)); }
@media (max-width: 640px) {
  .lb-stage { padding: 56px 12px; }
  .lb-nav { width: 42px; height: 42px; }
  .lb-prev { left: 6px; } .lb-next { right: 6px; }
}

/* ── Subscribe ──────────────────────────────────────────────── */
.subscribe-section {
  margin-top: var(--sp-12);
  padding: var(--sp-10) var(--sp-8);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-xl);
  text-align: center;
}

/* ── Password Page ──────────────────────────────────────────── */
.password-page {
  min-height: calc(100dvh - var(--nav-height, 56px));
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-4);
  background: var(--color-surface-2);
}
.password-card {
  width: 100%; max-width: 400px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-2xl);
  padding: var(--sp-10) var(--sp-8);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.password-icon {
  width: 56px; height: 56px;
  background: var(--color-primary-bg);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-5);
  color: var(--color-primary-text);
}
.password-icon svg { width: 26px; height: 26px; }
.password-card h1 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -.02em; margin-bottom: var(--sp-2); }
.password-card p { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--sp-6); }

/* ── Legal Pages ────────────────────────────────────────────── */
.legal-page { max-width: 760px; margin: var(--sp-12) auto; }
.legal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-10);
  box-shadow: var(--shadow-xs);
}
.legal-content h1, .legal-content h2, .legal-content h3 { margin-bottom: var(--sp-4); font-weight: 700; letter-spacing: -.02em; }
.legal-content h1 { font-size: var(--text-2xl); }
.legal-content h2 { font-size: var(--text-xl); margin-top: var(--sp-8); }
.legal-content h3 { font-size: var(--text-lg); margin-top: var(--sp-6); }
.legal-content p { margin-bottom: var(--sp-4); color: var(--color-text-2); }
.legal-content ul, .legal-content ol { margin: var(--sp-4) 0 var(--sp-4) var(--sp-6); }
.legal-content li { margin-bottom: var(--sp-2); color: var(--color-text-2); }

/* ── Kiosk Mode ─────────────────────────────────────────────── */
.kiosk-body { background: #000; color: #fff; min-height: 100dvh; overflow: hidden; }
.kiosk-slideshow { position: fixed; inset: 0; z-index: 0; }
.kiosk-slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.2s var(--ease); transform: scale(1.04);
}
.kiosk-slide.active { opacity: 1; }
.kiosk-overlay {
  position: fixed; inset: 0; z-index: 1;
  background: radial-gradient(ellipse at center, oklch(0.1 0.01 75 / .15) 0%, oklch(0.08 0.01 75 / .7) 100%);
}
.kiosk-content {
  position: relative; z-index: 2; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-8); text-align: center;
}
.kiosk-qr {
  background: #fff; border-radius: var(--r-2xl);
  padding: var(--sp-5); margin-bottom: var(--sp-6);
  box-shadow: 0 24px 64px oklch(0 0 0 / .45);
}
.kiosk-qr img { width: 200px; height: 200px; display: block; }
.kiosk-title { font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 800; letter-spacing: -.04em; margin-bottom: var(--sp-3); text-shadow: 0 2px 20px oklch(0 0 0 / .45); }
.kiosk-hint { font-size: var(--text-lg); opacity: .8; }

/* ── Print QR ───────────────────────────────────────────────── */
@media print {
  .public-nav, .public-footer { display: none; }
  body { background: #fff; }
}
.print-qr-card {
  max-width: 600px; margin: var(--sp-12) auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-2xl);
  padding: var(--sp-12) var(--sp-10);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.print-qr-card img { max-width: 280px; margin: 0 auto var(--sp-6); }

/* ── Setup Wizard ───────────────────────────────────────────── */
.setup-page {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 500px at 50% -10%, var(--color-primary-bg) 0%, transparent 60%),
    var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8) var(--sp-4);
}
.setup-card {
  width: 100%; max-width: 540px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.setup-header {
  padding: var(--sp-8) var(--sp-8) var(--sp-6);
  border-bottom: 1px solid var(--color-border-subtle);
}
.setup-header h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -.03em; margin-bottom: var(--sp-1); }
.setup-header p { color: var(--color-text-muted); font-size: var(--text-sm); }
.setup-body { padding: var(--sp-8); }
.setup-footer { padding: var(--sp-5) var(--sp-8) var(--sp-8); }

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  background:
    radial-gradient(1000px 460px at 50% -10%, var(--color-primary-bg) 0%, transparent 60%),
    var(--color-surface-2);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-6) var(--sp-4);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-2xl);
  padding: var(--sp-10) var(--sp-8);
  box-shadow: var(--shadow-lg);
}
.login-logo {
  width: 48px; height: 48px;
  background: var(--color-primary);
  border-radius: var(--r-xl);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.login-logo svg { width: 24px; height: 24px; color: var(--color-on-primary); }
.login-card h1 { font-size: var(--text-xl); font-weight: 700; text-align: center; letter-spacing: -.02em; margin-bottom: var(--sp-2); }
.login-card .subtitle { text-align: center; font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--sp-8); }

/* ── FAQ ─────────────────────────────────────────────────────── */
.faq-list {
  display: flex; flex-direction: column;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--color-surface);
}
.faq-item { border-bottom: 1px solid var(--color-border-subtle); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  font-weight: 600; cursor: pointer; list-style: none;
  background: var(--color-surface); transition: background var(--t);
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question:hover { background: var(--color-surface-2); }
details[open] .faq-question { background: var(--color-surface-2); }
details[open] .faq-chevron { transform: rotate(180deg); }
.faq-chevron { flex-shrink: 0; color: var(--color-text-muted); transition: transform var(--t); }
.faq-answer { padding: var(--sp-4) var(--sp-5) var(--sp-5); background: var(--color-surface); line-height: 1.7; color: var(--color-text-2); }
.faq-answer p { margin: 0 0 var(--sp-3); }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a { color: var(--color-link); }

/* ── Guest upload drop zone ─────────────────────────────────── */
.upload-drop-zone {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8) var(--sp-6);
  text-align: center;
  color: var(--color-text-2);
  transition: border-color var(--t), background var(--t);
}
.upload-drop-zone svg { width: 30px; height: 30px; margin: 0 auto var(--sp-3); color: var(--color-text-muted); }
.upload-drop-zone.drag-over { border-color: var(--color-primary); background: var(--color-primary-bg); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .events-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .gallery-header .container { flex-direction: column; align-items: flex-start; }
  .legal-content { padding: var(--sp-6); }
  .hero-content { padding: var(--sp-12) 0 var(--sp-10); }
}
@media (max-width: 480px) {
  .events-grid { grid-template-columns: 1fr; }
}
