/*
 * MHSG Core front-end styles.
 *
 * Written against custom properties so a theme can restyle every component by
 * redefining the tokens, without overriding individual rules.
 */

:root {
	--mhsg-ink: #0f1a1c;
	--mhsg-ink-2: #374a4c;
	--mhsg-muted: #637677;
	--mhsg-surface: #ffffff;
	--mhsg-surface-2: #eef3f2;
	--mhsg-line: #d9e3e2;
	--mhsg-accent: #0e6e6a;
	--mhsg-accent-wash: #e5f1ef;
	--mhsg-crisis: #8c1d1d;
	--mhsg-crisis-wash: #fbeeee;
	--mhsg-warn: #8a5a10;
	--mhsg-warn-wash: #f7efe0;
	--mhsg-radius: 3px;
}

/* ---------------------------------------------------------- crisis bar */

.mhsg-crisis-bar {
	background: var(--mhsg-crisis);
	color: #fff;
	padding: 10px 16px;
	text-align: center;
	font-size: 15px;
	line-height: 1.45;
	font-weight: 500;
}

.mhsg-crisis-bar a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.mhsg-crisis-bar a:hover { text-decoration-thickness: 2px; }

/* -------------------------------------------------------- crisis panel */

.mhsg-crisis-panel {
	display: grid;
	gap: 12px;
	margin: 1.5em 0;
}

@media (min-width: 620px) {
	.mhsg-crisis-panel { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}

.mhsg-line {
	background: var(--mhsg-crisis-wash);
	border: 1px solid var(--mhsg-line);
	border-left: 4px solid var(--mhsg-crisis);
	border-radius: var(--mhsg-radius);
	padding: 16px 18px;
	display: grid;
	gap: 4px;
	align-content: start;
}

.mhsg-line__name {
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .01em;
	color: var(--mhsg-ink);
}

.mhsg-line__num {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--mhsg-crisis);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
	letter-spacing: -.01em;
}

.mhsg-line__num:hover { text-decoration: underline; }

.mhsg-line__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: 13.5px;
	color: var(--mhsg-ink-2);
}

/* ------------------------------------------------------------- notices */

.mhsg-notice {
	border: 1px solid var(--mhsg-line);
	border-left: 4px solid var(--mhsg-muted);
	border-radius: var(--mhsg-radius);
	background: var(--mhsg-surface-2);
	padding: 16px 18px;
	margin: 1.5em 0;
	font-size: 15px;
	line-height: 1.6;
}

.mhsg-notice p { margin: 0 0 .5em; }
.mhsg-notice p:last-child { margin-bottom: 0; }

.mhsg-notice__title {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	margin-bottom: .4em !important;
}

.mhsg-notice--warning { border-left-color: var(--mhsg-warn); background: var(--mhsg-warn-wash); }
.mhsg-notice--warning .mhsg-notice__title { color: var(--mhsg-warn); }

.mhsg-notice--paid { border-left-color: var(--mhsg-accent); background: var(--mhsg-accent-wash); }
.mhsg-notice--paid .mhsg-notice__title { color: var(--mhsg-accent); }

.mhsg-notice--help { border-left-color: var(--mhsg-crisis); background: var(--mhsg-crisis-wash); }
.mhsg-notice--help .mhsg-notice__title { color: var(--mhsg-crisis); }

.mhsg-notice--disclaimer { font-size: 14px; color: var(--mhsg-ink-2); }

/* ------------------------------------------------------- review stamp */

.mhsg-stamp {
	border-top: 2px solid var(--mhsg-ink);
	margin: 2.5em 0 1em;
	padding-top: 14px;
	display: grid;
	gap: 4px;
	font-size: 14px;
	color: var(--mhsg-ink-2);
}

.mhsg-stamp__row { margin: 0; }

.mhsg-stamp__label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--mhsg-muted);
	margin-right: 6px;
}

.mhsg-stamp__cred { font-style: italic; }

/* -------------------------------------------------------------- cards */

.mhsg-cards {
	display: grid;
	gap: 14px;
	margin: 1.5em 0;
}

@media (min-width: 620px) {
	.mhsg-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

.mhsg-card {
	background: var(--mhsg-surface);
	border: 1px solid var(--mhsg-line);
	border-radius: var(--mhsg-radius);
	padding: 18px;
	display: grid;
	gap: 8px;
	align-content: start;
}

.mhsg-card.is-crisis { border-left: 4px solid var(--mhsg-crisis); }

.mhsg-card__title { font-size: 17px; line-height: 1.3; margin: 0; }
.mhsg-card__title a { text-decoration: none; color: inherit; }
.mhsg-card__title a:hover { text-decoration: underline; }

.mhsg-card__num {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.1;
	color: var(--mhsg-crisis);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

.mhsg-card__desc { font-size: 14.5px; line-height: 1.55; margin: 0; color: var(--mhsg-ink-2); }
.mhsg-card__cred { font-size: 13.5px; margin: 0; color: var(--mhsg-muted); font-style: italic; }

.mhsg-card__links { display: flex; gap: 14px; margin: 0; font-size: 14px; }

.mhsg-kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.mhsg-kv li { display: flex; gap: 10px; justify-content: space-between; border-bottom: 1px dotted var(--mhsg-line); padding-bottom: 3px; }
.mhsg-kv li span:first-child { color: var(--mhsg-muted); flex: 0 0 auto; white-space: nowrap; }
.mhsg-kv li span:last-child { text-align: right; }

/* --------------------------------------------------------------- pills */

.mhsg-pill {
	display: inline-block;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 2px;
	background: var(--mhsg-surface-2);
	color: var(--mhsg-ink-2);
	justify-self: start;
}

.mhsg-pill--crisis { background: var(--mhsg-crisis); color: #fff; }
.mhsg-pill--paid { background: var(--mhsg-accent-wash); color: var(--mhsg-accent); }
.mhsg-pill--verified { background: var(--mhsg-accent); color: #fff; }
.mhsg-pill--in_effect { background: var(--mhsg-accent-wash); color: var(--mhsg-accent); }
.mhsg-pill--announced { background: var(--mhsg-warn-wash); color: var(--mhsg-warn); }
.mhsg-pill--under_review { background: var(--mhsg-warn-wash); color: var(--mhsg-warn); }
.mhsg-pill--superseded { background: var(--mhsg-surface-2); color: var(--mhsg-muted); }

/* -------------------------------------------------------------- table */

.mhsg-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--mhsg-line);
	border-radius: var(--mhsg-radius);
	margin: 1.5em 0;
	background: var(--mhsg-surface);
}

.mhsg-table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 14.5px; }

.mhsg-table th,
.mhsg-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--mhsg-line); vertical-align: top; }

.mhsg-table th {
	font-size: 11px;
	letter-spacing: .11em;
	text-transform: uppercase;
	color: var(--mhsg-muted);
	background: var(--mhsg-surface-2);
	font-weight: 700;
	white-space: nowrap;
}

.mhsg-table tbody tr:last-child td { border-bottom: none; }
.mhsg-table a { color: inherit; }
.mhsg-table__note { display: block; font-size: 13px; color: var(--mhsg-muted); margin-top: 3px; line-height: 1.45; }

.mhsg-empty { color: var(--mhsg-muted); font-style: italic; }

/* Commercial units must not render inside the crisis layer. This is a
   belt-and-braces rule; the PHP already refuses to output them. */
.mhsg-no-commercial .mhsg-ad,
.mhsg-no-commercial .mhsg-sponsor,
.mhsg-no-commercial .adsbygoogle { display: none !important; }

@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------- record panel */

.mhsg-record {
	margin: 1.5em 0 2em;
	display: grid;
	gap: 14px;
}

.mhsg-record__list {
	margin: 0;
	display: grid;
	gap: 1px;
	background: var(--mhsg-line);
	border: 1px solid var(--mhsg-line);
	border-radius: var(--mhsg-radius);
	overflow: hidden;
}

.mhsg-record__row {
	background: var(--mhsg-surface);
	display: grid;
	gap: 2px 20px;
	padding: 12px 16px;
}

@media (min-width: 620px) {
	.mhsg-record__row { grid-template-columns: 150px minmax(0, 1fr); }
}

.mhsg-record__row dt {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--mhsg-muted);
	margin: 0;
	padding-top: 2px;
}

.mhsg-record__row dd { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mhsg-ink); }

.mhsg-record__cta { margin: 0; }

.mhsg-btn {
	display: inline-block;
	background: var(--mhsg-accent);
	color: #fff;
	text-decoration: none;
	font-size: 14.5px;
	font-weight: 600;
	padding: 10px 18px;
	border-radius: var(--mhsg-radius);
}

.mhsg-btn:hover { background: var(--mhsg-ink); color: #fff; }

.mhsg-changelog { border-top: 1px solid var(--mhsg-line); padding-top: 14px; }
.mhsg-changelog h3 { font-size: 11px; letter-spacing: .11em; text-transform: uppercase; color: var(--mhsg-muted); margin: 0 0 8px; }
.mhsg-changelog ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.mhsg-changelog li { display: grid; gap: 2px 14px; }
@media (min-width: 620px) { .mhsg-changelog li { grid-template-columns: 110px minmax(0, 1fr); } }
.mhsg-changelog__date { color: var(--mhsg-muted); font-variant-numeric: tabular-nums; }

/* Sources ---------------------------------------------------------------
   Deliberately quiet. A reader who wants the receipts will find them; a
   reader who does not should not have to read past them. */

.mhsg-sources {
	margin-top: 2.5rem;
	padding-top: 1.1rem;
	border-top: 1px solid var(--wp--preset--color--rule, #d6e0df);
}

.mhsg-sources__title {
	font-size: 0.82rem !important;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0 0 0.6rem !important;
	color: var(--wp--preset--color--muted, #6b7b7c);
	font-weight: 600;
}

.mhsg-sources__list {
	margin: 0;
	padding-left: 1.1rem;
	font-size: 0.86rem;
	line-height: 1.5;
	color: var(--wp--preset--color--muted, #6b7b7c);
}

.mhsg-sources__list li { margin-bottom: 0.3rem; }
.mhsg-sources__list a { color: inherit; }
.mhsg-sources__date { white-space: nowrap; opacity: 0.85; }
