/* Cold War — global stylesheet
 *
 * Mirrors the design-handoff styles.css. Tokens are duplicated as plain
 * CSS custom properties (in addition to theme.json's --wp--preset--color--*)
 * so the section CSS can stay terse and design-faithful.
 */

:root {
	--red:       #C8201E;
	--red-dark:  #8A1413;
	--red-deep:  #5A0E0D;
	--ink:       #0E0E0E;
	--ink-soft:  #1A1A1A;
	--bone:      #F2EBDD;
	--bone-soft: #E8DFCB;
	--signal:    #F0C419;
	--rust:      #A8442A;
	--steel:     #4A4A48;
}

/* ---- Resets (scoped to keep block editor sane) ---- */
body { -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* ---- Typography utilities ---- */
.cw-display {
	font-family: 'Oswald', 'Arial Narrow', sans-serif;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.01em;
	line-height: 0.92;
}
.cw-mono {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	font-size: 12px;
}

/* ---- Texture utilities ---- */
.cw-grain { position: relative; }
.cw-grain::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0.07;
	mix-blend-mode: multiply;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.cw-halftone {
	background-image: radial-gradient(circle at 1px 1px, currentColor 1px, transparent 1.5px);
	background-size: 6px 6px;
}
.cw-halftone-lg {
	background-image: radial-gradient(circle at 1.5px 1.5px, currentColor 1.5px, transparent 2px);
	background-size: 9px 9px;
}
.cw-stripes {
	background-image: repeating-linear-gradient(45deg, var(--ink) 0 12px, var(--signal) 12px 24px);
}

/* ---- Stamps ---- */
.cw-stamp {
	display: inline-block;
	border: 2px solid currentColor;
	padding: 4px 10px 3px;
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	transform: rotate(-2deg);
}
.cw-stamp--red { color: var(--red); border-color: var(--red); }
.cw-stamp--signal { color: var(--ink); background: var(--signal); border-color: var(--ink); }

/* ---- Buttons ---- */
.cw-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	font-family: 'Oswald', sans-serif;
	font-weight: 700;
	font-size: 15px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: transform 0.08s, background 0.15s;
	border-radius: 0;
}
.cw-btn:active { transform: translate(1px, 1px); }
.cw-btn--red   { background: var(--red);  color: var(--bone); box-shadow: 4px 4px 0 var(--ink); }
.cw-btn--red:hover { background: var(--red-dark); }
.cw-btn--ink   { background: var(--ink);  color: var(--bone); box-shadow: 4px 4px 0 var(--red); }
.cw-btn--ink:hover { background: var(--ink-soft); }
.cw-btn--ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.cw-btn--ghost:hover { background: var(--ink); color: var(--bone); }

/* ---- Section frame ---- */
.cw-section { position: relative; padding: 80px 48px; }
.cw-container { max-width: 1320px; margin: 0 auto; position: relative; }

/* ---- Section markers ---- */
.cw-section-marker {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 32px;
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.18em;
}
.cw-section-marker__bar { width: 36px; height: 2px; background: currentColor; }
.cw-section-marker__num { font-weight: 700; }

/* ---- Card hover ---- */
.cw-card { transition: transform 0.12s ease, box-shadow 0.15s ease; }
.cw-card:hover { transform: translate(-2px, -2px); }

/* ---- Marquee / animations ---- */
@keyframes cw-marquee {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}
.cw-marquee-track { display: flex; animation: cw-marquee 40s linear infinite; white-space: nowrap; }

@keyframes cw-pulse-red {
	0%, 100% { opacity: 1; }
	50%      { opacity: 0.4; }
}
.cw-pulse { animation: cw-pulse-red 1.4s ease-in-out infinite; }

@keyframes cw-spin-slow {
	from { transform: rotate(0); }
	to   { transform: rotate(360deg); }
}
.cw-spin-slow { animation: cw-spin-slow 30s linear infinite; }

/* ---- Tape ---- */
.cw-tape {
	position: absolute;
	background: var(--signal);
	opacity: 0.85;
	width: 90px;
	height: 22px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar         { width: 10px; height: 10px; }
::-webkit-scrollbar-track   { background: var(--bone); }
::-webkit-scrollbar-thumb   { background: var(--ink); }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.cw-section { padding: 56px 24px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	.cw-marquee-track,
	.cw-pulse,
	.cw-spin-slow { animation: none !important; }
}

/* ──────────────────────────────────────────────────────────────────────
   Vault grid — shared across the homepage (coldwar/episode-grid) and
   the archive (coldwar/episode-archive) blocks. Each block has a small
   inline <style> tag for grid-columns variants, but the structural rules
   (display:grid, gap, card border/shadow, body padding, etc.) live here
   so they load on every page that contains either block.
   ──────────────────────────────────────────────────────────────────── */

.cw-section--vault .cw-vault__head {
	display: flex; align-items: flex-end; justify-content: space-between;
	margin-bottom: 48px; flex-wrap: wrap; gap: 24px;
}
.cw-section--vault .cw-vault__h {
	font-size: clamp(44px, 5.5vw, 72px); text-wrap: balance; max-width: 720px;
}
.cw-section--vault .cw-vault__filter {
	display: flex; gap: 4px; border: 2px solid var(--ink);
}
.cw-section--vault .cw-vault__pill {
	display: inline-block;
	padding: 10px 18px; border: none;
	background: transparent; color: var(--ink);
	cursor: pointer; font-size: 11px; font-weight: 700;
	font-family: 'JetBrains Mono', monospace;
	text-transform: uppercase; letter-spacing: 0.18em;
	text-decoration: none;
	transition: background 0.1s, color 0.1s;
}
.cw-section--vault .cw-vault__pill:hover {
	background: var(--bone-soft); color: var(--ink);
}
.cw-section--vault .cw-vault__pill--active {
	background: var(--ink); color: var(--bone);
}
.cw-section--vault .cw-vault__pill--active:hover {
	background: var(--ink); color: var(--bone);
}

.cw-section--vault .cw-vault__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
}
.cw-section--vault .cw-vault__card {
	background: var(--bone);
	border: 2px solid var(--ink);
	box-shadow: 4px 4px 0 var(--ink);
	position: relative;
	display: flex; flex-direction: column;
	transition: transform 0.12s, box-shadow 0.15s;
}
.cw-section--vault .cw-vault__card:hover {
	transform: translate(-2px, -2px);
	box-shadow: 8px 8px 0 var(--red);
}
.cw-section--vault .cw-vault__card-link {
	display: flex; flex-direction: inherit;
	color: inherit; text-decoration: none;
	width: 100%;
}

.cw-section--vault .cw-vault__art {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	border-bottom: 2px solid var(--ink);
	flex-shrink: 0;
}
.cw-section--vault .cw-vault__art img,
.cw-section--vault .cw-vault__art svg {
	width: 100%; height: 100%; object-fit: cover; display: block;
}
.cw-section--vault .cw-vault__epnum {
	position: absolute; bottom: 0; left: 0;
	background: var(--ink); color: var(--bone);
	padding: 6px 14px; font-size: 11px;
}
.cw-section--vault .cw-vault__premium-badge {
	position: absolute; top: 12px; right: 12px;
	background: var(--signal); color: var(--ink);
	padding: 4px 8px; box-shadow: 2px 2px 0 var(--ink);
	font-size: 11px;
}
.cw-section--vault .cw-vault__overlay {
	position: absolute; inset: 0;
	background: rgba(14, 14, 14, 0.65);
	display: flex; align-items: center; justify-content: center;
	opacity: 0; transition: opacity 0.15s;
}
.cw-section--vault .cw-vault__card:hover .cw-vault__overlay { opacity: 1; }
.cw-section--vault .cw-vault__play {
	width: 72px; height: 72px;
	background: var(--red);
	display: flex; align-items: center; justify-content: center;
	box-shadow: 4px 4px 0 var(--bone);
}

.cw-section--vault .cw-vault__body {
	padding: 20px;
	display: flex; flex-direction: column;
	flex: 1;
}
.cw-section--vault .cw-vault__meta {
	display: flex; justify-content: space-between;
	margin-bottom: 12px;
}
.cw-section--vault .cw-vault__series { color: var(--red); font-size: 11px; }
.cw-section--vault .cw-vault__date { font-size: 11px; opacity: 0.6; }
.cw-section--vault .cw-vault__title {
	font-size: 20px; line-height: 1.0;
	text-wrap: balance; margin-bottom: 12px;
}
.cw-section--vault .cw-vault__excerpt {
	font-size: 15px; color: var(--steel);
	margin-bottom: 20px; flex: 1;
}
.cw-section--vault .cw-vault__foot {
	display: flex; align-items: center; justify-content: space-between;
	margin-top: auto; padding-top: 12px;
	border-top: 1px dashed var(--ink);
}
.cw-section--vault .cw-vault__dur {
	font-size: 11px; display: flex; align-items: center; gap: 6px;
}
.cw-section--vault .cw-vault__dur-dot {
	display: inline-block; width: 8px; height: 8px;
	background: var(--red);
}
.cw-section--vault .cw-vault__listen {
	font-size: 11px; text-decoration: underline;
}

/* CSS-driven FREE/PREMIUM filter — covers both the homepage Vault block
   (.cw-section--vault) and the archive block (.cw-section--vault.cw-section--archive)
   via the shared --vault class. JS just sets data-current-filter on the
   section; CSS hides the non-matching cards. */
.cw-section--vault[data-current-filter="free"]    .cw-vault__card[data-flag="premium"] { display: none !important; }
.cw-section--vault[data-current-filter="premium"] .cw-vault__card[data-flag="free"]    { display: none !important; }

/* Pagination — shared across archive + search templates */
.cw-pagination {
	display: flex; gap: 8px; flex-wrap: wrap;
	justify-content: center;
	margin-top: 56px;
}
.cw-pagination a,
.cw-pagination span.page-numbers {
	padding: 10px 16px;
	border: 2px solid var(--ink);
	background: var(--bone);
	color: var(--ink);
	text-decoration: none;
	font-family: 'JetBrains Mono', monospace;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	transition: background 0.1s, color 0.1s;
}
.cw-pagination a:hover { background: var(--ink); color: var(--bone); }
.cw-pagination span.current { background: var(--red); color: var(--bone); border-color: var(--red); }
.cw-pagination span.dots { border: none; background: transparent; padding: 10px 4px; }

@media (max-width: 1100px) {
	.cw-section--vault .cw-vault__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.cw-section--vault .cw-vault__grid { grid-template-columns: 1fr; }
}

/* ---- Scaffold placeholder (REMOVE once real templates land) ---- */
.cw-scaffold {
	min-height: 60vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: 80px 24px;
	text-align: center;
}
.cw-scaffold h1 {
	font-family: 'Oswald', sans-serif;
	font-weight: 700;
	font-size: clamp(40px, 6vw, 80px);
	text-transform: uppercase;
	color: var(--ink);
}
.cw-scaffold p {
	font-family: 'JetBrains Mono', monospace;
	font-size: 12px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--steel);
}
