:root {
  --grund: #000;
  --flaeche: #111;
  --text: #fff;
  --text-leise: #b8b8b8;
  --linie: #3a3a3a;
  --link: #c8d7eb;
  --link-hover: #7fa3d6;
  --rot: #ff4d4d;
  --rahmen-foto: #fff;
  --schrift: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --breite: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 1.0625rem;
  line-height: 1.6;
}

a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

.sprung {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--text); color: var(--grund); padding: .5rem 1rem; z-index: 10;
}
.sprung:focus { top: 1rem; }

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

.kopf {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 1.5rem 1rem 1rem;
  border-bottom: 1px solid var(--linie);
}
.kopf h1 {
  margin: 0;
  font-size: clamp(1.9rem, 5vw, 2.4rem);
  line-height: 1.2;
}
.kopf h1 a { color: var(--text); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.unterzeile { margin: .6rem 0 0; font-weight: 700; font-size: .95rem; }
.zaehler { margin: .5rem 0 0; color: var(--text-leise); font-size: .95rem; font-variant-numeric: tabular-nums; }

/* ---------- Rahmen und Navigation */

.rahmen {
  max-width: var(--breite);
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2rem;
}

.navigation { padding-top: 1.5rem; border-right: 1px solid var(--linie); padding-right: 1rem; }
.navigation ul { list-style: none; margin: 0; padding: 0; position: sticky; top: 1rem; }
.navigation li + li { margin-top: .3rem; }
.navigation a {
  display: block;
  padding: .35rem .7rem;
  border: 1px solid var(--linie);
  border-radius: 3px;
  color: var(--text);
  text-decoration: none;
  font-size: .95rem;
  background: var(--flaeche);
}
.navigation a:hover { border-color: var(--link); color: var(--link); }
.navigation a[aria-current="page"] { background: var(--text); color: var(--grund); border-color: var(--text); }
.menue-knopf { display: none; }

main { padding: 1.5rem 0 3rem; min-width: 0; }

.seitentitel { margin: 0 0 1.5rem; font-size: 1.5rem; font-weight: 600; }

@media (max-width: 760px) {
  .rahmen { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .navigation { border-right: 0; padding: .75rem 0 0; }
  .navigation ul { position: static; columns: 2; column-gap: .5rem; }
  .navigation ul li { break-inside: avoid; margin: 0 0 .3rem; }
  /* Mit JavaScript klappt das Menü ein, ohne bleibt es offen. */
  .js .navigation ul { display: none; }
  .js .navigation.offen ul { display: block; }
  .js .menue-knopf {
    display: block; width: 100%;
    padding: .6rem; font: inherit; font-weight: 600;
    color: var(--text); background: var(--flaeche);
    border: 1px solid var(--linie); border-radius: 3px; cursor: pointer;
  }
  .navigation.offen .menue-knopf { margin-bottom: .5rem; }
}

/* ---------- Inhalt */

main > * + * { margin-top: 2rem; }

hr.trenner { border: 0; border-top: 1px solid var(--linie); margin: 2.5rem 0; }
.text { overflow-wrap: break-word; }
.text p { margin: 0 0 1em; }
.text p:last-child { margin-bottom: 0; }
.gr-xl { font-size: 1.2rem; }
.gr-l { font-size: 1.05rem; }
.gr-s { font-size: .95rem; }
.rot { color: var(--rot); }

.reihe {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}
.spalten-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spalten-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.spalten-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.spalten-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.spalten-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .spalten-4, .spalten-5, .spalten-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.spalte > * + * { margin-top: 1.5rem; }
@media (max-width: 600px) {
  .reihe { grid-template-columns: minmax(0, 1fr); }
}

.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem;
  align-items: start;
}
.spalte .galerie { grid-template-columns: minmax(0, 1fr); }

.foto { margin: 0; }
.galerie .foto, .spalte .foto {
  background: var(--rahmen-foto);
  padding: .75rem .75rem .5rem;
  border-radius: 2px;
}
.foto a { display: block; }
.foto img { display: block; width: 100%; }
.foto figcaption { color: #000; text-align: center; font-size: .9rem; padding-top: .5rem; overflow-wrap: anywhere; }
main > .foto { max-width: 100%; }
main > .foto img { width: auto; max-width: 100%; }
main > .foto figcaption { color: var(--text-leise); text-align: left; }

/* ---------- Einbettungen (YouTube, Karte) erst nach Klick */

.einbettung {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  display: grid;
  place-items: center;
}
.einbettung iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.einbettung-hinweis { max-width: 32rem; padding: 1rem; text-align: center; font-size: .9rem; color: var(--text-leise); }
.einbettung-hinweis p { margin: .6rem 0 0; }
.einbettung button {
  font: inherit; font-size: 1rem; font-weight: 600;
  padding: .6rem 1.4rem; cursor: pointer;
  color: var(--grund); background: var(--text);
  border: 0; border-radius: 3px;
}
.einbettung button::before { content: "▶ "; }
.einbettung.karte button::before { content: ""; }

/* ---------- Gästebuch */

.gb-formular { background: var(--flaeche); border: 1px solid var(--linie); padding: 1.25rem; border-radius: 3px; }
.gb-formular label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
.gb-formular label:first-of-type { margin-top: 0; }
.gb-formular input, .gb-formular textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--grund); border: 1px solid var(--linie); border-radius: 3px; padding: .5rem .6rem;
}
.gb-formular textarea { min-height: 9rem; resize: vertical; }
.gb-formular button {
  margin-top: 1rem; font: inherit; font-weight: 600; padding: .55rem 1.4rem;
  color: var(--grund); background: var(--text); border: 0; border-radius: 3px; cursor: pointer;
}
.gb-formular button:disabled { opacity: .6; cursor: wait; }
.gb-hinweis { font-size: .85rem; color: var(--text-leise); margin: .8rem 0 0; }
.gb-falle { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.gb-meldung { padding: .8rem 1rem; border-radius: 3px; border: 1px solid var(--linie); }
.gb-meldung.ok { border-color: #4f8a4f; }
.gb-meldung.fehler { border-color: var(--rot); }
.gb-eintraege { list-style: none; margin: 0; padding: 0; }
.gb-eintrag { border-top: 1px solid var(--linie); padding: 1.25rem 0; }
.gb-eintrag h3 { margin: 0; font-size: 1.05rem; }
.gb-eintrag time { display: block; color: var(--text-leise); font-size: .85rem; }
.gb-eintrag p { margin: .6rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ---------- Lightbox */

.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(0, 0, 0, .94); color: var(--text);
}
.lightbox::backdrop { background: rgba(0, 0, 0, .94); }
.lightbox figure {
  margin: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 3.5rem 3.5rem 1.5rem;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; }
.lightbox figcaption { margin-top: .75rem; text-align: center; min-height: 1.5em; }
.lightbox button {
  position: absolute; font-size: 2.2rem; line-height: 1; width: 3rem; height: 3rem;
  color: var(--text); background: rgba(255, 255, 255, .08); border: 0; border-radius: 50%; cursor: pointer;
}
.lightbox button:hover { background: rgba(255, 255, 255, .2); }
.lb-zu { top: .75rem; right: .75rem; }
.lb-zurueck { left: .5rem; top: 50%; transform: translateY(-50%); }
.lb-weiter { right: .5rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .lightbox figure { padding: 3.5rem .5rem 4.5rem; }
  .lb-zurueck, .lb-weiter { top: auto; bottom: .75rem; transform: none; }
  .lb-zurueck { left: calc(50% - 3.5rem); }
  .lb-weiter { right: calc(50% - 3.5rem); }
}

/* ---------- Fuß */

.fuss {
  max-width: var(--breite); margin: 0 auto; padding: 1rem;
  border-top: 1px solid var(--linie);
  font-size: .9rem; color: var(--text-leise);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- Gästebuch-Verwaltung */

.verwaltung { max-width: 50rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.gb-offen { border-left: 3px solid var(--rot); padding-left: 1rem; }
.gb-aktionen { display: flex; gap: .5rem; margin-top: .8rem; }
.gb-aktionen button, .knopf-leise {
  font: inherit; font-size: .9rem; padding: .35rem .9rem; cursor: pointer; border-radius: 3px;
  color: var(--grund); background: var(--text); border: 1px solid var(--text);
}
.knopf-leise, .gb-aktionen .knopf-leise { color: var(--text); background: transparent; border-color: var(--linie); }
.gb-ueberschrift { margin: 2.5rem 0 0; font-size: 1.2rem; }

/* ---------- Kerzen */

.kerzen { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.kerze-eintrag {
  display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 1rem; align-items: start;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 3px; padding: 1rem;
}
.kerze-eintrag h3 { margin: 0; font-size: 1.05rem; }
.kerze-eintrag p { margin: .4rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.kerze-eintrag .kerze-von { color: var(--text-leise); font-size: .85rem; white-space: normal; }

.kerze { --farbe: #efe3c4; display: flex; flex-direction: column; align-items: center; padding-top: .2rem; }
.kerze .docht {
  width: .7rem; height: 1.15rem; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 50% 70%, #fff7c2 0 25%, #ffc94d 45%, #ff8a1f 75%, transparent 76%);
  box-shadow: 0 0 .9rem .25rem rgba(255, 190, 80, .35);
  margin-bottom: .15rem;
}
.kerze .koerper {
  width: 1.9rem; height: 3rem; border-radius: 3px 3px 2px 2px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .18), transparent 35%, rgba(255, 255, 255, .18) 60%, rgba(0, 0, 0, .15)), var(--farbe);
  display: grid; place-items: center; font-size: .95rem; line-height: 1; color: rgba(255, 255, 255, .85);
}
@media (prefers-reduced-motion: no-preference) {
  .kerze .docht { animation: flackern 3s ease-in-out infinite alternate; transform-origin: 50% 100%; }
  .kerze-eintrag:nth-child(3n) .docht { animation-delay: -1s; }
  .kerze-eintrag:nth-child(3n+1) .docht { animation-delay: -2s; }
}
@keyframes flackern {
  0% { transform: scale(1, 1) rotate(-1deg); }
  50% { transform: scale(.94, 1.06) rotate(1.5deg); }
  100% { transform: scale(1.03, .96) rotate(-.5deg); }
}

.k-rot { --farbe: #b3262e; }
.k-lila { --farbe: #7b4fa0; }
.k-flieder { --farbe: #b9a0d6; }
.k-blau { --farbe: #3a6fb5; }
.k-dunkelblau { --farbe: #23407a; }
.k-grau-blau { --farbe: #7b8ea6; }
.k-tuerkis-hell { --farbe: #6fd0cf; }
.k-tuerkis-dunkel { --farbe: #1f8a8a; }
.k-hellgruen { --farbe: #8cc56b; }
.k-dunkelgruen { --farbe: #2f6b3a; }
.k-gelb { --farbe: #e6c64a; }
.k-orange { --farbe: #e8892f; }
.k-rost { --farbe: #a5522a; }
.k-braun { --farbe: #6e4a2e; }
.k-grau-braun { --farbe: #8d7f72; }
.k-grau { --farbe: #9a9a9a; }
.k-rosa { --farbe: #e8a5bd; }
.k-creme { --farbe: #efe3c4; }
.k-weiss { --farbe: #f4f4f4; }
.k-schwarz { --farbe: #2a2a2a; }
.k-schwarz .koerper { outline: 1px solid #555; }
.k-creme .koerper, .k-weiss .koerper, .k-gelb .koerper, .k-hellgruen .koerper,
.k-tuerkis-hell .koerper, .k-rosa .koerper, .k-flieder .koerper { color: rgba(0, 0, 0, .55); }
