/*
Theme Name: AR Leisure Collective
Theme URI: https://arleisurecollective.co.uk/
Template: zero-digital-base
Author: Zero Digital
Author URI: https://zero-digital.co.uk/
Description: Child theme for AR Leisure Collective 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.2
License: GPLv2 or later
Text Domain: zerodigital-child
*/

/* -----------------------------------------------------------------------------
 * Per-client component refinements
 * -----------------------------------------------------------------------------
 * Two accents, on purpose (the same pattern as ARPPT):
 *
 *   accent (theme.json, #176A60)  The WORKING accent: the brand's own darker
 *                                 teal. The platform draws focus rings, hover
 *                                 text, open FAQ questions and white-text fills
 *                                 in it, so it has to pass AA: 6.43:1 on white,
 *                                 5.89:1 on #F4F5F5, and white text on it 6.43:1.
 *
 *   brand teal (#2DD4BF,          The VISIBLE brand accent, for marks that carry
 *   --wp--custom--brand--teal)    no information: the section keyline and the
 *                                 icon tints. It is only 1.86:1 on white, so it
 *                                 is never text, a focus ring or a state
 *                                 indicator on a light ground. On the indigo
 *                                 bands it reads at 7.2:1.
 *
 * 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 (#F4F5F5, light as on the live site): Site Editor,
 *     Footer template part.
 *   - Header logo: Business Details (the light footer reuses it).
 *   - Section bands (indigo #232A5F, grey #F4F5F5): each block's Layout
 *     Settings → Background.
 *   - Keyline SHAPE: Site Settings. Only its fill is set here.
 * -------------------------------------------------------------------------- */

/* Decorative marks in the brand teal.
 *
 * --zd-keyline-fill is the documented hook every keyline reads, so one
 * declaration covers them all. --zd-accent-tint is the platform's tint surface
 * (services icon tiles and the like), raised from 8% to 18% so the light hue
 * still reads as a tint. Text on it stays foreground or indigo. */
:root {
	--zd-keyline-fill: var(--wp--custom--brand--teal);
	--zd-accent-tint: color-mix(in srgb, var(--wp--custom--brand--teal) 18%, transparent);
}

/* Dark indigo headings on light grounds, as in the approved design.
 *
 * Never set styles.elements.heading.color in theme.json: WordPress prints it
 * as a bare h1–h6 rule that beats the inherited white on every dark band.
 * This rule has zero specificity from :where() and stops at dark grounds
 * (.zd-bg-dark, which the platform adds to indigo bands automatically), the
 * overlay hero and the CTA banner. If a dark block is added later that is not
 * marked .zd-bg-dark, add it to 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--secondary);
}

/* The live site's wave-dot pattern behind the Home hero.
 *
 * The Home Hero's background is a colour OR an image, and its overlay variant
 * always lays a near-black gradient on top, so the indigo-plus-pattern of the
 * live site can't be built from the block's fields. The hero is set to its
 * indigo colour in Layout Settings (which also switches the text to white);
 * this adds the pattern as a layer between that colour and the copy.
 *
 * The image is the live site's own pattern (706ecdff….png), recoloured to
 * white at 24% alpha, which matches the live #232a5f overlay at 0.8 over grey
 * dots. It is decorative, so it lives in CSS and needs no alt text. It sits
 * under .zerodigital-hero-home__inner (z-index 2). It is scoped to the front
 * page's hero on a dark colour ground (.zd-bg-dark, which the hero adds when
 * its colour is dark), so a hero with an image or a light ground is untouched. */
.home .zerodigital-hero-home.zd-bg-dark::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: url("assets/images/hero-wave.webp") center bottom / cover no-repeat;
	pointer-events: none;
}

/* =============================================================================
 * Design review fixes (0.1.1, 6 Oct 2026)
 * -----------------------------------------------------------------------------
 * Each rule below brings the staging build in line with the approved ARLC
 * homepage canvas, or keeps a platform default on-brand. A few rules beat a
 * platform selector of equal weight, so they carry one extra class or `body`.
 * ========================================================================== */

/* The brand's circle-check mark (Tabler "circle-check"), used as a mask so it
 * takes the teal from background-color. The pill and the test list use it. */
:root {
	--arlc-circle-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9 12l2 2l4 -4'/%3E%3C/svg%3E");
}

/* Header ------------------------------------------------------------------- */

/* A hairline under the header, as in the design. */
header.wp-block-template-part {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* The logo is a stacked badge whose small "collective ltd" line needs the
 * height: 48px on phones and 60px on desktop, as in the design (the platform
 * caps it at 40px). The sticky offset for anchors follows the header's real
 * height, so it needs no change. */
.zerodigital-site-brand__logo {
	max-height: 3rem;
}

@media (min-width: 961px) {
	.zerodigital-site-brand__logo {
		max-height: 3.75rem;
	}
}

/* Nav links in the brand's heading ink, not body grey (hover stays accent). */
@media (min-width: 600px) {
	.zerodigital-header__actions .wp-block-navigation-item__content:not(:hover) {
		color: var(--wp--preset--color--secondary);
	}
}

/* The header phone pill filled with the dark teal on hover, a green block in
 * an indigo header. It now fills with the brand indigo, like every other
 * filled button on the site. */
body .zerodigital-header__actions .zerodigital-business-phone:hover {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
}

/* Hero --------------------------------------------------------------------- */

/* The keyline before "End-to-End", as every other eyebrow on the site has. */
.zerodigital-hero-home__eyebrow-inline::before {
	content: "";
	display: inline-block;
	width: 1.125rem;
	height: 0.625rem;
	margin-right: 0.625rem;
	border-radius: 999px;
	background: var(--zd-keyline-fill);
	vertical-align: 0.05em;
}

/* The design puts the intro before the trust pill. The platform prints the
 * pills first, so the front-page hero's copy column becomes a flex column and
 * the pills move to the end. */
.home .zerodigital-hero-home__copy {
	display: flex;
	flex-direction: column;
}

.home .zerodigital-hero-home__pills {
	order: 1;
	margin-bottom: 0;
}

.home .zerodigital-hero-home__subtext {
	margin-bottom: 1.75rem;
}

/* The trust pill: white text, a firmer outline and the teal circle-check. */
.zerodigital-hero-home.zd-bg-dark .zerodigital-hero-home__pill {
	gap: 0.5rem;
	border-color: rgb(255 255 255 / 0.45);
	color: var(--wp--preset--color--background);
}

.zerodigital-hero-home.zd-bg-dark .zerodigital-hero-home__pill::before {
	content: "";
	flex: none;
	width: 1.0625rem;
	height: 1.0625rem;
	background: var(--wp--custom--brand--teal);
	-webkit-mask: var(--arlc-circle-check) center / contain no-repeat;
	mask: var(--arlc-circle-check) center / contain no-repeat;
}

/* Microbiological Testing: the four tests ---------------------------------- */

/* A two-column list of teal circle-checks, as in the design, rather than
 * bullets. One column on phones. */
#microbiological-testing .zerodigital-about__body ul {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.5rem 1.25rem;
	padding-left: 0;
	list-style: none;
}

#microbiological-testing .zerodigital-about__body li {
	display: flex;
	align-items: center;
	gap: 0.625rem;
}

#microbiological-testing .zerodigital-about__body li::before {
	content: "";
	flex: none;
	width: 1.25rem;
	height: 1.25rem;
	background: var(--wp--custom--brand--teal);
	-webkit-mask: var(--arlc-circle-check) center / contain no-repeat;
	mask: var(--arlc-circle-check) center / contain no-repeat;
}

@media (max-width: 600px) {
	#microbiological-testing .zerodigital-about__body ul {
		grid-template-columns: 1fr;
	}
}

/* Palintest FAQ ------------------------------------------------------------- */

/* Closed questions and the "Key models" / "Ideal for" labels in heading ink,
 * as in the design. The open question keeps the platform's accent. */
.zerodigital-faq__trigger:not([aria-expanded="true"]) {
	color: var(--wp--preset--color--secondary);
}

.zerodigital-faq__answer strong {
	color: var(--wp--preset--color--secondary);
}

/* Contact on the indigo band ----------------------------------------------- */

/* The platform draws the Call button in primary and the email link in primary
 * whatever the ground, so on this indigo band the button vanished and the
 * email was 1:1. As in the design: a white Call button with indigo text, and
 * a white email link with a teal icon. A platform bug worth raising. */
.zerodigital-contact.zd-bg-dark .zerodigital-contact__details .zerodigital-contact__call:not(.zerodigital-contact__call--secondary) {
	background: var(--wp--preset--color--background);
	color: var(--wp--preset--color--primary);
}

/* The platform's dark-ground rule whitens bare spans too, so the label
 * follows the button's own colour. */
.zerodigital-contact.zd-bg-dark .zerodigital-contact__details .zerodigital-contact__call > span {
	color: inherit;
}

.zerodigital-contact.zd-bg-dark .zerodigital-contact__details .zerodigital-contact__call:not(.zerodigital-contact__call--secondary):hover {
	background: color-mix(in srgb, var(--wp--preset--color--background) 88%, var(--wp--preset--color--foreground));
	color: var(--wp--preset--color--primary);
}

.zerodigital-contact.zd-bg-dark .zerodigital-contact__list a,
.zerodigital-contact.zd-bg-dark .zerodigital-contact__list a:hover {
	color: var(--wp--preset--color--background);
}

.zerodigital-contact.zd-bg-dark .zerodigital-contact__item-icon {
	color: var(--wp--custom--brand--teal);
}

/* The form in a white card, as in the design, with the heading and intro
 * across the top of the band. The platform only gives the form a card when
 * the lede sits inside it ("lede in form"). Without one, its dark labels and
 * the consent line sat straight on indigo. This uses the platform's own card
 * values and resets the text to the body ink. */
.zerodigital-contact.zd-bg-dark:not(.zerodigital-contact--lede-in-form) .zerodigital-contact__form {
	padding: clamp(var(--wp--preset--spacing--md, 1.5rem), 3vw, var(--wp--preset--spacing--lg, 2rem));
	background: var(--zd-card-bg, var(--wp--preset--color--surface, #fff));
	border: var(--zd-border, 1px solid #e4e6e9);
	border-radius: var(--zd-card-radius, var(--wp--custom--radius--lg, 0.75rem));
	color: var(--wp--preset--color--foreground);
}

/* The platform lightens anything with "label" or "subtext" in its class, and
 * every paragraph, on a dark ground, and only exempts its own .zd-light-card.
 * Inside this card they go back to the body ink: the consent line, the labels
 * and (0.1.2) Fluent Forms' "Thanks — we'll be in touch" confirmation, which is
 * a <p> and was white on the white card after a submission. Validation errors
 * are divs with their own colour and are unaffected. */
.zerodigital-contact.zd-bg-dark .zerodigital-contact__form :where([class*="label"], [class*="subtext"], p, li) {
	color: var(--wp--preset--color--foreground);
}

/* The consent tick box at the design's 18px, in the accent. */
.zerodigital-contact .fluentform input[type="checkbox"] {
	width: 1.125rem;
	height: 1.125rem;
	accent-color: var(--wp--preset--color--accent);
}

/* Fluent Forms' own hover fades the submit button to 80%, which washes the
 * platform's indigo-to-dark hover out to a grey-blue. */
.fluentform .frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style):hover {
	opacity: 1;
}

/* Focus on the indigo bands ------------------------------------------------- */

/* The accent focus ring is only 2.08:1 on indigo, below the 3:1 a focus
 * indicator needs. On dark grounds it turns white, except inside the white
 * form card, where the accent ring is right. */
.zd-bg-dark :where(a, button, summary):not(:where(.zd-light-card *, .zerodigital-contact__form *)):focus-visible {
	outline-color: var(--wp--preset--color--background);
}

/* Footer ------------------------------------------------------------------- */

/* Column headings in heading ink, as in the design. */
.zerodigital-footer-columns__column > summary {
	color: var(--wp--preset--color--secondary);
}
