/* ========================================================
   Editorial String Lights
   Paper & Ink (light) / Night Ink (dark)
   Zero-CLS hairline catenary with restrained incandescent optics.
   All theme-dependent colors are tokens on the wrapper.
   ======================================================== */
.string-lights-wrapper {
  /* Paper & Ink tokens */
  --sl-ink: #26231f;
  --sl-wire-hi: rgba(255, 255, 255, 0.30);
  --sl-keyline: rgba(242, 239, 233, 0.46);
  --sl-cord-shadow: 0.16;
  --sl-socket: #2a2723;
  --sl-socket-hi: rgba(255, 255, 255, 0.24);
  --sl-brass: #a88a55;
  --sl-eyelet-fill: #f2efe9;
  --sl-glass-edge-opacity: 0.85;
  --sl-halo-strength: 0.42;
  --sl-wash-strength: 0.34;
  --sl-glass-off-filter: saturate(0.12) brightness(1.04);
  --sl-glass-off-opacity: 0.6;
  --sl-accent-green: #3d5a47;
  --sl-accent-green-soft: #71897a;
  --sl-accent-red: #a3343b;
  --sl-accent-frost: #7891a8;
  --sl-accent-autumn: #a8622c;
  --sl-accent-blossom: #d6a3ab;
  --sl-accent-pollen: #c29a52;
  --sl-snow: #ffffff;
  --sl-snow-edge: rgba(88, 100, 116, 0.30);
  --sl-pull-line: #3a3631;
  --sl-toggle: #f8f5ef;
  --sl-toggle-edge: rgba(38, 35, 31, 0.58);
  --sl-focus: #26231f;

  display: none;
  position: relative;
  width: 100%;
  height: 0;
  overflow: visible;
  z-index: 14;
  pointer-events: none;
  user-select: none;
}

body.dark .string-lights-wrapper,
html[data-color-mode="dark"] .string-lights-wrapper {
  /* Night Ink tokens */
  --sl-ink: #8d877d;
  --sl-wire-hi: rgba(255, 248, 236, 0.16);
  --sl-keyline: rgba(18, 20, 23, 0.5);
  --sl-cord-shadow: 0;
  --sl-socket: #4b4741;
  --sl-socket-hi: rgba(255, 248, 236, 0.16);
  --sl-brass: #9c8152;
  --sl-eyelet-fill: #121417;
  --sl-glass-edge-opacity: 0.4;
  --sl-halo-strength: 1;
  --sl-wash-strength: 0.9;
  --sl-glass-off-filter: saturate(0.2) brightness(0.42);
  --sl-glass-off-opacity: 0.5;
  --sl-accent-green: #7f9d88;
  --sl-accent-green-soft: #5c7464;
  --sl-accent-red: #c4525a;
  --sl-accent-frost: #a8c2d8;
  --sl-accent-autumn: #c4874e;
  --sl-accent-blossom: #dcaab2;
  --sl-accent-pollen: #d4b06a;
  --sl-snow: #eef2f6;
  --sl-snow-edge: rgba(255, 255, 255, 0);
  --sl-pull-line: #a39d92;
  --sl-toggle: #e6e1d7;
  --sl-toggle-edge: rgba(0, 0, 0, 0.5);
  --sl-focus: #e9e4da;
}

.string-lights-wrapper.is-active {
  display: block;
}

.string-lights-wrapper[data-string-lights-slot="header_bottom"] {
  position: fixed;
  top: var(--header-height, 67px);
  left: 0;
  right: 0;
  z-index: 1025;
}

.string-lights-svg {
  position: absolute;
  top: calc(-56px + var(--string-lights-offset-y, 0px));
  left: 0;
  width: 100%;
  overflow: visible;
  pointer-events: none;
}

/* ---------- Optics: quiet on paper, soft bloom at night ---------- */
.string-lights-svg .sl-layer-wash {
  opacity: var(--sl-wash-strength);
}

.string-lights-svg .sl-halo-tone {
  opacity: var(--sl-halo-strength);
}

body.dark .string-lights-svg .sl-layer-wash,
body.dark .string-lights-svg .sl-bulb-halo,
html[data-color-mode="dark"] .string-lights-svg .sl-layer-wash,
html[data-color-mode="dark"] .string-lights-svg .sl-bulb-halo {
  mix-blend-mode: screen;
}

.string-lights-svg .sl-glass-shell {
  stroke-opacity: var(--sl-glass-edge-opacity);
}

/* ---------- Wire, eyelets and sockets ---------- */
.string-lights-svg .sl-layer-cord-shadow {
  opacity: var(--sl-cord-shadow);
}

.string-lights-svg .sl-wire-keyline,
.string-lights-svg .sl-wire,
.string-lights-svg .sl-wire-twist {
  fill: none;
  stroke-linecap: round;
}

.string-lights-svg .sl-wire-keyline {
  stroke: var(--sl-keyline);
}

.string-lights-svg .sl-wire {
  stroke: var(--sl-ink);
}

.string-lights-svg .sl-wire-twist {
  stroke: var(--sl-wire-hi);
  stroke-dasharray: 1.4 2.6;
}

.string-lights-svg .sl-drop {
  stroke: var(--sl-ink);
  stroke-linecap: round;
}

.string-lights-svg .sl-eyelet-ring {
  fill: var(--sl-eyelet-fill);
  stroke: var(--sl-ink);
  stroke-width: 0.8;
}

.string-lights-svg .sl-eyelet-pin {
  stroke: var(--sl-ink);
  stroke-width: 0.8;
  stroke-linecap: round;
}

.string-lights-svg .sl-socket {
  fill: var(--sl-socket);
}

.string-lights-svg .sl-socket-hi {
  stroke: var(--sl-socket-hi);
  stroke-width: 0.5;
  stroke-linecap: round;
}

.string-lights-svg .sl-socket-collar {
  fill: var(--sl-brass);
}

/* ---------- Snow ---------- */
.string-lights-svg .sl-snow-fill {
  fill: var(--sl-snow);
  stroke: var(--sl-snow-edge);
  stroke-width: 0.35;
  stroke-linejoin: round;
}

.string-lights-svg .sl-snow-line {
  fill: none;
  stroke: var(--sl-snow);
  stroke-linecap: round;
  opacity: 0.85;
}

/* ---------- Botanical and seasonal line accents ---------- */
.string-lights-svg .sl-spruce-twig {
  fill: none;
  stroke: var(--sl-accent-green);
  stroke-width: 0.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.string-lights-svg .sl-spruce-needle {
  stroke: var(--sl-accent-green);
  stroke-width: 0.7;
  stroke-linecap: round;
}

.string-lights-svg .sl-spruce-needle.is-soft {
  stroke: var(--sl-accent-green-soft);
}

.string-lights-svg .sl-accent-stem {
  fill: none;
  stroke: var(--sl-accent-green);
  stroke-width: 0.55;
  stroke-linecap: round;
}

.string-lights-svg .sl-accent-stem.is-autumn {
  stroke: var(--sl-accent-autumn);
}

.string-lights-svg .sl-accent-leaf {
  fill: var(--sl-accent-green);
}

.string-lights-svg .sl-accent-leaf.is-soft {
  fill: var(--sl-accent-green-soft);
}

.string-lights-svg .sl-accent-berry {
  fill: var(--sl-accent-red);
}

.string-lights-svg .sl-accent-berry-hi {
  fill: rgba(255, 255, 255, 0.72);
}

.string-lights-svg .sl-accent-frost {
  fill: none;
  stroke: var(--sl-accent-frost);
  stroke-width: 0.55;
  stroke-linecap: round;
}

.string-lights-svg .sl-accent-autumn {
  fill: var(--sl-accent-autumn);
  opacity: 0.92;
}

.string-lights-svg .sl-accent-vein {
  fill: none;
  stroke: rgba(255, 255, 255, 0.45);
  stroke-width: 0.35;
  stroke-linecap: round;
}

.string-lights-svg .sl-accent-petal {
  fill: var(--sl-accent-blossom);
  opacity: 0.92;
}

.string-lights-svg .sl-accent-pollen {
  fill: var(--sl-accent-pollen);
}

/* ---------- Pull cord ---------- */
.string-lights-svg .sl-pull-line {
  stroke: var(--sl-pull-line);
  stroke-width: 0.75;
  stroke-linecap: round;
}

.string-lights-svg .sl-pull-knot {
  fill: var(--sl-pull-line);
}

.string-lights-svg .sl-pull-toggle {
  fill: var(--sl-toggle);
  stroke: var(--sl-toggle-edge);
  stroke-width: 0.45;
}

.string-lights-svg .sl-pull-toggle-groove {
  stroke: var(--sl-toggle-edge);
  stroke-width: 0.35;
  opacity: 0.7;
}

.string-lights-svg .sl-pull-toggle-shine {
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 0.7;
  stroke-linecap: round;
}

.string-lights-svg .sl-pull-rose {
  fill: var(--sl-eyelet-fill);
  stroke: var(--sl-ink);
  stroke-width: 0.8;
}

.string-lights-svg .sl-pull-rose-pin {
  fill: var(--sl-brass);
}

/* ---------- Interaction ---------- */
.string-lights-svg .sl-bulb-hit,
.string-lights-svg .sl-pull-cord-hit {
  pointer-events: auto;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.string-lights-svg .sl-bulb-hit:focus,
.string-lights-svg .sl-bulb-hit:focus-visible,
.string-lights-svg .sl-pull-cord-hit:focus,
.string-lights-svg .sl-pull-cord-hit:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Fine keyboard focus ring drawn on the hit area itself */
.string-lights-svg .sl-pull-cord-hit:focus-visible {
  stroke: var(--sl-focus);
  stroke-width: 0.8;
  stroke-dasharray: 2 2;
}

.string-lights-svg .sl-pull-cord-movable {
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.string-lights-svg .sl-pull-cord-movable:hover {
  transform: translateY(2px);
}

.string-lights-svg .sl-pull-cord-movable.is-pulled {
  animation: slPullCordSpring 0.44s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes slPullCordSpring {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(8px);
  }
  70% {
    transform: translateY(-1.5px);
  }
  100% {
    transform: translateY(0);
  }
}

/* ---------- Power states ---------- */
.string-lights-svg .sl-wash-pool,
.string-lights-svg .sl-bulb-halo,
.string-lights-svg .sl-filament-group,
.string-lights-svg .sl-glass-shell,
.string-lights-svg .sl-glass-caustic,
.string-lights-svg .sl-lens-glint {
  transition: opacity 0.65s ease, filter 0.65s ease;
}

.string-lights-wrapper.is-powered-off .sl-wash-pool,
.string-lights-wrapper.is-powered-off .sl-bulb-halo,
.string-lights-wrapper.is-powered-off .sl-lens-glint {
  opacity: 0 !important;
  animation: none !important;
}

.string-lights-wrapper.is-powered-off .sl-filament-group {
  opacity: 0.08 !important;
  animation: none !important;
}

.string-lights-wrapper.is-powered-off .sl-glass-shell {
  opacity: var(--sl-glass-off-opacity);
  filter: var(--sl-glass-off-filter);
}

.string-lights-wrapper.is-powered-off .sl-glass-caustic {
  opacity: 0.14;
}

@keyframes slThermalEmberCooldown {
  0% {
    opacity: 0.95;
    stroke: #ffb347;
  }
  40% {
    opacity: 0.72;
    stroke: #ff4518;
  }
  78% {
    opacity: 0.28;
    stroke: #9e1405;
  }
  100% {
    opacity: 0;
    stroke: #3d0602;
  }
}

.string-lights-wrapper.is-cooling-down .sl-filament-ember {
  animation: slThermalEmberCooldown 1.2s ease-out forwards;
}

/* ---------- Effects ---------- */
@keyframes slLivingFilament {
  0%, 100% {
    opacity: 0.95;
  }
  45% {
    opacity: 1;
  }
  75% {
    opacity: 0.88;
  }
}

@keyframes slGentleTwinkle {
  0%, 100% {
    opacity: 0.98;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes slGlintPulse {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.85;
  }
}

.string-lights-wrapper[data-string-lights-effect="living_filament"] .sl-filament-group,
.string-lights-wrapper[data-string-lights-effect="calm_breeze"] .sl-filament-group {
  animation: slLivingFilament var(--sl-dur, 3.6s) ease-in-out var(--sl-delay, 0s) infinite;
}

.string-lights-wrapper[data-string-lights-effect="living_filament"] .sl-lens-glint,
.string-lights-wrapper[data-string-lights-effect="calm_breeze"] .sl-lens-glint {
  animation: slGlintPulse var(--sl-dur, 3.6s) ease-in-out var(--sl-delay, 0s) infinite;
}

.string-lights-wrapper[data-string-lights-effect="gentle_twinkle"] .sl-filament-group,
.string-lights-wrapper[data-string-lights-effect="gentle_twinkle"] .sl-bulb-halo,
.string-lights-wrapper[data-string-lights-effect="gentle_twinkle"] .sl-lens-glint {
  animation: slGentleTwinkle var(--sl-dur, 3.8s) ease-in-out var(--sl-delay, 0s) infinite;
}

@media (prefers-reduced-motion: reduce) {
  .string-lights-wrapper .sl-filament-group,
  .string-lights-wrapper .sl-bulb-halo,
  .string-lights-wrapper .sl-lens-glint,
  .string-lights-wrapper .sl-filament-ember,
  .string-lights-wrapper .sl-pull-cord-movable,
  .string-lights-wrapper .sl-pull-cord-movable.is-pulled {
    animation: none !important;
    transition: none !important;
  }

  .string-lights-svg .sl-pull-cord-movable:hover {
    transform: none;
  }
}

@media print {
  .string-lights-wrapper {
    display: none !important;
  }
}
