/* Calendar remains usable in the regular KRL theme with Christmas disabled. */
.advent-page { --advent-gold: var(--accent); --advent-cream: #e8f5f4; --advent-panel: #16313c; }
html.christmas-on .advent-page { --advent-gold: #efd18f; --advent-cream: #f5e8c9; --advent-panel: #14382f; }
main.advent-page { width: min(1280px,calc(100% - 2rem)); margin: 0 auto; padding-bottom: 4rem; }
.advent-hero { position: relative; text-align: center; padding: clamp(2rem,5vw,4rem) 1rem 2rem; }
.advent-hero .eyebrow { color: var(--advent-gold); font-size: .7rem; letter-spacing: .23em; }
.advent-hero h1 { font-size: clamp(2.7rem,6.8vw,6rem); line-height: 1.06; letter-spacing: -.045em; margin: 1rem auto; max-width: 17ch; padding: 0; }
.advent-hero h1 span { color: var(--advent-gold); }
.advent-hero p { color: #b9d0cf; max-width: 53ch; margin: 1rem auto; font-size: clamp(.9rem,1.5vw,1.06rem); }
.advent-hero-logo { width: 70px; height: 70px; margin-bottom: 1.4rem; }
.advent-landscape { display: block; width: 100%; height: clamp(155px,23vw,285px); object-fit: cover; object-position: center 65%; border-radius: 20px 20px 0 0; }
.advent-board { position: relative; padding: clamp(1rem,3vw,2.5rem); background: #102732; border: 1px solid #477a7b66; border-radius: 20px; }
html.christmas-on .advent-board { background: radial-gradient(ellipse at 50% 5%,#24483b60,transparent 70%),#102b2c; border-color: #bfa87366; border-radius: 0 0 20px 20px; }
.advent-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-bottom: 1.25rem; margin-bottom: 1rem; border-bottom: 1px solid #a7c6c433; }
.advent-toolbar h2 { font-size: .75rem; letter-spacing: .14em; line-height: 1.6; margin: 0; color: var(--advent-cream); }
#advent-progress { color: #c4d8d2; font-size: .75rem; }
.advent-status { min-height: 3rem; max-width: 70ch; margin: .7rem 0 1.25rem; color: var(--advent-cream); font-size: .87rem; }
.advent-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: clamp(.7rem,1.7vw,1.4rem); padding: .4rem .3rem 1.6rem; }
.advent-door {
  --door: #214951; position: relative; display: block; min-width: 0; height: clamp(158px,16vw,218px);
  padding: 0; margin: 0; border: 0; border-radius: 70px 70px 9px 9px;
  background: #071d23; color: var(--advent-cream); text-align: center; cursor: pointer;
  perspective: 900px; isolation: isolate; box-shadow: inset 0 0 0 1px #c2ad7666, 0 8px 12px #03141644;
}
.advent-door:nth-child(3n+2) { margin-top: 12px; }
html.christmas-on .advent-door--0 { --door: #714047; }
html.christmas-on .advent-door--1 { --door: #215042; }
html.christmas-on .advent-door--2 { --door: #284955; }
html.christmas-on .advent-door--3 { --door: #64434c; }
.advent-door-face {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .6rem; padding: 1.5rem .4rem 2.7rem; border: 1px solid #dfcf9b77; border-radius: inherit;
  background: linear-gradient(90deg,transparent 49%,#e6ce8c12 50%,transparent 51%),var(--door);
  transform-origin: left center; transform: rotateY(0); backface-visibility: hidden;
  box-shadow: inset 0 0 0 5px #061c2533,inset 0 0 0 6px #e8d49633;
  transition: transform .65s cubic-bezier(.2,.65,.2,1), box-shadow .3s;
}
.advent-door-face::before { content: ''; position: absolute; width: 5px; height: 9px; right: 12px; top: 57%; border-radius: 50%; background: #e1c58a; box-shadow: -1px 2px 3px #0006; }
.advent-door-face::after { content: ''; position: absolute; width: 80%; height: 9px; top: -3px; left: 10%; border-radius: 80% 70% 30% 40%; background: #daece0; opacity: .8; }
.advent-door-kicker { font-size: clamp(.49rem,.8vw,.62rem); letter-spacing: .16em; font-weight: 700; }
.advent-door-number { font-size: clamp(2.8rem,5vw,4.8rem); line-height: 1; font-weight: 750; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.advent-door-face > svg { width: 24px; height: 24px; stroke: currentColor; opacity: .8; }
.advent-door[data-day='24'] .advent-door-face { color: #f5e2b4; background-color: #655634; border-color: #f0d38d; }
.advent-door-state { position: absolute; z-index: 3; bottom: .65rem; left: .3rem; right: .3rem; display: flex; align-items: center; justify-content: center; gap: .35rem; color: #e0ece4; font-size: clamp(.58rem,.85vw,.72rem); line-height: 1.3; }
.advent-door-state svg { width: 12px; height: 12px; flex: 0 0 12px; }
.advent-door.is-locked .advent-door-face { filter: saturate(.55) brightness(.76); }
.advent-door.is-locked .advent-door-state { color: #e3e9df; }
.advent-door:not(.is-locked) { box-shadow: 0 0 18px #e3c77c20, 0 8px 12px #03141644; }
.advent-door:not(.is-locked):hover .advent-door-face { transform: rotateY(-12deg); }
.advent-door.is-opened .advent-door-face,
.advent-door.is-opened:hover .advent-door-face { transform: rotateY(-86deg); }
.advent-door.is-opened { z-index: 4; }
.advent-door:focus-visible { outline: 3px solid var(--advent-gold); outline-offset: 5px; z-index: 5; }
.advent-reveal { position: absolute; inset: .5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .7rem; padding-bottom: 1.8rem; border: 1px dashed #e4cf8b44; border-radius: inherit; background: radial-gradient(circle,#30584b88,transparent 80%); }
.advent-reveal img { width: 64px; height: 64px; object-fit: contain; }
.advent-reveal > span { color: #d3e3db; font-size: .6rem; letter-spacing: .18em; }
.advent-footnote { color: #afc8c1; max-width: 70ch; margin: 1.5rem auto .5rem; text-align: center; font-size: .76rem; }
.advent-explainer { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; margin: 1.5rem 0; }
.advent-explainer article { padding: 1.5rem; border: 1px solid #a8bdae33; border-radius: 12px; background: #132d34; }
.advent-explainer h2 { font-size: 1rem; color: var(--advent-gold); margin: 0 0 .75rem; line-height: 1.4; }
.advent-explainer p { margin: 0; color: #c1d1ce; font-size: .83rem; }
.advent-dialog { width: min(540px,calc(100% - 2rem)); max-height: calc(100dvh - 2rem); padding: clamp(1.5rem,4vw,2.5rem); border: 1px solid #d5bf83; border-radius: 20px; background: #142f35; color: #f4efdf; overflow-y: auto; box-shadow: 0 24px 100px #0009; }
.advent-dialog::backdrop { background: #03121bd9; backdrop-filter: blur(6px); }
.advent-dialog-brand { width: 72px; height: 72px; margin: 0 0 1.2rem; }
.advent-dialog h2 { font-size: clamp(1.8rem,5vw,2.5rem); margin: .5rem 0 1.5rem; line-height: 1.15; }
#advent-dialog-date { color: #e8cc8a; font-size: .7rem; letter-spacing: .05em; }
.advent-close { position: absolute; top: .75rem; right: .75rem; min-width: 44px; min-height: 44px; border: 1px solid #a6bba977; border-radius: 50%; color: #eee8d7; background: #1c3e40; cursor: pointer; font-size: 1.8rem; line-height: 1; }
.advent-placeholder { font-size: 1.2rem; line-height: 1.6; color: #f3e5c5; }
.advent-muted { color: #bdceca; font-size: .85rem; line-height: 1.7; }
.advent-question-text { font-size: clamp(1.2rem,2.4vw,1.5rem); line-height: 1.5; font-weight: 700; margin: 0 0 1.4rem; overflow-wrap: anywhere; }
.advent-answer-link { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; max-width: 100%; padding: .8rem 1.1rem; margin: 0 0 1rem; border: 1px solid var(--advent-gold); border-radius: 10px; color: #142b31; background: var(--advent-gold); text-align: center; text-decoration: none; font-weight: 800; font-size: .87rem; line-height: 1.35; }
.advent-answer-link:hover { filter: brightness(1.08); }
.advent-answer-link:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
@media (max-width: 1000px) { .advent-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } .advent-door { height: 190px; } }
@media (max-width: 650px) {
  .advent-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: .8rem; }
  .advent-door { height: 160px; }
  .advent-door-number { font-size: 3rem; }
  .advent-door-face { padding-top: 1.4rem; gap: .4rem; }
  .advent-door-face > svg { width: 20px; height: 20px; }
  .advent-door-kicker { font-size: .47rem; letter-spacing: .07em; }
  .advent-door-state { font-size: .57rem; }
  .advent-explainer { grid-template-columns: 1fr; }
  .advent-hero { padding-inline: 0; }
}
@media (max-width: 370px) { .advent-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (prefers-reduced-motion: reduce) { .advent-door-face { transition: none; } }

.advent-hero h1 { text-transform: none; }
.advent-door-face::after { width: 100%; height: 80px; top: -3px; left: 0; border-radius: 70px 70px 20% 20%; background: none; border-top: 5px solid #dcece3; }

.advent-landscape { height: auto; aspect-ratio: 1200/430; object-fit: contain; }

/* Reserve the asynchronous grid before paint, including normal-mode visits. */
html.js .advent-grid:empty { min-height: calc(4 * (clamp(158px,16vw,218px) + 12px) + 3 * clamp(.7rem,1.7vw,1.4rem) + 2rem); }
.advent-reveal > .advent-reveal-day { font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; line-height: 1; color: var(--advent-cream); }
@media (max-width: 1000px) { html.js .advent-grid:empty { min-height: calc(6 * 202px + 5 * clamp(.7rem,1.7vw,1.4rem) + 2rem); } }
@media (max-width: 650px) { html.js .advent-grid:empty { min-height: calc(8 * 172px + 7 * .8rem + 2rem); } }
@media (max-width: 370px) { html.js .advent-grid:empty { min-height: calc(12 * 172px + 11 * .8rem + 2rem); } }
