/* ==========================================================================
   Adventskalender (/adventskalender/) – nur auf dieser Seite eingebunden.
   Flach und ruhig: keine Schatten, keine Verzierungen; einige Türen sind größer (Rhythmus im Raster).
   Die Tür von heute ist rot. Türen sind links angeschlagen und schwenken nach außen (zum Betrachter)
   auf; geöffnete Türen bleiben so offen stehen, dahinter liegt der Inhalt.
   Animation nur über transform/opacity; prefers-reduced-motion beachtet.
   ========================================================================== */

.adv-head .display--page { max-width: 12ch; }
.adv-head .display--page em { font-style: normal; color: var(--accent-display); }

/* Mitwirkende: alle Namen aus der Datei, alphabetisch, schlicht mit Trennpunkten */
.adv-mit { display: grid; gap: 10px; max-width: 900px; padding-top: 8px; border-top: 1px solid var(--line); }
.adv-mit .label { margin: 8px 0 0; }
.adv-mit ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 17px; color: var(--text-2); }
.adv-mit li:not(:last-child)::after { content: "·"; margin: 0 12px; color: var(--muted); }

/* ---------- Raster: 6 Spalten, Tür 24 doppelt groß, 6/13/19 doppelt breit (build.py → ADVENT_GROSS) ---------- */
.adv-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: minmax(150px, 1fr); grid-auto-flow: dense;
  gap: 12px; padding-bottom: 96px; }
.door { position: relative; display: block; min-width: 0; border: 0; padding: 0; margin: 0; background: none;
  color: inherit; font: inherit; text-align: left; cursor: pointer; perspective: 2000px; perspective-origin: 0 50%; border-radius: var(--radius); }
.door.w2 { grid-column: span 2; }
.door.h2 { grid-row: span 2; }
.door:hover { color: inherit; }

/* Innenseite: was hinter der Tür liegt (nur bei geöffneten Türen im HTML) */
.door-in { position: absolute; inset: 0; border-radius: var(--radius); background: var(--surface-2); box-shadow: inset 0 0 0 1px #2c2a29;
  display: flex; flex-direction: column; justify-content: space-between; gap: 8px; padding: 16px 16px 16px 36%; overflow: hidden; transition: background .2s ease; }
/* große Türen: flacherer Blickwinkel, weiter aufgeschwenkt – sonst wäre die offene Tür sehr breit */
.door.w2, .door.h2 { perspective: 3500px; }
.door.w2 .door-in, .door.h2 .door-in { padding-left: 25%; }
.di-num { align-self: flex-end; font: 500 12px/1 var(--mono); letter-spacing: .12em; color: var(--accent-text); }
.di-artist { margin-top: auto; margin-bottom: -4px; font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.di-song { font-family: var(--display); font-size: 26px; line-height: 1; text-transform: uppercase; color: var(--text);
  overflow-wrap: break-word; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  padding-top: .14em; }   /* Platz für Umlaut-Punkte (ÄÖÜ), die overflow sonst abschneidet */
.door.h2 .di-song { font-size: 44px; -webkit-line-clamp: 4; line-clamp: 4; }
.di-by { font-size: 14px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.door.is-auf:hover .door-in { background: #1c1c1c; }

/* Vorderseite: die Tür */
.door-front { position: absolute; inset: 0; border-radius: var(--radius); background: var(--surface-1); box-shadow: inset 0 0 0 1px #2c2a29;
  display: flex; flex-direction: column; justify-content: space-between; padding: 14px 16px; transform-origin: 0 50%; backface-visibility: hidden; }
.df-num { font-family: var(--display); font-size: clamp(48px, 5vw, 76px); line-height: .85; color: #4a4642; }
.door.h2 .df-num { font-size: clamp(100px, 12vw, 180px); }
.df-lab { font: 400 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.door.is-zu { cursor: default; }

/* Heute: rote Tür */
.door.is-heute .door-front { background: var(--accent); box-shadow: none; }
.door.is-heute .df-num { color: #f1ebe2; }
.door.is-heute .df-lab { color: #f6dfe2; }
.door.is-heute:hover .door-front { filter: brightness(1.08); }

/* Geöffnet: Tür schwenkt an der linken Kante nach außen (die freie Kante kommt auf den Betrachter zu)
   und bleibt offen stehen. Etwas dunkler als geschlossen, damit sie als offene Tür lesbar ist. */
.door.is-auf { z-index: 2; }
.door.is-auf .door-front { transform: rotateY(-74deg); transition: transform .8s cubic-bezier(.3,.6,.25,1), background .3s ease; }
.door.is-auf:not(.is-heute) .door-front { background: #1a1918; }
.door.is-auf .df-lab { opacity: 0; }
.door.is-auf:hover .door-front { transform: rotateY(-78deg); }
.door.is-auf.w2 .door-front, .door.is-auf.h2 .door-front { transform: rotateY(-80deg); }
.door.is-auf.w2:hover .door-front, .door.is-auf.h2:hover .door-front { transform: rotateY(-83deg); }
.door.is-offen .door-front { transition: none; }   /* schon vorher offen: ohne Animation */

.adv-toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); background: var(--surface-3); color: var(--text); padding: 12px 18px; border-radius: 999px;
  font: 500 13px/1.3 var(--mono); letter-spacing: .04em; box-shadow: inset 0 0 0 1px #34302c; transition: opacity .2s, transform .2s; }
.adv-toast.zeigen { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Geöffnete Türen ----------
   Ohne JavaScript: Liste unter dem Raster. Mit JavaScript: im Fenster (die Liste ist dann ausgeblendet). */
.adv-liste { display: grid; gap: var(--gap); padding-bottom: 96px; }
.js .adv-liste { display: none; }
.adv-tuer { display: flex; flex-direction: column; gap: 16px; max-width: 760px; padding: 32px 0; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.ab-kopf { margin: 0; font: 500 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ab-nr { color: var(--accent-text); }
.ab-song { margin: 4px 0 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(44px, 6vw, 76px); line-height: .92; overflow-wrap: break-word; }
.ab-artist { margin: -4px 0 0; font-size: 20px; color: var(--text-2); }
.ab-wer { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ab-wer .label { margin-right: 6px; }
/* Ratespiel: Erscheinungsjahr */
.ab-raten { display: grid; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.ab-raten .label { margin: 0; color: var(--accent-text); }
/* Beim Öffnen der Tür blinken die Jahre kurz nacheinander rot auf, damit man das Spiel bemerkt */
.adv-dlg .ab-raten:not(.is-geraten) .ab-j { animation: abJBlitz 1.1s ease-in-out .5s 2 both; }
.adv-dlg .ab-raten:not(.is-geraten) .ab-j:nth-child(2) { animation-delay: .65s; }
.adv-dlg .ab-raten:not(.is-geraten) .ab-j:nth-child(3) { animation-delay: .8s; }
@keyframes abJBlitz {
  0%, 100% { background: var(--surface-3); box-shadow: inset 0 0 0 1px #34302c; color: var(--text); }
  35%      { background: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: #f1ebe2; }
}
@media (prefers-reduced-motion: reduce) { .adv-dlg .ab-raten .ab-j { animation: none !important; } }
.ab-raten-wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.ab-j { min-width: 92px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
        background: var(--surface-3); color: var(--text); font-family: var(--display); font-size: 26px; letter-spacing: .03em;
        box-shadow: inset 0 0 0 1px #4a4440; transition: background .15s ease, color .15s ease, opacity .2s ease; }
.ab-j:hover:not(:disabled) { background: #2a2626; box-shadow: inset 0 0 0 1px var(--accent); }
.ab-j:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.ab-j:disabled { cursor: default; }
.is-geraten .ab-j { opacity: .4; }
.is-geraten .ab-j.is-richtig { opacity: 1; background: var(--accent); color: #f1ebe2; box-shadow: none; }
.is-geraten .ab-j.is-gewaehlt:not(.is-richtig) { opacity: .75; text-decoration: line-through; text-decoration-thickness: 2px; }
.ab-raten-aufl { margin: 0; min-height: 1.4em; font-size: 16px; color: var(--text-2); }
.ab-raten-aufl:empty { display: none; }
html:not(.js) .ab-raten { display: none; }   /* ohne JavaScript lässt sich nicht auflösen */
.ab-text { font-size: 17px; line-height: 1.65; color: var(--text-2); }
.ab-text > :first-child { margin-top: 0; } .ab-text > :last-child { margin-bottom: 0; }
.ab-text a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-display); text-underline-offset: 3px; }
.ab-links { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.ab-links .btn { min-height: 44px; padding: 0 18px; }

/* Fenster */
.adv-dlg { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 8px;
  background: var(--surface-1); color: var(--text); box-shadow: inset 0 0 0 1px #2c2a29; overflow: auto; }
.adv-dlg::backdrop { background: rgba(8,8,8,.86); }
.adv-dlg[open] { animation: adv-auf .3s ease; }
@keyframes adv-auf { from { opacity: 0; transform: translateY(8px); } }
.adv-dlg .adv-tuer { max-width: none; border-top: 0; padding: 36px 40px 20px; }
.adv-x { position: absolute; top: 20px; right: 20px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.adv-x:hover { background: var(--surface-3); color: var(--text); }
.adv-nav { display: flex; justify-content: space-between; gap: 8px; margin: 0 40px; padding: 14px 0 22px; border-top: 1px solid var(--line); }
.adv-nav button { background: none; border: 0; color: var(--text-3); font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; padding: 10px 0; }
.adv-nav button:hover { color: var(--text); }
.adv-nav button:disabled { opacity: .3; cursor: default; }

@media (max-width: 1100px) { .adv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .door.w2:not(.h2):not(.keep) { grid-column: span 1; } }
@media (max-width: 640px) {
  .adv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(112px, 1fr); gap: 8px; }
  .door.w2:not(.h2) { grid-column: span 1; }
  .door-in, .door.w2 .door-in { padding: 10px 8px 10px 36%; }
  .door.h2 .door-in { padding-left: 25%; }
  .door.w2:not(.h2) { perspective: 2000px; }
  .door.is-auf.w2:not(.h2) .door-front { transform: rotateY(-74deg); }
  .door.h2 .di-song { font-size: 28px; }
  .di-song { font-size: 18px; } .di-by { display: none; }
  .di-artist { font-size: 9px; letter-spacing: .06em; margin-bottom: -2px; }
  .door-front { padding: 10px 12px; }
  .df-lab { font-size: 10px; letter-spacing: .08em; }
  .adv-dlg .adv-tuer { padding: 28px 20px 16px; }
  .adv-nav { margin: 0 20px; }
  .adv-x { top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .door.is-auf .door-front { transition: none; }
  .adv-dlg[open] { animation: none; }
}
