/*
Theme Name: Machines Arguing
Theme URI: https://machinesarguing.ai
Description: Broadcast-studio child theme for Machines Arguing. Source of truth is C:\programming\machinesarguing\wp\theme — edit there and redeploy, not on the server.
Author: Claude (Anthropic), for Machines Arguing
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Text Domain: machinesarguing
License: GNU General Public License v2 or later
*/

/* ---------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------ */

.ma-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(12, 13, 17, 0.88);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .ma-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ma-header { top: 46px; } }

.ma-brand { gap: 0.6rem !important; align-items: center; }
.ma-brand a { text-decoration: none; }

.ma-wordmark,
.ma-wordmark a {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-weight: 900;
	font-size: 1.05rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	margin: 0;
	line-height: 1;
}
.ma-wordmark a:hover { color: var(--wp--preset--color--contrast); }

/* The on-air light. It pulses only for people who have not asked for less motion. */
.ma-live {
	display: inline-block;
	width: 0.62rem;
	height: 0.62rem;
	border-radius: 50%;
	background: var(--wp--preset--color--signal);
	box-shadow: 0 0 0 0 rgba(255, 75, 62, 0.6);
}
@media (prefers-reduced-motion: no-preference) {
	.ma-live { animation: ma-pulse 2.4s ease-out infinite; }
}
@keyframes ma-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(255, 75, 62, 0.55); }
	70%  { box-shadow: 0 0 0 0.55rem rgba(255, 75, 62, 0); }
	100% { box-shadow: 0 0 0 0 rgba(255, 75, 62, 0); }
}

.ma-header .wp-block-navigation a { text-decoration: none; }
.ma-header .wp-block-navigation a:hover { color: var(--wp--preset--color--signal); }
.ma-nav-yt a {
	border: 1px solid var(--wp--preset--color--signal);
	border-radius: 999px;
	padding: 0.3rem 0.9rem !important;
	color: var(--wp--preset--color--signal) !important;
}
.ma-nav-yt a:hover {
	background: var(--wp--preset--color--signal);
	color: #0C0D11 !important;
}
.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--base) !important;
}

/* ---------------------------------------------------------------------------
   Small text styles shared across the site
   ------------------------------------------------------------------------ */

.ma-kicker {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--signal);
	margin: 0;
}
.ma-kicker.is-muted { color: var(--wp--preset--color--muted); }

.ma-mono {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.85em;
}

.ma-lede {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
	color: #D4D0C8;
}

/* ---------------------------------------------------------------------------
   Front page
   ------------------------------------------------------------------------ */

.ma-hero {
	position: relative;
	overflow: hidden;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
/* Studio key light behind the headline. */
.ma-hero::before {
	content: "";
	position: absolute;
	inset: -30% -10% auto auto;
	width: 70vw;
	height: 70vw;
	max-width: 900px;
	max-height: 900px;
	/* closest-side: fully transparent at the box edge, so no visible rectangle */
	background: radial-gradient(closest-side, rgba(255, 75, 62, 0.17) 0%, rgba(255, 75, 62, 0.07) 45%, rgba(255, 75, 62, 0) 100%);
	pointer-events: none;
}
.ma-hero > * { position: relative; }

.ma-hero h1 {
	font-size: var(--wp--preset--font-size--display);
	font-weight: 900;
	line-height: 0.95;
	letter-spacing: -0.035em;
	margin: 0;
}
.ma-hero h1 em {
	font-style: normal;
	color: var(--wp--preset--color--signal);
}

.ma-section-title {
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0;
}

/* Episode cards (query loops on home, archives, panelist pages) */
.ma-cards { gap: 1.25rem !important; }
.ma-card {
	height: 100%;
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	overflow: hidden;
	transition: border-color 0.15s ease, transform 0.15s ease;
}
.ma-card:hover { border-color: #4A4F5C; }
@media (prefers-reduced-motion: no-preference) {
	.ma-card:hover { transform: translateY(-2px); }
}
.ma-card .wp-block-post-featured-image { margin: 0; }
.ma-card .wp-block-post-featured-image img {
	aspect-ratio: 1200 / 630;
	object-fit: cover;
	width: 100%;
	display: block;
}
.ma-card-body { padding: 1.1rem 1.25rem 1.35rem !important; }
.ma-card .wp-block-post-title { margin: 0.35rem 0 0.5rem; }
.ma-card .wp-block-post-title a { text-decoration: none; }
.ma-card .wp-block-post-title a:hover { color: var(--wp--preset--color--signal); }
.ma-card .wp-block-post-excerpt {
	font-size: 0.97rem;
	color: #C9C5BD;
	margin: 0;
}
.ma-card .wp-block-post-excerpt__more-text { display: none; }

/* Panelist chips */
.wp-block-post-terms.taxonomy-panelist {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.8rem;
}
.wp-block-post-terms.taxonomy-panelist .wp-block-post-terms__separator { display: none; }
.wp-block-post-terms.taxonomy-panelist a,
.ma-chip {
	display: inline-block;
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.74rem;
	line-height: 1;
	padding: 0.4rem 0.6rem 0.4rem 0.55rem;
	border: 1px solid var(--wp--preset--color--line);
	border-left: 3px solid var(--spk, var(--wp--preset--color--muted));
	border-radius: 6px;
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	background: var(--wp--preset--color--base);
}
.wp-block-post-terms.taxonomy-panelist a:hover { border-color: var(--spk, var(--wp--preset--color--muted)); }

/* How-it-works steps */
.ma-steps { gap: 1.25rem !important; }
.ma-step {
	border-top: 2px solid var(--wp--preset--color--signal);
	padding-top: 1.1rem !important;
}
.ma-step h3 { margin: 0.4rem 0 0.5rem; font-size: 1.35rem; }
.ma-step p { color: #C9C5BD; margin: 0; font-size: 1rem; }

/* YouTube call to action */
.ma-cta {
	background:
		radial-gradient(120% 140% at 0% 0%, rgba(255, 75, 62, 0.20) 0%, rgba(255, 75, 62, 0) 55%),
		var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 20px;
}

/* ---------------------------------------------------------------------------
   Episode page
   ------------------------------------------------------------------------ */

.ma-episode-head { border-bottom: 1px solid var(--wp--preset--color--line); }
.ma-episode-head .wp-block-post-title {
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.02;
	letter-spacing: -0.03em;
}
.ma-question {
	font-family: var(--wp--preset--font-family--literata);
	font-style: italic;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	color: #D4D0C8;
	border-left: 3px solid var(--wp--preset--color--signal);
	padding-left: 1.1rem;
	margin: 0;
}
.ma-question .wp-block-post-excerpt__excerpt { margin: 0; }
.ma-question .wp-block-post-excerpt__more-text { display: none; }

/* Round dividers */
.ma-round {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin: 3rem 0 1.25rem !important;
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.78rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
.ma-round::before,
.ma-round::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--wp--preset--color--line);
}

/* A spoken turn. --spk is set per speaker by speakers.css. */
.ma-turn {
	margin: 0 0 1.6rem !important;
	padding: 0.15rem 0 0.15rem 1.15rem !important;
	border-left: 3px solid var(--spk, var(--wp--preset--color--muted));
}
.ma-turn > * { margin-block: 0 !important; }
.ma-speaker {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-weight: 800;
	font-size: 0.82rem !important;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--spk, var(--wp--preset--color--contrast));
	margin-bottom: 0.35rem !important;
}
.ma-speaker .ma-lab {
	font-family: var(--wp--preset--font-family--fira-code);
	font-weight: 400;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--wp--preset--color--muted);
	margin-left: 0.5rem;
}
.ma-line {
	font-size: 1.12rem;
	line-height: 1.72;
}
.ma-line + .ma-line { margin-top: 0.9rem !important; }

/* The host gets a different treatment: questions are the spine of the show. */
.ma-turn.ma-host {
	--spk: var(--wp--preset--color--amber);
	background: linear-gradient(90deg, rgba(255, 181, 71, 0.08), rgba(255, 181, 71, 0) 70%);
	padding: 1rem 1.25rem !important;
	border-radius: 0 12px 12px 0;
}
.ma-turn.ma-host.is-question .ma-line {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-weight: 600;
	font-size: 1.3rem;
	line-height: 1.45;
}

/* A panelist whose turn failed technically. Shown, never hidden. */
.ma-turn.is-failed { opacity: 0.75; }
.ma-turn.is-failed .ma-line {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}

/* Editor's notes and the "how this was made" box */
.ma-note {
	background: var(--wp--preset--color--base-2);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 14px;
	padding: 1.4rem 1.5rem !important;
}
.ma-note h2, .ma-note h3 {
	font-size: 1.05rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin-top: 0;
}
.ma-note p, .ma-note li { font-size: 0.98rem; }
.ma-note .ma-flag {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.8em;
	color: var(--wp--preset--color--signal);
	white-space: nowrap;
}
.ma-note table { font-size: 0.9rem; }
.ma-note td, .ma-note th { border-color: var(--wp--preset--color--line) !important; }
.ma-note code, .ma-mono-id {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.85em;
	background: var(--wp--preset--color--base);
	padding: 0.1em 0.35em;
	border-radius: 4px;
}

.ma-video-soon {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}
.ma-video iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 12px; }

/* Prompt listings on How It Works */
.wp-block-code { white-space: pre-wrap; overflow-wrap: anywhere; }
.wp-block-details summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--fira-sans);
	font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------ */

.ma-footer {
	border-top: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
	font-size: 0.92rem;
}
.ma-footer a { color: var(--wp--preset--color--contrast); }
.ma-footer .ma-fine {
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.74rem;
	line-height: 1.6;
}

/* Keyboard focus that is actually visible on a dark background. */
:where(a, button, input, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--amber);
	outline-offset: 3px;
	border-radius: 4px;
}

.ma-footer-links { list-style: none; margin: 0.6rem 0 0; }
.ma-footer-links li { margin: 0.35rem 0; }
.ma-footer-links a { text-decoration: none; }
.ma-footer-links a:hover { color: var(--wp--preset--color--signal); }

/* Panel chip row on the front page */
.ma-chip-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.ma-chip.ma-chip-lg {
	font-family: var(--wp--preset--font-family--fira-sans);
	font-weight: 800;
	font-size: 1.05rem;
	padding: 0.7rem 1rem 0.7rem 0.9rem;
	border-radius: 10px;
	color: var(--spk);
	background: var(--wp--preset--color--base-2);
}
.ma-chip.ma-chip-lg .ma-lab {
	font-family: var(--wp--preset--font-family--fira-code);
	font-weight: 400;
	font-size: 0.75rem;
	color: var(--wp--preset--color--muted);
	margin-left: 0.55rem;
}
a.ma-chip.ma-chip-lg:hover { border-color: var(--spk); }
.ma-cta-copy { max-width: 620px; }

/* Who wrote the opening question: "(AI created question)" / "(Human created question)" */
.ma-question-source {
	font-family: var(--wp--preset--font-family--fira-code);
	font-style: normal;
	font-size: 0.74rem;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--muted);
	margin: 0.45rem 0 0 !important;
}
.ma-question .ma-question-source { font-size: 0.78rem; }
.ma-question-source:empty { display: none; }

/* Cards are typographic: the share image is for social previews, not the grid. */
.ma-card { display: flex; flex-direction: column; }
.ma-card-body { padding: 1.4rem 1.5rem 1.5rem !important; display: flex; flex-direction: column; flex: 1; }
.ma-card .wp-block-post-title { font-size: 1.45rem; line-height: 1.15; }
.ma-card .wp-block-post-terms.taxonomy-panelist { margin-top: auto; padding-top: 1rem; }

/* "How this episode was made" table: stack into labelled rows on phones. */
@media (max-width: 600px) {
	.ma-made-table table, .ma-made-table tbody, .ma-made-table tr, .ma-made-table td { display: block; width: 100%; }
	.ma-made-table thead { display: none; }
	.ma-made-table tr { padding: 0.6rem 0; border-bottom: 1px solid var(--wp--preset--color--line); }
	.ma-made-table td { border: 0 !important; padding: 0.15rem 0 !important; }
	.ma-made-table td::before {
		content: attr(data-label);
		display: inline-block;
		min-width: 6.5rem;
		font-family: var(--wp--preset--font-family--fira-code);
		font-size: 0.72rem;
		color: var(--wp--preset--color--muted);
	}
	.ma-made-table td:first-child { font-weight: 700; }
}
