@import url('https://fonts.googleapis.com/css2?family=Besley:ital,wght@0,500;0,600;0,700;1,500&family=Karla:wght@400;500;700&display=swap');

/* ---------- Tokens ---------- */
:root {
  --ink: #16241F;
  --ink-hoch: #1F332C;
  --parchment: #F6EFDD;
  --parchment-dunkel: #EAE0C6;
  --gold: #C9A227;
  --beere: #8B3A3A;
  --gruen: #4B6355;
  --text-auf-dunkel: #F6EFDD;
  --text-auf-dunkel-matt: #B9C4BC;
  --text-auf-hell: #22302B;
  --text-auf-hell-matt: #5B6A62;
  --schrift-anzeige: 'Besley', Georgia, serif;
  --schrift-text: 'Karla', 'Segoe UI', sans-serif;
  --radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text-auf-dunkel);
  font-family: var(--schrift-text);
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

button, input, select {
  font-family: inherit;
  font-size: 1rem;
}

/* ---------- Layout ---------- */
.seite {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

.masthead {
  padding-top: 48px;
  padding-bottom: 8px;
}

.masthead-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.masthead-mark {
  width: 28px;
  height: 16px;
  margin: 0 0 14px;
  background:
    radial-gradient(circle at 30% 50%, var(--parchment) 0 8px, transparent 8px),
    radial-gradient(circle at 62% 50%, var(--gold) 0 8px, transparent 8px);
}

.masthead-titel {
  font-family: var(--schrift-anzeige);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.08;
  margin: 0 0 8px;
  color: var(--parchment);
}

.masthead-untertitel {
  margin: 0;
  max-width: 46ch;
  color: var(--text-auf-dunkel-matt);
  font-size: 1.02rem;
}

.abmelden-link {
  color: var(--text-auf-dunkel-matt);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
  margin-top: 6px;
}
.abmelden-link:hover { border-bottom-color: var(--text-auf-dunkel-matt); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 10px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.tab-btn {
  appearance: none;
  border: 1px solid rgba(246, 239, 221, 0.22);
  background: transparent;
  color: var(--text-auf-dunkel-matt);
  padding: 10px 16px 10px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: pointer;
  font-size: 0.96rem;
  border-bottom: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.tab-roemisch {
  font-family: var(--schrift-anzeige);
  font-style: italic;
  margin-right: 6px;
  opacity: 0.8;
}

.js .tab-btn.ist-aktiv {
  color: var(--ink);
  background: var(--parchment);
  border-color: var(--parchment);
}
.tab-btn--gruen.ist-aktiv { box-shadow: inset 0 3px 0 var(--gruen); }
.tab-btn--gold.ist-aktiv { box-shadow: inset 0 3px 0 var(--gold); }
.tab-btn--beere.ist-aktiv { box-shadow: inset 0 3px 0 var(--beere); }

.js .tab-btn:not(.ist-aktiv):hover {
  color: var(--parchment);
}

/* No-JS fallback: plain stacked links look, no active state needed */
.tab-btn { display: inline-flex; align-items: center; }

/* ---------- Panels & cards ---------- */
.panel { margin-top: 0; }
.js .panel { display: none; }
.js .panel.ist-aktiv { display: block; }

.karte {
  background: var(--parchment);
  color: var(--text-auf-hell);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 32px clamp(20px, 4vw, 40px) 40px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.18);
}

.js .panel:not(:first-of-type) .karte {
  border-radius: var(--radius);
}

.karte h2 {
  font-family: var(--schrift-anzeige);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.karte-hinweis {
  color: var(--text-auf-hell-matt);
  margin: 0 0 26px;
  max-width: 52ch;
}

.karte-hinweis a {
  color: var(--gruen);
  text-decoration: underline;
  text-decoration-color: rgba(75, 99, 85, 0.4);
  text-underline-offset: 2px;
  font-weight: 700;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.karte-hinweis a:visited {
  color: var(--gruen);
}

.karte-hinweis a:hover {
  color: var(--beere);
  text-decoration-color: var(--beere);
}

.karte-hinweis a:active {
  color: var(--ink);
}

.karte-hinweis a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}


/* ---------- Forms ---------- */
.formular {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: end;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--parchment-dunkel);
}

.feld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
}

.feld label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-auf-hell);
}

.optional {
  font-weight: 400;
  color: var(--text-auf-hell-matt);
}

.feld input,
.feld select {
  border: 1px solid #C9BE9E;
  background: #FFFDF7;
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text-auf-hell);
}

.feld-hinweis {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--text-auf-hell-matt);
}

.formular button {
  border: none;
  background: var(--ink);
  color: var(--parchment);
  padding: 11px 22px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  height: fit-content;
  transition: background-color 0.15s ease;
}
.formular button:hover { background: var(--ink-hoch); }

/* ---------- Counter ---------- */
.zaehler {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}
.zaehler-zahl {
  font-family: var(--schrift-anzeige);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--beere);
}
.zaehler-text {
  color: var(--text-auf-hell-matt);
}

/* ---------- Lists ---------- */
.gaesteliste, .dingeliste {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gaesteliste li, .dingeliste li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--parchment-dunkel);
}
.gaesteliste li:last-child, .dingeliste li:last-child { border-bottom: none; }

.gast-name { font-weight: 700; }
.gast-begleitung { color: var(--text-auf-hell-matt); font-style: italic; }

.ding-name { font-weight: 700; }
.ding-verantwortlich {
  color: var(--text-auf-hell-matt);
  font-style: italic;
  text-align: right;
  white-space: nowrap;
}

.btn-sekundaer {
  appearance: none;
  background: transparent;
  border: 1px solid var(--gold);
  color: var(--text-auf-hell);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn-sekundaer:hover {
  background: var(--gold);
  color: var(--ink);
}

.leer {
  color: var(--text-auf-hell-matt);
  font-style: italic;
  padding: 10px 0;
}

/* ---------- Anfahrt ---------- */
.anfahrt-liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.anfahrt-schritt {
  margin: 0;
}
.anfahrt-schritt img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  border: 6px solid #FFFDF7;
  box-shadow: 0 0 0 1px var(--parchment-dunkel);
  display: block;
}
.anfahrt-schritt figcaption {
  margin-top: 10px;
  margin-bottom: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.anfahrt-schritt figcaption strong { font-size: 0.98rem; }
.anfahrt-schritt figcaption span {
  color: var(--text-auf-hell-matt);
  font-size: 0.9rem;
}

/* ---------- Login page ---------- */
.tuer-seite {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.tuer-karte {
  background: var(--parchment);
  color: var(--text-auf-hell);
  max-width: 380px;
  width: 100%;
  padding: 40px 32px;
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.28);
  text-align: center;
}

.tuer-mark {
  width: 28px;
  height: 16px;
  margin: 0 auto 18px;
  background:
    radial-gradient(circle at 30% 50%, var(--ink) 0 8px, transparent 8px),
    radial-gradient(circle at 62% 50%, var(--gold) 0 8px, transparent 8px);
}

.tuer-titel {
  font-family: var(--schrift-anzeige);
  font-size: 1.7rem;
  margin: 0 0 10px;
}

.tuer-untertitel {
  color: var(--text-auf-hell-matt);
  margin: 0 0 24px;
  font-size: 0.94rem;
}

.tuer-fehler {
  background: rgba(139, 58, 58, 0.12);
  color: var(--beere);
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  margin: 0 0 18px;
}

.tuer-formular {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.tuer-formular label {
  font-size: 0.85rem;
  font-weight: 700;
}
.tuer-formular input {
  border: 1px solid #C9BE9E;
  background: #FFFDF7;
  border-radius: 4px;
  padding: 11px 12px;
}
.tuer-formular button {
  margin-top: 6px;
  border: none;
  background: var(--ink);
  color: var(--parchment);
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
}
.tuer-formular button:hover { background: var(--ink-hoch); }

/* ---------- Install button ---------- */
.install-knopf {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--gold);
  color: var(--ink);
  border: none;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

@media (max-width: 520px) {
  .masthead-inner { flex-direction: column; }
  .karte { padding: 26px 18px 32px; }
  .ding-verantwortlich { text-align: left; }
  .gaesteliste li, .dingeliste li { flex-direction: column; gap: 2px; }
}
