/* Christmas accents. Each accent shows while its name is in <html data-accents="...">. The
   script in <head> sets that every year from Dec 7 through Dec 28, Eastern time (content.json
   holds the dates and the accents), and a double tap on the big "Jazz" turns them on early as
   a preview (main.js). The art is in christmas/, drawn by scripts/make-christmas-art.mjs.
   Motion plays only without a reduced-motion preference. */

/* The big "Jazz" takes the double tap, so it neither zooms nor selects its letters. */
[data-season] .mast {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* ornaments: three glass ornaments hang from the top edge of each section band, behind the title. */
[data-accents~="ornaments"] .band { position: relative; isolation: isolate; }
[data-accents~="ornaments"] .band::after {
  content: "";
  position: absolute; z-index: -1; top: 0; right: max(12px, calc(var(--gutter) - 4px));
  width: 96px; aspect-ratio: 148 / 124;
  background: url(christmas/ornaments.svg) top / contain no-repeat;
  pointer-events: none;
}

/* candy: the striped rule beside each menu heading becomes a candy-cane stick. */
[data-accents~="candy"] .mc h3::after {
  height: 12px;
  border: 2px solid var(--cocoa);
  border-radius: 999px;
  background: repeating-linear-gradient(-60deg, var(--pink-deep) 0 5px, var(--print-white) 5px 10px);
}

/* snow: two layers of flakes drift down the pink bands; the big near flakes fall faster. */
[data-accents~="snow"] :is(.band, .cover-band) {
  background-image: url(christmas/snow-small.svg), url(christmas/snow-large.svg), var(--grain);
  background-size: 240px, 360px, auto;
}

/* snowcaps: snow settles on the cover photo, the menu cards, the map, and the QR card.
   The drift's bottom line (y=26 of 42 in the art) lands on each card's outer top edge,
   so it sits --edge above the padding box. It stays clear of the rounded corners. */
[data-accents~="snowcaps"] :is(.frame, .mc, .map-print, .qr-card) { position: relative; --edge: 0px; }
[data-accents~="snowcaps"] .mc { --edge: 2.5px; }
[data-accents~="snowcaps"] :is(.frame, .map-print) { --edge: 8px; }
[data-accents~="snowcaps"] .frame { overflow: visible; }
[data-accents~="snowcaps"] .frame img { border-radius: 18px; }
[data-accents~="snowcaps"] :is(.frame, .mc, .map-print, .qr-card)::before {
  content: "";
  position: absolute; z-index: 2;
  top: calc(-1 * var(--edge) - 36px * 26 / 42); left: calc(16px - var(--edge)); right: calc(16px - var(--edge));
  height: 36px;
  background: url(christmas/snowcap.svg) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
[data-accents~="snowcaps"] .frame::before { left: 14px; right: 14px; }

/* flakes: a snowflake opens each section label. */
[data-accents~="flakes"] .band .lbl::before {
  content: "";
  display: inline-block; vertical-align: -.25em;
  width: 1.25em; height: 1.25em; margin-right: .5em;
  background: currentColor;
  -webkit-mask: url(christmas/snowflake.svg) center / contain no-repeat;
  mask: url(christmas/snowflake.svg) center / contain no-repeat;
}

/* giftbox: small bows turn the Find her glyphs and the Instagram glyph into presents. */
[data-accents~="giftbox"] :is(.facts, .ig) .gly { position: relative; }
[data-accents~="giftbox"] :is(.facts, .ig) .gly::after {
  content: "";
  position: absolute; top: -15px; left: 50%; translate: -50% 0;
  width: 30px; aspect-ratio: 120 / 104;
  background: url(christmas/bow.svg) center / contain no-repeat;
  pointer-events: none;
}
[data-accents~="giftbox"] .facts li:nth-child(3n + 2) .gly::after { background-image: url(christmas/bow-pink.svg); }

/* Wide screens: the cover's pink band is .cover::before, so the snow moves there. */
@media (min-width: 768px) {
  [data-accents~="ornaments"] .band::after { width: 172px; }
  [data-accents~="snow"] .cover-band { background-image: none; }
  [data-accents~="snow"] .cover::before {
    background-image: url(christmas/snow-small.svg), url(christmas/snow-large.svg), var(--grain);
    background-size: 240px, 360px, auto;
  }
}

/* Each snow tile moves by exactly its own size per loop, so the fall never shows a seam. */
@keyframes snowfall { to { background-position: 240px 960px, 360px 1440px, 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  [data-accents~="snow"] .band,
  [data-accents~="snow"] .cover-band,
  [data-accents~="snow"] .cover::before { animation: snowfall 32s linear infinite; }
}
