/* December-only greeting. Deep green, red and gold, still in the site's type. */

html.festive {
  --festive-ribbon: 42px;
  --festive-ribbon-bg: #16382c;
  --festive-ribbon-text: #f8e7c1;
  --festive-gold: #e0b34a;
  --festive-red: #c23b3b;
  --festive-green: #2f7a4a;
  scroll-padding-top: calc(90px + var(--festive-ribbon));
}

html.festive body {
  padding-top: var(--festive-ribbon);
}

.festive-ribbon {
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 250;
  height: var(--festive-ribbon);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px 7px;
  background: var(--festive-ribbon-bg);
  color: var(--festive-ribbon-text);
  border-bottom: 2px solid var(--festive-gold);
  font-family: Outfit, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1;
  white-space: nowrap;
}

.festive-ribbon-label {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.festive-ribbon-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  line-height: 0;
}

.festive-ribbon-mark--flip {
  transform: scaleX(-1);
}

.festive-ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 8px;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 5px 4px, var(--festive-red) 2.4px, transparent 2.7px),
    radial-gradient(circle at 16px 4px, var(--festive-gold) 2px, transparent 2.4px),
    radial-gradient(circle at 27px 4px, #f4e4b4 1.6px, transparent 2px);
  background-size: 32px 8px;
  background-repeat: repeat-x;
}

/* Fixed and sticky bars sit just under the ribbon. Higher specificity than
   each page's own .nav / .site-header rules, including later stylesheets. */
html.festive .nav,
html.festive .site-header {
  top: var(--festive-ribbon);
}

html.festive .progress-container {
  top: calc(65px + var(--festive-ribbon));
}

html.festive #progressBar {
  margin-top: var(--festive-ribbon);
}

html.festive .skip-link:focus {
  transform: translateY(calc(var(--festive-ribbon) + 8px));
}

html.festive .nav-inner {
  padding-left: 46px;
}

html.festive .nav-logo,
html.festive .site-header .logo a {
  position: relative;
}

.festive-sprig,
.festive-hero-sprig,
.festive-ribbon-mark {
  pointer-events: none;
  line-height: 0;
}

.festive-sprig {
  position: absolute;
  right: calc(100% + 8px);
  top: 0;
  width: 26px;
  height: 26px;
}

html.festive .site-header .festive-sprig {
  top: 50%;
  right: calc(100% + 12px);
  width: 28px;
  height: 28px;
  margin-top: -14px;
}

.festive-sprig svg,
.festive-hero-sprig svg,
.festive-ribbon-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

html.festive .v2-hero,
html.festive header.hero,
html.festive .page-hero,
html.festive .iq-hero,
html.festive .page-404-panel {
  position: relative;
}

/* Room above the heading so the tree sits in clear space. */
html.festive .v2-hero {
  padding-top: calc(var(--nav-h) + 136px);
}

html.festive header.hero {
  padding-top: calc(clamp(3rem, 6vw, 5rem) + 5.5rem);
}

html.festive .page-hero {
  padding-top: calc(140px + 88px);
}

html.festive .iq-hero {
  padding-top: calc(var(--nav-h) + clamp(36px, 6vw, 72px) + 96px);
}

html.festive .page-404-panel {
  padding-top: 108px;
}

.festive-hero-sprig {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 28px;
  width: 86px;
  height: 118px;
}

html.festive .v2-hero .festive-hero-sprig,
html.festive .page-hero .festive-hero-sprig,
html.festive .iq-hero .festive-hero-sprig {
  top: calc(var(--nav-h) + 12px);
}

html.festive .page-404-panel .festive-hero-sprig {
  top: 16px;
  right: 22px;
  width: 68px;
  height: 92px;
}

html.festive .v2-hero > .v2-container,
html.festive header.hero > .hero-inner,
html.festive .page-hero > .container,
html.festive .iq-hero > .v2-container {
  position: relative;
  z-index: 1;
}

.festive-sparkles {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.festive-sparkle {
  --spark: var(--festive-gold);
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--spark);
  box-shadow: 0 0 10px var(--spark);
  opacity: 0.72;
  pointer-events: none;
  animation: festive-twinkle 7s ease-in-out infinite;
}

.festive-sparkle:nth-child(odd) { --spark: var(--festive-red); }
.festive-sparkle:nth-child(3),
.festive-sparkle:nth-child(6) { --spark: #f4e4b4; }

.festive-sparkle:nth-child(1) { left: 7%; top: 16%; animation-delay: 0s; }
.festive-sparkle:nth-child(2) { left: 22%; top: 8%; width: 5px; height: 5px; animation-delay: 1.4s; }
.festive-sparkle:nth-child(3) { left: 46%; top: 12%; animation-delay: 2.6s; }
.festive-sparkle:nth-child(4) { left: 68%; top: 7%; width: 5px; height: 5px; animation-delay: 0.8s; }
.festive-sparkle:nth-child(5) { left: 84%; top: 20%; animation-delay: 2.1s; }
.festive-sparkle:nth-child(6) { left: 14%; top: 28%; width: 5px; height: 5px; animation-delay: 3.4s; }

@keyframes festive-twinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 900px) {
  html.festive .nav-inner { padding-left: 38px; }
  html.festive .nav-logo .festive-sprig {
    width: 22px;
    height: 22px;
    right: calc(100% + 4px);
  }
  html.festive .v2-hero { padding-top: calc(var(--nav-h) + 112px); }
  html.festive header.hero { padding-top: calc(2.75rem + 4.75rem); }
  html.festive .page-hero { padding-top: calc(110px + 78px); }
  html.festive .festive-hero-sprig,
  html.festive .v2-hero .festive-hero-sprig,
  html.festive header.hero .festive-hero-sprig,
  html.festive .page-hero .festive-hero-sprig,
  html.festive .iq-hero .festive-hero-sprig {
    width: 70px;
    height: 96px;
    right: 16px;
  }
  html.festive .page-404-panel .festive-hero-sprig {
    width: 58px;
    height: 78px;
    right: 14px;
    top: 14px;
  }
  html.festive .page-404-panel { padding-top: 96px; }
}

@media (min-width: 901px) and (max-width: 1240px) {
  /* Desktop nav is already full. Keep the holly off it so the call to action stays intact. */
  html.festive .nav-inner { padding-left: 28px; }
  html.festive .nav-logo .festive-sprig { display: none; }
}

@media (max-width: 420px) {
  .festive-ribbon {
    gap: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.015em;
    padding-left: 10px;
    padding-right: 10px;
  }
  .festive-ribbon-mark { width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .festive-sparkles { display: none; }
  .festive-sparkle { animation: none; }
}

@media (forced-colors: active) {
  .festive-ribbon {
    background: Canvas;
    color: CanvasText;
    border-bottom: 1px solid CanvasText;
  }
  .festive-ribbon::after { display: none; }
}

@media print {
  html.festive { --festive-ribbon: 0px; }
  .festive-ribbon,
  .festive-sprig,
  .festive-hero-sprig,
  .festive-sparkles { display: none !important; }
  html.festive body { padding-top: 0; }
  html.festive .nav,
  html.festive .site-header { top: 0; }
  html.festive .nav-inner { padding-left: 28px; }
  html.festive .v2-hero,
  html.festive header.hero,
  html.festive .page-hero,
  html.festive .iq-hero { padding-top: calc(var(--nav-h) + 48px); }
}
