/* Digitales Gästebuch – Gästeoberfläche
   Typografie nach den Grundsätzen guter Hochzeitspapeterie: zwei Schriften,
   Hierarchie über Größe und Abstand statt über zusätzliche Schnitte.
   Cormorant Garamond trägt die Namen, Karla die Bedienelemente.

   Drei Designs, im Dashboard umschaltbar:
     klassisch  Elfenbein und Gold – klassische Papeterie
     salbei     Warmes Weiß mit Grün – Garten, Greenery
     abend      Tiefes Blau mit Gold – Abendfeier, Kerzenlicht */

/* ---------- Klassisch (Standard) ---------- */
:root,
[data-theme="klassisch"] {
  --bg:        #FCFAF6;
  --bg-tief:   #F5EEE2;
  --surface:   #FFFFFF;
  --surface-2: #F8F3EA;
  --text:      #2B2621;
  --text-soft: #8A7F71;
  --line:      #E8DFCE;
  --a-text:    #A3812F;
  --a-foto:    #A3812F;
  --a-video:   #A85E68;
  --a-stimme:  #6E8B75;
  --btn-bg:    #A3812F;
  --btn-text:  #FFFFFF;
  --schatten:  0 1px 2px rgba(120,100,60,.04), 0 8px 28px rgba(120,100,60,.07);
  --zier:      #BFA46A;
}

/* ---------- Salbei ---------- */
[data-theme="salbei"] {
  --bg:        #F8F8F3;
  --bg-tief:   #EBEFE5;
  --surface:   #FFFFFF;
  --surface-2: #F2F4EC;
  --text:      #232821;
  --text-soft: #737D6E;
  --line:      #DFE4D6;
  --a-text:    #4E6E54;
  --a-foto:    #93762F;
  --a-video:   #97606A;
  --a-stimme:  #4E6E54;
  --btn-bg:    #4E6E54;
  --btn-text:  #FFFFFF;
  --schatten:  0 1px 2px rgba(70,90,65,.04), 0 8px 28px rgba(70,90,65,.08);
  --zier:      #9BB197;
}

/* ---------- Abend ---------- */
[data-theme="abend"] {
  --bg:        #10141C;
  --bg-tief:   #1A2130;
  --surface:   #191F2A;
  --surface-2: #222937;
  --text:      #F4EFE6;
  --text-soft: #A9A294;
  --line:      #2C3442;
  --a-text:    #D4B36A;
  --a-foto:    #D4B36A;
  --a-video:   #C87F88;
  --a-stimme:  #86A48D;
  --btn-bg:    #D4B36A;
  --btn-text:  #171208;
  --schatten:  0 10px 34px rgba(0,0,0,.35);
  --zier:      #9A8450;
}

:root { --radius: 16px; --wrap: 620px; }

/* Ab Tablet mehr Luft, damit die Seite am Rechner nicht wie eine
   hochgezogene Handyansicht wirkt. */
@media (min-width: 820px) {
  body { font-size: 18px; }
  .head { padding: 76px 0 40px; }
  .picker { grid-template-columns: 1fr 1fr; gap: 14px; }
  /* Schreiben und Sprachnachricht über die volle Breite, Foto und Video
     nebeneinander – sonst steht die letzte Kachel allein da. */
  .picker .pick--text, .picker .pick--stimme { grid-column: 1 / -1; }
  .card { padding: 34px 32px; }
  .btn { max-width: 340px; margin-left: auto; margin-right: auto; }
  .btn--ghost { max-width: 240px; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Karla, "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  padding: 0 22px 72px;
  /* Sehr feine Papierkörnung – auf dem Handy kaum sichtbar, nimmt der
     Fläche aber das Sterile eines reinen Weiß. */
  background-image:
    radial-gradient(130% 60% at 50% -5%, var(--bg-tief) 0%, transparent 62%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.032'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed;
}

.wrap { max-width: var(--wrap); margin: 0 auto; }

/* ---------- Kopf ---------- */
.head { text-align: center; padding: 54px 0 30px; }

.monogramm {
  width: 62px; height: 62px; margin: 0 auto 26px;
  border: 1px solid var(--zier); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Cormorant Garamond", Cormorant, Georgia, serif;
  font-size: 21px; font-weight: 300; letter-spacing: .06em;
  color: var(--a-text);
}

.head .eyebrow {
  font-size: 11px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--text-soft); margin: 0 0 18px; font-weight: 400;
}

.head h1 {
  font-family: "Cormorant Garamond", Cormorant, Georgia, serif;
  font-weight: 300; font-style: normal;
  font-size: clamp(42px, 12.5vw, 68px);
  line-height: 1.06; letter-spacing: .005em;
  margin: 0;
}
.head h1 .amp {
  display: block; font-style: italic; font-weight: 300;
  color: var(--a-text); font-size: .46em; line-height: 1.5;
  margin: .04em 0;
}

.head .datum {
  font-size: 12px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--text-soft); margin: 20px 0 0;
}

.head .sub {
  color: var(--text-soft); margin: 20px auto 0; max-width: 32ch;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px; line-height: 1.5; font-style: italic;
}

.zweig { display: block; margin: 22px auto 0; width: 200px; height: 26px; color: var(--zier); }

/* Im Formular schrumpft der Kopf, damit die Bedienelemente sofort sichtbar
   sind – sonst muss man auf dem Handy erst an der Papeterie vorbeiscrollen. */
.is-form .head { padding: 22px 0 16px; }
.is-form .head .monogramm { width: 42px; height: 42px; font-size: 15px; margin-bottom: 12px; }
.is-form .head h1 { font-size: clamp(24px, 7vw, 32px); }
.is-form .head h1 .amp { font-size: .5em; margin: 0; }
.is-form .head .eyebrow { margin-bottom: 10px; font-size: 10px; }
.is-form .head .zweig, .is-form .head .datum, .is-form .head .sub { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .head, .head .monogramm, .head h1 { transition: padding .3s, width .3s, height .3s, font-size .3s; }
}

/* ---------- Auswahl der Beitragsart ---------- */
.picker { display: grid; gap: 10px; margin: 10px 0 28px; }
.pick {
  display: flex; align-items: center; gap: 16px; width: 100%; text-align: left;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 17px 18px; font: inherit; cursor: pointer; box-shadow: var(--schatten);
  transition: border-color .2s, transform .2s;
}
.pick:hover, .pick:focus-visible { transform: translateY(-2px); border-color: var(--tint); }
.pick .glyph {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--tint); color: var(--tint);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.pick b {
  display: block; font-weight: 400; font-size: 19px; line-height: 1.25;
  font-family: "Cormorant Garamond", Georgia, serif;
}
.pick span.hint { display: block; color: var(--text-soft); font-size: 13.5px; line-height: 1.35; margin-top: 1px; }
.pick--foto   { --tint: var(--a-foto); }
.pick--video  { --tint: var(--a-video); }
.pick--stimme { --tint: var(--a-stimme); }
.pick--text   { --tint: var(--a-text); }

/* ---------- Formular ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 22px; box-shadow: var(--schatten);
}
label {
  display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--text-soft); margin: 0 0 9px;
}
input[type=text], textarea, input[type=password] {
  width: 100%; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 15px; font: inherit; font-size: 17px;
}
textarea {
  min-height: 140px; resize: vertical; line-height: 1.6;
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px;
}
input:focus, textarea:focus, button:focus-visible, a:focus-visible, .filebtn:focus-within {
  outline: 2px solid var(--a-text); outline-offset: 2px;
}
.field + .field { margin-top: 22px; }

.sprueche { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.spruch {
  background: transparent; color: var(--text-soft); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 15.5px; font-style: italic;
}
.spruch:hover { color: var(--text); border-color: var(--a-text); }

.filebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.filebtn {
  display: block; text-align: center; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 12px; cursor: pointer; color: var(--text-soft);
  letter-spacing: 0; text-transform: none; font-size: 15px; background: var(--bg);
  transition: border-color .2s, background .2s;
}
.filebtn:hover { border-color: var(--a-foto); color: var(--text); background: var(--surface-2); }
.filebtn .fb-glyph {
  display: flex; width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 50%;
  border: 1px solid var(--a-foto); color: var(--a-foto);
  align-items: center; justify-content: center; font-size: 18px;
}
.filebtn strong {
  display: block; color: var(--text); font-weight: 400; font-size: 19px;
  font-family: "Cormorant Garamond", Georgia, serif;
}
.filebtn .fb-hint { display: block; font-size: 13px; margin-top: 1px; }
input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 14px; }
.previews figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.previews img, .previews video { width: 100%; height: 100%; object-fit: cover; }
.previews button {
  position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 15px; line-height: 1; cursor: pointer;
}

/* ---------- Tonspur ---------- */
.recorder { text-align: center; }
.wave { width: 100%; height: 84px; display: block; margin: 8px 0 14px; }
.rec-time {
  font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 300;
  font-family: "Cormorant Garamond", Georgia, serif;
}
.rec-hint { color: var(--text-soft); font-size: 14px; min-height: 22px; }
.rec-btn {
  width: 92px; height: 92px; border-radius: 50%; border: 1px solid var(--a-stimme);
  background: transparent; color: var(--a-stimme); cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 19px;
  transition: background .25s, color .25s;
}
.rec-btn.on { background: var(--a-stimme); color: #fff; }
@media (prefers-reduced-motion: no-preference) {
  .rec-btn.on { animation: puls 2.2s ease-in-out infinite; }
  @keyframes puls { 50% { box-shadow: 0 0 0 14px rgba(110,139,117,.13); } }
}

.btn {
  display: block; width: 100%; margin-top: 26px;
  background: var(--btn-bg); color: var(--btn-text); border: 0; border-radius: 999px;
  padding: 17px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
}
.btn:disabled { opacity: .5; cursor: progress; }
.btn--ghost {
  background: transparent; color: var(--text-soft); border: 1px solid var(--line);
  font-weight: 400; letter-spacing: .14em; margin-top: 10px;
}

.bar { height: 3px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 16px; display: none; }
.bar i { display: block; height: 100%; width: 0; background: var(--btn-bg); transition: width .25s; }

.note { color: var(--text-soft); font-size: 14px; text-align: center; margin-top: 18px; }
.err { color: var(--a-video); text-align: center; margin-top: 14px; font-size: 15px; }

.danke { text-align: center; padding: 52px 0; }
.danke h2 {
  font-family: "Cormorant Garamond", Georgia, serif; font-weight: 300;
  font-size: 40px; margin: 0 0 10px;
}
.danke .sub {
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic;
  font-size: 20px; color: var(--text-soft); max-width: 30ch; margin: 0 auto;
}

/* ---------- Galerie ---------- */
/* Der Kopf bleibt schmal wie eine Karte, die Einträge dürfen die
   Bildschirmbreite nutzen – auf dem Handy eine Spalte, am Rechner vier. */
.gal-wrap { max-width: 1240px; margin: 0 auto; }

.gal { columns: 1; column-gap: 16px; }
@media (min-width:  520px) { .gal { columns: 2; } }
@media (min-width:  860px) { .gal { columns: 3; } }
@media (min-width: 1180px) { .gal { columns: 4; } }

.gal .item {
  break-inside: avoid; -webkit-column-break-inside: avoid;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); margin: 0 0 16px; box-shadow: var(--schatten);
  overflow: hidden; display: block;
}

/* Bilder randlos oben, alles andere bekommt Innenabstand */
.item .medien { display: grid; gap: 2px; background: var(--line); }
.item .medien--mehr { grid-template-columns: 1fr 1fr; }
.item .bildknopf {
  display: block; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in;
  line-height: 0;
}
.item .bildknopf img { width: 100%; display: block; }
.item .medien--mehr .bildknopf img { aspect-ratio: 1; object-fit: cover; }
.item video { width: 100%; display: block; }

/* Sprachnachricht – eigener Abspieler statt des Systemelements */
.tonspur {
  display: flex; align-items: center; gap: 14px;
  margin: 18px 18px 4px; padding: 14px 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
}
.ton-knopf {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--a-stimme); background: transparent; color: var(--a-stimme);
  font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.tonspur.spielt .ton-knopf { background: var(--a-stimme); color: #fff; }
.ton-knopf:disabled { opacity: .4; cursor: default; }
.ton-play { margin-left: 2px; }
.ton-mitte { flex: 1 1 auto; min-width: 0; }
.ton-balken {
  height: 4px; background: var(--line); border-radius: 4px; cursor: pointer; overflow: hidden;
}
.ton-balken i { display: block; height: 100%; width: 0; background: var(--a-stimme); transition: width .15s linear; }
.ton-zeit {
  display: block; margin-top: 7px; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-soft); font-variant-numeric: tabular-nums;
}

/* Nachricht als Zitat, mit gesetztem Anführungszeichen */
.item .msg {
  position: relative;
  margin: 20px 18px 0; padding: 0;
  border: 0; quotes: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px; line-height: 1.55; white-space: pre-wrap; color: var(--text);
}
.item .msg::before {
  content: "\201C";
  position: absolute; left: -2px; top: -18px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 46px; line-height: 1; color: var(--tint, var(--a-text)); opacity: .3;
}
.item--text .msg::before { color: var(--a-text); }

/* Unterschrift wie unter einem handgeschriebenen Eintrag */
.item .sig {
  display: flex; align-items: baseline; justify-content: flex-end; gap: 12px;
  margin: 16px 18px 18px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.item .sig .who {
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic;
  font-size: 19px; color: var(--text);
}
.item .sig .when {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-soft); white-space: nowrap;
}
.item--foto  { --tint: var(--a-foto); }
.item--video { --tint: var(--a-video); }
.item--audio { --tint: var(--a-stimme); }
.item--text  { --tint: var(--a-text); }

/* Einträge ohne Bild bekommen oben etwas Luft */
.item--text .msg, .item--audio .msg { margin-top: 26px; }
.item--text { padding-top: 4px; }

.tabs { display: flex; gap: 7px; justify-content: center; margin-bottom: 26px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line); background: var(--surface); color: var(--text-soft);
  border-radius: 999px; padding: 8px 16px; cursor: pointer; text-decoration: none;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  transition: border-color .2s, color .2s;
}
.tab:hover { color: var(--text); border-color: var(--a-text); }
.tab.on { color: var(--btn-text); background: var(--btn-bg); border-color: var(--btn-bg); }

.leer { text-align: center; color: var(--text-soft); padding: 56px 20px; }
.leer p {
  max-width: 30ch; margin: 0 auto 22px;
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 21px; font-style: italic;
}

/* Bild groß ansehen */
.lupe {
  position: fixed; inset: 0; z-index: 60; background: rgba(20,16,10,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lupe img { max-width: 100%; max-height: 82vh; border-radius: 6px; display: block; }
.lupe-wer {
  color: #EFE8DC; margin: 18px 0 0; font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic; font-size: 19px;
}
.lupe-zu {
  position: absolute; top: 14px; right: 16px; width: 44px; height: 44px;
  border: 0; background: none; color: #EFE8DC; font-size: 32px; line-height: 1; cursor: pointer;
}

a { color: var(--a-text); }
.footlinks { text-align: center; margin-top: 40px; }
.footlinks a {
  color: var(--text-soft); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
}
.footlinks a:hover { color: var(--text); border-color: var(--a-text); }
