/* Digitales Gaestebuch - elegant & klassisch.
   Bewusst ohne externe Fonts/CDN: keine Verbindung zu Dritten, DSGVO-freundlich. */

:root {
  --paper:      #fbf8f3;
  --paper-warm: #f4eee4;
  --card:       #ffffff;
  --ink:        #2f2a24;
  --ink-soft:   #6d6458;
  --gold:       #a8874f;
  --gold-soft:  #d8c79f;
  --line:       #e3dbcd;
  --shadow:     0 1px 2px rgba(47, 42, 36, .05), 0 8px 24px rgba(47, 42, 36, .06);
  --radius:     14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0 16px 64px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
}

.sheet { max-width: 680px; margin: 0 auto; }

/* ---------- Kopf ---------- */

header.hero { text-align: center; padding: 48px 0 8px; }

.ornament {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; color: var(--gold); margin-bottom: 18px;
}
.ornament::before, .ornament::after {
  content: ""; height: 1px; width: 56px;
  background: linear-gradient(to right, transparent, var(--gold-soft), transparent);
}
.ornament span { font-size: 14px; letter-spacing: .28em; text-transform: uppercase; }

h1 {
  font-size: clamp(34px, 9vw, 52px);
  font-weight: 400; line-height: 1.1; margin: 0 0 10px;
  letter-spacing: .01em;
}
.hero .date { color: var(--ink-soft); font-size: 15px; letter-spacing: .16em; text-transform: uppercase; }
.hero .lead { color: var(--ink-soft); margin: 22px auto 0; max-width: 46ch; }

.backlink { margin: 22px 0 0; font-size: 15px; }
.backlink a { color: var(--ink-soft); text-decoration: none; }
.backlink a:hover { color: var(--gold); }

/* ---------- Grußwort (Startseite) ---------- */

.greeting {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 26px;
  margin-top: 34px;
  position: relative;
}
.greeting::before {
  content: "❦";
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--paper); color: var(--gold);
  padding: 0 12px; font-size: 18px; line-height: 28px;
}
.greeting-title {
  text-align: center; font-size: 26px; margin: 0 0 18px;
}
.greeting-text { white-space: pre-line; color: #453f36; }
.signature {
  margin: 24px 0 0; text-align: right; color: var(--ink-soft); font-size: 16px;
}
.signature em { color: var(--ink); font-style: italic; font-size: 19px; }

/* ---------- Große Wahlkacheln (Startseite) ---------- */

.big-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px;
  margin-bottom: 14px; text-decoration: none; color: inherit;
  transition: border-color .18s, transform .18s;
}
.big-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.big-card .glyph-lg { flex: 0 0 auto; color: var(--gold); }
.big-card .glyph-lg svg { width: 36px; height: 36px; }
.big-card-body { display: flex; flex-direction: column; gap: 3px; }
.big-card-body strong { font-weight: 400; font-size: 20px; }
.big-card-body span { color: var(--ink-soft); font-size: 15px; }
.big-card-body .count { color: var(--gold); font-size: 14px; }
.big-card .arrow { margin-left: auto; color: var(--gold-soft); font-size: 22px; }

/* ---------- So funktioniert's ---------- */

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; }
.steps li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 12px 0; border-top: 1px solid var(--line);
  color: var(--ink-soft); font-size: 15px;
}
.steps li:first-child { border-top: 0; }
.steps li span {
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--gold-soft); color: var(--gold);
  display: grid; place-items: center; font-size: 14px;
}

/* ---------- Abschnitte ---------- */

section { margin-top: 40px; }

h2 {
  font-size: 22px; font-weight: 400; margin: 0 0 6px;
}
.section-hint { color: var(--ink-soft); font-size: 15px; margin: 0 0 20px; }

/* ---------- Auswahlkacheln ---------- */

.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 420px) { .choices { grid-template-columns: 1fr; } }

.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice label {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s;
  height: 100%;
}
.choice label:hover { border-color: var(--gold-soft); }
.choice input:checked + label {
  border-color: var(--gold);
  background: #fffdf8;
  box-shadow: inset 0 0 0 1px var(--gold), var(--shadow);
}
.choice input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }

.choice .glyph {
  flex: 0 0 auto; width: 30px; height: 30px; color: var(--gold);
  display: grid; place-items: center;
}
.choice .glyph svg { width: 22px; height: 22px; }
.choice .title { display: block; }
.choice .hint { display: block; color: var(--ink-soft); font-size: 14px; }

.tick {
  margin-left: auto; width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid var(--line); flex: 0 0 auto; position: relative;
}
.choice input:checked + label .tick { background: var(--gold); border-color: var(--gold); }
.choice input:checked + label .tick::after {
  content: ""; position: absolute; left: 5px; top: 4px;
  width: 4px; height: 8px; border: solid #fff; border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

/* ---------- Formularfelder ---------- */

.field {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.field.hidden { display: none; }

.field label.question { display: block; margin-bottom: 10px; font-size: 17px; }
.field .sub { color: var(--ink-soft); font-size: 14px; margin: -4px 0 10px; }

input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px;
  resize: vertical;
}
input[type="text"]:focus, textarea:focus {
  outline: none; border-color: var(--gold); background: #fff;
}
textarea { min-height: 120px; }

/* ---------- Upload ---------- */

.dropzone {
  display: block;
  border: 1.5px dashed var(--gold-soft);
  border-radius: 12px;
  background: var(--paper-warm);
  padding: 26px 18px; text-align: center;
  cursor: pointer;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: #fffdf8; }
.dropzone strong { font-weight: 400; display: block; margin-bottom: 4px; }
.dropzone small { color: var(--ink-soft); display: block; }
.dropzone input[type="file"] { display: none; }

#fileList { list-style: none; margin: 14px 0 0; padding: 0; font-size: 15px; }
#fileList li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink-soft);
}
#fileList li span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block; font: inherit; text-align: center; text-decoration: none;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 999px;
  padding: 14px 30px; cursor: pointer;
  letter-spacing: .06em;
  transition: background .18s, color .18s;
}
.btn:hover { background: #474037; }
.btn.block { display: block; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); background: #fffdf8; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.gold:hover { background: #96763f; }
.btn.small { padding: 8px 18px; font-size: 15px; }
.btn.danger { background: transparent; color: #9c3b31; border-color: #e6cdc9; }

.actions { margin-top: 30px; }
.actions .note { color: var(--ink-soft); font-size: 14px; text-align: center; margin-top: 14px; }

.alert {
  background: #fdf1ee; border: 1px solid #e6cdc9; color: #8f3a30;
  border-radius: 10px; padding: 12px 16px; margin-top: 24px; font-size: 15px;
}
.notice {
  background: #fdfaf2; border: 1px solid var(--gold-soft); color: #6b5628;
  border-radius: 10px; padding: 12px 16px; margin-top: 24px; font-size: 15px;
}
.notice a { color: var(--gold); }

.optional {
  font-size: 13px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-soft);
  border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px;
}

/* ---------- Fotogalerie ---------- */

.gallery-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
.tile {
  position: relative; padding: 0; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; background: var(--paper-warm);
  aspect-ratio: 1; cursor: pointer;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover { border-color: var(--gold); }
.tile .play, .mod-card .play {
  position: absolute; inset: auto 8px 8px auto;
  background: rgba(47, 42, 36, .72); color: #fff;
  border-radius: 999px; width: 26px; height: 26px;
  display: grid; place-items: center; font-size: 11px;
}

.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(28, 25, 21, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 56px 16px 40px;
}
.lightbox[hidden] { display: none; }
.lb-stage { max-width: 100%; max-height: 100%; display: grid; place-items: center; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 78vh; border-radius: 8px; display: block; }
.lb-caption { color: #e9e1d4; font-size: 15px; margin: 16px 0 0; text-align: center; }
.lb-close, .lb-nav {
  position: absolute; background: none; border: 0; color: #e9e1d4;
  font-family: var(--serif); cursor: pointer; padding: 10px 16px;
}
.lb-close { top: 8px; right: 10px; font-size: 34px; line-height: 1; }
.lb-nav { top: 50%; transform: translateY(-50%); font-size: 46px; line-height: 1; }
.lb-prev { left: 0; }
.lb-next { right: 0; }
.lb-close:hover, .lb-nav:hover { color: var(--gold-soft); }

/* ---------- Admin: Navigation & Freigabe ---------- */

.adminnav {
  display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--line); margin: 26px 0 0;
}
.adminnav a {
  text-decoration: none; color: var(--ink-soft);
  padding: 10px 14px; border-bottom: 2px solid transparent; font-size: 16px;
}
.adminnav a:hover { color: var(--ink); }
.adminnav a.active { color: var(--ink); border-bottom-color: var(--gold); }

.mod-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.mod-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.mod-card > a { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--paper-warm); }
.mod-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mod-meta { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--ink-soft); }
.mod-meta strong { font-weight: 400; font-size: 16px; color: var(--ink); }
.mod-meta .cap { font-style: italic; }
.mod-actions { display: flex; gap: 8px; padding: 12px 14px 14px; margin-top: auto; }
.mod-actions form { flex: 1; }
.mod-actions .btn { width: 100%; padding: 7px 10px; }

footer.fine {
  text-align: center; color: var(--ink-soft); font-size: 13px;
  margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line);
}

/* ---------- Danke-Seite ---------- */

.center-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 44px 26px; text-align: center; margin-top: 40px;
}
.center-card .big { font-size: 40px; color: var(--gold); }

/* ---------- Admin ---------- */

.admin { max-width: 900px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.stat {
  flex: 1 1 140px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
.stat b { display: block; font-size: 26px; font-weight: 400; }
.stat span { color: var(--ink-soft); font-size: 14px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.entry {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.entry header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.entry header h3 { margin: 0; font-weight: 400; font-size: 20px; }
.entry header .meta { color: var(--ink-soft); font-size: 14px; margin-left: auto; }
.tags { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold); border: 1px solid var(--gold-soft);
  border-radius: 999px; padding: 3px 10px;
}
.qa { margin-top: 16px; }
.qa dt { color: var(--ink-soft); font-size: 14px; }
.qa dd { margin: 2px 0 12px; white-space: pre-wrap; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumbs a {
  display: block; width: 104px; height: 104px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--paper-warm);
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry footer { margin-top: 14px; display: flex; gap: 10px; align-items: center; }

.qr-box { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.qr-box img { width: 170px; height: 170px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
code.url { background: var(--paper-warm); padding: 3px 8px; border-radius: 6px; font-size: 14px; word-break: break-all; }
