/* Helbreath Hub seasonal Christmas theme. Loaded only while the theme is active. */
:root {
  --hb-xmas-red: #b51f2e;
  --hb-xmas-green: #176b43;
  --hb-xmas-gold: #f2c66d;
  --hb-xmas-snow: #f5fbff;
}

body.hb-christmas {
  --hb-xmas-glow: rgba(242, 198, 109, .24);
}

body.hb-christmas .container > .header,
body.hb-christmas .container > header:first-child {
  position: relative;
  isolation: isolate;
}

/* Original snow-shaped divider, recolored black. */
body.hb-christmas .container > .header::after,
body.hb-christmas .container > header:first-child::after {
  content: "";
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 12px;
  pointer-events: none;
  background:
    radial-gradient(18px 9px at 2% 35%, rgba(0,0,0,.96) 49%, transparent 52%) 0 0 / 82px 13px repeat-x,
    linear-gradient(to bottom, rgba(0,0,0,.96), rgba(8,8,8,.92));
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.55));
  border-radius: 50% 45% 35% 40%;
}

/* CSS-drawn Santa hat, positioned on the logo rather than over navigation. */
body.hb-christmas .container > .header > a,
body.hb-christmas .container > header:first-child > a {
  position: relative;
}

body.hb-christmas .container > .header > a::before,
body.hb-christmas .container > header:first-child > a::before {
  content: "";
  position: absolute;
  z-index: 5;
  top: clamp(4px, 1vw, 12px);
  right: clamp(18px, 7vw, 78px);
  width: clamp(38px, 5.5vw, 62px);
  height: clamp(31px, 4.5vw, 51px);
  pointer-events: none;
  background:
    radial-gradient(circle at 84% 15%, var(--hb-xmas-snow) 0 12%, transparent 13%),
    linear-gradient(160deg, transparent 0 19%, #d52c3b 20% 63%, transparent 64%),
    linear-gradient(to bottom, transparent 0 68%, var(--hb-xmas-snow) 69% 91%, transparent 92%);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.5));
  transform: rotate(8deg);
  transform-origin: bottom center;
}

body.hb-christmas nav {
  position: relative;
  z-index: 20;
  border-top-color: rgba(242,198,109,.38) !important;
  border-bottom-color: rgba(23,107,67,.72) !important;
  box-shadow: 0 5px 18px rgba(0,0,0,.34), 0 0 18px var(--hb-xmas-glow);
}

body.hb-christmas nav > a.active {
  color: var(--hb-xmas-gold) !important;
  text-shadow: 0 0 10px rgba(242,198,109,.34);
}

/* Evergreen garland and small berries along the lower edge of navigation. */
body.hb-christmas nav::after {
  content: "";
  position: absolute;
  z-index: 4;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 9px;
  pointer-events: none;
  background:
    radial-gradient(circle, #ca2c3b 0 2px, transparent 2.5px) 10px 0 / 48px 8px repeat-x,
    repeating-linear-gradient(135deg, #174f37 0 7px, #23784f 7px 13px, #123d2b 13px 19px);
  clip-path: polygon(0 0, 100% 0, 99% 56%, 96% 100%, 92% 58%, 88% 100%, 84% 55%, 80% 100%, 76% 55%, 72% 100%, 68% 55%, 64% 100%, 60% 55%, 56% 100%, 52% 55%, 48% 100%, 44% 55%, 40% 100%, 36% 55%, 32% 100%, 28% 55%, 24% 100%, 20% 55%, 16% 100%, 12% 55%, 8% 100%, 4% 55%, 1% 100%);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.45));
}

.hb-christmas-lights {
  position: absolute;
  z-index: 9;
  top: -7px;
  right: 7px;
  left: 7px;
  height: 13px;
  pointer-events: none;
  border-top: 2px solid rgba(31,56,39,.95);
}

.hb-christmas-light {
  --light-color: #e6424f;
  position: absolute;
  top: -1px;
  left: var(--light-position);
  width: 7px;
  height: 10px;
  border-radius: 45% 45% 55% 55%;
  background: var(--light-color);
  box-shadow: 0 0 5px var(--light-color), 0 0 12px var(--light-color);
  transform: rotate(var(--light-tilt, 0deg));
  transform-origin: top center;
  animation: hb-christmas-twinkle 2.2s ease-in-out infinite alternate;
  animation-delay: var(--light-delay, 0s);
}

.hb-christmas-light::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 1px;
  width: 5px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: #31523a;
}

/* Subtle seasonal framing on existing cards, without changing their sizing. */
body.hb-christmas .main-content > .box,
body.hb-christmas .main-content > .card,
body.hb-christmas main > .panel,
body.hb-christmas .account-pod {
  border-color: rgba(242,198,109,.30) !important;
  box-shadow: 0 14px 36px rgba(0,0,0,.32), inset 0 1px rgba(255,255,255,.025);
}

body.hb-christmas .page-title,
body.hb-christmas .page-head h1,
body.hb-christmas .main-content > h1 {
  text-shadow: 0 0 16px rgba(242,198,109,.16);
}

.hb-christmas-snowfall {
  position: fixed;
  z-index: 9990;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

.hb-christmas-snowflake {
  position: absolute;
  top: -18px;
  left: var(--snow-left);
  width: var(--snow-size);
  height: var(--snow-size);
  border-radius: 50%;
  background: rgba(248,252,255,var(--snow-opacity));
  box-shadow: 0 0 3px rgba(255,255,255,.5);
  animation: hb-christmas-snow var(--snow-duration) linear infinite;
  animation-delay: var(--snow-delay);
  will-change: transform;
}

@keyframes hb-christmas-twinkle {
  from { opacity: .58; filter: saturate(.8); }
  to { opacity: 1; filter: saturate(1.2); }
}

@keyframes hb-christmas-snow {
  from { transform: translate3d(0,-5vh,0) rotate(0deg); }
  to { transform: translate3d(var(--snow-drift),105vh,0) rotate(300deg); }
}

@media (max-width: 720px) {
  body.hb-christmas .container > .header::after,
  body.hb-christmas .container > header:first-child::after { height: 8px; }

  body.hb-christmas .container > .header > a::before,
  body.hb-christmas .container > header:first-child > a::before { right: 12px; }

  .hb-christmas-light:nth-child(even) { display: none; }
  body.hb-christmas nav::after { bottom: -5px; height: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .hb-christmas-light { animation: none; opacity: .9; }
  .hb-christmas-snowfall { display: none !important; }
}

@media print {
  .hb-christmas-lights,
  .hb-christmas-snowfall,
  body.hb-christmas nav::after,
  body.hb-christmas .container > .header::after,
  body.hb-christmas .container > header:first-child::after,
  body.hb-christmas .container > .header > a::before,
  body.hb-christmas .container > header:first-child > a::before { display: none !important; }
}

