/*
Theme Name: cmpwiki
Theme URI: https://cmp.wiki/
Author: cmp.wiki
Description: The cmp.wiki front door. Direction C: a cinematic landing, clean pages inside. Uses the shared header, palette and fonts served from /shared.
Version: 1.0.3
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cmpwiki
*/

/* Palette fallbacks in case /shared/header.css is unreachable. :where() keeps them below header.css, whose
   --cmp-header-h changes with the header layout. */
:where(:root) {
	--cmp-bg: #07080a; --cmp-bg-2: #0f1216; --cmp-surface: #13171c; --cmp-surface-2: #151a20; --cmp-surface-3: #1d232b;
	--cmp-text: #e9e6df; --cmp-muted: #a6acb4; --cmp-teal: #5ef2e8; --cmp-orange: #ff8a3d; --cmp-border: #222830;
	--cmp-ink: #071012; --cmp-gutter: 16px; --cmp-header-h: 60px;
}
@media (min-width: 720px) { :where(:root) { --cmp-gutter: 24px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--cmp-bg); -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--cmp-bg);
	color: var(--cmp-text);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
.wp-site-blocks { position: relative; padding: 0; }
.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }
img, svg, video { max-width: 100%; height: auto; }
::selection { background: rgba(94, 242, 232, .3); color: #fff; }
:focus-visible { outline: 2px solid var(--cmp-teal); outline-offset: 2px; }
.screen-reader-text {
	border: 0; clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}
.cmp-main { margin: 0; }

/* ---------- Buttons ---------- */
.cmp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid rgba(94, 242, 232, .75);
	color: var(--cmp-teal);
	font-family: var(--cmp-font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color .15s ease, color .15s ease;
}
.cmp-btn:hover, .cmp-btn:focus-visible { background: rgba(94, 242, 232, .12); color: var(--cmp-teal); }
.cmp-btn--solid { background: var(--cmp-teal); border-color: var(--cmp-teal); color: var(--cmp-ink); }
.cmp-btn--solid:hover, .cmp-btn--solid:focus-visible { background: #93f7f1; color: var(--cmp-ink); }

/* ---------- Landing hero ---------- */
.cmp-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: calc(var(--cmp-header-h) + 4px) var(--cmp-gutter) 36px; /* clears the header in every layout */
	color: var(--cmp-text);
	background:
		radial-gradient(ellipse 70% 45% at 70% 30%, rgba(94, 242, 232, .13), transparent 70%),
		radial-gradient(ellipse 55% 35% at 8% 18%, rgba(255, 138, 61, .11), transparent 70%),
		linear-gradient(180deg, #0a0c0f 0%, #07080a 100%);
}
.cmp-hero__media {
	position: relative;
	z-index: 0;
	margin: -4px calc(-1 * var(--cmp-gutter)) 4px;
	aspect-ratio: 16 / 9;
}
.cmp-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 62% 50%;
}
.cmp-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(7, 8, 10, .35) 0%, rgba(7, 8, 10, 0) 18%, rgba(7, 8, 10, 0) 62%, #07080a 100%);
}
.cmp-hero--drawn .cmp-hero__media { aspect-ratio: auto; padding: 20px 0 8px; }
.cmp-hero--drawn .cmp-hero__media::after { display: none; }
.cmp-hero__svg { display: block; width: 100%; transform: rotate(-9deg); }
.cmp-hero__grain {
	position: absolute;
	inset: 0;
	z-index: 1;
	opacity: .08;
	pointer-events: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}
.cmp-hero__inner { position: relative; z-index: 2; max-width: 1440px; margin: 0 auto; }
.cmp-hero__title {
	margin: 0;
	color: #f1eee7;
	font-family: var(--cmp-font-display);
	font-weight: 900;
	font-size: clamp(2.5rem, 12.5vw, 7rem);
	line-height: .92;
	letter-spacing: -.035em;
	white-space: nowrap;
}
.cmp-hero__tagline {
	display: flex;
	gap: 10px;
	margin: 14px 0 0;
	font-family: var(--cmp-font-mono);
	font-size: 12px;
	line-height: 1.5;
	letter-spacing: .18em;
	text-transform: uppercase;
}
.cmp-hero__tagline::before {
	content: "";
	flex: 0 0 18px;
	height: 1px;
	margin-top: .75em;
	background: var(--cmp-orange);
}
@media (max-width: 459px) {
	.cmp-hero__tagline { font-size: 11px; letter-spacing: .12em; }
}
.cmp-hero__lede {
	margin: 10px 0 0;
	max-width: 36ch;
	color: rgba(233, 230, 223, .8);
	font-size: 15px;
	line-height: 1.55;
}
.cmp-hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
@media (max-width: 459px) {
	.cmp-hero__cta { gap: 8px; margin-top: 18px; }
	.cmp-hero__cta .cmp-btn { flex: 1 1 auto; padding: 0 10px; font-size: 10.5px; letter-spacing: .1em; }
}

@media (min-width: 980px) {
	.cmp-hero {
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		min-height: clamp(520px, 66vh, 660px);
		padding: calc(var(--cmp-header-h) + 40px) var(--cmp-gutter) 44px;
	}
	.cmp-hero__inner { width: 100%; }
	.cmp-hero__media {
		position: absolute;
		top: calc(var(--cmp-header-h) - 12px);
		right: 0;
		bottom: 0;
		left: calc(93px + 17.7%); /* keeps about 40px between the title and the card from 980 to 1440 */
		margin: 0;
		aspect-ratio: auto;
		-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
		mask-image: linear-gradient(90deg, transparent 0%, #000 30%);
	}
	.cmp-hero__img { object-position: 0% 15%; } /* x only acts when the box is narrower than 16:9 (around 1024) */
	.cmp-hero__media::after {
		background: linear-gradient(180deg, rgba(7, 8, 10, .6) 0%, rgba(7, 8, 10, 0) 24%, rgba(7, 8, 10, 0) 72%, #07080a 100%);
	}
	.cmp-hero--drawn .cmp-hero__media {
		top: 70px; bottom: auto; left: auto; right: -2%; width: 54%; padding: 0;
		-webkit-mask-image: none; mask-image: none;
	}
	.cmp-hero__title { font-size: clamp(4.5rem, 7.2vw, 7.5rem); }
	.cmp-hero__lede { font-size: 16px; }
	.cmp-hero__cta { margin-top: 24px; }
}

/* Above 1440 the text column stays in a centred 1440 box: anchor the image box to it so the card never meets the title. */
@media (min-width: 1441px) {
	.cmp-hero__media { left: calc((100% - 1440px) / 2 + 348px); }
}

/* ---------- Landing panel: search, recipes, board ---------- */
.cmp-panel {
	background: var(--cmp-bg-2);
	border-top: 1px solid var(--cmp-border);
	padding: 16px var(--cmp-gutter) 40px;
	color: #e6e8eb;
}
.cmp-panel__inner { max-width: 1440px; margin: 0 auto; }
.cmp-search { display: flex; gap: 8px; margin: 0 0 18px; }
.cmp-search input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 48px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid #2a3038;
	border-radius: 8px;
	background: var(--cmp-surface);
	color: var(--cmp-text);
	font-family: var(--cmp-font-body);
	font-size: 16px;
	-webkit-appearance: none;
	appearance: none;
}
.cmp-search input[type="search"]::placeholder { color: #7f8892; opacity: 1; }
.cmp-search input[type="search"]:focus { outline: none; border-color: var(--cmp-teal); box-shadow: 0 0 0 3px rgba(94, 242, 232, .15); }
.cmp-search button {
	flex: 0 0 auto;
	min-height: 48px;
	padding: 0 16px;
	border: 1px solid rgba(94, 242, 232, .6);
	border-radius: 8px;
	background: transparent;
	color: var(--cmp-teal);
	font-family: var(--cmp-font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
}
.cmp-search button:hover, .cmp-search button:focus-visible { background: rgba(94, 242, 232, .12); }
.cmp-search__icon { display: none; width: 18px; height: 18px; }
@media (max-width: 459px) {
	.cmp-search button { width: 48px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
	.cmp-search__icon { display: block; }
	.cmp-search input[type="search"] { padding: 0 12px; }
	.cmp-search input[type="search"]::placeholder { font-size: 15px; }
	.cmp-search__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

.cmp-panel__grid { display: grid; gap: 24px; }
@media (min-width: 980px) {
	.cmp-panel { padding-top: 24px; }
	.cmp-panel__grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 36px; }
}
.cmp-panel__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}
.cmp-panel__head h2 { margin: 0; line-height: 1.4; }
.cmp-more {
	color: var(--cmp-muted);
	font-family: var(--cmp-font-mono);
	font-size: 10.5px;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}
.cmp-more::after { content: " \2192"; }
.cmp-more:hover, .cmp-more:focus-visible { color: var(--cmp-teal); }

.cmp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.35; }
.cmp-table th {
	padding: 8px 12px 8px 0;
	border-bottom: 1px solid var(--cmp-border);
	color: var(--cmp-muted);
	font-family: var(--cmp-font-mono);
	font-size: 10px;
	font-weight: 400;
	letter-spacing: .12em;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
}
.cmp-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--cmp-border); vertical-align: middle; }
.cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table td a { color: var(--cmp-text); text-decoration: none; }
.cmp-table td a:hover { color: var(--cmp-teal); }
.cmp-table .cmp-num { font-family: var(--cmp-font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-table .cmp-col-by { color: var(--cmp-muted); }
.cmp-table .cmp-cards { white-space: nowrap; }
@media (max-width: 559px) { .cmp-table .cmp-col-by { display: none; } }
.cmp-empty {
	margin: 0;
	padding: 14px 16px;
	border: 1px dashed #2a3038;
	border-radius: 8px;
	color: var(--cmp-muted);
	font-size: 14px;
}
.cmp-empty a { color: var(--cmp-teal); }

.cmp-board__cols {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 560px) { .cmp-board__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cmp-board__col { margin: 0; }
.cmp-board__col a {
	display: block;
	height: 100%;
	min-height: 64px;
	padding: 10px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: var(--cmp-surface-2);
	color: var(--cmp-text);
	text-decoration: none;
	transition: border-color .15s ease;
}
.cmp-board__col a:hover, .cmp-board__col a:focus-visible { border-color: rgba(94, 242, 232, .45); }
.cmp-board__name {
	display: block;
	color: var(--cmp-muted);
	font-family: var(--cmp-font-mono);
	font-size: 10px;
	letter-spacing: .1em;
	line-height: 1.45;
	text-transform: uppercase;
	overflow-wrap: anywhere;
}
.cmp-board__count { color: var(--cmp-text); font-weight: 600; }
.cmp-board__col:last-child .cmp-board__count { color: var(--cmp-teal); }
.cmp-board__card {
	display: block;
	margin-top: 8px;
	padding: 7px 8px;
	border-radius: 4px;
	background: var(--cmp-surface-3);
	font-size: 12.5px;
	line-height: 1.35;
}
.cmp-board__note { margin: 10px 0 0; color: var(--cmp-muted); font-size: 13px; }

.cmp-landing-extra { background: var(--cmp-bg-2); }
.cmp-landing-extra > :first-child { margin-top: 0; padding-top: 8px; }
.cmp-landing-extra > :last-child { padding-bottom: 40px; }

/* ---------- Pages ---------- */
.cmp-page-head {
	padding-top: 44px;
	padding-bottom: 28px;
	border-bottom: 1px solid var(--cmp-border);
	background:
		radial-gradient(ellipse 50% 140% at 88% 0%, rgba(94, 242, 232, .10), transparent 70%),
		radial-gradient(ellipse 40% 120% at 4% 0%, rgba(255, 138, 61, .08), transparent 70%),
		var(--cmp-bg);
}
.cmp-kicker {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	color: var(--cmp-muted);
	font-family: var(--cmp-font-mono);
	font-size: 11px;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.cmp-page-title {
	margin: 0;
	font-family: var(--cmp-font-display);
	font-size: clamp(2rem, 7vw, 3.5rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -.02em;
}
.cmp-page-head .cmp-label { margin-top: 12px; }
.cmp-content { padding-top: 32px; padding-bottom: 72px; background: var(--cmp-bg-2); }
.cmp-page { background: var(--cmp-bg-2); }
.cmp-content p, .cmp-content li { color: rgba(233, 230, 223, .9); }
.cmp-content .cmp-lede { color: var(--cmp-text); font-size: 1.2rem; line-height: 1.5; }
.cmp-content h2 { margin-top: 2.2em; margin-bottom: .5em; }
.cmp-content h3 { margin-top: 1.8em; margin-bottom: .4em; }
.cmp-content a { text-decoration: underline; text-decoration-color: rgba(94, 242, 232, .4); text-underline-offset: 3px; }
.cmp-content a:hover { text-decoration-color: currentColor; }
.cmp-content ul, .cmp-content ol { padding-left: 1.25em; }
.cmp-content li { margin: .3em 0; }
.cmp-content li::marker { color: var(--cmp-teal); }
.cmp-content code { padding: .1em .35em; border-radius: 4px; background: var(--cmp-surface); font-family: var(--cmp-font-mono); font-size: .9em; }
.cmp-content blockquote { margin-left: 0; padding-left: 1em; border-left: 2px solid var(--cmp-teal); color: var(--cmp-muted); }
.cmp-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cmp-content th, .cmp-content td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--cmp-border); text-align: left; }
.cmp-content .wp-block-table { overflow-x: auto; }
.cmp-content .cmp-soon {
	padding: 12px 16px;
	border-left: 2px solid var(--cmp-orange);
	background: var(--cmp-surface);
	color: var(--cmp-muted);
	font-size: .95rem;
}
.cmp-content .cmp-badge { margin-right: .4em; }
.cmp-content .cmp-status-list { list-style: none; padding-left: 0; }
.cmp-content .cmp-status-list li { margin: .7em 0; }

/* ---------- Wide page template (Credits): up to 1200px, text keeps a reading measure ---------- */
.cmp-wide {
	padding-left: max(var(--cmp-gutter), calc((100% - 1200px) / 2));
	padding-right: max(var(--cmp-gutter), calc((100% - 1200px) / 2));
}
.cmp-content.cmp-wide > p, .cmp-content.cmp-wide > h2, .cmp-content.cmp-wide > h3 { max-width: 760px; }
.cmp-content .cmp-credits { list-style: none; margin: 0 0 2em; padding: 0; }
@media (min-width: 980px) {
	.cmp-content .cmp-credits { column-count: 2; column-gap: 48px; }
}
.cmp-content .cmp-credits li {
	break-inside: avoid;
	margin: 0 0 .7em;
	padding: 0;
	font-size: .95rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
.cmp-content .cmp-credits li::marker { content: none; }
.cmp-credit__who { color: var(--cmp-teal); font-family: var(--cmp-font-mono); font-size: .86em; letter-spacing: .02em; }
.cmp-content a.cmp-credit__who, .cmp-content a.cmp-credit__repo { font-family: var(--cmp-font-mono); font-size: .86em; }
.cmp-credit__on { color: var(--cmp-muted); font-size: .86em; }
.cmp-credit__n { margin-left: .2em; color: var(--cmp-muted); font-family: var(--cmp-font-mono); font-size: .78em; white-space: nowrap; }

/* ---------- 404 ---------- */
.cmp-404 { max-width: 760px; margin: 0 auto; padding: 56px var(--cmp-gutter) 96px; }
.cmp-404__title {
	margin: 0 0 12px;
	font-family: var(--cmp-font-display);
	font-size: clamp(3rem, 14vw, 7rem);
	font-weight: 900;
	line-height: .95;
	letter-spacing: -.03em;
}
.cmp-404__text { margin: 0 0 20px; color: var(--cmp-muted); }
.cmp-404__links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 22px;
	margin-top: 20px;
	font-family: var(--cmp-font-mono);
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.cmp-404__links a { color: var(--cmp-text); text-decoration: none; }
.cmp-404__links a:hover { color: var(--cmp-teal); }

/* ---------- Footer ---------- */
.cmp-footer {
	padding: 32px var(--cmp-gutter) 40px;
	border-top: 1px solid var(--cmp-border);
	background: var(--cmp-bg);
	color: var(--cmp-muted);
	font-size: 13px;
}
.cmp-footer__inner { display: grid; gap: 16px; max-width: 1440px; margin: 0 auto; }
.cmp-footer__brand {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0;
	color: var(--cmp-text);
	font-family: var(--cmp-font-display);
	font-size: 14px;
	font-weight: 800;
}
.cmp-footer__brand span:last-child {
	color: var(--cmp-muted);
	font-family: var(--cmp-font-mono);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: .16em;
	text-transform: uppercase;
}
.cmp-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 20px;
	font-family: var(--cmp-font-mono);
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.cmp-footer__links a { color: var(--cmp-text); opacity: .85; text-decoration: none; }
.cmp-footer__links a:hover, .cmp-footer__links a:focus-visible { color: var(--cmp-teal); opacity: 1; }
.cmp-footer__note { margin: 0; max-width: 64ch; line-height: 1.55; }
@media (min-width: 980px) {
	.cmp-footer__inner { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
	.cmp-footer__links { justify-content: flex-end; }
	.cmp-footer__note { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
