/*
Theme Name: COM Crypto
Description: One block child theme of Twenty Twenty-Five for the nine crypto-gambling sites on 165.22.17.99 (cryptocasinos.ing and siblings). Each site gets its own palette, face, radius, header and heading style from variants/<host>.json, picked by the site's home host. Long-form column, one-row header, no search, no comments.
Author: COM
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: com-crypto
Update URI: false
*/

/* ------------------------------------------------------------------------
 * Everything site-specific is a token from theme.json (palette, font, column
 * width, radius). This file only says how tokens are used, plus four header
 * styles and four H2 styles picked by body classes (cct-hs-*, cct-h2-*).
 * Rules: docs/processes/ui-rules.md. px, not rem.
 * ---------------------------------------------------------------------- */

body {
	--cct-radius: var(--wp--custom--radius, 4px);
	--cct-gut: 24px;
	/* com-evergreen-elements: set on body so they beat eg.css's own :root defaults */
	--eg-ink: var(--wp--preset--color--contrast);
	--eg-muted: var(--wp--preset--color--muted);
	--eg-line: var(--wp--preset--color--line);
	--eg-surface: var(--wp--preset--color--surface);
	--eg-surface-2: color-mix(in srgb, var(--wp--preset--color--surface) 60%, var(--wp--preset--color--line));
	--eg-accent: var(--wp--preset--color--accent);
	--eg-cta-bg: var(--wp--preset--color--cta);
	--eg-cta-ink: var(--wp--preset--color--cta-ink);
	--eg-radius: var(--cct-radius);
	--eg-cta-radius: var(--cct-radius);
	--eg-display: var(--wp--preset--font-family--body);
	/* com-evergreen-header: centre its strip on our column */
	--com-eg-width: 100%;
	/* com-bm-table */
	--com-bm-cta: var(--wp--preset--color--cta);
	--com-bm-cta-text: var(--wp--preset--color--cta-ink);
	--com-bm-highlight: var(--wp--preset--color--brand);
	--com-bm-card: var(--wp--preset--color--base);
	--com-bm-text: var(--wp--preset--color--contrast);
	--com-bm-muted: var(--wp--preset--color--muted);
	--com-bm-line: var(--wp--preset--color--line);
	--com-bm-radius: var(--cct-radius);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
@media (max-width: 600px) { body { --cct-gut: 16px; } }

/* ---- header: one row, logo left, nav right ----------------------------- */
.cct-header {
	background: var(--wp--preset--color--header-bg);
	color: var(--wp--preset--color--header-ink);
	padding: 12px var(--cct-gut);
}
.cct-header__row { min-height: 40px; gap: 16px; }
.cct-logo { display: flex; align-items: center; min-width: 0; flex: 0 1 auto; line-height: 0; }
.cct-logo img { display: block; height: 34px; width: calc(var(--cct-r) * 34px); max-width: 100%; object-fit: contain; object-position: left center; }
.cct-nav { display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; flex: 0 0 auto; }
:root .cct-nav a:where(:not(.wp-element-button)) {
	color: inherit; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: .01em;
	display: inline-block; padding: 10px 0;
}
:root .cct-nav a:where(:not(.wp-element-button)):hover { text-decoration: underline; text-underline-offset: 4px; }

.cct-hs-topbar .cct-header { border-top: 4px solid var(--wp--preset--color--brand); border-bottom: 1px solid var(--wp--preset--color--line); }
.cct-hs-dark .cct-header { border-bottom: 3px solid var(--wp--preset--color--brand); }
.cct-hs-line .cct-header { border-bottom: 1px solid var(--wp--preset--color--line); box-shadow: inset 0 -3px 0 -1px var(--wp--preset--color--brand); }
.cct-hs-tint .cct-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.cct-hs-solid .cct-header { border-bottom: 0; }
.cct-hs-band .cct-header { border-bottom: 5px solid var(--wp--preset--color--brand); }

@media (max-width: 600px) {
	.cct-header { padding-top: 10px; padding-bottom: 10px; }
	.cct-logo img { height: auto; width: min(calc(var(--cct-r) * 28px), 100%); }
	.cct-nav { gap: 12px; }
	:root .cct-nav a:where(:not(.wp-element-button)) { font-size: 14px; }
}

/* ---- main column -------------------------------------------------------- */
.wp-site-blocks > * { margin-block-start: 0; }
.cct-main { padding: 28px var(--cct-gut) 24px; }
.cct-main > .wp-block-post-title { margin: 0 0 16px; }
@media (max-width: 600px) {
	.cct-main { padding-top: 20px; padding-bottom: 12px; }
	:root .wp-block-post-content h2 { font-size: 23px; }
	.cct-footer { padding-top: 20px; }
}

.wp-block-post-content > * + * { margin-block-start: 1.1em; }
.wp-block-post-content > :last-child, .cct-main > :last-child { margin-block-end: 0; }
.wp-block-post-content :where(h2) { margin-block-start: 1.5em; margin-block-end: .5em; }
.wp-block-post-content :where(h3) { margin-block-start: 1.35em; margin-block-end: .4em; }
.wp-block-post-content :where(ul, ol) { padding-left: 1.3em; }
.wp-block-post-content :where(li + li) { margin-top: .35em; }
:root .wp-block-post-content a:where(:not(.wp-element-button):not(.eg-cta)) { text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* H2 styles */
.cct-h2-rule .wp-block-post-content h2::after { content: ""; display: block; width: 44px; height: 3px; margin-top: 10px; background: var(--wp--preset--color--brand); }
.cct-h2-bar .wp-block-post-content h2 { border-left: 4px solid var(--wp--preset--color--brand); padding-left: 12px; }
.cct-h2-top .wp-block-post-content h2 { border-top: 2px solid var(--wp--preset--color--contrast); padding-top: 14px; }
.cct-h2-under .wp-block-post-content h2 { border-bottom: 2px solid var(--wp--preset--color--line); padding-bottom: 8px; }

/* ---- tables: ui-rules §7; scroll inside their own box on mobile ---------- */
.wp-block-table, .cct-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-inline: 0; }
.wp-block-table table { border-collapse: collapse; width: 100%; font-size: 15px; }
:root .wp-block-table thead { border-bottom: 0; }
:root .wp-block-table th, :root .wp-block-table td { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); padding: 10px 12px; text-align: left; vertical-align: top; }
:root .wp-block-table thead th, :root .wp-block-table thead td {
	font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
	color: var(--wp--preset--color--muted); border-bottom: 2px solid var(--wp--preset--color--contrast);
	background: transparent;
}
.wp-block-table td.num, .wp-block-table .has-text-align-right { font-variant-numeric: tabular-nums; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--wp--preset--color--surface); }
.wp-block-table figcaption { font-size: 13px; color: var(--wp--preset--color--muted); }
@media (max-width: 600px) {
	.wp-block-table table, .eg-table table { min-width: 560px; }
	.wp-block-table table { font-size: 14px; }
}

/* ---- buttons, quotes, images --------------------------------------------- */
.wp-element-button, .wp-block-button__link { border-radius: var(--cct-radius); }
.wp-block-post-content img { border-radius: min(var(--cct-radius), 6px); height: auto; }
.wp-block-quote { border-left: 3px solid var(--wp--preset--color--brand); padding-left: 16px; }

/* ---- posts (news desk, later) -------------------------------------------- */
.cct-meta { font-size: 14px; color: var(--wp--preset--color--muted); gap: 6px; }
.cct-meta a { color: inherit; }
.cct-meta .wp-block-post-author-name:empty + .cct-sep { display: none; }
.cct-lead { height: clamp(200px, 25vw, 320px); aspect-ratio: auto !important; overflow: hidden; }
.cct-lead img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.cct-list .wp-block-post { padding: 14px 0; border-bottom: 1px solid var(--wp--preset--color--line); }
.cct-list .wp-block-post-title { font-size: 20px; margin: 0 0 4px; }
.cct-list .wp-block-post-title a { color: inherit; text-decoration: none; }
.cct-list .wp-block-post-excerpt { font-size: 15px; color: var(--wp--preset--color--muted); margin: 6px 0 0; }

/* ---- footer --------------------------------------------------------------- */
.cct-footer {
	background: var(--wp--preset--color--footer-bg);
	color: var(--wp--preset--color--footer-ink);
	padding: 24px var(--cct-gut) 24px;
	font-size: 14px; line-height: 1.6;
}
.cct-f-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; }
.cct-f-name { font-weight: 700; font-size: 16px; }
.cct-f-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
:root .cct-footer a:where(:not(.wp-element-button)) { color: inherit; text-decoration: none; }
:root .cct-footer a:where(:not(.wp-element-button)):hover { text-decoration: underline; }
.cct-f-links a { display: inline-block; padding: 6px 0; }
.cct-f-legal { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent); color: var(--wp--preset--color--footer-muted); }
.cct-f-legal p { margin: 0 0 6px; }
.cct-f-age { display: inline-block; font-weight: 700; border: 1.5px solid currentColor; border-radius: 3px; padding: 0 5px; margin-right: 8px; font-size: 13px; color: var(--wp--preset--color--footer-ink); }
