/*
 * christmas/base.css: the BASE layer of the Christmas look (config/season.php; R-A-0983: yearly, layered).
 *
 * Reused every year. Linked by layouts/app.blade.php while App\Support\Season says 'christmas',
 * before that season's year layer (christmas/<year>.css), which builds on it and is the one file
 * swapped each year. Base holds the quiet structure: the tokens, the gold hairline and holly on the
 * site bar, and the footer band (garland, greeting, ribbon). EVERY selector starts with
 * html[data-season="christmas"], so the sheet does nothing if it is ever linked by mistake. Navy and
 * gold stay the identity; evergreen and oxblood are seasoning (a ribbon, a dot), well under 5% of any
 * view, except the holly on the logo. The snow is the one script: <snow-fall>, a vendored MIT web component
 * (public/js/vendor/snow-fall.js, linked by the layout only while the theme is on; Master 2026-11-18); this sheet
 * places it and switches it off. No glitter, no web font, no other script. The line drawings
 * (public/images/season/christmas/base/) were drawn for this site and are painted through a mask, so
 * each takes its colour from a token and follows the light and dark themes.
 *
 * Never here (nor in a year layer): a height, padding, margin or top on the header (the clearance
 * tests pin 64px and 68px), a recolour of --gold-ink, --text-muted or --secondary, anything on the
 * forms, the colour-vision filter, or the portal and admin (they never link this).
 * SeasonThemeTest pins all of that for every file in public/css/season/christmas/.
 */

/* ── Tokens. Declared for light and again for dark. ───────────────────────── */
html[data-season="christmas"] {
  --season-evergreen: #1E3A2F;   /* ground for the ribbon; 9.56:1 vs --bg-page, 12.34:1 vs white; ribbon text --secondary-light on it 7.62:1 */
  --season-berry: #7A1F2B;       /* decorative dots only, never text */
  --season-line: var(--gold-ink); /* line-art stroke on paper */
}
html[data-season="christmas"][data-theme="dark"] {
  --season-evergreen: #1E3A2F;
  --season-berry: #7A1F2B;
  --season-line: var(--secondary); /* on navy */
}

/* ── Header: a 1px gold hairline under the fixed nav (no height change) and holly on the logo.
   Scoped to body > header, the site bar: post spreads use <header class="spr-head"> inside the article,
   and the estimate hero is a <header class="page-hero">; neither may pick up the hairline.
   .nav-brand's ::before and ::after belong to the brand shine (and it clips with overflow:hidden) and the
   header's ::after to the reader's focus veil (blog-reader.css), so the holly hangs on the nav's ::after:
   absolute, so it takes no room in the nav's flex row and cannot change the header's height. Its left edge
   is the nav's own padding plus the logo (40px image) or the blog's seal (44px), so it sits beside either. ── */
html[data-season="christmas"] body > header {
  background-image: linear-gradient(var(--secondary), var(--secondary));
  background-repeat: no-repeat;
  background-size: 100% 1px;
  background-position: left bottom;
}
/* Holly on the logo (Master 2026-11-18: the 16px gold sprig read as "one small yellow thing"):
   two leaves and three berries in their own colours (a background image, not a mask), hung on the
   logo's top-right corner. Still on the nav's ::after, absolute, so the header's height cannot move. */
html[data-season="christmas"] body > header nav::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset-inline-start: calc(2rem + 22px);
  top: 0px;
  width: 34px;
  height: 34px;
  background: url("/images/season/christmas/base/holly.svg") no-repeat center / contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
  transform: rotate(12deg);
  pointer-events: none;
}
@media (max-width: 960px) {
  html[data-season="christmas"] body > header nav::after { top: 4px; }
}
/* The blog's paper header: a 44px seal at the nav's own padding. */
html[data-season="christmas"] body > header nav:has(.v3-seal)::after {
  inset-inline-start: calc(var(--v3-pad, 24px) + 21px);
  top: 3px;
}

/* ── Footer band: a garland hung from the band's top rule, then the greeting, above the copyright bar.
   The rule is the rail (gold, as wide as the band, matching the certificates rule above it). The garland
   cancels the band's padding so it spans the rail end to end and touches it; mask-repeat round fits a
   whole number of swags, so a swag's anchor lands on each end of the rail at every width, and a holly
   cluster (the logo's) ties off each end (Master 2026-11-18: nothing ends in mid-air). ── */
html[data-season="christmas"] .season-footer {
  position: relative;
  max-width: 1200px;
  margin: 1.25rem auto 0;
  padding: 1.5rem 2rem 0.25rem;
  text-align: center;
  border-top: 1px solid color-mix(in srgb, var(--secondary) 45%, transparent);
}
html[data-season="christmas"] .season-footer__garland {
  height: 40px;
  margin: -1.5rem -2rem 0;
  background: var(--secondary);
  -webkit-mask: url("/images/season/christmas/base/garland-band.svg") 0 0 / 176px 40px round no-repeat;
  mask: url("/images/season/christmas/base/garland-band.svg") 0 0 / 176px 40px round no-repeat;
}
/* The holly ties sit on the band, not on the garland: the garland is masked, which would cut them away. */
html[data-season="christmas"] .season-footer::before,
html[data-season="christmas"] .season-footer::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: -15px;
  left: 0;
  width: 32px;
  height: 32px;
  background: url("/images/season/christmas/base/holly.svg") no-repeat center / contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
  pointer-events: none;
}
html[data-season="christmas"] .season-footer::after {
  left: auto;
  right: 0;
  transform: scaleX(-1);
}
html[data-season="christmas"] .season-footer__greeting {
  margin: 0.75rem auto 0;
  max-width: 40rem;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--secondary); /* 8.2:1 on the footer navy */
}
html[data-season="christmas"] .season-footer__ribbon {
  display: inline-block;
  margin: 0.25rem auto 1rem;
  padding: 0.3rem 1rem;
  background: var(--season-evergreen);
  color: var(--secondary-light);
  font-family: "DM Sans", sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}
html[data-season="christmas"] .season-footer__ribbon::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 0.6rem;
  border-radius: 50%;
  background: var(--season-berry);
  box-shadow: 0 0 0 1px var(--secondary-light); /* keeps the dot visible on the green */
  vertical-align: middle;
}
@media (max-width: 575px) {
  html[data-season="christmas"] .season-footer { padding-inline: 1.25rem; }
  html[data-season="christmas"] .season-footer__garland { margin-inline: -1.25rem; }
  html[data-season="christmas"] .season-footer__greeting { font-size: 1.05rem; }
}

/* ── Snow (Master 2026-11-18: "add a snowfall effect too please. an overlay", then "use it": zachleat/snow-fall).
   The layout renders <snow-fall mode="page"> as a body child outside <main>; the component draws its flakes in
   its own shadow root. Here: a layer over the TOP of the page only (Master 2026-11-18: "only for the top part of
   the page. its hard to actually read it"): pinned to the document top, one screen tall, fading out at its foot,
   so it snows over the hero and scrolls away with it and the reading below stays clear. Clipped, so a drifting
   flake can never add a horizontal scroll; above the hero but below the site bar (2000), its menus and every
   modal, and it never takes a click. Pale ice on the paper theme so a flake reads on cream and on a photo; white on dark.
   Gone under reduced motion, in print and in Focus mode. ── */
html[data-season="christmas"] snow-fall {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
  z-index: 1500;
  overflow: hidden;
  pointer-events: none;
  --snow-fall-color: rgba(196, 213, 235, 0.95);
  --snow-fall-size: 9px;
}
html[data-season="christmas"][data-theme="dark"] snow-fall {
  --snow-fall-color: rgba(255, 255, 255, 0.85);
}
@media (prefers-reduced-motion: reduce) {
  html[data-season="christmas"] snow-fall { display: none; }
}
@media print {
  html[data-season="christmas"] snow-fall { display: none; }
}
html[data-season="christmas"][data-rd-mode="focus"] snow-fall { display: none; }
