/* ==========================================================================
   Adventskalender – Pinwand-Layer
   Schlicht, weihnachtlich, ohne externe Abhaengigkeiten.
   Alle Klassen tragen das Praefix "ak-", damit nichts mit deiner
   bestehenden Web-App kollidiert.
   ========================================================================== */

:root {
  --ak-gruen-dunkel: #0d1c13;
  --ak-gruen: #14281d;
  --ak-gruen-hell: #2c5238;
  --ak-gold: #c9a227;
  --ak-gold-hell: #e3c567;
  --ak-rot: #9e2b25;
  --ak-rot-dunkel: #6e1a16;
  --ak-papier: #f7f1e1;
  --ak-tinte: #3a2f24;
  --ak-holz-1: #7a5230;
  --ak-holz-2: #5c3d22;
  --ak-kork: #b98d5f;
}

/* ---------- Buttons auf deiner Seite (z. B. Login) ---------- */

.ak-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--ak-gold);
  background: linear-gradient(180deg, var(--ak-gruen-hell), var(--ak-gruen-dunkel));
  color: var(--ak-papier);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ak-knopf:hover {
  border-color: var(--ak-gold-hell);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.25);
  transform: translateY(-1px);
}

.ak-knopf:focus-visible {
  outline: 2px solid var(--ak-gold);
  outline-offset: 2px;
}

/* ---------- Der Kalender-Layer (Overlay oder ganze Seite) ---------- */

.ak-ebene {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  background:
    radial-gradient(1100px 700px at 50% -8%, var(--ak-gruen-hell), var(--ak-gruen) 55%, var(--ak-gruen-dunkel) 100%);
  color: var(--ak-papier);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ak-ebene.ak-offen { display: flex; opacity: 1; }

/* Ganze Seite statt Overlay (kalender.html) */
.ak-ebene.ak-seite {
  display: flex;
  position: relative;
  min-height: 100vh;
  opacity: 1;
  z-index: 1;
}

body.ak-vollseite {
  margin: 0;
  background: var(--ak-gruen-dunkel);
}

/* sanft fallender Schnee */
.ak-hintergrund {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ak-schneeflocke {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: #ffffff;
  animation: ak-fallen linear infinite;
}

@keyframes ak-fallen {
  from { transform: translateY(-4vh) translateX(0); }
  50%  { transform: translateY(48vh) translateX(14px); }
  to   { transform: translateY(104vh) translateX(-8px); }
}

/* ---------- Kopfzeile ---------- */

.ak-kopf {
  position: relative;
  z-index: 2;
  padding: 26px 20px 10px;
  text-align: center;
  flex: 0 0 auto;
}

.ak-titel {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 600;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: 0.04em;
  color: var(--ak-papier);
}

.ak-titel .ak-jahr {
  color: var(--ak-gold-hell);
  margin-left: 10px;
}

.ak-trenner {
  width: 130px;
  height: 1px;
  margin: 12px auto 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--ak-gold), transparent);
}

.ak-untertitel {
  margin: 10px 0 0;
  font-size: clamp(13px, 1.6vw, 15px);
  color: var(--ak-papier);
  opacity: 0.78;
}

.ak-schliessen {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 225, 0.35);
  background: rgba(247, 241, 225, 0.06);
  color: var(--ak-papier);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ak-schliessen:hover {
  background: rgba(247, 241, 225, 0.14);
  border-color: var(--ak-gold-hell);
}

.ak-ebene.ak-seite .ak-schliessen { display: none; }

/* ---------- Die Pinwand ---------- */

.ak-wand {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 26px 16px 56px;
}

.ak-tafel {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;                       /* Holzrahmen */
  border-radius: 10px;
  background: linear-gradient(100deg,
    var(--ak-holz-1), var(--ak-holz-2) 28%, var(--ak-holz-1) 52%,
    var(--ak-holz-2) 76%, var(--ak-holz-1));
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

.ak-board {
  min-height: 420px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.05) 1.5px, transparent 2.5px),
    radial-gradient(circle at 68% 42%, rgba(0, 0, 0, 0.05) 1.5px, transparent 2.5px),
    radial-gradient(circle at 38% 74%, rgba(255, 255, 255, 0.04) 1.5px, transparent 2.5px),
    radial-gradient(circle at 84% 86%, rgba(0, 0, 0, 0.04) 1.5px, transparent 2.5px),
    var(--ak-kork);
  box-shadow:
    inset 0 2px 10px rgba(0, 0, 0, 0.4),
    inset 0 -2px 8px rgba(0, 0, 0, 0.25);
  padding: 34px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 30px 26px;
  justify-content: center;
  align-items: flex-start;
}

/* ---------- Tageskarte (Polaroid mit Reissnagel) ---------- */

.ak-tag {
  position: relative;
  background: var(--ak-papier);
  color: var(--ak-tinte);
  border-radius: 3px;
  padding: 30px 20px 18px;
  max-width: 100%;
  box-shadow: 0 7px 16px rgba(0, 0, 0, 0.35), 0 2px 4px rgba(0, 0, 0, 0.25);
}

.ak-r1 { transform: rotate(-1.3deg); }
.ak-r2 { transform: rotate(0.9deg); }
.ak-r3 { transform: rotate(-0.45deg); }

.ak-nadel {
  position: absolute;
  top: -9px;
  left: 50%;
  margin-left: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e76b5d, var(--ak-rot) 55%, var(--ak-rot-dunkel));
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.45);
}

.ak-datum {
  margin: 0 0 4px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ak-rot);
  text-align: center;
}

.ak-datumlinie {
  width: 46px;
  height: 2px;
  margin: 0 auto 14px;
  border: 0;
  background: var(--ak-gold);
  border-radius: 1px;
}

.ak-fotos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.ak-foto {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: 2px;
}

.ak-foto img {
  display: block;
  height: 160px;
  width: auto;
  max-width: 100%;
  border-radius: 2px;
  background: #e8e0cd;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ak-foto:hover img,
.ak-foto:focus-visible img {
  transform: scale(1.025);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
}

.ak-foto:focus-visible {
  outline: 2px solid var(--ak-gold);
  outline-offset: 3px;
}

/* Hinweiskarte am Ende der Wand */
.ak-hinweis {
  flex-basis: 100%;
  max-width: 620px;
  margin: 8px auto 0;
  padding: 16px 22px;
  border: 1px dashed rgba(201, 162, 39, 0.55);
  border-radius: 8px;
  color: var(--ak-papier);
  opacity: 0.85;
  font-size: 14px;
  text-align: center;
  font-style: italic;
  background: rgba(247, 241, 225, 0.04);
}

/* Startkarte, solange der Kalender noch geschlossen ist */
.ak-start {
  flex-basis: 100%;
  max-width: 460px;
  margin: 40px auto 0;
  background: var(--ak-papier);
  color: var(--ak-tinte);
  border-radius: 4px;
  padding: 38px 30px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.ak-start .ak-datum { font-size: 20px; margin-bottom: 6px; }
.ak-start p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; }

/* Fehlermeldung (z. B. kalender.json nicht gefunden) */
.ak-fehler {
  flex-basis: 100%;
  max-width: 560px;
  margin: 40px auto 0;
  background: var(--ak-papier);
  border-radius: 4px;
  padding: 26px 28px;
  color: var(--ak-rot);
  text-align: center;
  font-size: 14.5px;
  line-height: 1.6;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* ---------- Lichtkasten (Bildansicht gross) ---------- */

.ak-lichtkasten[hidden] { display: none; }   /* gewinnt ueber display:flex */

.ak-lichtkasten {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 10, 0.93);
  animation: ak-einblenden 0.2s ease;
}

@keyframes ak-einblenden {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.ak-lichtkasten figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 1200px);
  padding: 12px;
}

.ak-lichtkasten img {
  max-width: 100%;
  max-height: 76vh;
  border: 8px solid #ffffff;
  border-radius: 2px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
  background: rgba(255, 255, 255, 0.08);
}

.ak-lichtkasten figcaption {
  color: var(--ak-papier);
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 15px;
  opacity: 0.9;
}

.ak-lk-zu {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 225, 0.35);
  background: rgba(247, 241, 225, 0.06);
  color: var(--ak-papier);
  font-size: 22px;
  cursor: pointer;
}

.ak-lk-zu:hover { background: rgba(247, 241, 225, 0.14); }

.ak-lk-vor {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(247, 241, 225, 0.3);
  background: rgba(247, 241, 225, 0.07);
  color: var(--ak-papier);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.ak-lk-vor:hover { background: rgba(247, 241, 225, 0.16); }

.ak-lk-zurueck { left: 16px; }
.ak-lk-weiter { right: 16px; }

.ak-lk-zu:focus-visible,
.ak-lk-vor:focus-visible,
.ak-schliessen:focus-visible {
  outline: 2px solid var(--ak-gold);
  outline-offset: 2px;
}

/* ---------- Kleine Bildschirme ---------- */

@media (max-width: 640px) {
  .ak-wand { padding: 18px 10px 44px; }
  .ak-tafel { padding: 10px; }
  .ak-board { padding: 26px 14px; gap: 24px 18px; }
  .ak-tag { padding: 26px 14px 14px; flex: 1 1 100%; }
  .ak-foto img { height: 130px; }
  .ak-lichtkasten img { max-height: 66vh; border-width: 5px; }
  .ak-lk-vor { width: 46px; height: 46px; }
  .ak-lk-zurueck { left: 8px; }
  .ak-lk-weiter { right: 8px; }
}

/* Barrierefreiheit: Nutzer ohne Animationen sehen keinen Schnee */
@media (prefers-reduced-motion: reduce) {
  .ak-schneeflocke { display: none; }
  .ak-ebene, .ak-lichtkasten, .ak-foto img { transition: none; animation: none; }
}
