/*
Theme Name: Broker Studio
Template: zero-digital-base
Author: Broker Studio
Description: Broker Studio's own site. Brand tokens live in theme.json (every preset list there is a full copy of the parent's, edited, because a child preset list replaces the parent's rather than merging). This file holds only component refinements that the tokens cannot express.
Version: 0.1.3
License: GPLv2 or later
Text Domain: broker-studio
*/

/* -----------------------------------------------------------------------------
 * Palette, as mapped in theme.json:
 *   primary    Ink         #1A1D1F  dark surfaces (hero, CTA band, footer)
 *   secondary  Ink Deep    #111315
 *   accent     Amber Deep  #A34F20  buttons, links, keylines on light grounds
 *   amber      Amber       #C2612B  display words and marks on dark grounds only
 *   amber-dark Amber Dark  #8A421A  hover and pressed
 *   background Bone / surface Bone Warm / muted Stone / border Stone Light
 *
 * Every value below is a token. Selectors match the parent's or the block's own
 * specificity; this sheet prints last, so an equal selector wins.
 * -------------------------------------------------------------------------- */

:root {
	/* The display steps every section heading sizes against. The brand's scale is
	 * a little larger than the platform default at the top end. */
	--zd-step-display: clamp(2.75rem, 1.6rem + 4.2vw, 5rem);
	--zd-step-h2: clamp(2rem, 1.7rem + 1.1vw, 2.75rem);
	--zd-step-h3: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);
	--zd-step-lede: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);

	/* Section labels: Poppins 600, 12px, tracked capitals. */
	--zd-spec-size: 0.75rem;
}

/* On a dark ground the keyline and any accent-driven mark take the brighter
 * brand amber: Amber Deep is too close to Ink to read as a mark there. */
.zd-bg-dark,
.zerodigital-cta-banner:not(.zd-bg-light),
footer.wp-block-template-part > .wp-block-group:not(.zd-bg-light) {
	--zd-accent: var(--wp--preset--color--amber);
}

/* Links sitting in dark-ground copy: Bone text with an amber underline. Amber
 * Deep text on Ink is under 4.5:1. Buttons carry their own classes and are left
 * alone. */
.zd-bg-dark :is(p, li) a:not([class]) {
	color: var(--wp--preset--color--background);
	text-decoration-color: var(--wp--preset--color--amber);
}

a:not([class]) {
	text-underline-offset: 0.18em;
}

/* -----------------------------------------------------------------------------
 * The signature: the amber keyline sits ABOVE a section label, as in the
 * logo's own construction, rather than in front of it. The shape itself stays
 * Site Settings → Keyline shape; this only moves where the mark sits.
 * -------------------------------------------------------------------------- */
.zd-spec {
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
	font-weight: 600;
}

/* Tabular figures wherever numbers are shown. */
.zd-data,
.zerodigital-pricing__tier-price,
.zerodigital-process__step-number {
	font-variant-numeric: tabular-nums lining-nums;
}

/* -----------------------------------------------------------------------------
 * Buttons. The platform fills its primary buttons with `primary`, which here is
 * Ink; the brand's primary button is Amber Deep with Bone text (5.1:1), hovering
 * to Amber Dark. On dark grounds the blocks invert to a light button; the brand
 * keeps the amber fill there too, so those rules are restated at the block's
 * own specificity.
 * -------------------------------------------------------------------------- */
.zerodigital-hero-home__cta:not(.zerodigital-hero-home__cta--secondary),
.zerodigital-hero-home.zd-bg-dark .zerodigital-hero-home__cta:not(.zerodigital-hero-home__cta--secondary),
.zerodigital-hero-subpage__cta,
.zerodigital-hero-subpage.zd-bg-dark .zerodigital-hero-subpage__cta,
.zerodigital-about__cta:not(.zerodigital-about__cta--secondary),
.zerodigital-about.zd-bg-dark .zerodigital-about__cta:not(.zerodigital-about__cta--secondary),
.zerodigital-cta-banner__button,
.zerodigital-cta-banner.zd-bg-light .zerodigital-cta-banner__button,
.zerodigital-tabs__cta,
.zerodigital-contact__call,
.zerodigital-contact__details .zerodigital-contact__call:not(.zerodigital-contact__call--secondary) {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--background);
}

.zerodigital-hero-home__cta:not(.zerodigital-hero-home__cta--secondary):hover,
.zerodigital-hero-home.zd-bg-dark .zerodigital-hero-home__cta:not(.zerodigital-hero-home__cta--secondary):hover,
.zerodigital-hero-subpage__cta:hover,
.zerodigital-hero-subpage.zd-bg-dark .zerodigital-hero-subpage__cta:hover,
.zerodigital-about__cta:not(.zerodigital-about__cta--secondary):hover,
.zerodigital-about.zd-bg-dark .zerodigital-about__cta:not(.zerodigital-about__cta--secondary):hover,
.zerodigital-cta-banner__button:hover,
.zerodigital-cta-banner.zd-bg-light .zerodigital-cta-banner__button:hover,
.zerodigital-tabs__cta:hover,
.zerodigital-contact__call:hover,
.zerodigital-contact__details .zerodigital-contact__call:not(.zerodigital-contact__call--secondary):hover {
	background: var(--wp--preset--color--amber-dark);
	color: var(--wp--preset--color--background);
}

/* Non-highlighted pricing tiers get the brand's secondary button: an Ink
 * outline on a transparent fill. The highlighted tier keeps the filled accent
 * button the block already gives it. */
.zerodigital-pricing__tier-cta {
	background: transparent;
	color: var(--wp--preset--color--foreground);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--foreground);
}

.zerodigital-pricing__tier-cta:hover {
	background: var(--wp--preset--color--foreground);
	color: var(--wp--preset--color--background);
}

.zerodigital-pricing__tier--highlighted .zerodigital-pricing__tier-cta {
	box-shadow: none;
	color: var(--wp--preset--color--background);
}

.zerodigital-pricing__tier--highlighted .zerodigital-pricing__tier-cta:hover {
	background: var(--wp--preset--color--amber-dark);
}

/* Forms: submit and step buttons in Amber Deep, matching the parent's 0,4,0
 * selector shape so this sheet, printed last, wins. */
.fluentform .frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style),
.fluentform .frm-fluent-form .ff-btn-next:not(.ff_btn_no_style) {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--background);
}

.fluentform .frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style):hover,
.fluentform .frm-fluent-form .ff-btn-next:not(.ff_btn_no_style):hover {
	background-color: var(--wp--preset--color--amber-dark);
	border-color: var(--wp--preset--color--amber-dark);
	color: var(--wp--preset--color--background);
}

/* Input edges in Stone rather than Stone Light: an input's border is the only
 * thing that shows where it is, and it needs 3:1 against Bone (Stone Light is
 * 1.3:1; Stone is 5.1:1). Focus moves to Amber Deep with a soft ring. */
.fluentform .frm-fluent-form .ff-el-form-control {
	border-color: var(--wp--preset--color--muted);
}

.fluentform .frm-fluent-form .ff-el-form-control:focus {
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--accent) 22%, transparent);
}

/* The privacy agreement and the box after it (the marketing opt-in) sit
 * together as a pair, not a field-width apart. Each is its own field group, so
 * the parent's group gap (1.5rem) is narrowed between them; the last box keeps
 * the full gap above the submit button.
 *
 * The second box may be an optional Checkbox field or another GDPR Agreement
 * field. A GDPR row is taller (Fluent pads its box 8px down), so after one the
 * gap drops to nothing; after a Checkbox field it keeps xs. Either way the two
 * lines end up about 16px apart, down from 41px. Measured live. */
.fluentform .frm-fluent-form .ff-el-group:has(> .ff-el-tc):has(+ .ff-el-group .ff-el-form-check) {
	margin-bottom: var(--wp--preset--spacing--xs);
}

.fluentform .frm-fluent-form .ff-el-group:has(> .ff-el-tc):has(+ .ff-el-group > .ff-el-tc) {
	margin-bottom: 0;
}

/* -----------------------------------------------------------------------------
 * Cards: Bone Warm, large radius, Stone Light hairline AND the small warm
 * shadow. The brand asks for both; the platform default is one or the other.
 * -------------------------------------------------------------------------- */
.zerodigital-services-grid__item {
	box-shadow: var(--zd-shadow-sm);
}

/* The highlighted pricing tier: an amber keyline along the top and a lift,
 * instead of the platform's tinted fill and ring. The Highlighted toggle on the
 * tier in the editor still decides which tier this is. */
.zerodigital-pricing__tier--highlighted {
	background: var(--wp--preset--color--background);
	border-color: var(--wp--preset--color--border);
	border-top: var(--zd-rule-w) solid var(--wp--preset--color--accent);
	box-shadow: var(--zd-shadow-lg);
}

/* No gradients anywhere in the brand, including the CTA band's sheen. */
.zerodigital-cta-banner {
	background-image: none;
}

/* Portfolio screenshots get the warm medium shadow over their hairline, so a
 * client site reads as a real page sitting on the Bone ground. */
.zerodigital-portfolio__item-media {
	box-shadow: var(--zd-shadow-md);
}

/* Feature illustrations carry their own flat Bone Warm or Ink ground, so they
 * sit on the section with no hairline or shadow: seamless on a matching ground,
 * a soft rounded panel on any other. The parent stretches split-layout media to
 * the copy's height and crops it with object-fit: cover, which cuts the text
 * inside an illustration, so they keep their own 3:2 shape and centre against
 * the copy instead. */
.zerodigital-about__media img,
.zerodigital-hero-home__media img {
	border: 0;
	box-shadow: none;
}

.zerodigital-about--image-left .zerodigital-about__media,
.zerodigital-about--image-right .zerodigital-about__media {
	height: auto;
	align-self: center;
}

.zerodigital-about--image-left .zerodigital-about__media img,
.zerodigital-about--image-right .zerodigital-about__media img {
	height: auto;
	object-fit: initial;
}

/* -----------------------------------------------------------------------------
 * Header: an Ink bar, matching the Ink hero it sits above, so the top of every
 * page reads as one dark band. Uses the traditional header style (Site
 * Settings). The logo is the Bone lockup, set in Business Details, because the
 * Brand lockup's Ink wordmark would disappear on this bar.
 * -------------------------------------------------------------------------- */
.wp-site-blocks > header {
	--zd-accent: var(--wp--preset--color--amber);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
	border-bottom-color: color-mix(in srgb, var(--wp--preset--color--background) 12%, transparent);
}

/* Bar links in Bone, with the amber rule underneath on hover and for the
 * current page. The mobile drawer keeps its own light panel and dark links:
 * the parent's drawer rules outrank these. */
.zerodigital-header__actions .wp-block-navigation a {
	color: var(--wp--preset--color--background);
}

.zerodigital-header__actions .wp-block-navigation a:hover {
	color: var(--wp--preset--color--background);
}

/* Inside the drawer the ground is light again, so the accent goes back to
 * Amber Deep for its hover colour. */
.zerodigital-header__actions .wp-block-navigation__responsive-dialog {
	--zd-accent: var(--wp--preset--color--accent);
}

.zerodigital-header__actions .zerodigital-business-phone {
	color: var(--wp--preset--color--background);
}

.zerodigital-header__actions .zerodigital-business-phone:hover {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--background);
}

/* Visible focus on the dark bar: a Bone ring, since Amber Deep would be under
 * 3:1 against Ink. */
.wp-site-blocks > header :where(a, button):focus-visible {
	outline-color: var(--wp--preset--color--background);
}

/* -----------------------------------------------------------------------------
 * "What we hear": the homepage's broker quotes, written in an About block as
 * <ul class="bs-quotes"> of <blockquote>s. Laid out as a grid of serif pull
 * quotes, each under a Stone Light hairline. The About body's reading-measure
 * cap is lifted for this list only.
 * -------------------------------------------------------------------------- */
.zerodigital-about__body:has(> .bs-quotes) {
	max-width: none;
}

.zerodigital-about__body .bs-quotes {
	list-style: none;
	margin: var(--wp--preset--spacing--lg) 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
	gap: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--xl);
}

.zerodigital-about__body .bs-quotes li {
	margin: 0;
	padding-top: var(--wp--preset--spacing--md);
	border-top: var(--zd-border);
}

.zerodigital-about__body .bs-quotes blockquote {
	margin: 0;
	padding: 0;
	border: 0;
}

.zerodigital-about__body .bs-quotes blockquote p {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--zd-step-h3);
	line-height: 1.35;
	color: var(--wp--preset--color--foreground);
}

/* The desktop dropdown continues the Ink bar, as the parent already does for
 * the floating header: the same fill, Bone text, and a Bone tint on hover.
 *
 * Specificity is the whole point here. Core's navigation stylesheet paints the
 * panel with `.wp-block-navigation:not(.has-background) .wp-block-navigation__
 * submenu-container` (0,3,0) and makes every item's text `inherit`, so a
 * two-class selector loses and the links inherit core's black. Prefixing with
 * the header landmark (0,3,1) beats it on specificity rather than load order,
 * and the links take the panel's Bone by inheritance. Measured live.
 * Scoped to the bar's breakpoint; below it the links are in the light mobile
 * drawer, which keeps its own colours. */
@media (min-width: 1200px) {
	.wp-site-blocks > header .zerodigital-header__actions .wp-block-navigation__submenu-container {
		background-color: var(--wp--preset--color--primary);
		color: var(--wp--preset--color--background);
		border-color: color-mix(in srgb, var(--wp--preset--color--background) 22%, transparent);
	}

	.wp-site-blocks > header .zerodigital-header__actions .wp-block-navigation__submenu-container li > a:hover,
	.wp-site-blocks > header .zerodigital-header__actions .wp-block-navigation__submenu-container li > a:focus-visible {
		color: var(--wp--preset--color--background);
		background-color: color-mix(in srgb, var(--wp--preset--color--background) 15%, transparent);
	}
}

/* -----------------------------------------------------------------------------
 * Mortgage calculator. The block takes its one accent from `primary`, which on
 * this site is Ink, the same colour as its results panel: slider fills, the
 * selected toggle and deposit buttons all went Ink, and on the dark panel the
 * capital and interest shades both mixed down to near-identical greys.
 *
 * Point the calculator's accent at Amber Deep instead (Bone on it is 5.1:1),
 * and draw capital in the bright brand amber, which the guidelines allow for
 * marks on dark grounds (4.1:1 on Ink, over the 3:1 graphics floor). Interest
 * keeps the block's own grey, so the two now differ in hue and in lightness.
 * The amber keyline along the top of the results panel is the brand's "amber
 * keyline on the result". Same selectors as the block; this sheet prints
 * after it. Measured live before shipping.
 * -------------------------------------------------------------------------- */
.zerodigital-mortgage-calculator {
	--zd-mc-accent: var(--wp--preset--color--accent);
}

.zerodigital-mortgage-calculator__split-bar > span,
.zerodigital-mortgage-calculator__key--capital::before {
	background: var(--wp--preset--color--amber);
}

.zerodigital-mortgage-calculator__results {
	box-shadow: inset 0 var(--zd-rule-w) 0 var(--wp--preset--color--amber);
}

/* -----------------------------------------------------------------------------
 * Post Feed. The block sets no size on its card titles, so they took the global
 * h2 (32px) and ran to four or five lines in a four-up card. Sized at the h3
 * step instead, tighter leading, and balanced so a title breaks into even lines
 * rather than leaving one word on the last.
 * -------------------------------------------------------------------------- */
.zerodigital-post-feed__title {
	font-size: var(--zd-step-h3);
	line-height: 1.25;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

/* -----------------------------------------------------------------------------
 * Comparison table. The block raises its highlighted column in the card colour
 * and tints the rest of the table half-way from the card colour to the page,
 * which assumes the card is the LIGHTER of the two (white on a grey page). Here
 * the card colour is Bone Warm, darker than the Bone page, so the raised column
 * came out barely different from the body of the table.
 *
 * Swapped for this site: the table body in Bone Warm, the raised column in
 * Bone, so Broker Studio's column reads as the lit one under its amber top
 * border and "Us" badge. The section itself sits on the page, with no colour of
 * its own. Measured live before shipping.
 * -------------------------------------------------------------------------- */
.zerodigital-comparison-table {
	--zdcmp-tint: var(--wp--preset--color--surface);
}

.zerodigital-comparison-table__col--raised,
.zerodigital-comparison-table__cell--raised {
	background: var(--wp--preset--color--background);
}

/* -----------------------------------------------------------------------------
 * Conversion details.
 *
 * 1. The header's last menu item ("Book a demo") is drawn as the primary
 *    button, so the one action every page leads to is always in view. Desktop
 *    bar only; in the mobile drawer it stays an ordinary row. Prefixed with the
 *    header landmark to outrank core's navigation rules, as the dropdown above.
 *
 * 2. Hub cards (Services Grid items that carry a link) are clickable across
 *    their whole area, via the long-standing "stretched link" pattern: the
 *    card's own link grows an empty ::before over the card. No words are added,
 *    the link keeps its accessible name, and keyboard users still tab to it.
 *    Cards without a link are untouched. Measured live before shipping.
 * -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
	.wp-site-blocks > header .zerodigital-header__actions .wp-block-navigation__container > .wp-block-navigation-item:last-child > .wp-block-navigation-item__content {
		background: var(--wp--preset--color--accent);
		color: var(--wp--preset--color--background);
		padding: 0.6rem 1.1rem;
		border-radius: var(--zd-btn-radius);
		font-weight: 600;
		transition: background-color var(--zd-ease);
	}

	.wp-site-blocks > header .zerodigital-header__actions .wp-block-navigation__container > .wp-block-navigation-item:last-child > .wp-block-navigation-item__content::after {
		content: none;
	}

	.wp-site-blocks > header .zerodigital-header__actions .wp-block-navigation__container > .wp-block-navigation-item:last-child > .wp-block-navigation-item__content:hover {
		background: var(--wp--preset--color--amber-dark);
		color: var(--wp--preset--color--background);
	}
}

.zerodigital-services-grid__item:has(.zerodigital-services-grid__item-link) {
	position: relative;
}

.zerodigital-services-grid__item:has(.zerodigital-services-grid__item-link):hover {
	border-color: var(--wp--preset--color--accent);
}

.zerodigital-services-grid__item-link::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

/* The copy-only home hero carries 6rem of padding top and bottom, which on a
 * phone pushes the buttons below the fold. Half of it is enough there: the
 * headline still has room to breathe and the first call to action stays in
 * view. Desktop keeps the parent's clamp. */
@media (max-width: 781px) {
	.zerodigital-hero-home--copy-only {
		padding-block: 3rem;
	}
}
