/* advent.css — Adventskalenner (advent.html), on top of gitter.css. Class prefix adv- (gitter.css flattens generic names like .tile/.card/.panel).
 * One extra accent: Christmas red (--xmas), only on door numbers and the Kleeschen / Hellegowend tags. Mobile first (375px). */
body.gt.adv { --xmas: #b3261e; }
html[data-theme="dark"] body.gt.adv { --xmas: #ee706a; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) body.gt.adv { --xmas: #ee706a; } }

body.adv-lock { overflow: hidden; }
.adv-page .gt-nav { padding-inline: 14px !important; }
.adv-text { font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.adv-small { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.adv-msg { gap: 10px; }

/* ---- intro ---- */
.adv-intro { align-items: flex-start; justify-content: flex-start !important; gap: 14px !important; padding: 22px 20px !important; }
.adv-countdown { color: var(--xmas); font-weight: 600; font-size: 14.5px; min-height: 1.4em; }
.adv-alt[hidden] { display: none; }

/* ---- door grid: a hairline grid of 3 columns (4 from 600px, 6 from 900px) ---- */
.adv-grid-wrap { padding: 0 !important; }
.adv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--soft); width: 100%; }
.adv-grid li { display: flex; }
.adv-door { all: unset; box-sizing: border-box; width: 100%; min-height: 112px; padding: 10px; display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; align-items: flex-start; background: var(--white); cursor: pointer; touch-action: manipulation; position: relative; overflow: hidden; }
.adv-door:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }
.adv-door[disabled] { cursor: default; }
.adv-num { font: 500 clamp(26px, 8vw, 34px)/1 "Geist Mono", ui-monospace, monospace; letter-spacing: -0.04em; color: var(--xmas); }
.adv-door-state { font: 500 12px/1.2 "Geist Mono", ui-monospace, monospace; color: var(--muted); margin-top: auto; }
.adv-door-sub { font: 500 11.5px/1.3 "Geist Mono", ui-monospace, monospace; color: var(--xmas); overflow-wrap: anywhere; }
.adv-admin-preview { color: var(--muted); font-weight: 400; opacity: .85; }
.adv-tag { font-size: 11.5px; font-weight: 700; color: var(--xmas); line-height: 1.2; }
.adv-door.locked .adv-num { color: var(--muted); }
.adv-door.locked { background: var(--sunk); }
.adv-door.ready { box-shadow: inset 0 0 0 2px var(--green); animation: adv-pulse 2.4s ease-in-out infinite; }
.adv-door.ready .adv-door-state { color: var(--green); font-weight: 600; font-size: 13px; }
.adv-door.done { background: var(--tint); }
.adv-door-gifts { display: flex; flex-direction: column; gap: 2px; margin-top: auto; font: 500 12px/1.3 "Geist", system-ui, sans-serif; color: var(--green); overflow-wrap: anywhere; }
@keyframes adv-pulse { 0%, 100% { box-shadow: inset 0 0 0 2px var(--green); } 50% { box-shadow: inset 0 0 0 5px var(--green); } }
@media (min-width: 600px) { .adv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .adv-door { min-height: 130px; } }
@media (min-width: 900px) { .adv-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* ---- sheet ---- */
.adv-sheet { position: fixed; inset: 0; z-index: 9000; background: var(--paper); color: var(--ink); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.adv-sheet[hidden] { display: none; }
.adv-sheet-inner { max-width: 640px; margin: 0 auto; padding: 0 20px calc(48px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.adv-sheet-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding-top: env(safe-area-inset-top); background: var(--paper); border-bottom: 1px solid var(--line); margin: 0 -20px; padding-inline: 14px; }
.adv-back { border: 0; background: none; cursor: pointer; font-family: inherit; font-size: 15px; padding: 0 6px; min-height: 44px; color: var(--ink); }
.adv-sheet-day { font: 500 14px/1 "Geist Mono", ui-monospace, monospace; color: var(--xmas); margin-top: 8px; }
.adv-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
.adv-sheet-inner .gt-btn { align-self: flex-start; }

/* ---- door + gift animation ---- */
.adv-stage { display: grid; place-items: center; padding: 8px 0; }
.adv-frame { position: relative; width: 150px; height: 190px; border: 3px solid var(--ink); background: var(--tint); display: grid; place-items: center; perspective: 600px; overflow: hidden; }
.adv-glow { font-size: 64px; line-height: 1; animation: adv-pop .7s .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.adv-leaf { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--xmas); border: 2px solid var(--ink); animation-duration: .7s; animation-timing-function: ease-in-out; animation-fill-mode: forwards; }
.adv-leaf-l { left: 0; transform-origin: left center; animation-name: adv-swing-l; }
.adv-leaf-r { right: 0; transform-origin: right center; animation-name: adv-swing-r; }
@keyframes adv-swing-l { to { transform: rotateY(-115deg); } }
@keyframes adv-swing-r { to { transform: rotateY(115deg); } }
@keyframes adv-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.adv-gifts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.adv-gift { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--green); background: var(--white); }
.adv-gifts.fresh .adv-gift { animation: adv-rise .5s both; }
.adv-gifts.fresh .adv-gift:nth-child(2) { animation-delay: .1s; }
.adv-gifts.fresh .adv-gift:nth-child(3) { animation-delay: .2s; }
.adv-gifts.fresh .adv-gift:nth-child(4) { animation-delay: .3s; }
@keyframes adv-rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
.adv-gift-text { font-size: 17px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  .adv-door.ready, .adv-glow, .adv-leaf, .adv-gifts.fresh .adv-gift { animation: none !important; }
  .adv-leaf { display: none; }
}
