/*
Theme Name:   Cornhill Connect
Theme URI:    https://github.com/Teurai213/cornhill-connect-theme
Description:  Block child theme of Twenty Twenty-Five for cornhillconnect.co.uk — the recruitment and business-consultancy arm of The Cornhill Group Services Ltd. All styling lives in theme.json; this file carries the header and nothing else.
Author:       The Cornhill Group Services Ltd
Template:     twentytwentyfive
Version:      0.1.2
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.2
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  cornhill-connect
*/

/*
 * Colours, typography, spacing and layout are declared in theme.json so that
 * every shipped pattern can use presets only (CLAUDE.md: "no hard-coded
 * colours or font sizes"). CSS lives here only for what theme.json cannot
 * express. Each rule says why.
 */

/*
 * Visible focus (CLAUDE.md, "visible focus"). theme.json has no focus state.
 * Neither Twenty Twenty-Five nor core ships a :focus-visible rule, so keyboard
 * users get whatever the browser defaults to, which varies and is often faint
 * on coloured bands. currentColor keeps the ring readable on any background
 * preset without naming a colour here.
 */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 3px;
	border-radius: 2px;
}

.wp-block-button__link:focus-visible {
	/* Filled buttons: ring outside the fill so it never blends in. */
	outline-offset: 4px;
}

/*
 * Logo. The header inlines the approved SVG (patterns/header.php) so its
 * wordmark can use the site's fonts. theme.json cannot size an inline SVG.
 * 10.5rem ≈ 168px wide at the SVG's 106:63.3 ratio; it scales with text zoom.
 */
.cc-logo {
	display: inline-block;
	line-height: 0;
	text-decoration: none;
}

.cc-logo__svg {
	width: 10.5rem;
	height: auto;
	display: block;
}

/*
 * Reduced motion (CLAUDE.md, "minimal motion with prefers-reduced-motion
 * respected"). theme.json cannot express a media query. This neutralises any
 * transition or animation from core blocks and plugins for people who asked
 * their OS for less motion, and stops smooth-scroll on anchor links.
 */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}

/*
 * Footer contact links. Two mailto links stacked with <br> gave 20px-tall
 * targets 19.6px apart — WCAG 2.2 AA 2.5.8 (target size) wants 24px, and
 * theme.json has no way to say it. Stack them and pad each to 24px.
 */
.cc-contact-links {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
}

.cc-contact-links a {
	display: inline-block;
	padding-block: 0.15rem;
	min-height: 24px;
}

/*
 * Sectors submenu toggle. Core's navigation block renders the chevron as its
 * own <button>, and it measures 11x11 — under the 24px that WCAG 2.2 AA 2.5.8
 * (target size) asks for, and its own target because it is a separate control
 * from the "Sectors" link beside it. axe reports it as "could not determine"
 * rather than a failure, so it is easy to miss; it was measured by hand.
 * Sized here rather than in theme.json, which cannot express a minimum target.
 * min-* rather than width/height: a minimum beats whatever core sets for the
 * box, so this holds without having to out-specify the block stylesheet.
 */
.wp-block-navigation__submenu-icon {
	min-width: 24px;
	min-height: 24px;
}

/* Cloudflare Turnstile — contain a third-party fixed-width widget.
   It currently shrinks itself to ~240px at narrow viewports, but that is
   Cloudflare's rendering behaviour, not ours, and it has shipped as a fixed
   300px in the past. Containing it here means a change on their side cannot
   push our contact page into horizontal scroll and fail WCAG 2.2 AA 1.4.10
   (Reflow). Verified no overflow at 300px on 11 Nov 2026; this is a guard,
   not a fix for a current defect. */
.cf-turnstile {
	max-width: 100%;
	overflow-x: auto;
}
