/* ============================================================================
 *  Warm Thistle Storybook – Design System
 *  Verbindliche Tokens aus dem Design-Handoff (Vivian & Gerrit).
 *  Mobile-First. Breakpoints: ~480 (Handy), 768 (Tablet), 1024+ (Desktop).
 * ========================================================================== */

:root {
  /* Farben ---------------------------------------------------------------- */
  --parchment:        #efe4d2;  /* Grundflaeche */
  --parchment-light:  #f7eeda;  /* Karten / erhabene Flaechen */
  --parchment-header: #f2e8d8;  /* Kopfzeile / Kartenkopf */
  --parchment-2:      #e8dac2;  /* Sekundaerabschnitt */
  --input-focus-bg:   #fff9ec;

  --thistle:   #8a5c8a;  /* Interaktion / Navigation / Distel-Lila */
  --thistle-d: #764e76;
  --rust:      #b06a44;  /* Hauptaktion / Rostrot */
  --rust-dark: #8a4a28;
  --wood:      #5a3826;  /* dunkles Holz – Footer, Ueberschriften-Text */
  --wood-deep: #4a2f20;  /* Login-Panel */
  --wood-deeper:#3d2619;
  --gold:      #e0b06a;  /* Ornament auf dunkel */

  --ink:       #4a3a2e;
  --text:      #5a3826;
  --text-med:  #6b4d38;
  --text-soft: #7d6449;
  --muted:     #a88a6c;
  --muted-2:   #b09779;
  --label:     #9c6b4a;

  --border:        #dcc4a6;
  --border-strong: #cf9a6f;
  --border-soft:   #c9ab8c;

  --success: #5f7a56;
  --danger:  #a8503c;
  --btn-text: #fff6e6;

  /* Schriften ------------------------------------------------------------- */
  --font-display: 'Uncial Antiqua', 'Marcellus', serif; /* nur Namen & Dank */
  --font-serif:   'Marcellus', Georgia, 'Times New Roman', serif;
  --font-body:    'Mulish', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Radien / Abstaende ---------------------------------------------------- */
  --r-pill: 26px;
  --r-lg: 18px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow-card: 0 18px 44px rgba(90,56,38,.18);
  --shadow-soft: 0 6px 18px rgba(90,56,38,.12);

  --tap: 44px; /* Mindest-Tap-Ziel */
}

/* Reset / Basis ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(120% 80% at 50% 0%, var(--parchment-light), var(--parchment)) fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--thistle); text-decoration: none; }
a:hover { color: var(--rust); }
h1, h2, h3 { font-weight: 400; }

/* Sichtbarer Tastatur-Fokus */
:focus-visible {
  outline: 3px solid var(--thistle);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Programmatischer Fokus auf den Content-Container (SPA-Routing) darf KEINEN
   sichtbaren Rahmen zeigen. Echte Bedienelemente (Links/Buttons/Felder)
   behalten ihren Tastatur-Fokus. */
#main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--rust); color: var(--btn-text); padding: 12px 18px; border-radius: 10px;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* Ornament ----------------------------------------------------------------- */
.triquetra {
  display: inline-block;
  color: var(--thistle);
  line-height: 0;
}
.triquetra svg { width: 100%; height: auto; display: block; }
.triquetra.on-dark { color: var(--gold); }

.knot-divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--border-strong);
  margin: 8px auto;
}
.knot-divider::before, .knot-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}
.knot-divider .triquetra { width: 26px; color: var(--border-strong); }

/* Buttons ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap);
  padding: 13px 28px;
  border-radius: var(--r-pill);
  font-family: var(--font-body); font-size: 15px; letter-spacing: .02em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn-primary   { background: var(--rust); color: var(--btn-text); }
.btn-primary:hover { background: #9c5c39; color: var(--btn-text); }
.btn-secondary { background: transparent; border-color: var(--rust); color: var(--rust-dark); }
.btn-secondary:hover { background: #f3e6d5; color: var(--rust-dark); }
.btn-thistle   { background: var(--thistle); color: var(--parchment-light); border-radius: 22px; }
.btn-thistle:hover { background: var(--thistle-d); color: var(--parchment-light); }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Formularelemente --------------------------------------------------------- */
.field { margin-bottom: 20px; }
.field label, .flabel {
  display: block; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--label); margin-bottom: 9px;
}
.flabel .muted { text-transform: none; letter-spacing: 0; color: var(--muted-2); }
.input, .textarea, select.input {
  width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--text);
  background: var(--parchment-light);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0 18px; min-height: 56px;
  appearance: none;
}
.textarea {
  min-height: 150px; padding: 16px 18px; line-height: 1.6; resize: vertical;
  font-family: var(--font-serif); font-size: 17px;
  background: var(--input-focus-bg); border: 1.5px solid var(--thistle);
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border: 1.5px solid var(--thistle); background: var(--input-focus-bg);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a88a6c' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 44px;
}

/* ==========================================================================
 *  Kopfzeile / Navigation
 * ======================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--parchment-header);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 20px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .triquetra { width: 30px; color: var(--thistle); }
.brand-name { font-family: var(--font-display); font-size: 19px; color: var(--wood); }

.nav-toggle {
  margin-left: auto;
  width: var(--tap); height: var(--tap);
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); border-radius: 12px;
  color: var(--wood); font-size: 20px; cursor: pointer;
}
.nav-links {
  margin-left: auto;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.nav-links a {
  display: inline-flex; align-items: center; min-height: var(--tap);
  padding: 8px 14px; border-radius: 12px;
  font-size: 14px; letter-spacing: .04em; color: var(--text-med);
}
.nav-links a:hover { background: #eaddc7; color: var(--wood); }
.nav-links a.active {
  color: var(--thistle); font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--thistle);
  border-radius: 4px;
}
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* Klapp-Menü "Galerie" (bündelt die Foto-Kategorien) */
.nav-group { position: relative; }
.nav-group-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap);
  padding: 8px 14px; border-radius: 12px; border: 0; background: transparent;
  font: inherit; font-size: 14px; letter-spacing: .04em; color: var(--text-med); cursor: pointer;
}
.nav-group-btn:hover { background: #eaddc7; color: var(--wood); }
.nav-group-btn.active { color: var(--thistle); font-weight: 600; box-shadow: inset 0 -2px 0 var(--thistle); border-radius: 4px; }
.nav-group-btn .caret { font-size: 11px; transition: transform .15s ease; }
.nav-group.open .nav-group-btn .caret { transform: rotate(180deg); }
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px;
  background: var(--parchment-header); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: 8px; z-index: 120;
  display: none; flex-direction: column; gap: 2px;
}
.nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown, .nav-group.open .nav-dropdown { display: flex; }
.nav-dropdown a {
  display: flex; align-items: center; min-height: var(--tap);
  padding: 10px 14px; border-radius: 8px; font-size: 14px; color: var(--text-med); white-space: nowrap;
}
.nav-dropdown a:hover { background: #eaddc7; color: var(--wood); }
.nav-dropdown a.active { color: var(--thistle); font-weight: 600; background: #efe0ef; }

/* Mobile-Drawer */
@media (max-width: 900px) {
  .nav-links {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--parchment-header);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 18px;
    box-shadow: var(--shadow-card);
    transform: translateY(-120%);
    transition: transform .25s ease;
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { font-size: 16px; padding: 12px 14px; }
  .nav-links a.active { box-shadow: none; background: #eaddc7; }
  .nav-actions { flex-direction: column; align-items: stretch; margin-top: 8px; }
  .nav-actions .btn { width: 100%; }

  /* Galerie-Gruppe im Drawer: in den Fluss, per Tap aufklappen */
  .nav-group { width: 100%; }
  .nav-group-btn { width: 100%; justify-content: space-between; font-size: 16px; padding: 12px 14px; }
  .nav-group-btn.active { box-shadow: none; background: #eaddc7; }
  .nav-dropdown {
    position: static; box-shadow: none; border: 0; background: transparent;
    padding: 2px 0 6px 12px; min-width: 0;
  }
  .nav-group:hover .nav-dropdown, .nav-group:focus-within .nav-dropdown { display: none; }
  .nav-group.open .nav-dropdown { display: flex; }
  .nav-dropdown a { font-size: 15px; }
}
@media (min-width: 901px) {
  .nav-toggle { display: none; }
  .nav-links { transform: none !important; }
}

/* ==========================================================================
 *  Seiten-Container / Abschnitte
 * ======================================================================== */
.page { max-width: 1440px; margin: 0 auto; padding: 24px 20px 64px; }
.section-head { text-align: center; margin: 24px auto 28px; max-width: 720px; }
.eyebrow {
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--label);
}
.section-title { font-family: var(--font-serif); font-size: 30px; color: var(--wood); margin: 12px 0 8px; }
.section-sub { color: var(--text-soft); font-size: 15px; margin: 0 auto; max-width: 640px; }
.chapter-kicker { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--rust); }

/* Kompakter Album-Kopf (Foto-Kategorie) – spart Höhe für die Fotos */
.album-head { text-align: center; margin: 2px auto 14px; }
.album-head .eyebrow { margin-bottom: 3px; }
.album-head-row { display: flex; align-items: baseline; justify-content: center; gap: 4px 12px; flex-wrap: wrap; }
.album-title { font-family: var(--font-serif); font-size: 24px; color: var(--wood); margin: 0; line-height: 1.15; }
.album-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (min-width: 768px) { .album-title { font-size: 28px; } }

@media (min-width: 768px) { .page { padding: 32px 40px 80px; } .section-title { font-size: 34px; } }
@media (min-width: 1024px){ .page { padding: 40px 56px 96px; } }

/* Hero (Startseite) */
.hero {
  border-radius: var(--r-md); overflow: hidden; background: var(--parchment-light);
  border: 1px solid var(--border); box-shadow: var(--shadow-card);
  display: grid; grid-template-columns: 1fr; margin-bottom: 40px;
}
.hero-text { padding: 40px 28px; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(120% 90% at 20% 10%, var(--parchment-light), var(--parchment)); }
.hero-text .eyebrow { letter-spacing: .28em; }
.hero-title { font-family: var(--font-display); font-size: 40px; line-height: 1.14; color: var(--wood); margin: 18px 0 0; }
.hero-lead { font-family: var(--font-serif); font-size: 19px; line-height: 1.6; color: var(--text-med); margin: 20px 0 0; max-width: 460px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-photo { position: relative; min-height: 240px; overflow: hidden;
  background-size: cover; background-position: center; background-color: var(--parchment-2); }
/* Weich überblendende Ebenen für das rotierende Zufalls-Foto (reiner Crossfade) */
.hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  border: 0; background: transparent; opacity: 0; transition: opacity 1100ms ease; will-change: opacity; }
.hero-slide.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  /* Der weiche Foto-Crossfade (reine Opazität) bleibt auch bei reduzierter
     Bewegung erhalten – die globale transition-Abschaltung oben wird für die
     Bild-Ebenen gezielt (spezifischer + !important) wieder aufgehoben. */
  .hero-slide, .cover-slide { transition: opacity 1000ms ease !important; }
}
@media (min-width: 768px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-title { font-size: 54px; }
  .hero-text { padding: 64px 48px; }
}

/* ==========================================================================
 *  Kapitel-Karten (Album-Uebersicht)
 * ======================================================================== */
.card-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
@media (min-width: 768px) { .card-grid { gap: 22px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }

.album-card {
  border-radius: var(--r-md); overflow: hidden; background: var(--parchment-light);
  border: 1px solid var(--border); box-shadow: var(--shadow-soft);
  cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease;
  display: flex; flex-direction: column;
}
.album-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.album-cover {
  position: relative; overflow: hidden;
  aspect-ratio: 4 / 3; background-size: cover; background-position: center;
  background-color: var(--parchment-2);
  background-image: repeating-linear-gradient(45deg,#e2d2ba,#e2d2ba 12px,#e9dcc7 12px,#e9dcc7 24px);
}
/* Sanft überblendende Vorschaubilder (nur aus der eigenen Kategorie) */
.cover-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
  border: 0; background: transparent; opacity: 0; transition: opacity 1400ms ease; will-change: opacity;
}
.cover-slide.show { opacity: 1; }
.album-body { padding: 14px 16px 18px; }
.album-title { font-family: var(--font-serif); font-size: 19px; color: var(--wood); margin: 5px 0 0; }
.album-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

/* ==========================================================================
 *  Foto-Grid + Lightbox
 * ======================================================================== */
.photo-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 480px) { .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 768px) { .photo-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; } }
@media (min-width: 1200px){ .photo-grid { grid-template-columns: repeat(5, 1fr); } }

.photo-thumb-wrap { position: relative; }
.photo-thumb {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--parchment-2); cursor: zoom-in;
  padding: 0; width: 100%; display: block;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.photo-thumb:hover img { transform: scale(1.05); }

/* Download-Icon je Foto (Ecke) */
.thumb-dl {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(43,28,18,.55); color: #f7eeda; text-decoration: none;
  opacity: 0; transition: opacity .15s ease, background .15s ease;
}
.thumb-dl svg { width: 18px; height: 18px; }
.photo-thumb-wrap:hover .thumb-dl, .thumb-dl:focus-visible { opacity: 1; }
.thumb-dl:hover { background: rgba(43,28,18,.82); color: #fff; }
/* Touch-Geraete ohne Hover: Icon dauerhaft (etwas dezent) und groesseres Tap-Ziel */
@media (hover: none) {
  .thumb-dl { opacity: .9; width: 44px; height: 44px; }
}

.loadmore-wrap { text-align: center; padding: 28px 0 8px; }

/* Seiten-Navigation (Pagination) für die Foto-Galerie */
.pagination-wrap { padding: 26px 0 8px; }
.pagination {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.pag-controls {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px;
}
.pag-btn {
  min-width: var(--tap); min-height: var(--tap);
  padding: 6px 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--parchment-light); color: var(--text-med);
  font: inherit; font-size: 15px; font-variant-numeric: tabular-nums; line-height: 1;
  cursor: pointer; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.pag-btn:hover:not(:disabled):not(.active) { background: var(--parchment-2); border-color: var(--border-strong); }
.pag-btn.pag-edge { font-size: 13px; letter-spacing: -.5px; }
.pag-btn.active {
  background: var(--thistle); border-color: var(--thistle); color: var(--parchment-light);
  cursor: default; font-weight: 600;
}
.pag-btn:disabled:not(.active) { opacity: .38; cursor: default; }
.pag-ellipsis {
  min-width: 24px; text-align: center; color: var(--muted); font-size: 15px;
  align-self: flex-end; padding-bottom: 10px;
}
.pag-status { font-size: 13px; color: var(--muted-2); letter-spacing: .02em; }

/* Handy: kompakter, aber Tap-Ziele groß genug */
@media (max-width: 520px) {
  .pag-controls { gap: 5px; }
  .pag-btn { min-width: 40px; min-height: 40px; padding: 6px 8px; font-size: 14px; }
  .pag-btn.pag-num { min-width: 40px; padding: 6px 6px; }
}

/* Toolbar „Bilder pro Seite" über dem Foto-Grid */
.gallery-toolbar { display: flex; justify-content: flex-end; align-items: center; margin: 2px 0 14px; }
.per-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-2); letter-spacing: .02em; }
.per-select {
  min-height: var(--tap); padding: 8px 34px 8px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--parchment-light); color: var(--text-med); font: inherit; font-size: 14px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a6a4a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.per-select:hover { border-color: var(--border-strong); }
@media (max-width: 520px) { .gallery-toolbar { justify-content: space-between; } }

/* Slideshow: Bereichs-Auswahl vor dem Start */
.ss-setup {
  max-width: 640px; margin: 0 auto;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--parchment-light);
  padding: 22px; box-shadow: var(--shadow-soft);
}
.ss-setup-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ss-setup-title { font-family: var(--font-serif); font-size: 20px; color: var(--wood); margin: 0; }
.ss-cat-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 13px; }
.ss-cat-list { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
@media (min-width: 560px) { .ss-cat-list { grid-template-columns: 1fr 1fr; } }
.ss-cat-item {
  display: flex; align-items: center; gap: 12px; min-height: var(--tap);
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--parchment); cursor: pointer; user-select: none;
}
.ss-cat-item input { width: 22px; height: 22px; flex: none; cursor: pointer; accent-color: var(--thistle); }
.ss-cat-name { flex: 1; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-cat-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ss-warn { margin: 12px 0 0; }
.ss-start { display: flex; width: 100%; margin: 16px auto 0; }
@media (min-width: 560px) { .ss-start { width: fit-content; } }

/* Triquetra – Info-Seite zum Logo */
.triquetra-page { max-width: 1040px; margin: 0 auto; padding: 4px 0 8px; }
.tq-title {
  font-family: var(--font-serif); text-align: center; color: var(--wood);
  font-size: 32px; margin: 10px 0 6px;
}
@media (min-width: 768px) { .tq-title { font-size: 40px; } }
.tq-subtitle {
  text-align: center; font-style: italic; color: var(--text-soft);
  font-size: 17px; line-height: 1.6; max-width: 560px; margin: 0 auto 6px;
}
.tq-invite {
  font-family: var(--font-serif); text-align: center; color: #6b4d38;
  font-size: 18px; line-height: 1.65; max-width: 600px; margin: 14px auto 22px;
}
@media (min-width: 768px) { .tq-invite { font-size: 19px; } }

/* Interaktive Ring-Bühne (1:1 aus Handoff v2) */
.tq-stage-outer { border: 2px solid #b06a44; border-radius: 20px; padding: 8px; margin: 6px auto 10px; max-width: 1000px; }
.tq-stage-inner { position: relative; border: 1px solid #cf9a6f; border-radius: 14px; overflow: hidden;
  background: radial-gradient(80% 70% at 50% 42%, #5f3d29, #3d2619); }
.tq-tartan { position: absolute; inset: 0; opacity: .13; pointer-events: none;
  background: repeating-linear-gradient(45deg, transparent 0 26px, #e0b06a 26px 27px),
              repeating-linear-gradient(-45deg, transparent 0 26px, #e0b06a 26px 27px); }
.tq-stage-body { position: relative; padding: 70px 40px 56px; display: flex; flex-direction: column; align-items: center; }
.tq-knot-wrap { width: 100%; max-width: 520px; touch-action: manipulation; }
.tq-textarea { min-height: 104px; margin-top: 34px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.tq-label { font-family: var(--font-serif); font-style: italic; font-size: 27px; letter-spacing: .16em; color: #f2dfbd; opacity: 0; transform: translateY(9px); }
.tq-sub { font-size: 13px; line-height: 1.7; letter-spacing: .06em; color: #c8a887; max-width: 420px; margin-top: 12px; opacity: 0; }
.tq-hint { font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: #a8825e; margin-top: 12px; }
@media (max-width: 520px) {
  .tq-stage-body { padding: 46px 20px 40px; }
  .tq-label { font-size: 22px; letter-spacing: .12em; }
}
@media (prefers-reduced-motion: reduce) {
  .tq-knot circle { transition: opacity 160ms linear !important; }
}
.tq-lead {
  font-size: 17px; line-height: 1.85; color: var(--text);
  max-width: 680px; margin: 10px auto 0; text-align: center;
}
.triquetra-page .knot-divider { max-width: 520px; margin: 30px auto 24px; }
.tq-section { max-width: 680px; margin: 0 auto; }
.tq-h2 {
  font-family: var(--font-serif); color: var(--wood);
  font-size: 22px; margin: 0 0 10px; text-align: center;
}
@media (min-width: 768px) { .tq-h2 { font-size: 25px; } }
.tq-text { font-size: 16px; line-height: 1.85; color: var(--text-med); margin: 0; }
@media (min-width: 768px) { .tq-text { font-size: 16.5px; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  background: rgba(43,28,18,.92);
  align-items: center; justify-content: center;
  touch-action: pan-y;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 94vw; max-height: 86vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  user-select: none;
}
.lb-btn {
  position: absolute; background: rgba(247,238,218,.14); color: var(--parchment-light);
  border: 1px solid rgba(247,238,218,.3); border-radius: 50%;
  width: 52px; height: 52px; font-size: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.lb-btn:hover { background: rgba(247,238,218,.26); }
.lb-close { top: 16px; right: 16px; }
.lb-download { top: 16px; left: 16px; text-decoration: none; }
.lb-download svg { width: 22px; height: 22px; }
.lb-prev  { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  color: var(--parchment-light); font-size: 13px; letter-spacing: .1em; opacity: .8; }
@media (max-width: 600px) {
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-btn { width: var(--tap); height: var(--tap); }
}

/* ==========================================================================
 *  Video-Bereich
 * ======================================================================== */
.video-list { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .video-list { grid-template-columns: 1fr 1fr; } }
.video-card {
  border-radius: var(--r-md); overflow: hidden; background: var(--parchment-light);
  border: 1px solid var(--border); box-shadow: var(--shadow-soft);
}
.video-card video { width: 100%; height: auto; display: block; background: #2b1c12; aspect-ratio: 16/9; }
.video-card .vc-body { padding: 14px 18px 18px; }
.video-card .vc-title { font-family: var(--font-serif); font-size: 18px; color: var(--wood); }

/* ==========================================================================
 *  PDF (Hochzeitsbote)
 * ======================================================================== */
.pdf-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.pdf-frame {
  width: 100%; height: 78vh; min-height: 420px;
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden;
  background: var(--parchment-light); box-shadow: var(--shadow-soft);
}
.pdf-frame iframe, .pdf-frame embed { width: 100%; height: 100%; border: 0; }
.pdf-fallback { padding: 40px 20px; text-align: center; color: var(--text-soft); }

/* ==========================================================================
 *  Gaestebuch
 * ======================================================================== */
.guest-layout { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .guest-layout { grid-template-columns: 420px 1fr; align-items: start; } }

.form-frame { border: 2px solid var(--rust); border-radius: var(--r-lg); padding: 8px; }
.form-frame-inner {
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 28px 24px; background: var(--parchment-light);
}
.form-frame-inner .head-icon { text-align: center; margin-bottom: 8px; }
.form-frame-inner .head-icon .triquetra { width: 40px; }
.form-title { font-family: var(--font-serif); font-size: 24px; color: var(--wood); text-align: center; margin: 8px 0 4px; }
.form-hint { font-size: 12.5px; color: var(--muted); }
.char-count { font-variant-numeric: tabular-nums; }
.form-row { display: grid; gap: 14px 16px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 520px) { .form-row { grid-template-columns: 1fr 1fr; } }
/* Beide oberen Felder gleich hoch; Eingabefelder unten buendig auf einer Linie,
   auch wenn ein Label zweizeilig umbricht. Auf dem Handy (1 Spalte) neutral. */
.form-row .field { margin-bottom: 0; display: flex; flex-direction: column; }
.form-row .field > .input,
.form-row .field > select.input { margin-top: auto; }

.entries { display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 768px) {
  .entries { display: block; column-count: 2; column-gap: 20px; }
  .entries > * { break-inside: avoid; margin-bottom: 20px; }
}
@media (min-width: 1400px) { .entries { column-count: 3; } }

.entry {
  border-radius: var(--r-md); background: var(--parchment-light);
  border: 1px solid var(--border); padding: 24px 24px 22px;
}
.entry .triquetra { width: 26px; color: var(--border-strong); }
.entry-text {
  font-family: var(--font-serif); font-style: italic; font-size: 17.5px; line-height: 1.65;
  color: var(--wood); margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere;
}
.entry-foot {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid #e4d2b8;
}
.entry-name { font-family: var(--font-serif); font-size: 15px; color: var(--thistle); }
.entry-rel { font-size: 11.5px; color: var(--muted); }
.entry-date { font-size: 11.5px; color: var(--muted-2); margin-left: auto; }

/* ==========================================================================
 *  Footer
 * ======================================================================== */
.site-footer {
  margin-top: 48px; padding: 48px 24px 56px; text-align: center;
  background: var(--wood); color: #f0dfc6;
}
.site-footer .triquetra { width: 36px; color: var(--gold); }
.footer-thanks { font-family: var(--font-display); font-size: 24px; margin-top: 12px; }
.footer-meta { font-size: 11px; letter-spacing: .2em; color: #c8a887; margin-top: 12px; }

/* Hinweise / Zustaende ----------------------------------------------------- */
.notice {
  padding: 14px 16px; border-radius: 10px; font-size: 14px; margin: 12px 0;
}
.notice-error { background: #f4e3d4; border: 1px solid #e0b79a; color: var(--danger); }
.notice-ok    { background: #e8efe0; border: 1px solid #bcd0ab; color: #47613f; }
.empty-state { text-align: center; color: var(--text-soft); padding: 48px 20px; }
.spinner {
  width: 34px; height: 34px; margin: 40px auto; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--thistle);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
 *  Foto-Challenge – Aufgabenliste
 * ======================================================================== */
.challenge-tasks { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 8px auto 0; max-width: 900px; }
@media (min-width: 640px) { .challenge-tasks { grid-template-columns: 1fr 1fr; } }
.challenge-task {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--parchment-light); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px;
}
.ct-num {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%;
  background: var(--thistle); color: var(--parchment-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 15px;
}
.ct-text { font-family: var(--font-serif); font-size: 16px; line-height: 1.5; color: var(--wood); padding-top: 4px; }

/* ==========================================================================
 *  Vollbild-Slideshow
 * ======================================================================== */
.slideshow {
  position: fixed; inset: 0; z-index: 500; background: #100c08;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  touch-action: none;
}
.ss-stage { position: absolute; inset: 0; }
.ss-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain;                     /* nichts verzerren */
  opacity: 0; transition: opacity .8s ease;
}
.ss-img.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ss-img { transition: opacity .001ms; } }

.ss-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(247,238,218,.14); color: var(--parchment-light);
  border: 1px solid rgba(247,238,218,.28); cursor: pointer;
  font-size: 22px; text-decoration: none; backdrop-filter: blur(2px);
  transition: background .15s ease, opacity .3s ease;
}
.ss-btn:hover { background: rgba(247,238,218,.28); color: #fff; }
.ss-btn svg { width: 22px; height: 22px; }
.ss-close { position: absolute; top: 18px; right: 18px; z-index: 3; }
.ss-controls {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 10px;
  background: rgba(20,14,9,.5); border: 1px solid rgba(247,238,218,.18);
  padding: 8px; border-radius: 34px;
}
.ss-count {
  position: absolute; top: 22px; left: 20px; z-index: 3;
  color: var(--parchment-light); font-size: 13px; letter-spacing: .1em; opacity: .85;
}
/* Auto-Ausblenden der Bedienelemente im Ruhezustand */
.slideshow.idle .ss-controls, .slideshow.idle .ss-close, .slideshow.idle .ss-count { opacity: 0; pointer-events: none; }
.slideshow.idle { cursor: none; }

/* Sichtbarkeits-Helfer */
[hidden] { display: none !important; }
