/* Season themes: hero motif canvas and the preview switcher. Colours come from the site tokens, so the
   switcher follows the theme it previews. */

.wrn-season-motif {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	/* Particles fade out over the hero's bottom quarter instead of vanishing at the section edge. */
	-webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent);
	mask-image: linear-gradient(to bottom, #000 72%, transparent);
}

.wrn-season {
	position: fixed;
	right: calc(16px + env(safe-area-inset-right, 0px));
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	z-index: 45; /* under the sticky header (50) and its open mobile menu */
	font-family: var(--wrn-font-body, "Lora", serif);
}

/* Phones: the button fades while the page scrolls (season-themes.js), back after 600 ms idle. The opacity sits on
   the glass button itself: opacity below 1 on an ancestor makes that ancestor the backdrop root, and the button's
   blur would vanish for the whole fade and snap back at the end. */
.wrn-season.is-scrolling .wrn-season-btn {
	opacity: .5;
}

.wrn-season-btn {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 50%;
	background: var(--wrn-glass-deep, rgba(3, 24, 47, .72));
	color: var(--wrn-ice, #d7e7f0);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	backdrop-filter: blur(12px) saturate(140%);
	box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .45);
	cursor: pointer;
	transition: box-shadow .2s var(--wrn-ease, ease), transform .2s var(--wrn-ease, ease), opacity .3s var(--wrn-ease, ease);
	position: relative;
}

/* 44px hit area around the 38px button. */
.wrn-season-btn::before {
	content: "";
	position: absolute;
	inset: -3px;
	border-radius: 50%;
}

.wrn-season-btn:hover,
.wrn-season-btn[aria-expanded="true"] {
	box-shadow: var(--wrn-glow);
}

.wrn-season-btn svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.5;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* The button floats over light sections too: a navy ring with an ice halo shows on both. */
.wrn-season-btn:focus-visible {
	outline: 2px solid var(--wrn-navy, #06305c);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--wrn-ice, #d7e7f0);
	/* The ring appears in one step with its outline, instead of morphing out of the drop shadow. */
	transition-property: transform, opacity;
}

.wrn-season-menu {
	position: absolute;
	right: 0;
	bottom: calc(100% + 10px);
	width: min(272px, calc(100vw - 32px));
	max-height: calc(100vh - 96px);
	max-height: calc(100dvh - 96px);
	overflow-y: auto;
	padding: 6px;
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: var(--wrn-radius-sm, 12px);
	background: var(--wrn-glass-deep, rgba(3, 24, 47, .72));
	-webkit-backdrop-filter: blur(18px) saturate(140%);
	backdrop-filter: blur(18px) saturate(140%);
	box-shadow: 0 18px 48px -12px rgba(0, 0, 0, .5);
	color: #fff;
	/* Opens and closes like the header's panels: a short fade and rise. The menu stays display:none while
	   [hidden], so it is never focusable or clickable when closed. */
	transform-origin: 100% 100%;
	transition: opacity var(--wrn-dur-s, .18s) var(--wrn-ease, ease), transform var(--wrn-dur-s, .18s) var(--wrn-ease, ease), display var(--wrn-dur-s, .18s) allow-discrete;
}

@starting-style {
	.wrn-season-menu {
		opacity: 0;
		transform: translateY(4px);
	}
}

.wrn-season-menu[hidden] {
	display: none;
	opacity: 0;
	transform: translateY(4px);
}

.wrn-season-opt {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	border: 0;
	border-radius: 8px;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.wrn-season-opt[data-season=""] {
	margin-bottom: 4px;
	box-shadow: 0 5px 0 -4px rgba(255, 255, 255, .14);
}

.wrn-season-opt:hover {
	background: rgba(255, 255, 255, .1);
}

/* Options sit on the dark menu, so the ice ring shows. */
.wrn-season-opt:focus-visible {
	outline: 2px solid var(--wrn-ice, #d7e7f0);
	outline-offset: 2px;
	background: rgba(255, 255, 255, .1);
}

.wrn-season-sw {
	flex: none;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--sw-a) 50%, var(--sw-b) 50%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.wrn-season-txt {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.wrn-season-name {
	font-family: var(--wrn-font-display, "Sequel Neue", sans-serif);
	font-size: 13px;
	line-height: 1.3;
	letter-spacing: .01em;
}

.wrn-season-when {
	font-size: 12.5px;
	line-height: 1.35;
	color: rgba(255, 255, 255, .85);
}

.wrn-season-check {
	flex: none;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: var(--wrn-ice, #d7e7f0);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	visibility: hidden;
}

.wrn-season-opt[aria-checked="true"] .wrn-season-check {
	visibility: visible;
}

/* A wrapped badge breaks evenly instead of leaving one word on its own line. */
.wrn-hero-badge {
	text-wrap: balance;
}

/* A theme's wordmark in place of the pre-line text: one line of type tall. */
.wrn-hero-wordmark {
	height: 1em;
	width: auto;
	vertical-align: baseline;
}

/* Theme switch: one whole-page cross-fade (season-themes.js choose()). Per-element colour transitions are held
   off for the switch, so buttons and links do not lag the page through muddy in-between colours. */
html.wrn-season-switching *,
html.wrn-season-switching *::before,
html.wrn-season-switching *::after {
	transition: none !important;
}

::view-transition-old(root),
::view-transition-new(root) {
	animation-duration: var(--wrn-dur-m, .3s);
	animation-timing-function: var(--wrn-ease, ease);
}

@media (prefers-reduced-motion: reduce) {
	.wrn-season,
	.wrn-season-btn,
	.wrn-season-menu {
		transition: none;
	}
}
