/*
 * Snow Watch Advisories
 * Clean, rounded cards: inset graphic, quiet status tag, valid times in a soft panel.
 * Colours follow snowwatch.org; override any --swa-* variable in the theme.
 */
.swa {
	--swa-blue: #056cf2;
	--swa-blue-dark: #0450b4;
	--swa-blue-tint: #e9f1fe;
	--swa-navy: #0a2540;
	--swa-slate: #4d5d6e;
	--swa-muted: #6c7a89;
	--swa-line: #e5e9ee;
	--swa-line-hover: #d3dae2;
	--swa-surface: #fff;
	--swa-soft: #f5f7fa;
	--swa-green: #34cc99;
	--swa-amber-tint: #fdf3d3;
	--swa-amber-ink: #7a5600;
	--swa-radius: 14px;
	--swa-radius-inner: 10px;

	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--swa-navy);
	text-align: left;
}
.swa *,
.swa *::before,
.swa *::after { box-sizing: border-box; }
.swa p,
.swa dl,
.swa dd,
.swa dt { margin: 0; padding: 0; }

.swa .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.swa a:focus-visible {
	outline: 2px solid var(--swa-blue);
	outline-offset: 2px;
	border-radius: 4px;
}

/* -------------------------------------------------------------------------
 * Optional key figures (summary="yes")
 * ---------------------------------------------------------------------- */
.swa .swa-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
}
.swa .swa-summary__item {
	flex: 1 1 0;
	min-width: 120px;
	padding: 12px 16px;
	background: var(--swa-surface);
	border: 1px solid var(--swa-line);
	border-radius: var(--swa-radius);
}
.swa .swa-summary dt { font-size: 12.5px; color: var(--swa-muted); }
.swa .swa-summary dd {
	margin-top: 2px;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
}
.swa .swa-summary__item--total dd { color: var(--swa-blue); }

/* -------------------------------------------------------------------------
 * List and cards
 * ---------------------------------------------------------------------- */
.swa .swa__list { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.swa .swa__list > li { margin: 0; padding: 0; list-style: none; }
.swa .swa__list > li::before { content: none; }

.swa .swa-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 8px;
	background: var(--swa-surface);
	border: 1px solid var(--swa-line);
	border-radius: var(--swa-radius);
	box-shadow: 0 1px 2px rgba(10, 37, 64, .04);
	transition: border-color .2s ease, box-shadow .2s ease;
}
.swa .swa-card:hover {
	border-color: var(--swa-line-hover);
	box-shadow: 0 6px 20px rgba(10, 37, 64, .07);
}

/* Graphic: inset, rounded, and the box takes the image's own shape. */
.swa .swa-card__graphic {
	display: block;
	overflow: hidden;
	border-radius: var(--swa-radius-inner);
	background: var(--swa-soft);
}
.swa .swa-card__graphic img {
	display: block;
	width: 100%;
	height: auto;
	/* Holds the usual graphic shape (1500 × 1300) while loading, then uses the image's own. */
	aspect-ratio: auto 15 / 13;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
.swa .swa-card__graphic.is-empty {
	display: grid;
	place-items: center;
	aspect-ratio: 15 / 13;
	font-size: 13px;
	color: var(--swa-muted);
}

/* Body */
.swa .swa-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 14px 8px 4px;
}
.swa .swa-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-bottom: 8px;
}
.swa .swa-tag {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 6px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	color: var(--swa-blue-dark);
	background: var(--swa-blue-tint);
}
.swa .swa-card--preliminary .swa-tag { color: var(--swa-amber-ink); background: var(--swa-amber-tint); }
.swa .swa-card.is-expired .swa-tag,
.swa .swa-card.is-withdrawn .swa-tag { color: var(--swa-slate); background: var(--swa-soft); }
.swa .swa-card__when {
	font-size: 12.5px;
	color: var(--swa-muted);
	font-variant-numeric: tabular-nums;
}

.swa h3.swa-card__title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 16.5px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -.01em;
	text-transform: none;
	color: var(--swa-navy);
}
.swa .swa-card__title a { color: inherit; text-decoration: none; }
.swa .swa-card__title a:hover { color: var(--swa-blue); }
.swa .swa-card.is-expired .swa-card__title,
.swa .swa-card.is-withdrawn .swa-card__title { color: var(--swa-slate); }
.swa .swa-card.is-withdrawn .swa-card__title a { text-decoration: line-through; text-decoration-thickness: 1px; }

.swa .swa-card__desc {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 6px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--swa-slate);
}

/* Valid from / to in a soft panel on the card's base line. */
.swa .swa-facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-top: auto;
	padding: 10px 12px;
	background: var(--swa-soft);
	border-radius: var(--swa-radius-inner);
	font-variant-numeric: tabular-nums;
}
.swa .swa-facts dt { font-size: 12px; line-height: 1.4; color: var(--swa-muted); }
.swa .swa-facts dd { margin-top: 1px; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--swa-navy); }
.swa .swa-card.is-expired .swa-facts dd,
.swa .swa-card.is-withdrawn .swa-facts dd { color: var(--swa-slate); }

/* Space above the panel, whether a description is there or not. */
.swa .swa-card__body > :nth-last-child(2) { margin-bottom: 14px; }

/* -------------------------------------------------------------------------
 * Grid (columns 2–4). Columns follow the width of the space the list sits in.
 * ---------------------------------------------------------------------- */
.swa.swa--grid { container-type: inline-size; }
.swa--grid .swa__list { grid-template-columns: minmax(0, 1fr); }

@container (min-width: 500px) {
	.swa--grid .swa__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (min-width: 780px) {
	.swa--cols-3 .swa__list,
	.swa--cols-4 .swa__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (min-width: 1040px) {
	.swa--cols-4 .swa__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* -------------------------------------------------------------------------
 * Single column (columns="1"): graphic on the right.
 * ---------------------------------------------------------------------- */
.swa:not(.swa--grid) .swa-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 140px;
	grid-template-areas: "body graphic";
	gap: 8px;
}
.swa:not(.swa--grid) .swa-card__body { grid-area: body; padding: 8px 8px 0; }
.swa:not(.swa--grid) .swa-card__graphic { grid-area: graphic; align-self: start; }

/* -------------------------------------------------------------------------
 * Empty state
 * ---------------------------------------------------------------------- */
.swa .swa-empty {
	padding: 8px;
	background: var(--swa-surface);
	border: 1px solid var(--swa-line);
	border-radius: var(--swa-radius);
	box-shadow: 0 1px 2px rgba(10, 37, 64, .04);
}
.swa .swa-empty__main { padding: 12px 12px 14px; }
.swa .swa-empty__state {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16.5px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -.01em;
	color: var(--swa-navy);
}
.swa .swa-empty__dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	/* Same blue as the site's buttons, e.g. Report Snowfall. */
	background: var(--swa-blue);
	box-shadow: 0 0 0 4px rgba(5, 108, 242, .14);
}
.swa .swa-empty__text {
	max-width: 80ch;
	margin-top: 4px;
	padding-left: 18px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--swa-slate);
}
.swa .swa-empty__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 24px;
	padding: 12px 14px;
	background: var(--swa-soft);
	border-radius: var(--swa-radius-inner);
}
.swa .swa-empty__facts { display: flex; flex-wrap: wrap; gap: 10px 40px; }
.swa .swa-empty__fact { min-width: 0; }
.swa .swa-empty__fact dt { margin-bottom: 2px; font-size: 12px; line-height: 1.4; color: var(--swa-muted); }
.swa .swa-empty__fact dd {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0 8px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--swa-slate);
	font-variant-numeric: tabular-nums;
}
.swa .swa-empty__fact a { font-weight: 600; color: var(--swa-navy); text-decoration: none; }
.swa .swa-empty__fact a:hover { color: var(--swa-blue); }

/* Archive links */
.swa .swa-empty__archive,
.swa .swa__more {
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.45;
	color: var(--swa-blue);
	text-decoration: none;
	white-space: nowrap;
}
.swa .swa-empty__archive:hover,
.swa .swa__more:hover { color: var(--swa-blue-dark); text-decoration: underline; text-underline-offset: .2em; }
.swa .swa__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; }
.swa .swa__more svg { transition: transform .15s ease; }
.swa .swa__more:hover svg { transform: translateX(2px); }

/* -------------------------------------------------------------------------
 * Small screens
 * ---------------------------------------------------------------------- */
@media (max-width: 480px) {
	.swa .swa-summary__item { flex-basis: calc(50% - 4px); min-width: 0; }
	.swa:not(.swa--grid) .swa-card { grid-template-columns: minmax(0, 1fr) 92px; }
	.swa h3.swa-card__title { font-size: 16px; }
	.swa .swa-empty__text { padding-left: 0; }
}
