/*
Theme Name: Severe Weather History
Theme URI: https://severeweatherhistory.com
Author: Severe Weather History
Description: Atmospheric Archive Dark — a dark data-archive block theme for the definitive record of US severe weather. Tri-font system (Inter / Source Serif 4 / JetBrains Mono), tonal slate layering, hazard-semantic accents.
Version: 1.0.0
Requires at least: 6.9
Tested up to: 7.0
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: severeweather
Tags: dark, block-theme, full-site-editing
*/

::selection {
	background-color: var(--wp--preset--color--hazard-severe);
	color: #ffffff;
}

.swh-caps {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--caps);
	font-weight: 700;
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	text-transform: uppercase;
}

.swh-caps-mono {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	font-weight: 500;
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	text-transform: uppercase;
}

.swh-tabular {
	font-variant-numeric: tabular-nums;
}

.swh-card {
	background-color: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	transition: background-color var(--wp--custom--transition);
}

.swh-card:hover {
	background-color: var(--wp--preset--color--card-high);
}

.swh-badge {
	border-radius: 2px;
	display: inline-block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	font-weight: 700;
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	line-height: 1.34;
	padding: 2px 8px;
	text-transform: uppercase;
}

.swh-badge-moderate {
	background-color: var(--wp--custom--hazard-tint--moderate);
	color: var(--wp--preset--color--hazard-moderate);
}

.swh-badge-severe {
	background-color: var(--wp--custom--hazard-tint--severe);
	color: var(--wp--preset--color--hazard-severe-text);
}

.swh-badge-extreme {
	background-color: var(--wp--custom--hazard-tint--extreme);
	color: var(--wp--preset--color--hazard-extreme-text);
}

.wp-block-table {
	overflow-x: auto;
}

.wp-block-table table {
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
	width: 100%;
}

.wp-block-table td:not(:first-child),
.wp-block-table th:not(:first-child) {
	font-family: var(--wp--preset--font-family--mono);
	text-align: right;
	white-space: nowrap;
}

.wp-block-table td:first-child {
	font-family: var(--wp--preset--font-family--display);
}

.wp-block-table thead th {
	background-color: var(--wp--preset--color--card);
	border-bottom: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--caps);
	font-weight: 700;
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	text-align: left;
	text-transform: uppercase;
}

.wp-block-table tbody tr:nth-child(even) {
	background-color: var(--wp--preset--color--surface);
}

.wp-block-table tbody tr:nth-child(odd) {
	background-color: var(--wp--preset--color--card);
}

.wp-block-table :is(th, td) {
	border: 0;
	padding: 0.5rem 0.75rem;
}

.swh-hero {
	background-color: var(--wp--custom--hero--ground);
	border-bottom: 1px solid var(--wp--custom--hero--line);
	overflow: hidden;
	position: relative;
}

.swh-hero > * {
	position: relative;
	z-index: 1;
}

.storm-sky {
	background:
		radial-gradient(90% 70% at 50% -10%, #182741 0%, transparent 65%),
		radial-gradient(60% 50% at 85% 0%, #1c2b47 0%, transparent 70%),
		var(--wp--custom--hero--ground);
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	position: absolute;
	z-index: 0;
}

.storm-cloud {
	animation: swh-cloud-drift 52s ease-in-out infinite alternate;
	background:
		radial-gradient(55% 42% at 22% 18%, rgba(40, 58, 89, 0.5) 0%, transparent 70%),
		radial-gradient(48% 38% at 72% 8%, rgba(28, 43, 71, 0.62) 0%, transparent 72%),
		radial-gradient(65% 48% at 48% 2%, rgba(16, 26, 46, 0.75) 0%, transparent 75%);
	inset: -25% -12%;
	position: absolute;
	will-change: transform;
}

.storm-cloud-far {
	animation: swh-cloud-drift 74s ease-in-out infinite alternate-reverse;
	background:
		radial-gradient(50% 40% at 35% 12%, rgba(35, 52, 82, 0.38) 0%, transparent 70%),
		radial-gradient(45% 36% at 88% 16%, rgba(24, 38, 63, 0.45) 0%, transparent 70%);
	inset: -30% -15%;
}

@keyframes swh-cloud-drift {
	from {
		transform: translate3d(-1.6%, 0, 0);
	}

	to {
		transform: translate3d(1.6%, 0, 0);
	}
}

.sheet-flash {
	animation: swh-sheet-flash 13s linear infinite;
	background: radial-gradient(
		42% 34% at 74% 10%,
		rgba(219, 231, 255, 0.85) 0%,
		rgba(148, 173, 214, 0.22) 45%,
		transparent 70%
	);
	inset: 0;
	opacity: 0;
	position: absolute;
}

.sheet-flash-b {
	animation: swh-sheet-flash 19s linear infinite 7s;
	background: radial-gradient(
		36% 30% at 24% 6%,
		rgba(219, 231, 255, 0.7) 0%,
		rgba(148, 173, 214, 0.18) 45%,
		transparent 70%
	);
}

@keyframes swh-sheet-flash {
	0%, 88.4%, 100% {
		opacity: 0;
	}

	88.9% {
		opacity: 0.55;
	}

	89.6% {
		opacity: 0.08;
	}

	90.6% {
		opacity: 0.4;
	}

	92% {
		opacity: 0;
	}
}

.bolt {
	color: var(--wp--custom--hero--flash);
	filter: drop-shadow(0 0 12px rgba(190, 214, 255, 0.9)) drop-shadow(0 0 34px rgba(148, 183, 255, 0.5));
	opacity: 0;
	position: absolute;
}

.bolt-a {
	animation: swh-bolt-flash-a 13s linear infinite;
	right: 15%;
	top: 4%;
	width: 44px;
}

.bolt-b {
	animation: swh-bolt-flash-b 19s linear infinite 7s;
	right: 36%;
	top: 1%;
	width: 28px;
}

@keyframes swh-bolt-flash-a {
	0%, 88.5%, 100% {
		opacity: 0;
	}

	89% {
		opacity: 1;
	}

	89.8% {
		opacity: 0.12;
	}

	90.8% {
		opacity: 0.85;
	}

	92.2% {
		opacity: 0;
	}
}

@keyframes swh-bolt-flash-b {
	0%, 70%, 100% {
		opacity: 0;
	}

	70.5% {
		opacity: 0.95;
	}

	71.3% {
		opacity: 0.1;
	}

	72.3% {
		opacity: 0.7;
	}

	73.8% {
		opacity: 0;
	}
}

.swh-hero .swh-caps-mono {
	color: var(--wp--custom--hero--muted);
}

.swh-stat-value {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--stat);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
}

.swh-ledger .swh-stat-value {
	font-size: clamp(1.75rem, 1rem + 2.2vw, 3.5rem);
}

.swh-header {
	backdrop-filter: none;
	background-color: var(--wp--preset--color--ground);
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
}

.swh-footer {
	background-color: var(--wp--preset--color--surface);
	border-top: 1px solid var(--wp--preset--color--line-soft);
}

.swh-wordmark-accent {
	color: var(--wp--preset--color--hazard-severe);
}

.wp-block-navigation .wp-block-navigation-item a {
	border-radius: 4px;
	padding: 0.375rem 0.625rem;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.wp-block-navigation .wp-block-navigation-item a:hover {
	background-color: var(--wp--preset--color--card);
	color: var(--wp--preset--color--ink);
}

/* The nav is right-aligned in the header row, and that alignment carried into
   the mobile overlay: the links stacked against the right edge with no padding
   and the longest one was clipped. The panel is laid out explicitly instead. */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--ground);
	display: flex;
	flex-direction: column;
	height: 100dvh;
	inset: 0;
	max-height: 100dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
	position: fixed;
	width: 100vw;
	z-index: 100000;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding: 2.5rem 1.5rem 0;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: flex-start;
	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	border-bottom: 1px solid var(--wp--preset--color--line);
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	color: var(--wp--preset--color--ink);
	display: block;
	font-size: 1.25rem;
	padding: 0.875rem 0;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--ink);
	position: absolute;
	right: 1.25rem;
	top: 1.25rem;
	z-index: 1;
}

.wp-block-search__inside-wrapper {
	background-color: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	padding: 4px;
	transition: border-color var(--wp--custom--transition);
}

.wp-block-search__inside-wrapper:focus-within {
	border-color: var(--wp--preset--color--ink);
}

.swh-hero .wp-block-search__inside-wrapper {
	background-color: var(--wp--custom--hero--card);
	border-color: var(--wp--custom--hero--line);
}

.wp-block-search__input {
	background-color: transparent;
	border: 0;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	outline: none;
	padding: 0.625rem 0.75rem;
}

.wp-block-search__input::placeholder {
	color: var(--wp--preset--color--ink-faint);
}

.wp-block-search__button {
	background-color: var(--wp--preset--color--action);
	border: 0;
	border-radius: 4px;
	color: var(--wp--preset--color--action-ink);
	cursor: pointer;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--data);
	font-weight: 600;
	transition: background-color var(--wp--custom--transition);
}

.wp-block-search__button:hover {
	background-color: var(--wp--preset--color--ink);
}

.swh-footer .wp-block-list {
	list-style: none;
	margin: 0;
}

.swh-footer .wp-block-list li {
	margin-bottom: 0.5rem;
}

.swh-footer .wp-block-list a,
.swh-footer a {
	color: var(--wp--preset--color--ink-muted);
	text-decoration: none;
	transition: color var(--wp--custom--transition);
}

.swh-footer .wp-block-list a:hover,
.swh-footer a:hover {
	color: var(--wp--preset--color--ink);
}

.swh-footer p a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
	outline: 2px solid var(--wp--preset--color--link);
	outline-offset: 2px;
}

html {
	scroll-behavior: smooth;
}

h1,
h2,
h3 {
	text-wrap: balance;
}

p {
	text-wrap: pretty;
}

.swh-header {
	border-top: 2px solid var(--wp--preset--color--hazard-severe);
}

.wp-block-navigation .current-menu-item a,
.wp-block-navigation [aria-current="page"] {
	background-color: var(--wp--preset--color--card);
	color: var(--wp--preset--color--ink);
}

button:active,
.wp-block-search__button:active,
.wp-block-navigation .wp-block-navigation-item a:active {
	transform: translateY(1px);
}

.storm-sky::after {
	background-image:
		repeating-linear-gradient(0deg, rgba(148, 173, 214, 0.05) 0, rgba(148, 173, 214, 0.05) 1px, transparent 1px, transparent 56px),
		repeating-linear-gradient(90deg, rgba(148, 173, 214, 0.04) 0, rgba(148, 173, 214, 0.04) 1px, transparent 1px, transparent 56px);
	content: "";
	inset: 0;
	-webkit-mask-image: radial-gradient(120% 90% at 50% 0%, black 30%, transparent 78%);
	mask-image: radial-gradient(120% 90% at 50% 0%, black 30%, transparent 78%);
	position: absolute;
}

.swh-grain::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
	content: "";
	inset: 0;
	opacity: 0.05;
	pointer-events: none;
	position: absolute;
	z-index: 1;
}

.swh-ledger {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	overflow: hidden;
}

.swh-ledger .wp-block-column {
	border-left: 1px solid var(--wp--preset--color--line-soft);
	position: relative;
}

.swh-ledger .wp-block-column:first-child {
	border-left: 0;
}

.swh-ledger .wp-block-column::before {
	background-color: var(--wp--preset--color--line);
	content: "";
	height: 2px;
	left: 1.5rem;
	position: absolute;
	top: 0;
	width: 2rem;
}

.swh-ledger .wp-block-column:first-child::before {
	background-color: var(--wp--preset--color--hazard-severe);
}

@media (max-width: 781px) {
	.swh-ledger.wp-block-columns:not(.is-not-stacked-on-mobile) {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
	}

	.swh-ledger .wp-block-column:nth-child(odd) {
		border-left: 0;
	}

	.swh-ledger .wp-block-column:nth-child(n+3) {
		border-top: 1px solid var(--wp--preset--color--line-soft);
	}
}

.swh-section-head {
	align-items: baseline;
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	padding-bottom: 0.75rem;
	position: relative;
}

.swh-section-head::after {
	background-color: var(--wp--preset--color--hazard-severe);
	bottom: -1px;
	content: "";
	height: 1px;
	left: 0;
	position: absolute;
	width: 3rem;
}

.swh-section-head .swh-view-all {
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	text-decoration: none;
	text-transform: uppercase;
	transition: color var(--wp--custom--transition);
}

.swh-section-head .swh-view-all:hover {
	color: var(--wp--preset--color--link);
}

.swh-index-card {
	background-color: var(--wp--custom--hero--card);
	border: 1px solid var(--wp--custom--hero--line);
	border-radius: 8px;
}

.swh-index-card .swh-index-row {
	border-top: 1px solid var(--wp--custom--hero--line);
	display: flex;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--data);
	font-variant-numeric: tabular-nums;
	gap: 1rem;
	justify-content: space-between;
	margin: 0;
	padding: 0.625rem 1rem;
}

.swh-index-card .swh-index-row:first-of-type {
	border-top: 0;
}

.swh-index-card .swh-index-row .swh-index-label {
	color: var(--wp--custom--hero--faint);
	font-size: var(--wp--preset--font-size--caps);
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	text-transform: uppercase;
}

.swh-index-card .swh-index-row .swh-index-value {
	color: var(--wp--custom--hero--ink);
}

.swh-popular {
	align-items: baseline;
	color: var(--wp--custom--hero--faint);
	display: flex;
	flex-wrap: wrap;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	gap: 0.375rem 0.875rem;
}

.swh-popular a {
	color: var(--wp--custom--hero--muted);
	text-decoration: none;
	transition: color var(--wp--custom--transition);
}

.swh-popular a:hover {
	color: var(--wp--custom--hero--ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.swh-post-card {
	display: flex;
	flex-direction: column;
}

.swh-post-card .wp-block-post-excerpt {
	flex-grow: 1;
}

.swh-post-card .wp-block-post-excerpt__more-text a,
.swh-read-more {
	color: var(--wp--preset--color--link);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	text-decoration: none;
	text-transform: uppercase;
}

.wp-block-table thead th {
	position: sticky;
	top: 0;
}

.wp-block-table tbody tr {
	transition: background-color var(--wp--custom--transition);
}

.wp-block-table tbody tr:hover {
	background-color: var(--wp--preset--color--card-high);
}

.swh-decades {
	align-items: end;
	display: grid;
	gap: 0.5rem;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	min-height: 180px;
}

.swh-decade {
	align-items: center;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	height: 100%;
	justify-content: flex-end;
}

.swh-decade-bar {
	background-color: var(--wp--preset--color--line);
	border-radius: 2px 2px 0 0;
	display: block;
	transition: background-color var(--wp--custom--transition);
	width: 100%;
}

.swh-decade:hover .swh-decade-bar {
	background-color: var(--wp--preset--color--ink-muted);
}

.swh-decade.is-peak .swh-decade-bar {
	background-color: var(--wp--preset--color--hazard-severe);
}

.swh-decade-value,
.swh-decade-label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	font-variant-numeric: tabular-nums;
	order: -1;
}

.swh-decade-value {
	color: var(--wp--preset--color--ink);
}

.swh-decade-label {
	color: var(--wp--preset--color--ink-faint);
	order: 1;
}

.swh-place-list,
.swh-county-index {
	display: grid;
	gap: 0.5rem 1.5rem;
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
}

.swh-place-list {
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.swh-county-index {
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.swh-place-list li,
.swh-county-index li {
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
	display: flex;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--data);
	gap: 0.75rem;
	justify-content: space-between;
	padding-bottom: 0.375rem;
}

.swh-place-count {
	color: var(--wp--preset--color--ink-faint);
	font-family: var(--wp--preset--font-family--mono);
	font-variant-numeric: tabular-nums;
}

.swh-county-index a,
.swh-place-list a {
	text-decoration: none;
}

.swh-county-index a:hover,
.swh-place-list a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.swh-tile-map {
	display: grid;
	gap: 4px;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	margin-top: 1.5rem;
}

.swh-tile {
	aspect-ratio: 1;
	border: 1px solid var(--wp--preset--color--line-soft);
	border-radius: 4px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	justify-content: center;
	padding: 4px;
	text-align: center;
	text-decoration: none;
	transition: transform var(--wp--custom--transition), border-color var(--wp--custom--transition);
}

.swh-tile:hover {
	border-color: var(--wp--preset--color--ink-muted);
	transform: translateY(-1px);
}

.swh-tile-l0 { background-color: var(--wp--preset--color--surface); }
.swh-tile-l1 { background-color: var(--wp--preset--color--card); }
.swh-tile-l2 { background-color: var(--wp--preset--color--card-high); }
.swh-tile-l3 { background-color: #3b4d6b; }
.swh-tile-l4 { background-color: var(--wp--preset--color--hazard-severe); }

.swh-tile-code {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-size: 0.8125rem;
	font-weight: 700;
}

.swh-tile-l4 .swh-tile-code,
.swh-tile-l4 .swh-tile-count {
	color: #0b1220;
}

.swh-tile-count {
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.5625rem;
	font-variant-numeric: tabular-nums;
}

@media (max-width: 781px) {
	.swh-tile-count {
		display: none;
	}
}

.swh-otd-list {
	display: grid;
	gap: 0.625rem;
	font-family: var(--wp--preset--font-family--serif);
	list-style: none;
	margin: 0;
	padding: 0;
}

.swh-otd-list li {
	border-bottom: 1px solid var(--wp--preset--color--line-soft);
	padding-bottom: 0.625rem;
}

.swh-otd-year {
	color: var(--wp--preset--color--hazard-severe-text);
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 700;
}

.swh-days-since {
	margin-top: 2rem;
}

.swh-flip-row {
	display: inline-flex;
	gap: 4px;
}

.swh-flip-digit {
	background-color: var(--wp--custom--hero--card);
	border: 1px solid var(--wp--custom--hero--line);
	border-radius: 4px;
	box-shadow: inset 0 -1.5em 0 rgba(2, 6, 23, 0.35);
	color: var(--wp--custom--hero--ink);
	display: inline-block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.5rem);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1;
	padding: 0.375em 0.3em;
	position: relative;
}

.swh-flip-digit::after {
	background-color: var(--wp--custom--hero--line);
	content: "";
	height: 1px;
	left: 0;
	opacity: 0.7;
	position: absolute;
	right: 0;
	top: 50%;
}

.swh-cite {
	border-left: 2px solid var(--wp--preset--color--line);
	margin-top: 3rem;
	padding-left: 1.25rem;
}

.swh-cite-text {
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--data);
	margin: 0;
}

.rank-math-breadcrumb {
	color: var(--wp--preset--color--ink-faint);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	margin-bottom: 1rem;
	text-transform: uppercase;
}

.rank-math-breadcrumb a {
	color: var(--wp--preset--color--ink-muted);
	text-decoration: none;
}

.rank-math-breadcrumb a:hover {
	color: var(--wp--preset--color--link);
}

.rank-math-breadcrumb .separator {
	margin: 0 0.375rem;
}

.swh-alert-list {
	display: grid;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.swh-alert {
	padding: 1rem 1.25rem;
}

.swh-alert-area {
	font-family: var(--wp--preset--font-family--serif);
	margin: 0.375rem 0;
}

.swh-tone-extreme {
	color: var(--wp--preset--color--hazard-extreme-text);
}

.swh-tone-severe {
	color: var(--wp--preset--color--hazard-severe-text);
}

.swh-tone-elevated {
	color: var(--wp--preset--color--hazard-moderate);
}

.swh-tone-watch {
	color: var(--wp--preset--color--ink-muted);
}

.swh-pulse {
	background-color: var(--wp--preset--color--hazard-extreme);
	border-radius: 9999px;
	display: inline-block;
	height: 8px;
	margin-right: 0.5rem;
	vertical-align: 1px;
	width: 8px;
}

@media (prefers-reduced-motion: no-preference) {
	.swh-pulse {
		animation: swh-pulse 1.6s ease-in-out infinite;
	}
}

@keyframes swh-pulse {
	0%, 100% {
		opacity: 1;
	}

	50% {
		opacity: 0.35;
	}
}

@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.swh-card,
		.swh-ledger {
			animation: swh-rise linear both;
			animation-range: entry 0% entry 40%;
			animation-timeline: view();
		}
	}
}

@keyframes swh-rise {
	from {
		opacity: 0.2;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.storm-cloud,
	.storm-cloud-far {
		animation: none;
	}

	.sheet-flash,
	.sheet-flash-b,
	.bolt {
		animation: none;
		opacity: 0;
	}
}

/* Live search */
.swh-search {
	position: relative;
	margin-top: 2rem;
	max-width: 42rem;
}

.swh-search-form {
	align-items: stretch;
	background-color: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	display: flex;
	gap: 4px;
	padding: 4px;
	transition: border-color var(--wp--custom--transition);
}

.swh-search-hero .swh-search-form {
	background-color: var(--wp--custom--hero--card);
	border-color: var(--wp--custom--hero--line);
}

.swh-search-form:focus-within {
	border-color: var(--wp--preset--color--link);
}

.swh-search-form input[type="search"] {
	appearance: none;
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--ink);
	flex: 1;
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	outline: none;
	padding: 0.75rem 0.875rem;
}

.swh-search-form input::placeholder {
	color: var(--wp--preset--color--ink-faint);
}

.swh-search-form button {
	background-color: var(--wp--preset--color--action);
	border: 0;
	border-radius: 4px;
	color: var(--wp--preset--color--action-ink);
	cursor: pointer;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--data);
	font-weight: 600;
	padding: 0 1.25rem;
	transition: background-color var(--wp--custom--transition);
}

.swh-search-form button:hover {
	background-color: var(--wp--preset--color--ink);
}

.swh-search-results {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 6px;
	box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
	left: 0;
	list-style: none;
	margin: 6px 0 0;
	max-height: 380px;
	overflow-y: auto;
	padding: 4px;
	position: absolute;
	right: 0;
	top: 100%;
	z-index: 30;
}

.swh-search-results li a {
	align-items: baseline;
	border-radius: 4px;
	display: flex;
	gap: 0.75rem;
	padding: 0.625rem 0.75rem;
	text-decoration: none;
	transition: background-color var(--wp--custom--transition);
}

.swh-search-results li a:hover,
.swh-search-results li a.is-active {
	background-color: var(--wp--preset--color--card);
}

.swh-search-kind {
	color: var(--wp--preset--color--hazard-severe-text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	min-width: 4.5rem;
	text-transform: uppercase;
}

.swh-search-label {
	color: var(--wp--preset--color--ink);
	flex: 1;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--data);
}

.swh-search-meta,
.swh-search-empty {
	color: var(--wp--preset--color--ink-faint);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	font-variant-numeric: tabular-nums;
}

.swh-search-empty {
	padding: 0.75rem;
}

/* Contact form */
.swh-form {
	background-color: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 8px;
	display: grid;
	gap: 1rem;
	margin-top: 2rem;
	max-width: 40rem;
	padding: 1.75rem;
}

.swh-field {
	display: grid;
	gap: 0.375rem;
	margin: 0;
}

.swh-field label {
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--data);
}

.swh-field input,
.swh-field select,
.swh-field textarea {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--display);
	font-size: 1rem;
	padding: 0.625rem 0.75rem;
	transition: border-color var(--wp--custom--transition);
	width: 100%;
}

.swh-field textarea {
	font-family: var(--wp--preset--font-family--serif);
	resize: vertical;
}

.swh-field :is(input, select, textarea):focus {
	border-color: var(--wp--preset--color--link);
	outline: none;
}

.swh-field-hp {
	left: -9999px;
	position: absolute;
}

.swh-field-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin: 0.5rem 0 0;
}

.swh-field-actions .swh-caps-mono {
	color: var(--wp--preset--color--ink-faint);
}

.swh-form-notice {
	border-left: 2px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--serif);
	margin-top: 1.5rem;
	padding: 0.875rem 1.25rem;
}

.swh-form-notice.is-ok {
	border-left-color: var(--wp--preset--color--hazard-severe);
	background-color: var(--wp--custom--hazard-tint--severe);
}

.swh-form-notice.is-error {
	border-left-color: var(--wp--preset--color--hazard-extreme);
	background-color: var(--wp--custom--hazard-tint--extreme);
}

/* Table of contents */
.swh-toc {
	background-color: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line-soft);
	border-radius: 8px;
	margin-bottom: 2rem;
	padding: 1.25rem 1.5rem;
}

.swh-toc .swh-caps-mono {
	color: var(--wp--preset--color--ink-faint);
	margin: 0 0 0.625rem;
}

.swh-toc ol {
	columns: 2;
	column-gap: 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.swh-toc li {
	break-inside: avoid;
	margin-bottom: 0.375rem;
}

.swh-toc a {
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--data);
	text-decoration: none;
}

.swh-toc a:hover {
	color: var(--wp--preset--color--link);
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 600px) {
	.swh-toc ol {
		columns: 1;
	}
}

/* Data chart figure */
.swh-chart {
	margin: 1.5rem 0 0;
}

.swh-chart img {
	border: 1px solid var(--wp--preset--color--line-soft);
	border-radius: 8px;
	height: auto;
	max-width: 100%;
}

:target {
	scroll-margin-top: 5rem;
}

/* Cross-document page transitions */
@view-transition {
	navigation: auto;
}

@media (prefers-reduced-motion: no-preference) {
	::view-transition-old(root) {
		animation: swh-fade-out 140ms ease both;
	}

	::view-transition-new(root) {
		animation: swh-fade-in 220ms ease both;
	}
}

@keyframes swh-fade-out {
	to {
		opacity: 0;
		transform: translateY(-4px);
	}
}

@keyframes swh-fade-in {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
}

@media (prefers-reduced-motion: reduce) {
	::view-transition-old(root),
	::view-transition-new(root) {
		animation: none;
	}
}

.swh-days-since-place a {
	color: var(--wp--custom--hero--muted);
	text-decoration: none;
	transition: color var(--wp--custom--transition);
}

.swh-days-since-place a:hover {
	color: var(--wp--preset--color--link);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.swh-days-since-note {
	color: var(--wp--custom--hero--faint);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--caps);
	line-height: 1.5;
	margin: 0.5rem 0 0;
	max-width: 26rem;
}

.swh-days-since {
	transition: opacity 180ms ease;
}

.swh-days-since.is-swapping {
	opacity: 0.25;
}

.swh-flip-digit.is-symbol {
	background: transparent;
	border-color: transparent;
	box-shadow: none;
	padding-inline: 0.05em;
}

.swh-flip-digit.is-symbol::after {
	display: none;
}

.swh-fact-dots {
	display: flex;
	gap: 6px;
	margin: 0.875rem 0 0;
}

.swh-fact-dot {
	background-color: var(--wp--custom--hero--line);
	border: 0;
	border-radius: 9999px;
	cursor: pointer;
	height: 5px;
	padding: 0;
	transition: background-color var(--wp--custom--transition), width var(--wp--custom--transition);
	width: 14px;
}

.swh-fact-dot:hover {
	background-color: var(--wp--custom--hero--muted);
}

.swh-fact-dot.is-active {
	background-color: var(--wp--preset--color--hazard-severe);
	width: 24px;
}

/* Light theme (data-swh-theme="light") — hero band stays dark by brand lock */
[data-swh-theme="light"] {
	--wp--preset--color--ground: #f6f8fc;
	--wp--preset--color--surface: #ffffff;
	--wp--preset--color--card: #ffffff;
	--wp--preset--color--card-high: #eef2f9;
	--wp--preset--color--line: #d8e0ec;
	--wp--preset--color--line-soft: #e7edf6;
	--wp--preset--color--ink: #0b1c30;
	--wp--preset--color--ink-muted: #5a6b84;
	--wp--preset--color--ink-faint: #8194ad;
	--wp--preset--color--hazard-moderate: #b45309;
	--wp--preset--color--hazard-severe: #c2410c;
	--wp--preset--color--hazard-extreme: #b91c1c;
	--wp--preset--color--hazard-severe-text: #c2410c;
	--wp--preset--color--hazard-extreme-text: #b91c1c;
	--wp--preset--color--link: #0369a1;
	--wp--preset--color--action: #0f172a;
	--wp--preset--color--action-ink: #f1f5f9;
	--wp--custom--hazard-tint--moderate: #fdf1de;
	--wp--custom--hazard-tint--severe: #ffe8d5;
	--wp--custom--hazard-tint--extreme: #fee2e2;
	color-scheme: light;
}

[data-swh-theme="light"] .swh-tile-l0 { background-color: #eef2f9; }
[data-swh-theme="light"] .swh-tile-l1 { background-color: #dbe4f0; }
[data-swh-theme="light"] .swh-tile-l2 { background-color: #b9c9de; }
[data-swh-theme="light"] .swh-tile-l3 { background-color: #8aa3c2; }
[data-swh-theme="light"] .swh-tile-l4 { background-color: #c2410c; }
[data-swh-theme="light"] .swh-tile-l4 .swh-tile-code,
[data-swh-theme="light"] .swh-tile-l4 .swh-tile-count { color: #ffffff; }
[data-swh-theme="light"] .swh-chart img { background-color: #ffffff; }
[data-swh-theme="light"] .swh-decade-bar { background-color: #b9c9de; }
[data-swh-theme="light"] .swh-decade.is-peak .swh-decade-bar { background-color: var(--wp--preset--color--hazard-severe); }

.swh-theme-toggle {
	align-items: center;
	background: transparent;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	color: var(--wp--preset--color--ink-muted);
	cursor: pointer;
	display: inline-flex;
	gap: 0.375rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--caps);
	letter-spacing: var(--wp--custom--caps-letter-spacing);
	padding: 0.375rem 0.625rem;
	text-transform: uppercase;
	transition: border-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

.swh-theme-toggle:hover {
	border-color: var(--wp--preset--color--ink-muted);
	color: var(--wp--preset--color--ink);
}

.swh-theme-toggle svg {
	height: 14px;
	width: 14px;
}

/* Consent banner */
.swh-consent {
	background-color: var(--wp--preset--color--surface);
	border-top: 1px solid var(--wp--preset--color--line);
	bottom: 0;
	box-shadow: 0 -12px 32px rgba(2, 6, 23, 0.35);
	left: 0;
	position: fixed;
	right: 0;
	z-index: 60;
}

.swh-consent-inner {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	justify-content: space-between;
	margin: 0 auto;
	max-width: 80rem;
	padding: 1rem 1.5rem;
}

.swh-consent-text {
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--data);
	margin: 0;
	max-width: 52rem;
}

.swh-consent-actions {
	display: flex;
	gap: 0.5rem;
}

.swh-consent button {
	border-radius: 4px;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--data);
	font-weight: 600;
	padding: 0.5rem 1.125rem;
	transition: background-color var(--wp--custom--transition);
}

.swh-consent-decline {
	background: transparent;
	border: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--ink-muted);
}

.swh-consent-decline:hover {
	color: var(--wp--preset--color--ink);
}

.swh-consent-accept {
	background-color: var(--wp--preset--color--action);
	border: 1px solid var(--wp--preset--color--action);
	color: var(--wp--preset--color--action-ink);
}

.swh-account {
	background-color: var(--wp--preset--color--surface);
	border-left: 2px solid var(--wp--preset--color--hazard-severe);
	border-radius: 0 6px 6px 0;
	margin: 1.25rem 0 0;
	padding: 1.125rem 1.5rem;
}

.swh-account figcaption {
	color: var(--wp--preset--color--ink-faint);
	margin-bottom: 0.5rem;
}

.swh-account blockquote {
	border: 0;
	margin: 0;
	padding: 0;
}

.swh-account blockquote p {
	color: var(--wp--preset--color--ink-muted);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--data);
	line-height: 1.65;
	margin: 0;
}

/*
 * The hero band stays dark in both themes (brand lock), so inside it every
 * palette token is pinned back to its dark-theme value — otherwise light-mode
 * ink would render dark-on-dark.
 */
[data-swh-theme="light"] .swh-hero {
	--wp--preset--color--ground: var(--wp--custom--hero--ground);
	--wp--preset--color--surface: var(--wp--custom--hero--surface);
	--wp--preset--color--card: var(--wp--custom--hero--card);
	--wp--preset--color--card-high: #16233a;
	--wp--preset--color--line: var(--wp--custom--hero--line);
	--wp--preset--color--line-soft: var(--wp--custom--hero--line);
	--wp--preset--color--ink: var(--wp--custom--hero--ink);
	--wp--preset--color--ink-muted: var(--wp--custom--hero--muted);
	--wp--preset--color--ink-faint: var(--wp--custom--hero--faint);
	--wp--preset--color--hazard-severe-text: #fb923c;
	--wp--preset--color--hazard-extreme-text: #f87171;
	--wp--preset--color--link: #7bd0ff;
	--wp--preset--color--action: #e2e8f0;
	--wp--preset--color--action-ink: #0f172a;
	color: var(--wp--custom--hero--ink);
}

[data-swh-theme="light"] .swh-hero :is(h1, h2, h3),
[data-swh-theme="light"] .swh-hero .has-ink-color {
	color: var(--wp--custom--hero--ink);
}

[data-swh-theme="light"] .swh-hero .has-hazard-severe-text-color {
	color: #fb923c;
}

[data-swh-theme="light"] .swh-hero .swh-search-results {
	background-color: var(--wp--custom--hero--surface);
	border-color: var(--wp--custom--hero--line);
}

[data-swh-theme="light"] .swh-hero .swh-search-label {
	color: var(--wp--custom--hero--ink);
}
