/* Der Adventskalender als Haus (Landingpage altbau-adventskalender.html, Verhalten in advent-kalenderbild.js).
   Ein Gründerzeit-Eckhaus bei Nacht (images/advent/kalender-fassade-nacht.jpg, aus dem Fassadenbild der Startseite):
   23 Fenster und die Haustür sind die 24 Türchen. Fensterflügel sind Ausschnitte desselben Bildes und schwingen nach innen auf.
   Jedes Türchen trägt die Perforation eines Papierkalenders und darunter ein emailliertes Nummernschild. */

.adv-held { overflow-anchor: none; }   /* sonst springt die Seite, wenn die Karte erscheint (klebendes Formular rechts) */
.akf { position: relative; margin-top: clamp(1.8rem, 3.5vw, 2.6rem); }
.akf-rahmen { position: relative; }
.akf-scroll { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55); }
.akf-buehne {
  position: relative; width: 100%; aspect-ratio: 1400 / 1084; overflow: hidden; container-type: inline-size;
  background: radial-gradient(90% 60% at 50% 0%, #1a2240 0%, #0b0f20 55%, #070912 100%);
  transition: transform 1.1s cubic-bezier(.65, 0, .35, 1); transform-origin: 50% 50%;
}
/* Das Haus steht unten, darüber 220 von 1084 Teilen Nachthimmel für den Titel. Lage der Türchen in Prozent des Hauses. */
.akf-haus { position: absolute; left: 0; right: 0; bottom: 0; height: 79.7%; }
.akf-haus::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 22%; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, #0b0f20 0%, rgba(11, 15, 32, 0.6) 40%, rgba(11, 15, 32, 0) 100%); }
.akf-bild { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }

/* Titel im Nachthimmel — über dem Wischbereich, damit er am Handy beim Schieben stehen bleibt */
.akf-titel { position: absolute; left: 0; right: 0; top: 0; height: 20.3%; z-index: 9; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-top: 1%; }
.akf-titel { transition: opacity 0.6s ease; }
.akf.ist-nah .akf-titel { opacity: 0; }
.akf-titel span { display: block; font-size: clamp(0.5rem, 0.95vw, 0.66rem); letter-spacing: 0.26em; text-transform: uppercase; color: rgba(247, 242, 234, 0.66); }
.akf-titel b {
  display: block; margin-top: 0.3em; font-family: var(--font-display); font-weight: 500; line-height: 1;
  font-size: clamp(1.45rem, 3.6vw, 2.75rem); letter-spacing: -0.01em;
  background: linear-gradient(180deg, #fff1cf 0%, #e8c47f 42%, #b38a45 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(232, 190, 110, 0.28));
}
.akf-titel i { display: block; margin-top: 0.5em; font-style: normal; font-size: clamp(0.58rem, 1.05vw, 0.78rem); letter-spacing: 0.08em; color: rgba(247, 242, 234, 0.72); }

/* ---------- Ein Türchen ---------- */
.akf-tuer { position: absolute; z-index: 3; perspective: 300px; cursor: pointer; }
/* Perforation wie bei einem Papierkalender; beim Zeigen wird sie zum leuchtenden Rahmen */
.akf-tuer:not(.ist-offen)::before {
  content: ""; position: absolute; inset: -2px; z-index: 4; pointer-events: none; border-radius: 2px;
  border: 1px dashed rgba(231, 195, 124, 0.6); transition: border-color 0.25s, box-shadow 0.25s;
}
.akf-tuer:not(.ist-offen):hover::before, .akf-tuer:not(.ist-offen):has(.akf-siegel:focus-visible)::before {
  border-style: solid; border-color: rgba(255, 226, 160, 0.95); box-shadow: 0 0 14px rgba(255, 210, 120, 0.45);
}
.akf-innen {
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s ease; box-shadow: 0 0 22px 6px rgba(255, 190, 90, 0.55);
  background:
    linear-gradient(90deg, transparent 47%, rgba(60, 30, 8, 0.55) 47%, rgba(60, 30, 8, 0.55) 53%, transparent 53%),
    linear-gradient(0deg, transparent 63%, rgba(60, 30, 8, 0.5) 63%, rgba(60, 30, 8, 0.5) 67%, transparent 67%),
    radial-gradient(120% 90% at 50% 60%, #fff3cf 0%, #ffd27a 30%, #e79a3c 65%, #8a4a17 100%);
}
.akf-fluegel {
  position: absolute; top: 0; height: 100%; width: 50%; background-repeat: no-repeat;
  backface-visibility: hidden; transition: transform 1.2s cubic-bezier(.45, 0, .2, 1);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.akf-fluegel-l { left: 0; transform-origin: 0% 50%; }
.akf-fluegel-r { right: 0; transform-origin: 100% 50%; }
/* Erst fährt die Kamera heran, dann schwingen die Flügel auf und das Licht kommt */
.akf-tuer.ist-offen .akf-innen { opacity: 1; transition-delay: 0.6s; }
.akf-tuer.ist-offen .akf-fluegel { transition-delay: 0.55s; }
.akf-tuer.ist-offen .akf-fluegel-l { transform: rotateY(95deg); }
.akf-tuer.ist-offen .akf-fluegel-r { transform: rotateY(-95deg); }
.akf-tuer.ist-haustuer .akf-fluegel { transition-duration: 1.6s; }
.akf-tuer.ist-haustuer.ist-offen .akf-fluegel-l { transform: rotateY(88deg); }
.akf-tuer.ist-haustuer.ist-offen .akf-fluegel-r { transform: rotateY(-88deg); }

/* Licht, das aus dem geöffneten Fenster auf die Fassade fällt */
.akf-licht {
  position: absolute; left: 50%; top: 50%; width: 520%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(0.2);
  border-radius: 50%; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 205, 120, 0.75), rgba(255, 170, 70, 0.3) 45%, rgba(255, 150, 50, 0) 75%);
  transition: opacity 0.8s ease 0.6s, transform 1.3s cubic-bezier(.2, .7, .2, 1) 0.6s;
}
.akf-tuer.ist-offen .akf-licht { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.akf-tuer.ist-haustuer .akf-licht { width: 260%; top: 58%; }
.akf-tuer.ist-haustuer .akf-innen {
  background: radial-gradient(90% 70% at 50% 75%, #fffaf0 0%, #ffe3a1 30%, #f0a94a 70%, #9a5517 100%);
}
/* Oberlicht über der Haustür: leuchtet von hinten, das Gitter bleibt dunkel */
.akf-oberlicht { position: absolute; z-index: 3; pointer-events: none; opacity: 0;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0; mix-blend-mode: color-dodge;
  background: radial-gradient(70% 95% at 50% 100%, rgba(255, 205, 140, 0.88) 0%, rgba(255, 180, 100, 0.65) 55%, rgba(255, 160, 80, 0.3) 100%);
  transition: opacity 1.2s ease 0.5s; }
.akf-oberlicht.ist-an { opacity: 1; }

/* Das Nummernschild unter dem Fenster: der Knopf (die ganze Fensterfläche ist ebenfalls klickbar) */
.akf-siegel {
  position: absolute; left: 50%; bottom: -3px; transform: translate(-50%, 100%); z-index: 5; cursor: pointer;
  min-width: clamp(24px, 3.3vw, 30px); height: clamp(24px, 3.3vw, 30px);   /* Rückfall ohne Containerabfrage */
  min-width: clamp(24px, 4cqw, 30px); height: clamp(24px, 4cqw, 30px); padding: 0 0.3em; border-radius: 4px;
  display: grid; place-items: center;
  font: 500 clamp(0.66rem, 1.8cqw, 0.82rem)/1 var(--font-display); font-variant-numeric: lining-nums tabular-nums; color: #f3d9a0;
  background: linear-gradient(180deg, #232741, #0e1020); border: 1px solid rgba(231, 195, 124, 0.85);
  box-shadow: inset 0 0 0 2px #0e1020, inset 0 0 0 3px rgba(231, 195, 124, 0.32), 0 3px 10px rgba(0, 0, 0, 0.6);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}
.akf-tuer:hover .akf-siegel, .akf-siegel:focus-visible {
  transform: translate(-50%, 100%) scale(1.12);
  box-shadow: inset 0 0 0 2px #0e1020, inset 0 0 0 3px rgba(231, 195, 124, 0.5), 0 4px 14px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 210, 120, 0.55);
}
.akf-siegel:focus-visible { outline: 2px solid #fff3cf; outline-offset: 2px; }
.akf-tuer.ist-offen .akf-siegel { opacity: 0; transform: translate(-50%, 100%) scale(1.5) rotate(-8deg); }
.akf-tuer.ist-offen:has(.akf-siegel:focus-visible) { outline: 2px solid #fff3cf; outline-offset: 3px; border-radius: 3px; }
.akf-tuer.ist-haustuer .akf-siegel {
  top: 46.5%; bottom: auto; transform: translate(-50%, -50%);
  min-width: clamp(32px, 6cqw, 46px); height: clamp(32px, 6cqw, 46px); font-size: clamp(0.85rem, 2.4cqw, 1.15rem);
}
.akf-tuer.ist-haustuer:hover .akf-siegel, .akf-tuer.ist-haustuer .akf-siegel:focus-visible { transform: translate(-50%, -50%) scale(1.1); }
.akf-tuer.ist-haustuer.ist-offen .akf-siegel { transform: translate(-50%, -50%) scale(1.5) rotate(-8deg); }

/* Einladung beim ersten Besuch */
.akf-tuer.ist-einladung .akf-siegel::after {
  content: ""; position: absolute; inset: -5px; border-radius: 6px; border: 2px solid rgba(255, 226, 160, 0.9);
  animation: akf-puls 1.6s ease-out infinite;
}
@keyframes akf-puls { 0% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1.7); opacity: 0; } }
.akf-tipp {
  position: absolute; z-index: 7; white-space: nowrap; pointer-events: none; will-change: transform;
  transform: translate(-20%, calc(clamp(24px, 4cqw, 30px) + 10px));
  background: rgba(10, 9, 14, 0.85); color: #fff3cf; border: 1px solid rgba(231, 195, 124, 0.6); border-radius: 999px;
  font-size: clamp(0.62rem, 1.6cqw, 0.78rem); padding: 0.4em 0.85em;
  animation: akf-schweben 2.2s ease-in-out infinite;
}
@keyframes akf-schweben {
  0%, 100% { transform: translate(-20%, calc(clamp(24px, 4cqw, 30px) + 10px)); }
  50%      { transform: translate(-20%, calc(clamp(24px, 4cqw, 30px) + 15px)); }
}

.akf-funken { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }

/* Inszenierung beim Öffnen: Lichtkegel auf das Türchen, Strahlen, ein Ring */
.akf-spot {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.45s ease;
  background: radial-gradient(circle at var(--sx, 50%) var(--sy, 50%), rgba(0, 0, 0, 0) 0, rgba(0, 0, 0, 0) var(--sr, 60px), rgba(4, 4, 10, 0.62) calc(var(--sr, 60px) * 2.6));
}
.akf-spot.ist-an { opacity: 1; }
.akf-strahlen {
  position: absolute; left: 50%; top: 50%; width: 900%; aspect-ratio: 1; pointer-events: none; opacity: 0; mix-blend-mode: screen;
  transform: translate(-50%, -50%) rotate(0deg) scale(0.3); border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 140, 0.32) 0deg 4deg, rgba(255, 214, 140, 0) 4deg 18deg);
  -webkit-mask: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 70%); mask: radial-gradient(closest-side, #000 0%, rgba(0, 0, 0, 0.6) 30%, transparent 70%);
}
.akf-tuer.ist-auftritt .akf-strahlen { animation: akf-strahlen 2.4s ease-out 0.6s forwards; }
@keyframes akf-strahlen { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(0deg) scale(0.3); } 25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(40deg) scale(1); } }
.akf-ring { position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
  border: 2px solid rgba(255, 228, 165, 0.95); box-shadow: 0 0 18px rgba(255, 210, 120, 0.8); opacity: 0; z-index: 5; }
.akf-tuer.ist-auftritt .akf-ring { animation: akf-ring 0.9s ease-out forwards; }
@keyframes akf-ring { 0% { opacity: 1; transform: scale(0.4); } 100% { opacity: 0; transform: scale(4.2); } }

/* ---------- Die Karte: was hinter dem Türchen wartet — unter dem Haus, damit das Haus frei bleibt ---------- */
.akf-karte {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); margin-top: 0.9rem;
  background: rgba(20, 17, 13, 0.92); color: #f7f2ea; border: 1px solid rgba(231, 195, 124, 0.45); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.3); overflow: hidden;
  visibility: hidden; opacity: 0; transform: translateY(-10px);
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2, .8, .2, 1), visibility 0s linear 0.6s;
}
.akf-karte.ist-da { visibility: visible; opacity: 1; transform: none; transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.akf-karte[hidden] { display: none; }
.akf-karte img { display: block; width: 100%; height: 100%; min-height: 0; aspect-ratio: 16 / 9; object-fit: contain; background: #f2ece0; }
.akf-karte-text { padding: 0.95rem 1.1rem 1rem; }
.akf-karte .akf-k-eyebrow { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: #e7c37c; }
.akf-karte h3 { margin: 0.35rem 2rem 0 0; font-size: 1.08rem; line-height: 1.25; color: #fff; outline: none; }
.akf-karte p { margin: 0.4rem 0 0; font-size: 0.82rem; line-height: 1.5; color: rgba(247, 242, 234, 0.82);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.akf-karte p.akf-k-meta { font-size: 0.74rem; color: rgba(247, 242, 234, 0.6); display: block; }
.akf-karte .akf-k-knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; align-items: center; }
.akf-karte .btn { padding: 0.6rem 1rem; font-size: 0.82rem; }
.akf-karte .akf-k-weiter { background: none; border: 0; color: #e7c37c; font-size: 0.8rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: 0.3rem; }
.akf-karte .akf-k-zu {
  position: absolute; top: 0.45rem; right: 0.45rem; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(10, 9, 14, 0.7); color: #fff; font-size: 1.1rem; line-height: 1; z-index: 2;
}
@media (max-width: 560px) { .akf-karte { grid-template-columns: 1fr; } .akf-karte img { height: auto; } }

.akf-unten { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; justify-content: space-between; align-items: baseline; margin-top: 0.9rem; }
.akf-hinweis { margin: 0; font-size: 0.86rem; color: var(--on-dark-soft); }
.akf-zaehler { margin: 0; font-size: 0.8rem; color: #e7c37c; letter-spacing: 0.02em; }
.akf-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Schmal: Das Haus bleibt groß genug zum Tippen und lässt sich seitlich schieben; Pfeile am Rand zeigen die Richtung. */
.akf-schieben { display: none; margin: 0.6rem 0 0; font-size: 0.8rem; color: rgba(247, 242, 234, 0.72); }
.akf-rand { display: none; }
@media (max-width: 720px) {
  .akf-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
  .akf-scroll::-webkit-scrollbar { display: none; }
  .akf-buehne { width: 700px; max-width: none; }
  .akf-schieben { display: block; }
  .akf-rand { position: absolute; top: 20.3%; bottom: 0; width: 34px; z-index: 8; pointer-events: none; display: flex; align-items: center; justify-content: center;
    color: #f3d9a4; font-size: 1.5rem; text-shadow: 0 0 8px rgba(0, 0, 0, 0.8); transition: opacity 0.35s; }
  .akf-rand.links { left: 0; border-bottom-left-radius: var(--radius); background: linear-gradient(90deg, rgba(7, 9, 18, 0.9), rgba(7, 9, 18, 0)); }
  .akf-rand.rechts { right: 0; border-bottom-right-radius: var(--radius); background: linear-gradient(-90deg, rgba(7, 9, 18, 0.9), rgba(7, 9, 18, 0)); }
  .akf-rand.ist-weg { opacity: 0; }
  .akf-rand.links::before { content: "‹"; }
  .akf-rand.rechts::before { content: "›"; }
}

@media (prefers-reduced-motion: reduce) {
  .akf-buehne, .akf-fluegel, .akf-licht, .akf-karte, .akf-siegel, .akf-innen, .akf-oberlicht { transition-duration: 0.01s !important; transition-delay: 0s !important; }
  .akf-tuer.ist-einladung .akf-siegel::after, .akf-tipp, .akf-strahlen, .akf-ring { animation: none !important; }
}
