/* Phasmas: the site's own rules on top of the Spectrum Plan kit (assets/brand/tokens.css holds the fonts and the
   --phs-* tokens; brand/brand-guidelines.md at the top of the repo holds the rules these follow). */

/* The theme reads these seven variables; they take the kit's palette. Links and buttons are cyan, never amber or
   violet (amber on paper fails contrast; violet is reserved for the upper ray). */
:root {
	--contrast: var(--phs-ink, #1A192E);
	--contrast-2: var(--phs-muted, #5B6874);
	--contrast-3: var(--phs-faint, #7A8591);
	--base: var(--phs-line, #E0E5E9);
	--base-2: var(--phs-base-2, #E8EEF1);
	--base-3: var(--phs-paper, #F4F6F8);
	--accent: var(--phs-cyan, #0E7490);
}

/* Type: IBM Plex Sans 400 for text, 600 for headings; IBM Plex Mono 500 for small labels. */
body,
button,
input,
select,
textarea {
	font-family: var(--phs-font-body, system-ui, sans-serif);
}

body {
	font-weight: var(--phs-weight-body, 400);
	font-size: 17px;
	line-height: 1.5;
}

h1,
h2,
h3,
h4,
.entry-title {
	font-family: var(--phs-font-display, system-ui, sans-serif);
	font-weight: var(--phs-weight-display, 600);
	letter-spacing: -0.01em;
	color: var(--phs-ink, #1A192E);
}

code,
kbd,
pre,
samp {
	font-family: var(--phs-font-mono, ui-monospace, monospace);
}

/* Header: paper, one hairline under it. The logo is the kit's horizontal colour lockup at 40 px (the kit says 32 to
   48, never under 28). */
.site-header {
	border-bottom: 1px solid var(--phs-line, #E0E5E9);
}

.site-branding .phs-logo {
	display: block;
	height: 40px;
	width: auto;
	max-width: 100%;
}

/* Menu: small tracked labels in the mono face; the page you are on and the hovered item are cyan. */
body .main-navigation .main-nav ul li a {
	font-family: var(--phs-font-mono, ui-monospace, monospace);
	font-weight: 500;
	font-size: 13px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

body .main-navigation .main-nav ul li.phasma-language-item > a {
	border: 1px solid var(--phs-ink, #1A192E);
	border-radius: var(--phs-radius-sm, 4px);
	margin-left: 8px;
	padding: 6px 10px;
	line-height: 1.2;
	min-height: 0;
	height: auto;
}

/* The content column (0.4.1): the same column as the header's .inside-header, so the logo lines up with the text.
   Long prose pages (body class phs-prose, includes/content.php: About, our method, the legal and contact pages)
   keep a narrower measure, aligned on the same left edge. */
.site-main {
	max-width: min(var(--phasma-container-max, 1200px), calc(100% - 80px));
}

.phs-prose .entry-content {
	max-width: 760px;
}

.entry-content a:not(.wp-block-button__link) {
	color: var(--phs-cyan, #0E7490);
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.entry-content a:not(.wp-block-button__link):hover,
.entry-content a:not(.wp-block-button__link):focus {
	color: var(--phs-ink, #1A192E);
}

.wp-block-button .wp-block-button__link {
	background: var(--phs-cyan, #0E7490);
	color: var(--phs-paper, #F4F6F8);
	border: 1px solid var(--phs-cyan, #0E7490);
	border-radius: var(--phs-radius-sm, 4px);
	font-weight: 500;
	text-decoration: none;
}

.wp-block-button .wp-block-button__link:hover,
.wp-block-button .wp-block-button__link:focus {
	background: var(--phs-ink, #1A192E);
	border-color: var(--phs-ink, #1A192E);
	color: var(--phs-paper, #F4F6F8);
}

/* Front page title (includes/brand.php): kept as the H1, hidden from sight only; the logo above already names the site. */
.phs-sr-only,
.phs-front .entry-header .entry-title {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	clip-path: inset(50%) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.phs-front .entry-header {
	margin: 0;
	padding: 0;
	border: 0;
}

.phs-front .entry-header + .entry-content {
	margin-top: 0;
}

/* Front-page hero (includes/brand.php): the kit's animated mark, 240 px, centred, on paper as it was drawn for. */
.phs-hero {
	margin: 8px auto 24px;
	max-width: 240px;
	text-align: center;
}

.phs-hero img {
	display: block;
	width: 240px;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	box-shadow: none;
}

/* Front-page hero text (0.4.1): only the first heading, its sub-line and its buttons are centred; the sections
   below read left, on the same edge as the logo. */
.phs-front .entry-content > h2:first-of-type {
	max-width: 820px;
	margin: 0 auto 12px;
	text-align: center;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.15;
}

.phs-front .entry-content > p:first-of-type {
	max-width: 680px;
	margin: 0 auto 20px;
	text-align: center;
	color: var(--phs-muted, #5B6874);
}

.phs-front .entry-content > .wp-block-buttons:first-of-type {
	justify-content: center;
	margin-bottom: 48px;
}

.entry-content > h2 {
	margin-top: 48px;
}

.entry-content > h2:first-child {
	margin-top: 0;
}

/* Cards (0.4.1): every Columns block in page text is a row of cards. Core prints its own
   `.wp-container-core-columns-is-layout-…{flex-wrap:nowrap}` after this file; these selectors are more specific,
   so the cards wrap: four across on a wide screen, two on a mid one, one on a phone. */
.entry-content .wp-block-columns.is-layout-flex {
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 20px;
}

.entry-content .wp-block-columns.is-layout-flex > .wp-block-column {
	flex: 1 1 240px;
	min-width: 0;
	box-sizing: border-box;
	padding: 20px 22px;
	background: var(--phs-white, #FFFFFF);
	border: 1px solid var(--phs-line, #E0E5E9);
	border-radius: var(--phs-radius-md, 8px);
}

.entry-content .wp-block-column > h3 {
	margin: 0 0 8px;
	font-size: 19px;
	line-height: 1.3;
}

.entry-content .wp-block-column > h3 a {
	text-decoration: none;
}

.entry-content .wp-block-column > p {
	margin: 0;
	font-size: 16px;
	color: var(--phs-muted, #5B6874);
}

/* Page art (0.4.2, includes/page-art.php): the hero at the top of the page text, the square cover on episode pages. */
.phs-page-art {
	margin: 0 0 32px;
}

.phs-page-art-page {
	max-width: 960px;
}

.phs-page-art-episode {
	max-width: 480px;
}

.phs-page-art img,
.phs-episode-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--phs-radius-md, 8px);
	box-shadow: none;
}

/* Callout, ::: note in the page files (the "how we label things" and "not yet proven" boxes). */
.entry-content .phs-note {
	margin: 24px 0;
	padding: 18px 22px;
	background: var(--phs-white, #FFFFFF);
	border: 1px solid var(--phs-line, #E0E5E9);
	border-left: 4px solid var(--phs-cyan, #0E7490);
	border-radius: var(--phs-radius-sm, 4px);
}

.entry-content .phs-note > :first-child {
	margin-top: 0;
}

.entry-content .phs-note > :last-child {
	margin-bottom: 0;
}

/* The podcast title, [phs_show]: "Inside Phasma" heavier than "Mostly Harmless". The credit, [phs_show_credit], in
   the small mono face where it is a paragraph of its own (the episodes hub); inside a sentence it reads as text. */
.phs-show-lead {
	font-weight: 400;
}

.phs-show-main {
	font-weight: 600;
}

p > .phs-show-credit:only-child {
	font-family: var(--phs-font-mono, ui-monospace, monospace);
	font-weight: 500;
	font-size: 14px;
	letter-spacing: 0.04em;
	color: var(--phs-muted, #5B6874);
}

/* Lists of posts and episodes, [phs_posts] and [phs_episodes]: cards in a wrapping grid; one line when empty. */
.phs-empty {
	color: var(--phs-muted, #5B6874);
	font-style: italic;
}

.entry-content ul.phs-posts,
.entry-content ul.phs-episodes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 20px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.phs-post,
.phs-episode {
	margin: 0;
	padding: 18px 20px;
	background: var(--phs-white, #FFFFFF);
	border: 1px solid var(--phs-line, #E0E5E9);
	border-radius: var(--phs-radius-md, 8px);
}

.phs-post h3,
.phs-episode h3 {
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.3;
}

.phs-post p {
	margin: 0;
	font-size: 15px;
}

.phs-post .phs-meta {
	margin-bottom: 6px;
	font-family: var(--phs-font-mono, ui-monospace, monospace);
	font-size: 13px;
	color: var(--phs-muted, #5B6874);
}

.phs-post-image img,
.phs-episode-image img {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 12px;
	border-radius: var(--phs-radius-sm, 4px);
}

/* Footer: ink, with the small credit in the mono face. */
.site-footer,
.site-info {
	background: var(--phs-ink, #1A192E);
	color: var(--phs-paper, #F4F6F8);
}

.site-info .copyright-bar {
	font-family: var(--phs-font-mono, ui-monospace, monospace);
	font-weight: 500;
	font-size: 13px;
	letter-spacing: 0.04em;
}

.site-info a {
	color: var(--phs-cyan-bright, #5EC8D8);
}

/* Footer line (0.4.1, includes/content.php): "© <year> Phasmas · Operated by 6385494 Canada Inc." and the contact,
   privacy and terms links, which left the header menu. */
.phs-footer-link {
	text-decoration: none;
}

.phs-footer-link:hover,
.phs-footer-link:focus {
	text-decoration: underline;
}

/* Contact form, [phs_contact_form]. */
.phs-form {
	max-width: 640px;
	margin: 28px 0;
}

.phs-form p {
	margin: 0 0 18px;
}

.phs-form label {
	display: block;
	font-weight: 500;
	font-size: 15px;
	margin-bottom: 6px;
	color: var(--phs-ink, #1A192E);
}

.phs-form input[type=text],
.phs-form input[type=email],
.phs-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 11px 13px;
	font-size: 17px;
	line-height: 1.4;
	color: var(--phs-ink, #1A192E);
	background: var(--phs-white, #FFFFFF);
	border: 1px solid var(--phs-faint, #7A8591);
	border-radius: var(--phs-radius-sm, 4px);
}

.phs-form textarea {
	min-height: 150px;
	resize: vertical;
}

.phs-form input:focus,
.phs-form textarea:focus {
	border-color: var(--phs-cyan, #0E7490);
	outline: 2px solid var(--phs-cyan, #0E7490);
	outline-offset: 1px;
}

.phs-form [aria-invalid=true] {
	border-color: #B3261E;
}

.phs-form-error {
	display: block;
	color: #B3261E;
	font-weight: 500;
	font-size: 15px;
	margin-top: 6px;
}

p.phs-form-error {
	padding: 12px 16px;
	border: 1px solid #B3261E;
	border-radius: var(--phs-radius-sm, 4px);
	background: var(--phs-white, #FFFFFF);
}

.phs-form-notice {
	padding: 16px 20px;
	margin: 28px 0;
	border: 1px solid var(--phs-cyan, #0E7490);
	border-left-width: 4px;
	border-radius: var(--phs-radius-sm, 4px);
	background: var(--phs-white, #FFFFFF);
}

.phs-form-notice p {
	margin: 0 0 6px;
}

.phs-form-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.phs-form-check {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 4px 12px;
	align-items: start;
}

.phs-form-check input {
	width: 20px;
	height: 20px;
	margin: 3px 0 0;
	accent-color: var(--phs-cyan, #0E7490);
}

.phs-form-check label {
	font-weight: 400;
	font-size: 15px;
	line-height: 1.5;
	margin: 0;
}

.phs-form-check .phs-form-error {
	grid-column: 2;
}

.phs-form-small {
	font-size: 14px;
	color: var(--phs-muted, #5B6874);
}

.phs-form-turnstile {
	min-height: 65px;
	margin: 0 0 18px;
}

.phs-form-send {
	background: var(--phs-cyan, #0E7490);
	color: var(--phs-paper, #F4F6F8);
	border: 1px solid var(--phs-cyan, #0E7490);
	border-radius: var(--phs-radius-sm, 4px);
	padding: 12px 28px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
}

.phs-form-send:hover,
.phs-form-send:focus {
	background: var(--phs-ink, #1A192E);
	border-color: var(--phs-ink, #1A192E);
}

@media (max-width: 768px) {
	.site-main {
		max-width: calc(100% - 60px);
	}

	.entry-content > h2 {
		margin-top: 36px;
	}

	.phs-hero,
	.phs-hero img {
		max-width: 200px;
	}
}
