/* =========================================================
   Fonts (aus /fonts) – neue CoopCond-Familie
   ========================================================= */
@font-face {
  font-family: "CoopCond";
  src: url("fonts/CoopCond.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CoopCond";
  src: url("fonts/CoopCondBd.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "CoopCond";
  src: url("fonts/CoopCondBdIt.ttf") format("truetype");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* =========================================================
   Design Tokens
   ========================================================= */
:root {
  --gold: #C1A05B;
  --gold-deep: #b18944;
  --ink: #222;
  --bg: #f4f4f4;
  --card: #fff;
  --muted: #9aa0a6;
  --radius: 5px;
  --shadow: 0 6px 18px rgba(0, 0, 0, 0.08);

  /* Einheitliche Breite & Seitenabstand */
  --wrap-max: 1200px;
  --wrap-pad: 16px;
}

/* =========================================================
   Base
   ========================================================= */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "CoopCond", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }

/* Utility: Einheitlicher Wrapper (optional, falls im HTML verwendet) */
.wrap {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding-left: var(--wrap-pad);
  padding-right: var(--wrap-pad);
}

/* =========================================================
   Header / Hero
   ========================================================= */
.hero {
  background: #f4f4f4;
  /* keine seitlichen Padding-Abstände auf .hero – Alignment via .hero__inner */
  padding: 20px 0 10px;
  position: relative;
  overflow: hidden;
}

/* Wrapper exakt wie Container & Legende */
.hero__inner {
  max-width: var(--wrap-max);
  margin: 0 auto;
  padding-left: var(--wrap-pad);
  padding-right: var(--wrap-pad);

  display: flex;
  justify-content: space-between; /* Text links, Badge rechts */
  align-items: center;            /* vertikal mittig */
  flex-wrap: wrap;                /* bei kleinen Screens umbrechen */
  gap: 12px;
}

/* Linke Seite: Überschrift */
.hero__heading {
  flex: 1 1 auto;
  min-width: 240px;
}

.hero__heading h1 {
  line-height: 1.05;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gold);
  font-weight: 400;
  font-size: clamp(28px, 2.5vw, 46px);
}

.hero__heading h1 span {
  display: block;
  font-size: clamp(42px, 6vw, 64px);
  font-weight: 400;
}

.badge {
  --badge-size: 200px;          /* Desktop-Groesse */
  background: var(--gold);
  color: #fff;
  font-size: 26px;
  display: grid;                 /* zentriert Text */
  place-items: center;
  inline-size: var(--badge-size);
  block-size: var(--badge-size);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 12px;                 /* Innenabstand fuer mehrzeiligen Text */
  text-align: center;
  line-height: 1.15;
  font-weight: 700;
  box-shadow: var(--shadow);
  white-space: normal;           /* kein nowrap – Text darf umbrechen */
  word-break: break-word;
  z-index: 1000;        /* lange Worte umbrechen */
}

/* Responsives Verhalten: Badge unter Titel + kleiner */
@media (max-width: 600px) {
  .hero__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .badge {
    --badge-size: 120px;
    align-self: flex-start;
    margin-top: 8px;
    padding: 10px;
    font-size: 14px;
  }
}


/* =========================================================
   Sterne – Header & geschlossene Türchen
   ========================================================= */
.hero__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero__stars .star {
  position: absolute;
  width: clamp(26px, 4.2vw, 56px);
  aspect-ratio: 1;
  background-image: url("graphics/star.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: .9;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,.04));
}
/* Drei fixe Positionen analog Layout-Vorlage */
.hero__stars .star:nth-child(1) { top: 18%; left: 58%; }
.hero__stars .star:nth-child(2) { top: 34%; right: 26%; }
.hero__stars .star:nth-child(3) { top: 8%; right: 10%; }

/* Sparkles auf geschlossenen Adventstürchen */
.door__front .sparkle {
  position: absolute;
  width: clamp(30px, 5.3vw, 40px);
  aspect-ratio: 1;
  background-image: url("graphics/star.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: .9;
}

/* Positionierung je Flügel */
.leaf--left .sparkle {
  bottom: 12px;
  left: 12px;
}
.leaf--right .sparkle {
  top: 12px;
  right: 12px;
}

/* Sparkles nur sichtbar wenn Tür geschlossen */
.door.open .door__front .sparkle { display: none; }
/* =========================================================
   Layout
   ========================================================= */
.container {
  max-width: var(--wrap-max);
  margin: 18px auto 48px;
  padding-left: var(--wrap-pad);
  padding-right: var(--wrap-pad);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width:1280px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width:1000px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width:820px)  { .grid { grid-template-columns: 1fr; } }

/* =========================================================
   Door Card
   ========================================================= */
.door {
  position: relative;
  min-height: 520px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  outline: none;
  transition: transform .15s ease;
  overflow: hidden;
  display: flex;
}
.door:focus-visible { box-shadow: 0 0 0 3px #0000001a, var(--shadow); }
.door:active { transform: translateY(1px); }

.door__inner {
  position: relative;
  width: 100%;
  height: 100%;
  perspective: 1200px;          /* 3D-Perspektive */
  border-radius: inherit;
  overflow: hidden;
  transform-style: preserve-3d;
}

/* Vorderseite (zweifluegelig) */
.door__front {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 2;
  background: transparent;
  transform-style: preserve-3d;
  border-radius: inherit;
}

/* Mittelnaht – sofort ausblenden, sobald .open gesetzt */
.door__front::after {
  content: "";
  position: absolute;
  top: 5%;
  bottom: 5%;
  left: 50%;
  width: 1px;
  transform: translateX(-0.5px);
  background: repeating-linear-gradient(
    to bottom,
    #5e5e5e,
    #5e5e5e 3px,
    transparent 3px,
    transparent 6px
  );
  opacity: 0.7;
  pointer-events: none;
}
.door.open .door__front::after {
  opacity: 0 !important; /* sofort weg */
}

/* Tuerfluegel */
.leaf {
  position: relative;
  background: #fff;
  border: 1px solid #ececec;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transform-origin: left center;
  transform: rotateY(0deg);
  will-change: transform;
  transition: transform 2s cubic-bezier(.2, .7, .1, 1.05);
}
.leaf--left {
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  justify-content: flex-center;
  padding-left: 22px;
}
.leaf--right {
  transform-origin: right center;
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  transform: rotateY(0deg);
}
.day-num {
  font-size: clamp(68px, 10vw, 80px);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.leaf--right .day-num { display: none; }


/* =========================================================
   Rueckseite / Inhalt (ALLGEMEINES LAYOUT FÜR ALLE TAGE)
   ========================================================= */
.door__content {
  position: absolute;
  inset: 0;
  /* Hintergrund der Rückseite auf Gold ändern (wenn geöffnet) */
  background: #fff;
  color: #fff; /* Textfarbe auf Weiss setzen */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0; /* Abstand entfernen */
  z-index: 1;
  border-radius: inherit;
  transform-style: preserve-3d;
}

/* Kopfzeile Datum – WIRD VERSTECKT UND DURCH DIE BUBBLE ERSETZT */
.content__header {
  background-color: var(--gold);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 20px 10px 0; /* Oberen Padding für Text lassen */
  text-align: left;
}
.content__date {
  /* Altes Datum (Tag, Wochentag) ausblenden, da Bubble verwendet wird */
  display: none;
}

/* Promo (Text) – Jetzt Teil des Gold-Containers */
.content__promo {
  margin-bottom: 10px;
  background: transparent; /* KEIN goldener Balken mehr nötig, da der Container GOLD ist */
  color: #fff;
  padding: 0 10px 0; /* Padding nur seitlich */
  box-shadow: none;
  text-align: left; /* Text zentrieren wie im Screenshot */
}
.promo-big {
  font-weight: 400;
  font-size: clamp(50px, 12vw, 70px); /* Grösser machen */
  line-height: .9;
  position: relative;
  padding-right: 0; /* Entfernt den Abstand für die alte Bubble */
}
.promo-sub {
  margin-top: 14px;
  
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: clamp(20px, 2.8vw, 22px);
  line-height: 1.15;
  font-weight: 400;
}
.promo-note {
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: clamp(12px, 1.7vw, 14px);
  line-height: 1.4;
  font-weight: 400;
  opacity: .95;
}

/* Datums-Bubble (muss jetzt über dem Gold-Hintergrund stehen) */
.promo-bubble-abs {
  position: absolute;
  right: 16px;
  top: 16px;
  background: #fff;
  color: #C1A05B; 
  border-radius: 50%; 
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .05); 
  z-index: 10;

  white-space: normal;
}
/* Allow month to wrap to a second line inside the promo bubble when needed */
.promo-bubble-abs .bubble-mm { display: block; line-height: 1.0; }


/* Bildbereich – muss jetzt weiss sein */
.content__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; <-- VERTICAL CENTERING HIER ENTFERNEN */
  background: #fff;
  /* min-height: 200px; <-- Optional: Entfernen, damit es sich dem Inhalt anpasst */
  border-radius: 0 0 var(--radius) var(--radius);

  /* Diese Breiten-Korrekturen (100vw) sind im Card-Kontext oft problematisch. */
  /* Wir entfernen die problemverursachenden Positionierungen/Breiten: */
  width: 100%; /* NEU: Breite des Elternelements */
  position: relative; /* Oder entfernen, wenn nicht benötigt */
  left: auto; /* NEU */
  margin-left: 0; /* NEU */
  
  /* position: fixed; <--- DIESE ZEILE MUSS WEG! */
}
.content__figure img {
  width: 50%;
  max-width: 60%;
  height: auto;
  object-fit: contain;
  margin: 10px auto 0;
}

/* CTA-Button (GROSS und ORANGE) */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f2a23b; /* Orange aus dem Screenshot */
  color: #fff;
  font-weight: 400;
  border-radius: 10px; /* Eckig wie im Screenshot */
  padding: 16px;
  margin: 10px auto 30px; /* Zentriert unter dem Bild */
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .01);
  width: 90%;
  max-width: 260px;
  font-size: 18px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.cta:hover { background: #e69632; transform: translateY(-1px); filter: none; }
.cta:active { transform: translateY(0); }

.cta--label {
  cursor: default;
  pointer-events: none;
}

.cta--expired {
  background: #dedede;
  color: #666;
}


/* =========================================================
   Animation
   ========================================================= */
.door.open .leaf--left { transform: rotateY(-160deg); }
.door.open .leaf--right { transform: rotateY(160deg); }
.door.open { cursor: default; }

/* Gesperrte Tuerchen */
.door.locked { cursor: not-allowed; }
.door.locked .day-num { color: #c9c9c9; }

/* Heute-Badge */
.badge--today {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 3;
  background: var(--gold);
  color: #fff;
  opacity: 0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* Hover-Polish */
.door:hover:not(.open):not(.locked)) {
  box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
  transform: translateY(-2px);
}

/* =========================================================
   Legende / Kleingedrucktes
   ========================================================= */
.legend {
  margin: 18px auto 48px;
  max-width: var(--wrap-max);
  padding-left: var(--wrap-pad);
  padding-right: var(--wrap-pad);
  text-align: center;
}
.legend__inner {
  display: inline-block;
  max-width: 100%;
}
.legend__item {
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .02em;
  text-transform: uppercase;
  font-weight: 700;
}
.legend__item--last {
  margin-top: 10px;
  font-weight: 800;
}
.legend__mark {
  display: inline-block;
  width: 2.4ch;
  text-align: left;
  margin-right: 6px;
  color: var(--gold-deep);
}
@media (max-width: 420px) {
  .legend__item { font-size: 11px; }
  .legend { margin-bottom: 28px; }
}

/* =========================================================
   3D-Polish & States
   ========================================================= */
.leaf { filter: drop-shadow(0 10px 12px rgba(0,0,0,.1)); }
.door.open .leaf { filter: drop-shadow(0 16px 32px rgba(0,0,0,.1)); }

/* Vergangene Tage: Inhalt in Schwarzweiss darstellen */
.door.past .door__content { filter: grayscale(100%); }


/* =========================================================
   Interaktions-Sheen fuer aktive Angebote
   ========================================================= */
.door.has-link .door__content {
  position: relative;
  cursor: pointer;
}

.door.has-link .door__content::before {
  content: "";
  position: absolute;
  top: -100%;
  left: -150%;
  width: 250%;
  height: 300%;
  transform: rotate(25deg);
  background: linear-gradient( to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 45%, rgba(255,255,255,0) 70% );
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

.door.has-link.open:hover .door__content::before,
.door.has-link.open:active .door__content::before {
  animation: sheen-sweep 1.2s ease;
  opacity: 1;
}

@keyframes sheen-sweep {
  0%   { transform: translateX(-40%) rotate(25deg); }
  100% { transform: translateX(40%)  rotate(25deg); }
}

/* Fokus-Outline fuer Tastatur */
.door.has-link.open:focus-visible .door__content {
  box-shadow: 0 0 0 3px #0000001a;
}

/* CTA-Button (Legacy, falls es irgendwo noch genutzt wird) */
.cta-link {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-radius: 10px;
  background: var(--gold);
  color: #2b1600;
  text-decoration: none;
  outline: none;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
.cta-link:hover { transform: translateY(-1px); }
.cta-link:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(0,0,0,.14); }

/* === Juri minimal add-ons v2 (überarbeitete Reste) === */
.badge--today{ display:none !important; }
.content__figure img{ max-width:360px; width:80%; margin:8px auto 0; } /* Angepasst, um dem neuen Standard-Layout zu folgen */
.promo-note{ white-space:pre-line; }

/* === Veraltete Juri-Blöcke entfernt, da sie nun in den Hauptblöcken definiert sind === */

/* === Juri add-on: Pin CTA to bottom of door content === */
.door__content { padding-bottom: 10px; }

/* Make CTA stick to bottom center of the door content */
.door.open .cta, .door.open .cta-link, .cta, .cta-link {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0 !important;
}

/* Ensure the figure leaves room so CTA doesn't overlap content */
.door__content .content__figure {
  padding-bottom: 56px; /* leave space above CTA (approx button height) */
}



/* === Juri fix v2: CTA bottom, ample spacing === */
.door__content { position: absolute; inset: 0; padding-bottom: 16px; }
.door.open .cta, .door.open .cta-link, .cta, .cta-link {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 !important;
}
/* Ensure content has room above CTA; footer space reserve */
.door__content .content__figure { padding-bottom: 72px; }



/* === Juri v5: CTA fixed to bottom inside door content === */
.door.open .door__content { position: absolute; inset: 0; padding-bottom: 18px; }
.door.open .door__content .cta {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 !important;
  width: 90%;
  max-width: 280px;
}
.door.open .door__content .content__figure { padding-bottom: 84px; }