/*
 * Base CSS (skeleton). Only what theme.json and block settings can't express: the page edge and focus visibility.
 * Values are tokens from the design system; no raw colours or sizes (rc-kit/CLAUDE.md, build rules).
 */

/* Page edge on phones: theme.json sets the gutter; a narrower one below 600px (theme.json has no breakpoints). */
@media (max-width: 599px) {
	body {
		--wp--style--root--padding-left: var(--wp--custom--layout--gutter-mobile);
		--wp--style--root--padding-right: var(--wp--custom--layout--gutter-mobile);
	}
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--wp--custom--border--focus) solid var(--wp--preset--color--focus);
	outline-offset: var(--wp--custom--border--focus-offset);
}

.skip-link:focus {
	z-index: var(--wp--custom--z--toast);
}

/* The Conti logo (patterns/site-logo.php): brass/gold in every style variation, never smaller than a touch target. */
.rc-logo {
	display: inline-flex;
	align-items: center;
	min-height: var(--wp--custom--control--min);
	color: var(--wp--preset--color--accent-1);
	text-decoration: none;
}

.rc-logo__mark {
	display: block;
	width: auto;
	height: var(--wp--custom--logo--height);
	fill: currentColor;
}

@media (min-width: 1024px) {
	.rc-logo__mark {
		height: var(--wp--custom--logo--height-desktop);
	}
}

/* Large headings use Archivo's narrower cut (theme.json has no font-stretch setting). */
h1,
.has-xxx-large-font-size {
	font-stretch: var(--wp--custom--font-stretch--display);
}

/*
 * Reading rhythm (owner, 2026-11-07: "best practices for heading sizes and space between paragraphs").
 * theme.json sets the type scale (h1 xxx-large → h6 small, ratio about 1.25), body line height 1.6, headings 1.1
 * (h3–h6 1.3) and the gap between blocks. What it can't express lives here:
 *  - headings balance their lines; paragraphs avoid a lone last word;
 *  - in long text a heading sits closer to what it introduces than to what came before
 *    (more space above, less below), so sections read as groups;
 *  - classic (non-block) text, such as product descriptions in the Description tab, gets the same rhythm;
 *  - lists get a readable indent and a little air between items.
 */
h1,
h2,
h3,
h4,
h5,
h6 {
	text-wrap: balance;
}

p,
li,
dd,
blockquote {
	text-wrap: pretty;
}

.wp-block-post-content h2,
.woocommerce-Tabs-panel h2 {
	margin-block-start: var(--wp--preset--spacing--70);
}

.wp-block-post-content h3,
.wp-block-post-content h4,
.woocommerce-Tabs-panel h3,
.woocommerce-Tabs-panel h4 {
	margin-block-start: var(--wp--preset--spacing--60);
}

.wp-block-post-content > :first-child,
.woocommerce-Tabs-panel > :first-child {
	margin-block-start: 0;
}

.wp-block-post-content :is(h2, h3, h4) + *,
.woocommerce-Tabs-panel :is(h2, h3, h4) + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

/* Classic text (wpautop paragraphs, pasted HTML) has no block gap: give it the same flow. */
.woocommerce-Tabs-panel > * {
	margin-block-end: 0;
}

.woocommerce-Tabs-panel > * + * {
	margin-block-start: var(--wp--preset--spacing--40);
}

:is(.wp-block-post-content, .woocommerce-Tabs-panel) :is(ul, ol):not([class*="wp-block-"]):not(.wc-tabs),
.wp-block-list:not([class*="is-style-"]) {
	padding-inline-start: 1.25em;
}

:is(.wp-block-post-content, .woocommerce-Tabs-panel) li + li {
	margin-block-start: var(--wp--preset--spacing--20);
}

/* Inside a product's Description tab the page already has its H1 and section titles: one step smaller. */
.woocommerce-Tabs-panel h2 {
	font-size: var(--wp--preset--font-size--x-large);
}

.woocommerce-Tabs-panel h3 {
	font-size: var(--wp--preset--font-size--large);
}

.woocommerce-Tabs-panel h2 b,
.woocommerce-Tabs-panel h2 strong {
	font-weight: inherit; /* pasted descriptions wrap headings in <b> */
}

/* Title added by rc-site above Elementor pages that had no main heading. */
.rc-page-title {
	max-width: var(--wp--custom--layout--wide);
	margin: var(--wp--preset--spacing--60) auto var(--wp--preset--spacing--40);
	padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
	box-sizing: content-box;
}

/* Pages still drawn by Elementor (not on rc-site's theme-designed list: Return Policy, Privacy Policy, Photo Gallery,
   old lesson pages …) paint their sections white or cream in Elementor, while their text takes the theme's light
   colour: light on light, unreadable (found on the live site at launch, 2026-11-17). Their section, column and
   container fills are dropped so the text sits on the page's dark background. Background images stay.
   !important: Elementor's generated rules (.elementor-N .elementor-element.elementor-element-X:not(…)) are per page. */
body.elementor-page .elementor :is(.elementor-section, .elementor-column > .elementor-widget-wrap, .elementor-column > .elementor-column-wrap, .e-con, .e-con-inner, .elementor-motion-effects-layer, .elementor-widget-text-editor, .elementor-widget-heading, .elementor-widget-container) {
	background-color: transparent !important;
}
/* Text these pages colour dark in Elementor (readable on white, not on the dark page) takes the theme's text colour;
   links and buttons keep theirs. */
body.elementor-page { background-color: var(--wp--preset--color--base) !important; } /* page-level fill set in Elementor */
body.elementor-page .elementor :is(.elementor-widget-text-editor, .elementor-widget-heading) {
	color: var(--wp--preset--color--contrast) !important;
}
body.elementor-page .elementor :is(.elementor-tab-title, .elementor-tab-content, .elementor-toggle-title, .elementor-accordion-title) {
	background-color: transparent !important;
	color: var(--wp--preset--color--contrast) !important;
}
body.elementor-page .elementor :is(.elementor-heading-title, .elementor-tab-title a, .elementor-tab-content *, .elementor-widget-text-editor :is(p, li, span, strong, b, em, h1, h2, h3, h4, h5, h6, td, th)) {
	color: inherit !important;
}
