/* ==========================================================================
   Feinschliff: mehr Wärme und Liebe zum Detail
   Papier mit Lichtverlauf, Zierlinien und -ecken, ein Umschlag mit Wachs,
   Zweig und Handschrift, ein Nachthimmel mit funkelnden Sternen und Mond.
   Wird nach book.css geladen.
   ========================================================================== */

/* ---------- Papier: Licht von oben, warme Ränder ---------- */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--paper) 55%, #fff) 0%, transparent 60%),
    radial-gradient(140% 120% at 50% 50%, transparent 55%, color-mix(in srgb, var(--paper) 88%, var(--gold)) 100%);
  background-attachment: fixed;
}
body::before { opacity: .65; }

/* ---------- Nacht: tiefer Himmel, Sterne, Mond ---------- */
.night body {
  background-image:
    radial-gradient(90% 60% at 80% 0%, color-mix(in srgb, var(--paper) 70%, #3b4a8a) 0%, transparent 60%),
    linear-gradient(to bottom, color-mix(in srgb, var(--paper) 80%, #000) 0%, var(--paper) 45%, color-mix(in srgb, var(--paper) 85%, #3a2a5a) 100%);
}
#sky .star { fill: #fff6dc; }
#sky .bright circle { fill: #fff6dc; }
#sky .bright path { stroke: #fff6dc; stroke-width: .08; opacity: .7; }
.night #sky .tw0 { animation: twinkle 4.2s ease-in-out infinite; }
.night #sky .tw1 { animation: twinkle 5.6s ease-in-out 1.3s infinite; }
.night #sky .tw2 { animation: twinkle 7s ease-in-out 2.7s infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
#sky .shooting { stroke: #fff6dc; stroke-width: .12; stroke-linecap: round; opacity: 0; stroke-dasharray: 14; stroke-dashoffset: 14; }
.night #sky .shooting { animation: shoot 17s ease-out 6s infinite; }
@keyframes shoot {
  0%, 92% { opacity: 0; stroke-dashoffset: 14; }
  93% { opacity: .9; }
  97% { opacity: .6; stroke-dashoffset: 0; }
  100% { opacity: 0; stroke-dashoffset: -14; }
}
#sky .sky-moon {
  position: absolute; top: 4.6rem; left: 9%;
  width: 44px; height: 44px;
  filter: drop-shadow(0 0 10px rgba(246, 235, 200, .45));
}
#sky .sky-moon .lit { fill: #f6ebc8; }
#sky .sky-moon .disc { fill: rgba(246, 235, 200, .06); stroke: rgba(246, 235, 200, .3); }

/* ---------- Kopf: Zierecken und Vignette ---------- */
.day-head { position: relative; padding-top: 1.1rem; }
.day-head .corner-l, .day-head .corner-r { position: absolute; top: 0; width: 2.4rem; height: 2.4rem; color: var(--gold); opacity: .8; }
.day-head .corner-l { left: 0; }
.day-head .corner-r { right: 0; transform: scaleX(-1); }
.corner { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: .9; stroke-linecap: round; }
.corner .solid { fill: currentColor; stroke: none; }
.head-vignette, .env-vignette { display: flex; justify-content: center; color: var(--gold); margin-top: .55rem; }
.head-vignette svg, .env-vignette svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.day-head h1 { font-size: 1.9rem; letter-spacing: .005em; }
.day-head .chapter { color: var(--accent2); }
.day-head .chapter .moon { width: 13px; height: 13px; }

/* ---------- Zierlinie: Goldlinien, die zur Mitte hin auslaufen, mit Ranke ---------- */
.rule { gap: .4rem; margin: 1.5rem 0; }
.rule::before { border: 0; height: .5px; background: linear-gradient(to right, transparent, var(--gold)); }
.rule::after { border: 0; height: .5px; background: linear-gradient(to left, transparent, var(--gold)); }
.flourish { width: 96px; height: 19px; flex: none; fill: none; stroke: var(--gold); stroke-width: .9; stroke-linecap: round; }
.flourish .solid { fill: var(--gold); stroke: none; }

/* ---------- Strauß: Licht dahinter, Schatten darunter ---------- */
.bouquet { position: relative; isolation: isolate; }
.bouquet::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: .5rem; width: 19rem; height: 19rem; translate: -50% 0;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--card) 90%, #fff) 0%, color-mix(in srgb, var(--card) 40%, transparent) 45%, transparent 70%);
  border-radius: 50%;
}
.bouquet .bq { filter: drop-shadow(0 10px 10px rgba(60, 40, 20, .12)); }
.night .bouquet::before { background: radial-gradient(circle at 50% 45%, rgba(246, 235, 200, .09) 0%, transparent 65%); }
.bouquet .flower-name { font-size: 1.55rem; }
.bouquet .flower-meaning { font-size: .86rem; letter-spacing: .12em; }

/* Link zur Wikipedia unter der Blume */
.flower-more { margin-top: .35rem; font-size: .95rem; font-style: italic; }
.flower-more a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .25em; }
.flower-more a::after { content: " ↗"; font-style: normal; font-size: .8em; color: var(--gold); }
.flower-more a:hover { color: var(--accent2); }

/* ---------- Karten: Beschriftung mit feiner Linie ---------- */
.card .eyebrow, .question .eyebrow.section-title, .tasks .section-title {
  display: flex; align-items: center; gap: .6rem; color: var(--accent2);
}
.card .eyebrow::after, .question .eyebrow.section-title::after, .tasks .section-title::after {
  content: ""; width: 2rem; height: .5px; background: var(--gold);
}
.card .text { font-size: 1.28rem; }
.card.quote .text { font-size: 1.24rem; }

/* ---------- Frage: ein Hauch Briefpapier ---------- */
.question { padding: 1rem 1rem .9rem; margin: 0 -.4rem; background: color-mix(in srgb, var(--card) 55%, transparent); border-left: 1.5px solid color-mix(in srgb, var(--accent2) 55%, transparent); }
.ask-carl { padding: 0 .6rem; }

/* ---------- Notiz von Richard ---------- */
.note { font-size: 1.7rem; }
.note-sign { position: relative; }
.note-sign::after { content: ""; position: absolute; left: -.2rem; right: -.4rem; bottom: .05rem; height: 1px; background: currentColor; opacity: .5; rotate: -3deg; }

/* ---------- Countdown in einer kleinen Kartusche ---------- */
.countdown span {
  position: relative; display: inline-block; padding: .4rem 1.4rem;
  border-top: .5px solid var(--gold); border-bottom: .5px solid var(--gold);
}
.countdown span::before, .countdown span::after {
  content: ""; position: absolute; top: 50%; width: .42rem; height: .42rem; background: var(--gold); rotate: 45deg; translate: 0 -50%;
}
.countdown span::before { left: -.25rem; }
.countdown span::after { right: -.25rem; }
.tomorrow::before { content: "✦ "; color: var(--gold); }

/* ---------- Navigation: Punkt unter dem aktiven Eintrag ---------- */
#tabs button { position: relative; }
#tabs button[aria-current="page"]::after {
  content: ""; position: absolute; bottom: .55rem; left: 50%; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent2); translate: -50% 0;
}

/* ---------- Umschlag ---------- */
.envelope-stage { gap: 1.1rem; }
.envelope-stage .for { font-size: 1.9rem; font-style: italic; font-weight: 400; }
.envelope-stage .env-vignette { margin-top: -.4rem; }
.envelope { width: min(100%, 22rem); rotate: -1.2deg; transition: rotate .4s var(--ease), translate .4s var(--ease); }
.envelope:not(.static):hover { rotate: 0deg; translate: 0 -3px; }
.envelope svg { filter: drop-shadow(0 18px 22px rgba(60, 40, 20, .22)) drop-shadow(0 2px 3px rgba(60, 40, 20, .12)); }
.night .envelope svg { filter: drop-shadow(0 18px 26px rgba(0, 0, 0, .5)); }
.envelope .body, .envelope .flap { fill: url(#paper-grad); }
.envelope .paper-top { stop-color: color-mix(in srgb, var(--card) 70%, #fff); }
.envelope .paper-bottom { stop-color: color-mix(in srgb, var(--card) 86%, var(--gold)); }
.night .envelope .paper-top { stop-color: color-mix(in srgb, var(--card) 80%, #fff 8%); }
.night .envelope .paper-bottom { stop-color: var(--card); }
.envelope .flap-shadow { fill: none; stroke: rgba(60, 40, 20, .1); stroke-width: 3; }
.envelope .lining { fill: none; stroke: var(--gold); stroke-width: .7; stroke-dasharray: 2 2.5; opacity: .7; }
.envelope .wax { fill: url(#wax-grad); }
.envelope .wax-hi { stop-color: color-mix(in srgb, var(--seal) 65%, #fff); }
.envelope .wax-mid { stop-color: var(--seal); }
.envelope .wax-lo { stop-color: color-mix(in srgb, var(--seal) 60%, #000); }
.envelope .wax-ring { stroke: rgba(255, 255, 255, .22); }
.envelope .wax-ring.inner { stroke: rgba(0, 0, 0, .18); }
.envelope .emboss { fill: rgba(0, 0, 0, .35); }
.envelope .seal-num { font-size: 26px; font-style: italic; }
.envelope .seal-mono { font-size: 36px; }
.envelope .env-to { font-family: var(--hand); font-size: 24px; fill: var(--accent); }
.envelope .twig { fill: none; stroke: #7a5a3a; stroke-width: 1.4; stroke-linecap: round; }
.envelope .needle { fill: color-mix(in srgb, var(--accent) 80%, #4f7a55); stroke: none; }
.night .envelope .needle { fill: #7fa685; }
.envelope .berry { fill: var(--accent2); }
.night .envelope .twig { stroke: #b39470; }
.envelope.opening .env-sprig { transition: opacity .4s; opacity: 0; }

.env-pager { display: flex; justify-content: space-between; width: min(100%, 22rem); margin-top: .4rem; }
.env-nav {
  display: inline-flex; align-items: center; gap: .2rem; min-height: 44px; padding: 0 .4rem;
  font-family: var(--serif); font-variant: small-caps; text-transform: lowercase; letter-spacing: .14em; font-size: .95rem; color: var(--muted);
}
.env-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.env-nav:hover:not(:disabled) { color: var(--accent2); }
.env-nav:disabled { opacity: .25; cursor: default; }

/* ---------- Weniger Bewegung ---------- */
@media (prefers-reduced-motion: reduce) {
  .night #sky .tw0, .night #sky .tw1, .night #sky .tw2, .night #sky .shooting { animation: none; }
  .envelope { rotate: 0deg; }
}

/* ---------- Admin: Aktivität ---------- */
ul.adm-list { list-style: none; padding: 0; margin: .5rem 0 0; }
ul.adm-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.adm-timeline { list-style: none; padding: 0; margin: .5rem 0 0; }
.adm-timeline li { display: grid; grid-template-columns: 9.5rem 1fr; gap: .6rem; padding: .3rem 0; border-bottom: .5px dotted color-mix(in srgb, var(--gold) 30%, var(--paper)); }
.adm-timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
@media (max-width: 420px) { .adm-timeline li { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Admin: Alle Tage ---------- */
.cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.4rem 1.6rem; margin-top: 1rem; }
.cal-title { font-variant: small-caps; letter-spacing: .06em; font-size: 1.05rem; margin: 0 0 .4rem; color: var(--accent); }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-head span { text-align: center; font-size: .72rem; color: var(--muted); }
.cal-day { position: relative; aspect-ratio: 1; border: .5px solid color-mix(in srgb, var(--gold) 35%, var(--paper)); border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.cal-day small { font-size: .6rem; color: var(--accent); margin-top: 1px; }
.cal-day:hover { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.cal-day.is-future { color: var(--muted); }
.cal-day.is-opened { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cal-day.is-special { border-color: var(--accent); border-width: 1px; }
.cal-day.is-today { outline: 2px solid var(--gold); outline-offset: 1px; font-weight: 600; }
.cal-day[aria-pressed="true"] { background: var(--accent); color: var(--paper); }
.cal-day[aria-pressed="true"] small { color: var(--paper); }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.cal-key { display: inline-block; width: .9rem; height: .9rem; border-radius: 3px; border: .5px solid color-mix(in srgb, var(--gold) 35%, var(--paper)); vertical-align: middle; margin-left: .4rem; }
.cal-key.is-opened { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cal-key.is-special { border: 1px solid var(--accent); }
.cal-key.is-today { outline: 2px solid var(--gold); }
.adm-dayinfo { position: sticky; top: 0; z-index: 2; background: var(--paper); }
