/*
Theme Name: YOLO Canvas
Author: YOLO
Author URI: https://yolo-plugin.com/
Description: A small, plain block theme to build a site on. It gives you a header, a footer, page layouts for pages, posts, search and errors, and ready-made sections and starting pages built only from core blocks. Every template, header and footer can be changed in the Site Editor. It has light and dark colours of its own, and its colours, fonts and page width come from CSS custom properties, so they are easy to restyle in one place. All of its styles sit underneath everything else, so plugins and blocks look the way they were designed.
Version: 0.3.0
Update URI: https://yolo-plugin.cloud/
YOLO Official: yes
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yolo-canvas
Tags: full-site-editing, block-patterns, one-column, wide-blocks, custom-colors, editor-style, translation-ready
*/

/*
 * Everything here is inside cascade layers: resets in "base" (the same layer
 * as Tailwind's reset), typography and parts in "components" with zero-
 * specificity :where() selectors. So every utility class, every
 * component class and every extension's own (unlayered) CSS wins over the
 * theme without fighting. Never add unlayered rules to this file.
 */
@layer base, components;

@layer components {
	body {
		background-color: var(--color-page, var(--yolo-th-page));
		color: var(--color-ink, var(--yolo-th-ink));
	}
	:where(h1, h2, h3, h4, h5, h6) {
		font-family: var(--font-display, var(--yolo-th-font-display));
		font-weight: 700;
		line-height: 1.15;
		letter-spacing: -0.015em;
		color: inherit;
		margin-block: 0;
	}
	:where(h1) { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem); letter-spacing: -0.025em; }
	:where(h2) { font-size: clamp(1.7rem, 1.25rem + 1.6vw, 2.5rem); letter-spacing: -0.02em; }
	:where(h3) { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.75rem); }
	:where(h4) { font-size: 1.25rem; }
	:where(h5) { font-size: 1.1rem; }
	:where(h6) { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }
	:where(a) {
		/* Brand mixed towards the text colour, so links pass contrast in light and dark. */
		color: color-mix(in srgb, var(--color-brand, var(--yolo-th-brand)) 72%, var(--color-ink, var(--yolo-th-ink)));
	}
	:where(code, kbd, pre, samp) { font-family: var(--font-mono, var(--yolo-th-font-mono)); }
	:where(hr) { border: 0; border-top: 1px solid var(--color-line, var(--yolo-th-line)); }
	:where(blockquote) { border-inline-start: 3px solid var(--color-brand, var(--yolo-th-brand)); padding-inline-start: 1.25rem; margin-inline: 0; }
	:where(.wp-block-post-date, .wp-block-post-terms, .wp-block-post-author-name, .wp-block-query-no-results) { color: var(--color-muted, var(--yolo-th-muted)); }
	:where(.wp-block-search__input, .wp-block-post-comments-form input:not([type=submit]), .wp-block-post-comments-form textarea) {
		border: 1px solid var(--color-line, var(--yolo-th-line));
		border-radius: 8px;
		background: var(--color-surface, var(--yolo-th-surface));
		color: inherit;
		padding: 0.6em 0.8em;
	}
}

@layer base {
	:root {
		--yolo-th-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
		--yolo-th-font-display: var(--yolo-th-font-sans);
		--yolo-th-font-mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
	}
	:root {
		/* The theme's own colours. Any --color-* variables a plugin or your own CSS sets take over when present. */
		--yolo-th-page: #ffffff;
		--yolo-th-surface: #f4f6f8;
		--yolo-th-ink: #142021;
		--yolo-th-muted: #4f5d64;
		--yolo-th-line: #dde3e6;
		--yolo-th-brand: #0a6166;
		--yolo-th-brand-dark: #084a4e;
		--yolo-th-on-brand: #ffffff;
		--yolo-th-contrast: #0f1c24;
		--yolo-th-on-contrast: #ffffff;
		color-scheme: light;
	}
	@media (prefers-color-scheme: dark) {
		:root:not([data-theme="light"]) {
			--yolo-th-page: #0b1220;
			--yolo-th-surface: #131c2e;
			--yolo-th-ink: #e8eef7;
			--yolo-th-muted: #a3b1c2;
			--yolo-th-line: #26344b;
			--yolo-th-brand: #5fd0d6;
			--yolo-th-brand-dark: #8fe0e4;
			--yolo-th-on-brand: #062a2c;
			--yolo-th-contrast: #1b2436;
			--yolo-th-on-contrast: #e8eef7;
			color-scheme: dark;
		}
	}
	:root[data-theme="dark"] {
		--yolo-th-page: #0b1220;
		--yolo-th-surface: #131c2e;
		--yolo-th-ink: #e8eef7;
		--yolo-th-muted: #a3b1c2;
		--yolo-th-line: #26344b;
		--yolo-th-brand: #5fd0d6;
		--yolo-th-brand-dark: #8fe0e4;
		--yolo-th-on-brand: #062a2c;
		--yolo-th-contrast: #1b2436;
		--yolo-th-on-contrast: #e8eef7;
		color-scheme: dark;
	}

	html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
	body { margin: 0; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
	html:has(.alignfull) { overflow-x: clip; }

	img, video, svg { max-width: 100%; height: auto; }

	:where(a) { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
	:where(a):hover { text-decoration-thickness: 2px; }

	:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
		outline: 2px solid var(--color-brand, var(--yolo-th-brand));
		outline-offset: 2px;
	}

	:where(h1, h2, h3, h4, h5, h6) { text-wrap: balance; }
	:where(p, li, figcaption) { text-wrap: pretty; }

	::selection { background: var(--color-brand, var(--yolo-th-brand)); color: var(--yt-on-brand, var(--yolo-th-on-brand)); }

	/* Header and footer */
	.yolo-th-header { border-bottom: 1px solid var(--color-line, var(--yolo-th-line)); }
	.yolo-th-header .wp-block-site-title a { text-decoration: none; }
	.yolo-th-header .wp-block-navigation a { text-decoration: none; }
	.yolo-th-header .wp-block-navigation a:hover { text-decoration: underline; }
	.yolo-th-footer { border-top: 1px solid var(--color-line, var(--yolo-th-line)); }

	/* Posts */
	.yolo-th-card { border: 1px solid var(--color-line, var(--yolo-th-line)); border-radius: var(--radius-card, 14px); overflow: hidden; background: var(--color-surface, var(--yolo-th-surface)); }
	.yolo-th-card .wp-block-post-title a { text-decoration: none; }
	.yolo-th-card .wp-block-post-title a:hover { text-decoration: underline; }

	@media (prefers-reduced-motion: reduce) {
		*, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
	}
}
