/*
Theme Name: Andy Rudkin Pool Plant Training
Theme URI: https://andyrudkinpoolplanttraining.co.uk/
Template: zero-digital-base
Author: Zero Digital
Author URI: https://zero-digital.co.uk/
Description: Child theme for Andy Rudkin Pool Plant Training on the Zero Digital platform. Brand tokens live in theme.json (Default look only; never select a sector variation on this site). This file holds component refinements only, written with tokens. See README.md for the handover notes.
Requires at least: 7.0
Requires PHP: 8.0
Version: 0.1.3
License: GPLv2 or later
Text Domain: zerodigital-child
*/

/* -----------------------------------------------------------------------------
 * Per-client component refinements
 * -----------------------------------------------------------------------------
 * Two accents, on purpose (decided 26 Sep 2026, "option B"):
 *
 *   accent (theme.json, #236E95)    The WORKING accent. The platform draws focus
 *                                   rings, hover text, open FAQ questions, the
 *                                   nav and tab underlines, carousel dots and
 *                                   white-text fills in it, so it has to pass AA
 *                                   on every background this site uses: 5.62:1
 *                                   on white, 4.59:1 on #E8E8E8, 5.19:1 on
 *                                   #F4F6F7, and white text on it 5.62:1.
 *
 *   brand light blue (#80C4E7,      The VISIBLE brand accent, for marks that
 *   --wp--custom--brand--light-blue)  carry no information: the section keyline,
 *                                   the CTA band's keyline, the icon tints, the
 *                                   testimonial quote mark, and the footer's
 *                                   Review us button (with navy text). It is
 *                                   only 1.9:1 on white, so it must never be
 *                                   text, a focus ring or a state indicator.
 *
 * Everything else the brand needs is a token in theme.json. Rules follow the
 * parent starter: tokens only, .zerodigital-* hooks at the parent's
 * specificity, no !important, nothing a UI setting already controls.
 *
 * Decided elsewhere, not here:
 *   - Footer background (secondary navy): Site Editor, Footer template part.
 *   - Header and footer logos: Business Details.
 *   - Section bands (#E8E8E8, #F4F6F7): each block's Layout Settings → Background.
 *   - Keyline SHAPE: Site Settings → Keyline shape (Line). Only its fill is set here.
 * -------------------------------------------------------------------------- */

/* Decorative marks in the brand light blue.
 *
 * --zd-keyline-fill is the documented hook every keyline reads (the .zd-spec
 * label tick and the CTA banner's mark), so one declaration covers them all;
 * a shape set in Site Settings still decides its geometry. --zd-accent-tint is
 * the platform's tint surface (services icon tiles, the pricing highlight, the
 * comparison badge), raised from 8% to 18% so a light hue still reads as a tint.
 * Text on it stays foreground or navy, which is 7:1 or better. */
:root {
	--zd-keyline-fill: var(--wp--custom--brand--light-blue);
	--zd-accent-tint: color-mix(in srgb, var(--wp--custom--brand--light-blue) 18%, transparent);
}

/* Navy headings on light grounds, as in the approved designs.
 *
 * Not set in theme.json: WordPress prints styles.elements.heading.color as a
 * bare h1–h6 rule, and platform blocks inherit their heading colour from the
 * section, so it turned headings navy on the dark heroes and CTA bands too.
 * Here it is limited to light sections and light cards, and every part of the
 * selector is inside :where(), so it has no specificity: each block's own
 * heading and label rules, and the parent's .zd-bg-dark flip, still win.
 * Dark grounds that are not marked .zd-bg-dark are listed in the :not(). */
:where(.zd-section, .zd-light-card):not(:where(.zd-bg-dark, .zerodigital-hero-home--full-bg-overlay, .zerodigital-cta-banner)) :where(h1, h2, h3, h4, h5, h6) {
	color: var(--wp--preset--color--primary);
}

/* SEOPress 10.2 "Cookie preferences": a platform bug, patched here until the parent is fixed.
 *
 * The parent styles every .seopress-user-consent as the consent card (fixed,
 * z-index 9999, 440px, padded, shadowed) and expects "manage cookies" as a
 * link INSIDE it. SEOPress 10.2 prints it as its own fixed sibling box, always
 * present. So the box picked up the card styling, came later in the DOM at the
 * same z-index, and covered Accept and Decline on a first visit.
 * These rules hide it while the card is open, keep it under the card, and draw
 * it as a small corner button once a choice has been made. The !important
 * matches the parent's own !important on the same properties. */
.seopress-user-consent.seopress-edit-choice {
	z-index: 9998 !important;
	width: auto !important;
	max-width: none !important;
	padding: 0 !important;
	gap: 0 !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

.seopress-user-consent.seopress-edit-choice > p {
	margin: 0;
}

.seopress-user-consent.seopress-user-message:not(.seopress-user-consent-hide) ~ .seopress-user-consent.seopress-edit-choice {
	display: none !important;
}

#seopress-user-consent-edit {
	flex: none !important;
	padding: 0.5rem 0.9rem !important;
	font-size: 0.8125rem !important;
	font-weight: 500 !important;
	background: var(--wp--preset--color--surface) !important;
	border-color: var(--wp--preset--color--border) !important;
	color: var(--wp--preset--color--foreground) !important;
	box-shadow: var(--zd-shadow-md, 0 4px 12px -4px rgba(16, 24, 40, 0.18));
}

#seopress-user-consent-edit:hover {
	border-color: var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--accent) !important;
}

/* Desktop dropdown: a long submenu (7+ items, i.e. Courses) opens as two
 * columns under a full-width first item ("All courses") instead of one tall
 * list. Only from 1200px, the bar's own dropdown breakpoint; below it the menu
 * is the drawer and stacks as normal. Shorter submenus are left alone. */
@media (min-width: 1200px) {
	.zerodigital-header__actions .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container:has(> li:nth-child(7)) {
		display: grid;
		grid-template-columns: repeat(2, max-content);
		column-gap: var(--wp--preset--spacing--2-xs, 0.25rem);
		padding: 0.375rem;
	}

	.zerodigital-header__actions .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container:has(> li:nth-child(7)) > li {
		white-space: nowrap;
	}

	.zerodigital-header__actions .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container:has(> li:nth-child(7)) > li:first-child {
		grid-column: 1 / -1;
		margin-bottom: 0.25rem;
		padding-bottom: 0.25rem;
		border-bottom: 1px solid var(--wp--preset--color--border);
	}

	.zerodigital-header__actions .wp-block-navigation-item.has-child > .wp-block-navigation__submenu-container:has(> li:nth-child(7)) > li:first-child > a {
		font-weight: 600;
	}
}

/* Team grid with exactly five members: 3 + 2, the bottom pair centred, rather
 * than the platform's 4 + 1. A six-track grid with each card spanning two
 * tracks; the fourth card starts at track 2. Desktop only; at 960px and below
 * the platform's own 2-up and 1-up grids apply. */
@media (min-width: 961px) {
	.zerodigital-team__members:has(> li:nth-child(5):last-child) {
		grid-template-columns: repeat(6, 1fr);
	}

	.zerodigital-team__members:has(> li:nth-child(5):last-child) > li {
		grid-column: span 2;
	}

	.zerodigital-team__members:has(> li:nth-child(5):last-child) > li:nth-child(4) {
		grid-column: 2 / span 2;
	}
}

/* The opening quote mark on each testimonial: decoration, never information. */
.zerodigital-testimonials blockquote::before {
	color: var(--wp--custom--brand--light-blue);
}

/* Footer "Review us": light blue with navy text (5.51:1). The parent paints it
 * in the accent with a white label; its hover darkens the accent and holds the
 * label white, so both states are restated here. */
.zerodigital-footer-columns__review-cta {
	background: var(--wp--custom--brand--light-blue);
	color: var(--wp--preset--color--secondary);
}

.zerodigital-footer-columns__review-cta:hover {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--secondary);
}
