/*
Theme Name: Costly Folly
Theme URI: https://costlyfolly.com
Author: Costly Folly
Description: Dark documentary block theme for Costly Folly. Case files with sources, timelines and corrections, two series, standards page and newsletter section.
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: costlyfolly
Tags: dark, block-patterns, full-site-editing, one-column, two-columns, custom-colors, editor-style
*/

/* Most styling lives in theme.json. Only what theme.json cannot express is here. */

:where(.wp-site-blocks) :focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
}

/* Small uppercase label above headings */
.is-style-cf-eyebrow {
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--x-small);
	color: var(--wp--preset--color--gold);
}

/* Header: logo mark + wordmark */
.cf-brand a { text-decoration: none; }
.cf-wordmark {
	font-family: var(--wp--preset--font-family--inter-tight);
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

/* Thin gold crack divider, echoing the Cracked Coin */
.is-style-cf-crack {
	border: 0 !important;
	height: 14px !important;
	width: 100% !important;
	background: url("assets/images/crack.svg") center / 100% 14px no-repeat;
	opacity: 1;
}

/* Case-file timeline: date column + event */
.cf-timeline .wp-block-columns { margin-block: 0 !important; padding-block: 18px; border-top: 1px solid var(--wp--preset--color--line); }
.cf-timeline .wp-block-columns:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.cf-timeline > .wp-block-heading { margin-bottom: 20px; }
.cf-timeline .cf-date { color: var(--wp--preset--color--gold); font-weight: 600; }

/* Source superscripts */
.cf-src sup a, sup a { color: var(--wp--preset--color--gold); text-decoration: none; font-weight: 600; }

/* Arrow after "Open case file" style links */
.is-style-cf-arrow a::after, a.cf-arrow::after { content: " \2192"; }

/* External-link mark in source lists */
.cf-sources a[href^="http"]::after { content: " \2197"; font-size: 0.85em; }

/* Play badge on case thumbnails */
.cf-card .wp-block-post-featured-image { position: relative; }
.cf-card .wp-block-post-featured-image::after {
	content: "";
	position: absolute; left: 16px; bottom: 16px;
	width: 44px; height: 44px; border-radius: 999px;
	background: var(--wp--preset--color--night) url("assets/images/play.svg") center / 18px no-repeat;
	pointer-events: none;
}
.cf-card .wp-block-post-featured-image img { aspect-ratio: 16 / 9; object-fit: cover; }

/* Placeholder box when a case has no image yet */
.cf-card .wp-block-post-featured-image:empty { display: none; }

/* Newsletter form (plain HTML form until a newsletter plugin is connected) */
.cf-newsletter form { display: flex; flex-wrap: wrap; gap: 10px; }
.cf-newsletter label { display: block; width: 100%; font-weight: 500; }
.cf-newsletter input[type="email"] {
	flex: 1 1 240px; min-width: 0; min-height: 52px; padding: 0 16px;
	border-radius: 6px; border: 1px solid #5A4E44;
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--bone);
	font: inherit;
}
.cf-newsletter button {
	min-height: 52px; padding: 0 24px; border: 0; border-radius: 6px; cursor: pointer;
	background: var(--wp--preset--color--gold); color: var(--wp--preset--color--night);
	font: 600 16px var(--wp--preset--font-family--inter);
}
.cf-newsletter button:hover { background: var(--wp--preset--color--bone); }

/* Term filter pills (links to case-type archives) */
.cf-filters .wp-block-categories-list, .cf-filters ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.cf-filters a, .cf-filters .wp-block-button__link {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px;
	border: 1px solid #3A322C; color: var(--wp--preset--color--bone); text-decoration: none; font-size: 14px; font-weight: 500;
}
.cf-filters a:hover { border-color: var(--wp--preset--color--gold); color: var(--wp--preset--color--gold); }

/* Footer watermark */
.cf-footer { background: var(--wp--preset--color--deep) url("assets/images/watermark.svg") right -80px center / 360px no-repeat; }

@media (max-width: 600px) {
	.cf-header-cta { display: none; }
	.cf-timeline .wp-block-columns { flex-direction: column; gap: 4px; }
	.cf-footer { background-image: none; }
}
