/*
Theme Name: PECSRL
Theme URI: https://paullacey.digital
Template: presa
Author: Paul Lacey
Author URI: https://paullacey.digital
Description: The site layer for Presa. Feature files (custom post types + shortcodes), hierarchy templates, design-system loading, image handling, hardening and per-site snippets live here — each switched by a constant — so the parent theme stays identical across installs.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: presa-child
*/

/* Per-site CSS overrides go below. Most sites won't need any —
   structure belongs to the design system's base layer, never here. */

:root {
	/* Presa starter tokens — brand-neutral defaults.
	   A site's design system or design kit overrides these. */
	--presa-ink: #1a1a1a;
	--presa-muted: #5a5a5a;
	--presa-muted-2: #8a8a8a;
	--presa-surface: #f7f6f4;
	--presa-surface-2: #efeeeb;
	--presa-border: #e2e0dc;
	--presa-accent: #3a4654;        /* neutral placeholder — replace per brand */
	--presa-accent-tint: #cdd4db;
	--presa-font-heading: Georgia, 'Times New Roman', serif;
	--presa-font-body: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
	--presa-font-accent: var(--presa-font-heading);
}

/* The design system scopes its body/reset rules to its own containers
   (.fl-ds-page / .fl-ds-block), so the theme chrome that sits outside them
   (masthead, footer) does not inherit the body font. Set the base family here
   too, from the design system's own token, so the chrome is Archivo not the
   browser serif default. */
body { font-family: var(--ds-font-body, Archivo, system-ui, sans-serif); }

/* Footer column headings promoted from h4 to h2 for a valid heading order
   (the design system's heading ramp is scoped to .fl-ds-page and does not
   reach the footer chrome, so restate the small-label look here). */
.bb-footer .bb-footer__heading { margin: 0; font-family: var(--ds-font-body); font-size: 13px; font-weight: var(--ds-weight-semibold, 600); color: #ffffff; letter-spacing: 0.04em; line-height: 1.3; }

/* --- Iterative design refinements (21 Sep) --- */

/* Chrome links carry no underline. The design system's reset is scoped to
   .fl-ds-page, so restate it here for the masthead, nav and footer; the nav's
   current/hover state is the moss underline drawn by .bb-nav a::after. */
a { text-decoration: none; }

/* Eyebrow labels on the dark statement band read white, not gold. */
.bb-eyebrow.bb-eyebrow--light { color: #ffffff; }

/* Fewer rules: the chalk-green surface sections are separated by their colour
   alone, and the ledger / register / facts lists do not need a trailing
   hairline after the last row. The inter-row rules and 2px heading rules stay. */
.bb-section.bb-section--surface { border-top: 0; border-bottom: 0; }
.bb-ledger__row:last-child,
.bb-register__row:last-child,
.bb-facts__row:last-child { border-bottom: 0; }
body .news-item:last-child,
body .news-other__item:last-child,
body .links-list__item:last-child { border-bottom: 0; }

/* --- Border reduction, round 2 (21 Sep) --- */

/* The hero's two hairline top rules (under the organisation name, above the
   plate caption) are ornament rather than structure. Drop them and keep a
   modest gap so the spacing still reads. Three classes to sit above the hero
   module's own scoped .fl-node-* rules. */
.home-hero.bb-section .home-hero__name { border-top: 0; padding-top: 0; margin-top: 18px; }
.home-hero.bb-section .home-hero__caption { border-top: 0; padding-top: 0; }

/* Soften the ledger's rules on the surface band so the four commitments read
   as a gently structured list rather than a ruled table. Four classes to sit
   above the home-purpose module's scoped colour override. */
.bb-section.home-purpose .home-purpose__grid .bb-ledger,
.bb-section.home-purpose .bb-ledger .bb-ledger__row { border-color: #d9ded7; }

/* --- Mobile navigation: hamburger toggle (21 Sep) --- */

/* Hidden by default: the desktop nav sits inline, and where JS is off the full
   menu shows instead, so the button would have nothing to do. */
.bb-navtoggle {
	display: none;
	align-items: center;
	gap: 9px;
	margin: 0;
	padding: 11px 2px;
	min-height: 44px;
	background: none;
	border: 0;
	color: var(--ds-color-ink, #1b1d1f);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
}
.bb-navtoggle__label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.bb-navtoggle__icon { display: inline-flex; }
.bb-navtoggle__close { display: none; }
.bb-masthead.is-open .bb-navtoggle__open { display: none; }
.bb-masthead.is-open .bb-navtoggle__close { display: block; }
.bb-navtoggle:focus-visible { outline: 2px solid var(--ds-color-accent, #3f6152); outline-offset: 3px; }

@media (max-width: 860px) {
	/* Wordmark left, toggle pinned to the right of the top row; the nav wraps to
	   its own full-width row below. Flex-basis 0 on the wordmark keeps the toggle
	   from being bumped to a second row when the strapline is long. The design
	   system stacks this container to a column at 480px; the element-qualified
	   selector sits above that scoped rule. */
	header.bb-masthead .bb-container { flex-direction: row; align-items: flex-start; flex-wrap: wrap; column-gap: 16px; row-gap: 0; }
	header.bb-masthead .bb-wordmark { flex: 1 1 0; min-width: 0; }
	html.has-js .bb-navtoggle { display: inline-flex; flex: 0 0 auto; align-self: center; }

	/* With JS the menu collapses behind the toggle and opens as a stacked panel
	   that pushes the page down (no overlay, no motion). */
	html.has-js .bb-nav { flex-basis: 100%; width: 100%; display: none; margin-top: 16px; gap: 0; }
	html.has-js .bb-masthead.is-open .bb-nav { display: flex; flex-direction: column; }

	html.has-js .bb-nav a { display: block; width: 100%; padding: 9px 2px; }
	/* The desktop underline marker does not suit a stacked row; the current page
	   is marked with the accent colour instead. */
	html.has-js .bb-nav a::after { display: none; }
	html.has-js .bb-nav a[aria-current="page"] { color: var(--ds-color-accent, #3f6152); font-weight: 600; }
}

/* Buttons inside design-system blocks take their block's colour. A
   .fl-builder-content button:not(.fl-content-ui-button) colour rule (seen on
   the Avanti build) paints every button inside a block at a specificity block
   CSS cannot beat. PECSRL has no such rule today and no block contains a
   <button>; this is insurance carried over from that build. */
.fl-builder-content .fl-module-ds-block button:not(.fl-content-ui-button),
.fl-builder-content .fl-module-ds-block button:not(.fl-content-ui-button) * { color: inherit; }

/* Sessions register: proceedings and links under a row, in the full register
   on Conferences (the Home teaser leaves them out). Rendered inside the
   theme cell, so it sits directly under the theme at every width. */
.bb-register__detail { display: block; margin-top: 8px; font-family: var(--ds-font-body); font-size: 13.5px; line-height: 1.55; color: var(--ds-color-ink-3); }
.bb-register__cite { display: block; max-width: 72ch; }
.bb-register__cite + .bb-register__cite { margin-top: 6px; }
.bb-register__links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.bb-register__cite + .bb-register__links { margin-top: 8px; }
a.bb-register__link { color: var(--ds-color-accent); border-bottom: 1px solid var(--ds-color-accent-soft); }
a.bb-register__link:hover { border-bottom-color: var(--ds-color-accent); }

/* News list: the body keeps its links (conference websites). */
.news-item__body a, .news-other__body a { color: var(--ds-color-accent); border-bottom: 1px solid var(--ds-color-accent-soft); }
.news-item__body a:hover, .news-other__body a:hover { border-bottom-color: var(--ds-color-accent); }

/* Gold eyebrow labels on the chalk-green band (and the green Next session
   panel on Conferences): the design system's gold is
   4.15:1 on that ground, under the 4.5:1 AA minimum for small text. A touch
   darker here (4.8:1); on white the original gold already passes. */
.bb-section--surface .bb-eyebrow:not(.bb-eyebrow--light),
.conf-next__panel .bb-eyebrow:not(.bb-eyebrow--light) { color: #8a5f24; }
