/* Advent calendar page only (templates/advent.html). Kept out of site.css so that adding it changes no other page.
   Without scripts every door is open (the page as built). advent.js sets .adv-js on <html> before the first paint,
   then marks the doors: .is-open (their day has come), .is-today, and leaves the others closed. */

.adv-status { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 12px 18px; border-radius: var(--r); background: var(--lav-100); color: var(--primary); font-weight: 700; }
.adv-status .ico { flex: none; }

/* The door of the day (December) or the wreath (November) */
.adv-feature { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: center; margin: 0 0 34px; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.adv-feature-img { display: block; aspect-ratio: 3 / 4; border-radius: var(--r); border: 1px solid var(--line); background: #fff; overflow: hidden; }
.adv-feature-img img { width: 100%; height: 100%; object-fit: contain; padding: 5%; }
.adv-feature-body h2 { margin: 0 0 10px; font-size: 1.6rem; letter-spacing: -.02em; }
.adv-feature-body p { margin: 0 0 16px; color: var(--ink-2); }
.adv-feature-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 700px) {
  .adv-feature { grid-template-columns: 1fr; gap: 16px; padding: 16px; }
  .adv-feature-img { max-width: 260px; margin: 0 auto; width: 100%; }
  .adv-feature-body h2 { font-size: 1.3rem; }
  .adv-feature-actions .btn { flex: 1 1 100%; }
}

/* The 24 doors */
.adv-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; list-style: none; margin: 0 0 40px; padding: 0; }
@media (max-width: 1000px) { .adv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .adv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; } }
.adv-door { min-width: 0; }
.adv-face { position: relative; display: flex; flex-direction: column; height: 100%; padding: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.adv-face[href]:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.adv-face img { display: block; width: 100%; aspect-ratio: 3 / 4; height: auto; object-fit: contain; border-radius: var(--r-sm); background: #fff; }
.adv-num { position: absolute; top: 4px; left: 4px; z-index: 1; min-width: 30px; height: 30px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 800; font-size: .9rem; box-shadow: var(--shadow); }
.adv-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; padding: 0 2px; font-size: .8rem; font-weight: 700; line-height: 1.25; }
.adv-when { display: none; }
@media (max-width: 560px) { .adv-face { padding: 5px; } .adv-title { font-size: .7rem; } .adv-num { min-width: 26px; height: 26px; font-size: .8rem; } }

/* Scripts on: a door stays closed until advent.js opens it */
.adv-js .adv-door:not(.is-open) .adv-face { align-items: center; justify-content: center; min-height: 0; aspect-ratio: 3 / 4; background: var(--lav-100); border: 2px dashed var(--lav-300); box-shadow: none; cursor: default; }
.adv-js .adv-door:not(.is-open) .adv-face img,
.adv-js .adv-door:not(.is-open) .adv-title { display: none; }
.adv-js .adv-door:not(.is-open) .adv-num { position: static; min-width: 0; height: auto; padding: 0; background: none; box-shadow: none; color: var(--primary); font-size: 2.1rem; line-height: 1; }
.adv-js .adv-door:not(.is-open) .adv-when { display: block; margin-top: 6px; padding: 0 4px; text-align: center; font-size: .68rem; font-weight: 600; color: var(--muted); line-height: 1.2; }
.adv-js .adv-door.is-today .adv-face { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-50), var(--shadow-hover); }
.adv-js .adv-door.is-today .adv-num { background: var(--coral); }
@media (max-width: 560px) {
  .adv-js .adv-door:not(.is-open) .adv-num { font-size: 1.6rem; }
  .adv-js .adv-door:not(.is-open) .adv-when { font-size: .6rem; }
}

/* The printable sheet */
.adv-sheet .pr-previews { grid-template-columns: minmax(0, 420px); }
.adv-sheet-h { margin: 0; font-size: 1.25rem; }
.adv-sheet-p { margin: 0 0 4px; font-size: .92rem; color: var(--ink-2); }
/* one column on small screens: minmax(0, …) so the wide preview picture cannot stretch the column past the screen */
@media (max-width: 860px) { .adv-sheet { grid-template-columns: minmax(0, 1fr); } .adv-sheet .pr-previews { grid-template-columns: minmax(0, 1fr); } }
