/* ==========================================================================
   Charlton Live Theme V2 - Christmas (1 December to 1 January)
   The winter theme's look, moved here unchanged. Loaded last, after the
   parent's eleven sheets and seasons.css, and only while Christmas is the
   season (cl_v2_current_season()). It keeps the winter theme's body class,
   cl-winter, and its cl-w-* decoration classes.

   Charlton at Christmas, not a different website: brand red, the logo and the
   type are untouched. What changes is the supporting palette - warm browns to
   cold blues - plus the decorations below and a badge on the two fixtures
   that matter in the window.

   Every decoration hangs off its own body class (cl-w-hat-header, cl-w-tree,
   ...), added by cl_v2_body_class() only while it is switched on in the
   Customizer, so a hidden element has no rule applying to it at all.
   ========================================================================== */

/* ==========================================================================
   Palette
   ========================================================================== */

/* On body rather than :root.

   Custom properties inherit, and nothing in the theme styles <html> with a
   token - base.css:23 sets only -webkit-text-size-adjust there - so scoping to
   body reaches every consumer while leaving the sheet genuinely inert without
   the class. The enqueue is already gated on the season; this means the CSS is
   gated too, rather than trusting one mechanism twice.

   Every value below was picked to hold the contrast ratios tokens.css
   documents. All thirteen documented pairs come out level or better than the
   warm palette - the ratios are in the comments. Do not adjust these by eye. */
body.cl-winter {
	/* Cold near-black. Slightly darker than the warm ink it replaces, which is
	   what buys back the headroom on red-on-ink: at #101820 that pair landed on
	   4.51, a hundredth above the line. */
	--cl-ink: #0d141b;          /* white on it 18.53:1 · --cl-red-on-ink 4.67:1 */
	--cl-off: #f2f6f9;          /* --cl-body 11.26:1 · --cl-mut 5.00:1 */
	--cl-canvas: #dde5ec;       /* page background behind cards */
	--cl-line: #dde4ea;         /* 1px borders and dividers */
	--cl-body: #2f363d;         /* on white 12.24:1 · on off-white 11.26:1 */
	--cl-mut: #616b75;          /* on white 5.43:1 · on off-white 5.00:1 */

	/* Text on the dark sections. */
	--cl-dark-body: #b0b8c1;    /* on ink 9.24:1 */
	--cl-dark-meta: #828c96;    /* on ink 5.42:1 */
	--cl-nav: #dde4ea;          /* on ink 14.44:1 */
	--cl-footer-body: #c3ccd5;  /* on ink 11.40:1 */

	/* The draw pill, cooled to match. It carries ink text, not white, so the
	   ratio to check is against --cl-ink: 10.65:1, up from the 9.72:1
	   tokens.css records for the warm grey. */
	--cl-draw: #bfc5cb;

	/* The fill behind the festive badge, and the only colour this theme adds.

	   It is gold rather than the obvious holly green, and that is a design
	   system decision rather than a taste one. Green is already spoken for:
	   --cl-win is #177a43, and the closest holly that held its contrast came
	   out at #1a7a49 - a ratio of 1.01:1 apart, which is to say the same
	   colour. The badge sits on the same strip as the "last time out" result
	   pill, so a festive green chip and a win green chip would have been
	   indistinguishable, and green would have stopped meaning "win".

	   Not --cl-amber either: that token is scoped to the Etsy button in the
	   header by the comment on it, and this is a deeper, duller gold so the two
	   do not read as the same control when the header sits directly above.

	   Takes ink text, not white - gold is a light fill. */
	--cl-gold: #e8b33a;         /* --cl-ink on it 9.66:1 · against --cl-ink 9.66:1 */
	--cl-badge-bg: var(--cl-gold);  /* the shared badge in seasons.css */

	/* Deliberately NOT overridden: --cl-red, --cl-red-text and --cl-red-on-ink.
	   The brand does not get a seasonal variant. --cl-win and --cl-loss are
	   already tuned to carry white text and are left alone, and --cl-amber is
	   the Etsy button, which is gold and needs no help in December. */
}

/* ==========================================================================
   The backgrounds tokens cannot reach
   ========================================================================== */

/* Five declarations in the parent hardcode a warm brown instead of using a
   token, so the palette swap above misses them and they would sit as brown
   patches in a cold design. They are all artwork backplates - visible as a
   border around non-square podcast art, and while an image loads.

   The parent is not being edited to fix this: these are its colours and they
   are correct for the rest of the year. Overriding them here keeps the change
   inside the season.

   Cooled to the same lightness as the originals, so nothing shifts but hue. */
body.cl-winter .cl-lead__art,        /* home.css:205    */
body.cl-winter .cl-pin__media,       /* home.css:272    */
body.cl-winter .cl-video__media {    /* videos.css:85   */
	background: linear-gradient(150deg, #1b242c, #333f49);
}

body.cl-winter .cl-member__photo {   /* about.css:194 - #2a231e */
	background: #1b242c;
}

body.cl-winter .cl-phone {           /* app.css:108 - #f7f1ef */
	background: #eef3f7;
}

/* Left alone on purpose: the eight rgba(228, 18, 43, ...) literals across seven
   sheets are brand red and stay red, and the #6aa84f playoff marker in
   fixtures.css:365 is already green. */

/* ==========================================================================
   Snow
   ========================================================================== */

/* The falling snow and the snow building up in the footer are drawn by
   assets/js/snow.js, which is only loaded while they are switched on. The two
   canvases are placed by seasons.css, which Easter's blossom shares; this keeps
   the footer's content above the pile. */
body.cl-winter.cl-w-pile .cl-footer > :not(.cl-snow-pile) {
	position: relative;
	z-index: 1;
}

/* ==========================================================================
   Settled snow
   ========================================================================== */

/* Snow piling along the bottom edge of the dark sections. These four are the
   ones already running position: relative with overflow: hidden for their
   wordmark watermark, so the drift needs no layout changes and cannot escape.
   ::before is that watermark, which is why this is on ::after.

   It lands where a dark section meets the white one below it, so the drift
   reads as snow gathered against the boundary rather than as a stripe. */
body.cl-winter.cl-w-drifts .cl-lead::after,
body.cl-winter.cl-w-drifts .cl-hero--ink::after,
body.cl-winter.cl-w-drifts .cl-app-hero::after,
body.cl-winter.cl-w-drifts .cl-about-hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 22px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 22'%3E%3Cpath d='M0 22V13q20-9 40-3t40-2q20-8 40-1t40 0q20-7 40-1t40 7v9z' fill='%23F2F6F9'/%3E%3C/svg%3E") repeat-x left bottom / 240px 22px;
	pointer-events: none;
}

/* ==========================================================================
   Christmas tree
   ========================================================================== */

/* Standing in the bottom corner of the home page's dark lead, on the settled
   snow. It is one more background layer on the same ::after the drift uses, so
   no template changes - which is also why the two have a combined rule for
   when both are on. Height comes from the Customizer (--cl-tree-h). */
body.cl-winter.cl-w-tree .cl-lead::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: var(--cl-tree-h, 150px);
	background: url("../img/tree.svg") no-repeat right 3% bottom 4px / auto calc(var(--cl-tree-h, 150px) - 6px);
	pointer-events: none;
}

body.cl-winter.cl-w-tree.cl-w-drifts .cl-lead::after {
	background:
		url("../img/tree.svg") no-repeat right 3% bottom 4px / auto calc(var(--cl-tree-h, 150px) - 6px),
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 22'%3E%3Cpath d='M0 22V13q20-9 40-3t40-2q20-8 40-1t40 0q20-7 40-1t40 7v9z' fill='%23F2F6F9'/%3E%3C/svg%3E") repeat-x left bottom / 240px 22px;
}

body.cl-winter.cl-w-tree.cl-w-tree-left .cl-lead::after { background-position: left 3% bottom 4px, left bottom; }

/* Below about 1280px the episode art reaches the corner, but there is always
   a clear strip under it, so the tree shrinks to fit there instead of
   standing in front of the art. A smaller Customizer height still wins. */
@media (max-width: 1279px) {
	body.cl-winter.cl-w-tree .cl-lead::after,
	body.cl-winter.cl-w-tree.cl-w-drifts .cl-lead::after {
		height: min(var(--cl-tree-h, 150px), 64px);
		background-size: auto calc(min(var(--cl-tree-h, 150px), 64px) - 6px), 240px 22px;
	}
}
@media (max-width: 700px) {
	body.cl-winter.cl-w-tree .cl-lead::after,
	body.cl-winter.cl-w-tree.cl-w-drifts .cl-lead::after {
		height: min(var(--cl-tree-h, 150px), 52px);
		background-size: auto calc(min(var(--cl-tree-h, 150px), 52px) - 6px), 240px 22px;
	}
}

/* ==========================================================================
   Fairy lights
   ========================================================================== */

/* Strung under the header and along the top of the footer, hanging half over
   the section below so they read as draped rather than as a border.

   Two stacked layers: ::after draws the wire and the bulbs, ::before is a set
   of soft glows at the same four positions that fades in and out. One layer
   could not twinkle - a single background image can only be animated as a
   whole - and this way the bulbs stay put while the light in them moves.

   The header needs a stacking context so the lights paint over the section
   that follows it; without the z-index the next section covers them. Safe to
   add: the mobile drawer is a flex child of the header, not a positioned
   overlay, and the only fixed element in the theme is the consent banner. */
body.cl-winter .cl-header {
	position: relative;
	z-index: 3;
}

body.cl-winter .cl-footer {
	position: relative;
	z-index: 1;
}

body.cl-winter.cl-w-lights-header .cl-header::before,
body.cl-winter.cl-w-lights-header .cl-header::after,
body.cl-winter.cl-w-lights-footer .cl-footer::before,
body.cl-winter.cl-w-lights-footer .cl-footer::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 26px;
	pointer-events: none;
}

body.cl-winter.cl-w-lights-header .cl-header::before,
body.cl-winter.cl-w-lights-header .cl-header::after { bottom: -13px; }

body.cl-winter.cl-w-lights-footer .cl-footer::before,
body.cl-winter.cl-w-lights-footer .cl-footer::after { top: -13px; }

/* The wire and the bulbs. */
body.cl-winter.cl-w-lights-header .cl-header::after,
body.cl-winter.cl-w-lights-footer .cl-footer::after {
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 26'%3E%3Cpath d='M0 3Q15 13 30 3Q45 13 60 3Q75 13 90 3Q105 13 120 3' fill='none' stroke='%23707c88' stroke-width='1.4'/%3E%3Cg fill='%23707c88'%3E%3Crect x='13.8' y='7' width='2.4' height='2.6'/%3E%3Crect x='43.8' y='7' width='2.4' height='2.6'/%3E%3Crect x='73.8' y='7' width='2.4' height='2.6'/%3E%3Crect x='103.8' y='7' width='2.4' height='2.6'/%3E%3C/g%3E%3Cellipse cx='15' cy='14' rx='3.8' ry='4.8' fill='%23E4122B'/%3E%3Cellipse cx='45' cy='14' rx='3.8' ry='4.8' fill='%23E8B33A'/%3E%3Cellipse cx='75' cy='14' rx='3.8' ry='4.8' fill='%232FA84F'/%3E%3Cellipse cx='105' cy='14' rx='3.8' ry='4.8' fill='%23F2F6F9'/%3E%3C/svg%3E") repeat-x left top / 120px 26px;
}

/* The glow, aligned to the four bulb positions in the tile above. */
body.cl-winter.cl-w-lights-header .cl-header::before,
body.cl-winter.cl-w-lights-footer .cl-footer::before {
	background-image:
		radial-gradient(9px 9px at 12.5% 54%, rgba(228, 18, 43, .60), transparent 70%),
		radial-gradient(9px 9px at 37.5% 54%, rgba(232, 179, 58, .60), transparent 70%),
		radial-gradient(9px 9px at 62.5% 54%, rgba(47, 168, 79, .60), transparent 70%),
		radial-gradient(9px 9px at 87.5% 54%, rgba(242, 246, 249, .55), transparent 70%);
	background-size: 120px 26px;
	background-repeat: repeat-x;
	animation: cl-twinkle 2.6s ease-in-out infinite alternate;
}

/* Out of phase with the header, so the two strings are not in lockstep. */
body.cl-winter.cl-w-lights-footer .cl-footer::before { animation-duration: 3.4s; }

@keyframes cl-twinkle {
	from { opacity: .25; }
	to   { opacity: .95; }
}

/* ==========================================================================
   Santa hat
   ========================================================================== */

/* On the logo in the header and again in the footer, as a background on the
   wrapping link rather than as markup. cl_logo() outputs a bare <img>,
   replaced elements do not render pseudo-elements, and the theme has no
   function_exists guard that would let a child redefine it - so the hat hangs
   off the <a> around it instead, and no template is copied.

   Size, nudge and tilt come from the Customizer (--cl-hat-*), so it can be
   lined up on the logo without a deploy. The header grows a little at the top
   so the bobble is never cut off by the edge of the page. */
body.cl-winter.cl-w-hat-header .cl-header__inner {
	padding-top: calc(12px + 16px * var(--cl-hat-scale, 1));
}

body.cl-winter.cl-w-hat-header .cl-brand,
body.cl-winter.cl-w-hat-footer .cl-footer__lockup {
	position: relative;
}

body.cl-winter.cl-w-hat-header .cl-brand::before,
body.cl-winter.cl-w-hat-footer .cl-footer__lockup::before {
	content: "";
	position: absolute;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 66 54'%3E %3Cdefs%3E %3ClinearGradient id='r' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ff4a57'/%3E%3Cstop offset='.45' stop-color='%23d01a2e'/%3E%3Cstop offset='1' stop-color='%2386091a'/%3E%3C/linearGradient%3E %3CradialGradient id='w' cx='.4' cy='.3' r='.8'%3E%3Cstop offset='0' stop-color='%23ffffff'/%3E%3Cstop offset='.7' stop-color='%23eef3f7'/%3E%3Cstop offset='1' stop-color='%23c5d0da'/%3E%3C/radialGradient%3E %3C/defs%3E %3Cpath d='M9 40C8 23 17 9 31 6c12-2 22 4 27 15 2 4 2 8 1 11-2-4-6-6-9-4-3 2-3 7-2 12z' fill='url(%23r)'/%3E %3Cpath d='M31 9c-6 6-9 17-9 30' fill='none' stroke='rgba(255,255,255,.18)' stroke-width='3' stroke-linecap='round'/%3E %3Cpath d='M44 13c4 3 7 8 8 13' fill='none' stroke='rgba(0,0,0,.18)' stroke-width='2' stroke-linecap='round'/%3E %3Cg fill='url(%23w)'%3E %3Ccircle cx='57' cy='34' r='6.6'/%3E %3Crect x='3' y='37' width='50' height='12' rx='6'/%3E %3Ccircle cx='8' cy='42.5' r='5.6'/%3E%3Ccircle cx='16' cy='40.6' r='5'/%3E%3Ccircle cx='24' cy='41.4' r='5.2'/%3E%3Ccircle cx='32' cy='40.4' r='5'/%3E%3Ccircle cx='40' cy='41.2' r='5.2'/%3E%3Ccircle cx='48' cy='42.6' r='5.4'/%3E %3C/g%3E %3Cpath d='M5 47c10 2 34 2 46-1' fill='none' stroke='rgba(120,140,160,.35)' stroke-width='1.6' stroke-linecap='round'/%3E %3C/svg%3E") no-repeat center / contain;
	pointer-events: none;
	z-index: 2;
	rotate: var(--cl-hat-tilt, -12deg);
	transform-origin: 30% 80%;
}

/* Against the 52px header logo. */
body.cl-winter.cl-w-hat-header .cl-brand::before {
	width: calc(48px * var(--cl-hat-scale, 1));
	height: calc(39px * var(--cl-hat-scale, 1));
	left: calc(-7px * var(--cl-hat-scale, 1) + var(--cl-hat-x, 0px));
	top: calc(-18px * var(--cl-hat-scale, 1) + var(--cl-hat-y, 0px));
}

/* Against the 44px footer logo - the same hat, a size down. */
body.cl-winter.cl-w-hat-footer .cl-footer__lockup::before {
	width: calc(41px * var(--cl-hat-scale, 1));
	height: calc(33px * var(--cl-hat-scale, 1));
	left: calc(-6px * var(--cl-hat-scale, 1) + var(--cl-hat-x, 0px));
	top: calc(-15px * var(--cl-hat-scale, 1) + var(--cl-hat-y, 0px));
}

/* ==========================================================================
   Hanging baubles
   ========================================================================== */

/* Two baubles on short threads, hanging below the header near each edge -
   off the fairy lights when those are on. Pseudo-elements of the header's
   inner row, positioned against the header itself, so no markup is added. */
body.cl-winter.cl-w-baubles .cl-header__inner::before,
body.cl-winter.cl-w-baubles .cl-header__inner::after {
	content: "";
	position: absolute;
	top: calc(100% - 4px);
	width: 18px;
	height: 45px;
	background: no-repeat center top / contain;
	pointer-events: none;
	transform-origin: 50% 0;
	animation: cl-sway 4.2s ease-in-out infinite alternate;
	z-index: 1;
}

body.cl-winter.cl-w-baubles .cl-header__inner::before {
	left: 7%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 45'%3E %3Cdefs%3E%3CradialGradient id='b' cx='.35' cy='.32' r='.75'%3E%3Cstop offset='0' stop-color='%23ff7a85'/%3E%3Cstop offset='.5' stop-color='%23e4122b'/%3E%3Cstop offset='1' stop-color='%238e0a1a'/%3E%3C/radialGradient%3E%3C/defs%3E %3Cpath d='M9 0V30' stroke='%239aa5b0' stroke-width='.9'/%3E %3Crect x='6.6' y='29' width='4.8' height='3' rx='.6' fill='%23c9a227'/%3E %3Ccircle cx='9' cy='37' r='7.6' fill='url(%23b)'/%3E %3Cellipse cx='6.4' cy='34' rx='2' ry='1.3' fill='rgba(255,255,255,.55)'/%3E %3C/svg%3E");
}

body.cl-winter.cl-w-baubles .cl-header__inner::after {
	right: 9%;
	height: 35px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 35'%3E %3Cdefs%3E%3CradialGradient id='b' cx='.35' cy='.32' r='.75'%3E%3Cstop offset='0' stop-color='%23fff1c2'/%3E%3Cstop offset='.5' stop-color='%23e8b33a'/%3E%3Cstop offset='1' stop-color='%239c6f12'/%3E%3C/radialGradient%3E%3C/defs%3E %3Cpath d='M9 0V20' stroke='%239aa5b0' stroke-width='.9'/%3E %3Crect x='6.6' y='19' width='4.8' height='3' rx='.6' fill='%23c9a227'/%3E %3Ccircle cx='9' cy='27' r='7.6' fill='url(%23b)'/%3E %3Cellipse cx='6.4' cy='24' rx='2' ry='1.3' fill='rgba(255,255,255,.55)'/%3E %3C/svg%3E");
	animation-duration: 5.1s;
	animation-delay: -1.3s;
}

@keyframes cl-sway {
	from { rotate: -4deg; }
	to   { rotate: 4deg; }
}

@media (max-width: 700px) {
	body.cl-winter.cl-w-baubles .cl-header__inner::after { display: none; }
}

/* ==========================================================================
   Holly
   ========================================================================== */

/* A small sprig before the home page's section headings. */
body.cl-winter.cl-w-holly .cl-watch__title::before {
	content: "";
	display: inline-block;
	width: 1.25em;
	height: 1em;
	margin-inline-end: .3em;
	vertical-align: -.04em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E %3Cpath d='M19 20C14 18 11 20 8 17c2-1 1-3-1-4 3-1 3-3 1-5 4 0 6-2 6-4 2 3 4 3 6 2-1 3 0 6 2 7-3 1-4 4-3 7z' fill='%231f6b3a'/%3E %3Cpath d='M21 20c5-2 8 0 11-3-2-1-1-3 1-4-3-1-3-3-1-5-4 0-6-2-6-4-2 3-4 3-6 2 1 3 0 6-2 7 3 1 4 4 3 7z' fill='%232b8a4b'/%3E %3Cpath d='M19 19C15 14 12 10 8 8M21 19c4-5 7-9 11-11' fill='none' stroke='rgba(0,0,0,.25)' stroke-width='.8'/%3E %3Ccircle cx='17' cy='23' r='4' fill='%23e4122b'/%3E%3Ccircle cx='24' cy='23.5' r='4' fill='%23c40f25'/%3E%3Ccircle cx='20.5' cy='27.5' r='4' fill='%23e4122b'/%3E %3Ccircle cx='16' cy='21.8' r='1.1' fill='rgba(255,255,255,.6)'/%3E%3Ccircle cx='19.5' cy='26.3' r='1.1' fill='rgba(255,255,255,.6)'/%3E %3C/svg%3E") no-repeat center / contain;
}

/* The Boxing Day / New Year badge is styled in seasons.css, in --cl-gold
   (set as --cl-badge-bg above). */
