/*
  Green Shades — Holiday 2026 site theme.
  Every rule is scoped under html.is-holiday, which /scripts/holiday-theme.js sets (until Dec 31,
  unless ?holiday=off). Without the class this file does nothing.
  Decorations are pseudo-elements or absolutely positioned [data-hol-deco] nodes: none of them take
  up space, so the class can arrive after first paint without layout shift.
  html.holt-self = a page with its own holiday art (gift page, subscription redesign): chrome only.
  Tokens (--hol-*) come from holiday.css. Revert: node scripts/holiday-bar-inject.js --remove
*/

/* ---------- Header: string lights on the bottom edge ---------- */
/* Straddles the border so only ~10px hangs over the page; the logo always ends higher than that. */
html.is-holiday .site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 8px);
  height: 18px;
  background: url(/images/holiday/string-lights.svg) repeat-x 0 0 / auto 18px;
  pointer-events: none;
}

html.is-holiday .site-header.is-open::after {
  display: none;
}

/* ---------- Header: Santa hat on the logo cat ---------- */
html.is-holiday .site-header .brand__logo {
  position: relative;
}

html.is-holiday .site-header .brand__logo::after {
  content: "";
  position: absolute;
  /* mobile/tablet icon (500×500): the cat's head sits just right of center */
  left: 46%;
  top: 23.6%;
  width: 14%;
  aspect-ratio: 96 / 60;
  background: url(/images/holiday/santa-hat.svg) no-repeat center / contain;
  transform: rotate(10deg);
  pointer-events: none;
}

@media (min-width: 960px) {
  /* desktop wordmark (500×131): the cat is at the far left */
  html.is-holiday .site-header .brand__logo::after {
    left: 11.6%;
    top: -10%;
    width: 11.6%;
    transform: rotate(-10deg);
  }
}

/* ---------- Hero: snow layer behind the copy ---------- */
html.is-holiday .holt-hero-host {
  position: relative;
  isolation: isolate;
}

html.is-holiday .holt-hero {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

html.is-holiday .holt-snow {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

html.is-holiday .holt-hero--static {
  background: url(/images/holiday/snow-pattern-sage.svg) repeat;
}

html.is-holiday .holt-hero--dark.holt-hero--static {
  background-image: url(/images/holiday/snow-pattern.svg);
}

html.is-holiday .holt-holly {
  position: absolute;
  width: 52px;
  height: auto;
  aspect-ratio: 52 / 34;
}

/* Phone heroes are all text edge to edge; the sprigs would sit right behind the headline. */
@media (max-width: 599px) {
  html.is-holiday .holt-holly { display: none; }
}

html.is-holiday .holt-holly--tr {
  top: 14px;
  right: 6%;
  transform: rotate(16deg);
}

html.is-holiday .holt-holly--br {
  bottom: 18px;
  right: 12%;
  width: 36px;
  transform: rotate(-22deg);
  opacity: 0.85;
}

@media (min-width: 760px) {
  html.is-holiday .holt-holly { width: 72px; }
  html.is-holiday .holt-holly--br { width: 48px; }
}

/* ---------- Section breaks: pine garland straddling the top edge ---------- */
html.is-holiday .holt-garland-host {
  position: relative;
}

html.is-holiday .holt-garland {
  position: absolute;
  left: 0;
  right: 0;
  top: -22px;
  height: 44px;
  z-index: 2;
  background: url(/images/holiday/pine-garland.svg) repeat-x center / auto 44px;
  pointer-events: none;
}

@media (min-width: 760px) {
  html.is-holiday .holt-garland {
    top: -26px;
    height: 52px;
    background-size: auto 52px;
  }
}

/* ---------- Product cards: holly tucked on the seam under the photo ---------- */
html.is-holiday:not(.holt-self) .product-card .card__body {
  position: relative;
}

html.is-holiday:not(.holt-self) .product-card .card__body::before {
  content: "";
  position: absolute;
  top: -13px;
  right: 10px;
  z-index: 1;
  width: 42px;
  height: 28px;
  background: url(/images/holiday/holly-sprig.svg) no-repeat center / contain;
  transform: rotate(-8deg);
  pointer-events: none;
}

/* ---------- Product page: holiday cat peeking from the photo corner ---------- */
html.is-holiday .holt-peek {
  position: absolute;
  right: 3%;
  bottom: -5%;
  z-index: 2;
  width: 21%;
  max-width: 118px;
  height: auto;
  transform: rotate(-6deg);
  transform-origin: 50% 100%;
  pointer-events: none;
}

html.is-holiday .holt-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: var(--space-3) 0 0;
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.4;
  color: var(--hol-cranberry-dk);
}

html.is-holiday .holt-note::before {
  content: "";
  flex: none;
  width: 26px;
  height: 17px;
  background: url(/images/holiday/holly-sprig.svg) no-repeat center / contain;
}

/* ---------- Cart drawer: one-line holiday note above checkout ---------- */
html.is-holiday .cart-footer::before {
  content: "🎄 Order by Dec 7 for Christmas";
  display: block;
  margin-bottom: var(--space-3);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--hol-cranberry) 8%, #fff);
  color: var(--hol-cranberry-dk);
  font-size: var(--step--1);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

html.is-holiday[data-hol-phase="2"] .cart-footer::before {
  content: "🎄 Roasted & shipped in 3–4 business days, plus 1–2 during the holidays";
}

html.is-holiday[data-hol-phase="3"] .cart-footer::before {
  content: "🎄 Happy holidays from Green Shades";
}

/* ---------- Footer: snow drift along the top edge, cats peeking over it ---------- */
html.is-holiday .site-footer {
  position: relative;
}

html.is-holiday .site-footer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 22px;
  background: url(/images/holiday/snow-drift.svg) repeat-x 0 100% / 240px 22px;
  pointer-events: none;
}

/* Cats sitting in the snow: the box shows the top 80% of the lineup (down to the chins), half above
   the footer edge and half in its empty top padding, so it stays clear of content on both sides. */
html.is-holiday:not(.holt-self) .site-footer::after {
  content: "";
  position: absolute;
  top: -22px;
  right: 4%;
  width: 200px;
  aspect-ratio: 660 / 136;
  background: url(/images/holiday/cat-lineup.svg) no-repeat center top / 100% auto;
  pointer-events: none;
}

@media (min-width: 760px) {
  html.is-holiday:not(.holt-self) .site-footer::after {
    top: -34px;
    width: 300px;
  }
}

@media print {
  html.is-holiday [data-hol-deco]:not(.holt-note),
  html.is-holiday .site-header::after,
  html.is-holiday .site-header .brand__logo::after,
  html.is-holiday .site-footer::before,
  html.is-holiday .site-footer::after,
  html.is-holiday .product-card .card__body::before {
    display: none;
  }
}
