/* Adventskalender - look: classic Christmas, clean and modern.
   Evergreen night, warm gold, cream paper, a touch of berry red.
   All colours live here as tokens; change them here to restyle the whole page. */

@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('/fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }

:root {
  --tanne: #0f2a22;
  --tanne-2: #173a2f;
  --tanne-3: #21503f;
  --gold: #d6ad62;
  --gold-hell: #f2dca8;
  --gold-dunkel: #a77e36;
  --papier: #f7f0e3;
  --papier-2: #ebdfc8;
  --beere: #9e2a33;
  --beere-2: #7d1f27;
  --tinte: #2a231b;
  --tinte-2: #5b4e3f;
  --hell: #f3ead8;
  --hell-2: #c9c0ac;
  --schatten: 0 10px 30px rgba(0, 0, 0, .35), 0 2px 6px rgba(0, 0, 0, .25);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --rand: 16px;
  --breite: 560px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--hell);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(214, 173, 98, .18), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(158, 42, 51, .18), transparent 70%),
    linear-gradient(180deg, var(--tanne) 0%, #0b211b 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }

#schnee { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }

.seite { position: relative; z-index: 1; max-width: var(--breite); margin: 0 auto; padding: 0 var(--rand) 64px; }

/* ---------- header ---------- */
.kopf { text-align: center; padding: 40px 8px 22px; }
.ornament { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold); }
.ornament::before, .ornament::after { content: ''; height: 1px; width: 64px; background: linear-gradient(90deg, transparent, var(--gold)); }
.ornament::after { transform: scaleX(-1); }
.ornament svg { width: 22px; height: 22px; }
.kicker { margin: 14px 0 0; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold-hell); opacity: .85; }
.kopf h1 { margin: 6px 0 4px; font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 12vw, 58px); line-height: 1.02; letter-spacing: -.01em; color: var(--papier); font-variation-settings: 'SOFT' 50, 'WONK' 0; }
.kopf h1 em { font-style: italic; color: var(--gold-hell); }
.datum { margin: 10px 0 0; color: var(--hell-2); font-size: 15px; }
.gruss { margin: 18px auto 0; max-width: 34ch; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--hell); opacity: .9; }

.vorschau-leiste { position: relative; z-index: 30; margin: 0 calc(-1 * var(--rand)); padding: 8px var(--rand); background: var(--beere); color: #fff; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vorschau-leiste input { font: inherit; padding: 2px 6px; border-radius: 6px; border: 0; }
.vorschau-leiste button { background: rgba(255, 255, 255, .18); border: 0; border-radius: 6px; padding: 4px 10px; cursor: pointer; }

.countdown { margin: 4px 0 22px; padding: 18px; text-align: center; border: 1px solid rgba(214, 173, 98, .35); border-radius: 16px; background: rgba(255, 255, 255, .03); }
.countdown b { display: block; font-family: var(--serif); font-size: 44px; font-weight: 500; color: var(--gold-hell); line-height: 1.1; }

/* ---------- calendar ---------- */
.kalender {
  --luecke: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: calc((min(100vw, var(--breite)) - 2 * var(--rand) - 3 * var(--luecke)) / 4 * 1.18);
  grid-auto-flow: dense;
  gap: var(--luecke);
  perspective: 1400px;
}
.tuer {
  --farbe: var(--papier);
  --farbe-2: var(--papier-2);
  --zahl: var(--beere);
  position: relative;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  transform-style: preserve-3d;
  perspective: 700px;
  border-radius: 10px;
  outline-offset: 3px;
}
.tuer.gross { grid-column: span 2; grid-row: span 2; }
.tuer.breit { grid-column: span 2; }
.tuer.v-beere { --farbe: var(--beere); --farbe-2: var(--beere-2); --zahl: var(--gold-hell); }
.tuer.v-tanne { --farbe: var(--tanne-3); --farbe-2: var(--tanne-2); --zahl: var(--gold-hell); }
.tuer.v-gold { --farbe: #e6c587; --farbe-2: #cfa560; --zahl: var(--tanne); }

/* what is behind the door */
.tuer-innen {
  position: absolute; inset: 0; border-radius: 10px; overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #fff3d6 0%, var(--gold) 45%, var(--gold-dunkel) 100%);
  background-size: cover; background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25), inset 0 6px 18px rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end;
}
.tuer-innen .klein { width: 100%; hyphens: auto; overflow-wrap: anywhere; padding: 18px 6px 6px; font-size: 11px; line-height: 1.2; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); font-weight: 600; opacity: 0; transition: opacity .4s; }
.tuer.offen .tuer-innen .klein { opacity: 1; }

/* the door panel itself */
.tuer-blatt {
  position: absolute; inset: 0; border-radius: 10px;
  background:
    radial-gradient(120% 80% at 30% 0%, rgba(255, 255, 255, .25), transparent 60%),
    linear-gradient(160deg, var(--farbe), var(--farbe-2));
  box-shadow: var(--schatten), inset 0 0 0 1px rgba(255, 255, 255, .15);
  transform-origin: left center;
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
  backface-visibility: hidden;
  display: grid; place-items: center;
}
.tuer-blatt::before { /* thin inner gold frame */
  content: ''; position: absolute; inset: 6px; border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--gold) 70%, transparent);
}
.tuer-blatt::after { /* knob */
  content: ''; position: absolute; right: 9px; top: 66%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold-hell), var(--gold-dunkel));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.tuer.gross .tuer-blatt::after { top: 50%; right: 16px; width: 10px; height: 10px; margin-top: -5px; }
.nr { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 8vw, 38px); color: var(--zahl); line-height: 1; font-variation-settings: 'SOFT' 100; }
.tuer.gross .nr { font-size: clamp(56px, 18vw, 84px); }
.tuer.breit .nr { font-size: clamp(34px, 10vw, 48px); }
.tuer .zusatz { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--zahl); opacity: .8; }
.tuer.gross .zusatz { bottom: 18px; font-size: 11px; }

.tuer.zu .tuer-blatt { filter: saturate(.8) brightness(.84); }
.tuer.bereit .tuer-blatt { animation: leuchten 2.4s ease-in-out infinite; }
.tuer.offen .tuer-blatt { transform: rotateY(-100deg); box-shadow: none; pointer-events: none; }
.tuer-innen .ecke { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: grid; place-items: center; background: rgba(15, 42, 34, .82); color: var(--gold-hell); font-family: var(--serif); font-size: 14px; }
.tuer.gross .tuer-innen .ecke { min-width: 32px; height: 32px; border-radius: 16px; font-size: 18px; top: 10px; left: 10px; }
.tuer.gross .tuer-innen .klein { font-size: 14px; padding: 30px 12px 10px; }
.tuer.wackeln { animation: wackeln .45s; }
@keyframes leuchten {
  0%, 100% { box-shadow: var(--schatten), 0 0 0 0 rgba(242, 220, 168, 0), inset 0 0 0 1px rgba(255, 255, 255, .15); }
  50% { box-shadow: var(--schatten), 0 0 22px 4px rgba(242, 220, 168, .55), inset 0 0 0 1px rgba(255, 255, 255, .35); }
}
@keyframes wackeln { 0%, 100% { transform: none; } 20% { transform: rotate(-3deg); } 40% { transform: rotate(3deg); } 60% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } }

/* ---------- feed ---------- */
.verlauf-kopf { margin: 44px 0 16px; text-align: center; }
.verlauf-kopf h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 28px; color: var(--papier); }
.verlauf-kopf p { margin: 4px 0 0; color: var(--hell-2); font-size: 14px; }
.leer { text-align: center; color: var(--hell-2); font-style: italic; font-family: var(--serif); padding: 8px 0 24px; }

.eintrag { position: relative; margin: 0 0 22px; padding: 22px 18px 20px; background: var(--papier); color: var(--tinte); border-radius: 18px; box-shadow: var(--schatten); overflow: hidden; }
.eintrag::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--beere), var(--gold), var(--tanne-3)); }

/* ---------- door content (feed + sheet) ---------- */
.inhalt-kopf { margin-bottom: 14px; }
.inhalt-kopf .tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--beere); font-weight: 700; }
.inhalt-kopf .tag .kreis { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--beere); color: var(--papier); font-family: var(--serif); font-size: 15px; letter-spacing: 0; }
.inhalt-kopf h3 { margin: 10px 0 2px; font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.15; color: var(--tinte); }
.inhalt-kopf .unter { margin: 0; color: var(--tinte-2); font-style: italic; font-family: var(--serif); font-size: 17px; }
.bloecke > * + * { margin-top: 16px; }
.b-text p { margin: 0 0 .8em; }
.b-text p:last-child { margin-bottom: 0; }
.b-ueberschrift { font-family: var(--serif); font-size: 22px; font-weight: 600; margin: 22px 0 0 !important; }
.b-zitat { margin-left: 0; margin-right: 0; padding: 6px 0 6px 16px; border-left: 3px solid var(--gold); font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.4; }
.b-zitat cite { display: block; margin-top: 6px; font-family: var(--sans); font-style: normal; font-size: 14px; color: var(--tinte-2); }
.medium-rahmen { border-radius: 12px; overflow: hidden; background: var(--papier-2); }
.b-bild img { width: 100%; height: auto; border-radius: 12px; cursor: zoom-in; }
.unterschrift { margin: 6px 2px 0; font-size: 14px; color: var(--tinte-2); }
.b-galerie .raster { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.b-galerie .raster img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.b-galerie .raster img.breit { grid-column: span 2; aspect-ratio: 16 / 10; }
.b-video video { width: 100%; border-radius: 12px; background: #000; }
.b-audio { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: var(--tanne); color: var(--hell); }
.b-audio .zeile { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.b-audio .zeile svg { width: 22px; height: 22px; color: var(--gold); flex: none; }
.b-audio audio { width: 100%; }

/* slideshow */
.diashow { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #111; touch-action: pan-y; user-select: none; }
.diashow img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s ease; }
.diashow img.an { opacity: 1; animation: kenburns var(--dauer, 5s) ease-out forwards; }
.diashow img.an.gerade { animation-name: kenburns2; }
@keyframes kenburns { from { transform: scale(1.0) translate(0, 0); } to { transform: scale(1.08) translate(-1.5%, -1%); } }
@keyframes kenburns2 { from { transform: scale(1.08) translate(1%, 1%); } to { transform: scale(1.0) translate(0, 0); } }
.diashow .punkte { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.diashow .punkte i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: background .3s, transform .3s; }
.diashow .punkte i.an { background: #fff; transform: scale(1.25); }
.diashow .pause { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, .45); display: none; place-items: center; color: #fff; }
.diashow.angehalten .pause { display: grid; }

/* ---------- opening stage ---------- */
.buehne { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(5, 15, 12, 0); backdrop-filter: blur(0); transition: background .5s, backdrop-filter .5s; }
.buehne.sichtbar { background: rgba(5, 15, 12, .78); backdrop-filter: blur(6px); }
.buehne .gross-tuer { position: relative; width: min(74vw, 330px); aspect-ratio: .82; perspective: 1200px; transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.buehne .gross-tuer .tuer-blatt { transition: transform 1.3s cubic-bezier(.3, .6, .1, 1); }
.buehne .gross-tuer .nr { font-size: 96px; }
.buehne .gross-tuer .tuer-blatt::after { right: 18px; width: 12px; height: 12px; margin-top: -6px; }
.buehne .gross-tuer .tuer-innen { display: grid; place-items: center; text-align: center; padding: 20px; background: radial-gradient(circle at 50% 45%, #fffaf0 0%, #f6d892 35%, var(--gold-dunkel) 100%); }
.buehne .gross-tuer .tuer-innen .text { font-family: var(--serif); color: var(--tinte); font-size: 26px; line-height: 1.15; opacity: 0; transform: scale(.9); transition: opacity .6s .5s, transform .8s .5s; }
.buehne .gross-tuer.auf .tuer-innen .text { opacity: 1; transform: none; }
.buehne .gross-tuer.auf .tuer-blatt { transform: rotateY(-112deg); }
.buehne canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- content sheet ---------- */
.blatt { position: fixed; inset: 0; z-index: 60; overflow-y: auto; overscroll-behavior: contain; background: var(--papier); color: var(--tinte); transform: translateY(100%); transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
.blatt.sichtbar { transform: none; }
.blatt .innen { max-width: var(--breite); margin: 0 auto; padding: 18px var(--rand) 40px; }
.blatt .leiste { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; padding: 10px var(--rand); background: linear-gradient(var(--papier) 60%, transparent); }
.knopf-rund { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--tanne); color: var(--papier); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.knopf-rund svg { width: 20px; height: 20px; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0; background: var(--tanne); color: var(--papier); font-weight: 700; cursor: pointer; }
.knopf.gold { background: linear-gradient(180deg, var(--gold-hell), var(--gold)); color: var(--tanne); }
.blatt .zurueck { display: flex; justify-content: center; margin-top: 32px; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .94); display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lightbox::-webkit-scrollbar { display: none; }
.lightbox figure { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; display: grid; place-items: center; padding: 56px 8px; }
.lightbox img { max-height: 100%; max-width: 100%; object-fit: contain; }
.lightbox .zu-knopf { position: fixed; top: 12px; right: 12px; z-index: 81; background: rgba(255, 255, 255, .15); color: #fff; }
.lightbox .zaehler { position: fixed; top: 22px; left: 0; right: 0; text-align: center; color: #fff; font-size: 14px; opacity: .8; pointer-events: none; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 90; transform: translate(-50%, 30px); opacity: 0; padding: 12px 18px; border-radius: 999px; background: var(--papier); color: var(--tinte); font-weight: 600; box-shadow: var(--schatten); transition: opacity .3s, transform .3s; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
.toast.an { opacity: 1; transform: translate(-50%, 0); }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px var(--rand); position: relative; z-index: 1; }
.login-karte { width: 100%; max-width: 380px; text-align: center; }
.login-karte form { margin-top: 28px; display: grid; gap: 12px; }
.login-karte input { width: 100%; min-height: 54px; padding: 0 18px; border-radius: 14px; border: 1px solid rgba(214, 173, 98, .5); background: rgba(255, 255, 255, .06); color: var(--papier); font: inherit; font-size: 19px; text-align: center; }
.login-karte input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.login-karte .fehler { min-height: 1.4em; color: #ffb4a8; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .tuer.bereit .tuer-blatt, .diashow img.an { animation: none; }
  .tuer-blatt, .blatt, .buehne .gross-tuer .tuer-blatt { transition-duration: .01s; }
}
