/* phm-article.css - the guide under the map. SHELL track. ASCII only.
 * Cream page, ink text, Nunito Sans body, Fredoka headings. All text pairs meet WCAG AA:
 * ink #1a3a2f on cream #fdfbf2 is 12.0:1, muted #33544a on cream 8.1:1,
 * link #0f6a92 on cream 5.8:1 (5.3:1 on the FAQ mint).
 * Tokens come from css/phm.css (:root); the fallbacks keep this file valid on its own. */

.phm-article {
	--phm-a-ink: var(--phm-ink, #1a3a2f);
	--phm-a-muted: var(--phm-muted, #33544a);
	--phm-a-cream: var(--phm-cream, #fdfbf2);
	--phm-a-mint: var(--phm-mint, #e8f4ec);
	--phm-a-link: #0f6a92;
	--phm-a-rule: #cfdcd2;
	box-sizing: border-box;
	background: var(--phm-a-cream);
	color: var(--phm-a-ink);
	max-width: 720px;
	margin: 0 auto;
	padding: 48px 20px 56px;
	font-family: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 18px;
	line-height: 1.7;
	overflow-wrap: break-word;
}

.phm-article *,
.phm-article *::before,
.phm-article *::after {
	box-sizing: border-box;
}

.phm-article > :first-child {
	margin-top: 0;
}

.phm-article p,
.phm-article ul,
.phm-article ol,
.phm-article figure,
.phm-article blockquote {
	margin: 0 0 1.2em;
}

.phm-article h2,
.phm-article h3,
.phm-article h4 {
	font-family: Fredoka, "Nunito Sans", system-ui, sans-serif;
	color: var(--phm-a-ink);
	line-height: 1.25;
	font-weight: 600;
}

.phm-article h2 {
	font-size: 1.75rem;
	margin: 2.1em 0 0.6em;
	padding-top: 0.2em;
	scroll-margin-top: 16px;
}

.phm-article h3 {
	font-size: 1.25rem;
	margin: 1.6em 0 0.4em;
}

.phm-article h4 {
	font-size: 1.05rem;
	margin: 1.4em 0 0.3em;
}

.phm-article a {
	color: var(--phm-a-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.phm-article a:hover {
	text-decoration-thickness: 2px;
}

.phm-article a:focus-visible,
.phm-article summary:focus-visible {
	outline: 3px solid #1a3a2f;
	outline-offset: 2px;
	border-radius: 3px;
}

.phm-article strong {
	font-weight: 700;
}

.phm-article ul,
.phm-article ol {
	padding-left: 1.4em;
}

.phm-article li {
	margin: 0 0 0.4em;
}

.phm-article blockquote {
	border-left: 4px solid var(--phm-a-rule);
	padding: 0.2em 0 0.2em 1em;
	color: var(--phm-a-muted);
}

/* Figures: width and height attributes on the img reserve the box. */
.phm-article figure {
	margin: 1.8em 0;
}

.phm-article figure img,
.phm-article img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.phm-article figcaption {
	margin-top: 0.6em;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--phm-a-muted);
}

/* Tables: the wrapper scrolls, the page never does. */
.phm-article .phm-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 1.6em 0;
	border: 1px solid var(--phm-a-rule);
	border-radius: 12px;
}

.phm-article table {
	width: 100%;
	min-width: 480px;
	border-collapse: collapse;
	font-size: 0.9375rem;
	line-height: 1.45;
}

.phm-article caption {
	text-align: left;
	padding: 10px 14px;
	font-weight: 700;
	color: var(--phm-a-ink);
}

.phm-article th,
.phm-article td {
	padding: 10px 14px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--phm-a-rule);
}

.phm-article thead th {
	background: var(--phm-a-mint);
	color: var(--phm-a-ink);
	font-weight: 700;
	white-space: nowrap;
}

.phm-article tbody tr:last-child th,
.phm-article tbody tr:last-child td {
	border-bottom: 0;
}

/* FAQ: the h3/p pairs under the "Frequently asked questions" h2 stay plain
 * h3 + p in the markup (the JSON-LD is parsed from them); this only styles them
 * as Q/A blocks. */
.phm-article h2[id="faq"] ~ h3 {
	margin: 1.4em 0 0;
	padding: 14px 18px 0;
	background: var(--phm-a-mint);
	border-radius: 12px 12px 0 0;
	font-size: 1.1rem;
}

.phm-article h2[id="faq"] ~ h3 + p {
	margin: 0 0 0;
	padding: 6px 18px 16px;
	background: var(--phm-a-mint);
	border-radius: 0 0 12px 12px;
}

/* Manual in-article ad units: the box is reserved before the ad fills. */
.phm-article .phm-ad {
	min-height: 280px;
	margin: 2em 0;
	text-align: center;
	overflow: hidden;
}

@media (max-width: 600px) {
	.phm-article {
		padding: 36px 16px 44px;
		font-size: 17px;
	}

	.phm-article h2 {
		font-size: 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.phm-article * {
		scroll-behavior: auto;
	}
}
