/* ============================================
   Evidence First Solutions — Main Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Color values are injected by data/theme.yaml via theme-css partial.
       These are fallback defaults only. */
    --color-charcoal: #2f2b36;
    --color-tan: #d4b08a;
    --color-brown: #4a3f35;
    --color-sand: #f0e6d6;
    --color-warm-white: #fefaf6;
    --color-bronze: #9a5f28;
    --color-cream: #fdf6ee;
    --color-light-pink: #f5ede8;
    --color-sage: #8caea8;
    --color-white: #ffffff;
    --color-black: #000000;
    --color-text: #2f2b36;
    --color-text-light: #4a3f35;
    --color-border: #e0d5c4;

    /* Fonts: Fraunces ≈ fraunces_120pt, DM Sans ≈ madefor-text/display */
    --font-heading: 'Fraunces', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 1200px;
    --header-height: 80px;
    /* Header spacing: defaults here, overridden by Theme & Design → Header
       (layouts/partials/theme-css.html emits the saved values). */
    --header-pad-x: 2rem;
    --logo-width: 200px;
    --logo-gap: 2rem;
    --nav-gap: 2rem;
    --nav-font-size: 0.92rem;
    --dropdown-width: 220px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    line-height: 1.7;
    background: var(--color-white);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-bronze);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-tan);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--color-charcoal);
    line-height: 1.3;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
}

h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.4rem;
    font-weight: 600;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.85rem 2.2rem;
    border-radius: 4px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.25s;
    border: 2px solid transparent;
    text-align: center;
}

.btn-primary {
    background: var(--color-tan);
    color: var(--color-charcoal);
    border-color: var(--color-tan);
}

.btn-primary:hover {
    background: var(--color-bronze);
    border-color: var(--color-bronze);
    color: var(--color-white);
}

.btn-secondary {
    background: var(--color-charcoal);
    color: var(--color-white);
    border-color: var(--color-olive);
}

.btn-secondary:hover {
    background: var(--color-tan);
    border-color: var(--color-tan);
    color: var(--color-charcoal);
}

.btn-outline {
    background: transparent;
    color: var(--color-bronze);
    border-color: var(--color-bronze);
}

.btn-outline:hover {
    background: var(--color-bronze);
    color: var(--color-white);
}

/* --- Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-height);
}

.header-container {
    max-width: var(--header-max-width, var(--max-width));
    margin: 0 auto;
    padding: 0 var(--header-pad-x);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* The logo never shrinks, and --logo-gap is the least space kept between it
   and the first menu item (the menu was squashed against it before). */
.logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: var(--logo-gap);
}

.logo {
    height: auto;
    width: var(--logo-width);
    max-width: none;
}

.main-nav > ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--nav-gap);
}

.main-nav a {
    color: var(--color-charcoal);
    font-weight: 500;
    font-size: var(--nav-font-size);
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--color-brown);
}

.nav-cta {
    background: var(--color-charcoal) !important;
    color: var(--color-white) !important;
    padding: 0.55rem 1.4rem !important;
    border-radius: 4px;
}

.nav-cta:hover {
    background: var(--color-brown) !important;
}

/* Dropdown (a main-menu item with `children:` in data/menu.yaml).
   Opens on hover on desktop (CSS) and on click/tap/Enter (header.html's
   script toggles .open). The panel is hidden by default everywhere. */
.has-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.1rem;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem;
    color: var(--color-charcoal);
    font: inherit;
}

.dropdown-toggle.label-toggle {
    gap: 0.4rem;
    padding: 0;
    white-space: nowrap;
    font-weight: 500;
    font-size: var(--nav-font-size);
    letter-spacing: 0.01em;
}

.dropdown-toggle:hover {
    color: var(--color-brown);
}

.caret {
    display: block;
    width: 0.4rem;
    height: 0.4rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s;
}

.has-dropdown.open > .dropdown-toggle .caret {
    transform: translateY(2px) rotate(-135deg);
}

.dropdown,
.submenu {
    display: none;
    flex-direction: column;
    list-style: none;
    min-width: var(--dropdown-width);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: 2px solid var(--color-tan);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 0.4rem 0;
    z-index: 1002;
}

.dropdown a {
    display: block;
    padding: 0.6rem 1.25rem;
}

.dropdown a:hover {
    background: var(--color-cream);
}

.has-dropdown.open > .dropdown {
    display: flex;
}

/* Side menu: a dropdown item with its own `children:` (one level deeper only).
   Same pattern as the top level, with its own classes (.has-submenu,
   .submenu-toggle, .submenu) so opening it never closes the dropdown that
   holds it. On desktop it opens beside the dropdown (see the min-width block
   below); in the slide-out panel it is an indented section. */
.has-submenu {
    position: relative;
    display: flex;
    align-items: stretch;
}

.has-submenu > a {
    flex: 1;
}

.submenu-toggle {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.35rem 1rem;
    color: var(--color-charcoal);
    font: inherit;
}

.submenu-toggle.label-toggle {
    flex: 1;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    text-align: left;
    font-weight: 500;
    font-size: var(--nav-font-size);
    letter-spacing: 0.01em;
}

.submenu-toggle:hover {
    color: var(--color-brown);
}

.has-submenu:hover > .submenu-toggle.label-toggle,
.has-submenu > a:hover + .submenu-toggle {
    background: var(--color-cream);
}

.has-submenu.open > .submenu-toggle .caret {
    transform: translateY(2px) rotate(-135deg);
}

.has-submenu.open > .submenu {
    display: flex;
}

@media (min-width: 901px) {
    /* The bar is as tall as the header, so the panel (top: 100%) starts
       exactly at the header's bottom edge and the pointer never crosses a
       gap on its way down from the label. */
    .site-header:not(.nav-collapsed) .main-nav {
        align-self: stretch;
        display: flex;
    }

    .site-header:not(.nav-collapsed) .main-nav > ul {
        height: 100%;
    }

    .site-header:not(.nav-collapsed) .main-nav > ul > li {
        align-self: stretch;
        display: flex;
        align-items: center;
    }

    .site-header:not(.nav-collapsed) .dropdown {
        position: absolute;
        top: 100%;
        left: 0;
    }

    /* The side menu starts exactly at its dropdown's right edge (no gap, so the
       pointer can cross), level with the item it belongs to. header.html's script
       adds .flip-left when it would run off the screen's right edge. */
    .site-header:not(.nav-collapsed) .submenu {
        position: absolute;
        top: calc(-0.4rem - 2px);
        left: 100%;
    }

    .site-header:not(.nav-collapsed) .has-submenu.flip-left > .submenu {
        left: auto;
        right: 100%;
    }

    /* The caret points the way the side menu opens. */
    .site-header:not(.nav-collapsed) .has-submenu > .submenu-toggle .caret,
    .site-header:not(.nav-collapsed) .has-submenu.open > .submenu-toggle .caret {
        transform: rotate(-45deg);
    }

    .site-header:not(.nav-collapsed) .has-submenu.flip-left > .submenu-toggle .caret,
    .site-header:not(.nav-collapsed) .has-submenu.flip-left.open > .submenu-toggle .caret {
        transform: rotate(135deg);
    }
}

@media (min-width: 901px) and (hover: hover) {
    .site-header:not(.nav-collapsed) .has-dropdown:hover > .dropdown,
    .site-header:not(.nav-collapsed) .has-submenu:hover > .submenu {
        display: flex;
    }
}

/* Hamburger */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-charcoal);
    transition: all 0.3s;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    top: 7px;
}

.nav-toggle.active .hamburger {
    background: transparent;
}

.nav-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.active .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    margin-top: var(--header-height);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(47, 43, 54, 0.88) 0%, rgba(91, 77, 67, 0.75) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    /* --pad-t|r|b|l: typed padding from the editor (Text Block Padding); these are today's values */
    padding: var(--pad-t, 4rem) var(--pad-r, 2rem) var(--pad-b, 4rem) var(--pad-l, 4rem);
    color: var(--color-white);
}

.hero-content h1 {
    color: var(--color-white);
    font-size: 3.8rem;
    margin-bottom: 0.5rem;
}

.hero-subheading {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--color-tan);
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
}


/* --- Sections (common) --- */
section {
    padding: 5rem 0;
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--color-text-light);
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
}

section h2 {
    text-align: center;
    margin-bottom: 0.8rem;
}

/* --- Commitment --- */
.commitment {
    background: var(--color-white);
    text-align: center;
}

.commitment p {
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 1.05rem;
    line-height: 1.9;
}

.commitment .social-icons {
    justify-content: center;
}

.commitment-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.commitment-text h2 {
    text-align: left;
}

.commitment-image img {
    width: 100%;
    border-radius: 8px;
}

/* --- Who We Serve --- */
.who-we-serve {
    background: var(--color-sand);
}

.audience-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.audience-card {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
}

.audience-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.audience-image {
    height: 220px;
    background-size: cover;
    background-position: center;
}

.audience-card h3 {
    padding: 1.5rem;
    color: var(--color-charcoal);
    font-size: 1.3rem;
    text-align: center;
}

/* --- Pillars --- */
.pillars {
    background: var(--color-white);
}

.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.pillar-card {
    background: var(--color-white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

.pillar-card:hover {
    transform: translateY(-2px);
}

.pillar-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-charcoal);
    color: var(--color-light-pink);
}

.pillar-card h3 {
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.pillar-card p {
    font-size: 0.95rem;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* --- Services --- */
.services {
    background: var(--color-brown);
    color: var(--color-light-pink);
}

.services h2 {
    color: var(--color-light-pink);
}

.services .section-subtitle {
    color: var(--color-light-pink);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background: transparent;
    border-radius: 8px;
    padding: 2.5rem;
    border-left: 4px solid var(--color-tan);
    transition: transform 0.2s;
}

.service-card:hover {
    transform: translateY(-2px);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bronze);
    color: var(--color-light-pink);
}

.service-card:nth-child(even) .service-icon:not(.has-image) {
    background: var(--color-charcoal);
}

/* Icons on the Pillars and Services cards: a Lucide line drawing (partials/icon.html)
   centred in the shape, or an uploaded picture that replaces both. */
.pillar-icon svg,
.service-icon svg {
    width: 58%;
    height: 58%;
    flex: none;
}

.pillar-icon.has-image,
.service-icon.has-image {
    background: transparent;
}

.pillar-icon.has-image img,
.service-icon.has-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.service-card h3 {
    margin-bottom: 0.8rem;
    color: var(--color-light-pink);
}

.service-card p {
    font-size: 0.95rem;
    color: var(--color-light-pink);
    line-height: 1.7;
}

/* --- Team Preview --- */
.team-preview {
    background: var(--color-cream);
    color: var(--color-charcoal);
}

.team-preview h2 {
    color: var(--color-charcoal);
}

.team-preview .section-subtitle {
    color: var(--color-brown);
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.team-card {
    text-align: center;
}

.team-photo {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    border: 3px solid var(--color-sand);
}

.team-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-card h3 {
    color: var(--color-charcoal);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.team-card h3 small {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--color-brown);
    font-family: var(--font-body);
}

.team-role {
    color: var(--color-brown);
    font-size: 0.9rem;
}

.team-cta {
    text-align: center;
}

/* --- Newsletter --- */
.newsletter {
    background: var(--color-white);
}

.newsletter-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.inline-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.inline-form label {
    font-weight: 500;
    font-size: 0.9rem;
}

.inline-form input[type="email"] {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-body);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 400;
}

/* Hide the Visit our Substack text and button: one centred column, the signup box in the middle. */
.newsletter-content.newsletter-signup-only {
    grid-template-columns: 1fr;
    justify-items: center;
}

.newsletter-signup-only .newsletter-form {
    width: 100%;
    max-width: 480px;
}

.newsletter-substack {
    text-align: center;
    padding-top: 1rem;
}

.newsletter-substack h3 {
    margin-bottom: 1.5rem;
}

/* --- Contact Form --- */
.contact {
    background: var(--color-white);
}

.contact-form-section h2 {
    text-align: center;
}

.contact-form {
    max-width: 700px;
    margin: 2rem auto 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--color-charcoal);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color 0.2s;
    background: var(--color-white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-bronze);
    box-shadow: 0 0 0 3px rgba(162, 103, 45, 0.15);
}

.contact-form .btn {
    margin-top: 1rem;
    width: 100%;
}

/* --- Page Hero (subpages) --- */
.page-hero {
    padding: var(--pad-t, 8rem) 0 var(--pad-b, 4rem);
    margin-top: var(--header-height);
    text-align: center;
}

.team-hero {
    background: var(--color-charcoal);
}

.team-hero h1 {
    color: var(--color-white);
}

.subpage-hero {
    position: relative;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.subpage-hero .container {
    position: relative;
    z-index: 2;
}

.subpage-hero h1 {
    color: var(--color-white);
}

/* --- Team Full Page --- */
.team-full {
    padding: 4rem 0;
}

.team-member {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--color-border);
    align-items: start;
}

.team-member:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.team-member-photo img {
    border-radius: 8px;
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.team-member-info h2 {
    text-align: left;
    margin-bottom: 0.3rem;
    font-size: 1.8rem;
}

.team-member-info h3 {
    color: var(--color-bronze);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.team-member-bio p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text-light);
}

/* --- Subpage Content --- */
.subpage-content {
    padding: 4rem 0;
}

.content-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.9;
}

.content-body p {
    margin-bottom: 1.5rem;
}

.subpage-contact {
    background: var(--color-cream);
}

/* --- Footer --- */
.site-footer {
    background: var(--color-cream);
    color: var(--color-charcoal);
    padding: 4rem 0 0;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand h3 {
    color: var(--color-charcoal);
    margin: 1rem 0 0.5rem;
}

.footer-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.footer-brand a {
    color: var(--color-charcoal);
    text-decoration: underline;
}

.footer-links h4,
.footer-social h4 {
    color: var(--color-charcoal);
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--color-charcoal);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--color-bronze);
}

/* Footer "Find us on Substack": the E-only logo and the words are one link on one line
   (the E is images/logo-e.svg, cut from logo.svg; 2026-11-06). */
.footer-social h4.footer-substack {
    margin-bottom: 1.25rem;
}

.substack-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-charcoal);
    text-decoration: none;
}

.substack-link:hover .substack-link-text {
    color: var(--color-bronze);
    text-decoration: underline;
}

.substack-link:focus-visible {
    outline: 3px solid var(--color-bronze);
    outline-offset: 4px;
    border-radius: 4px;
}

.substack-logo {
    height: 2.75rem;
    width: auto;
    flex: 0 0 auto;
}

.substack-link-text {
    min-width: 0;
}

.social-icons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.social-icons a {
    padding: 0.4rem 1rem;
    border: 1px solid var(--color-charcoal);
    border-radius: 4px;
    color: var(--color-charcoal);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.social-icons a:hover {
    border-color: var(--color-bronze);
    color: var(--color-white);
    background: var(--color-charcoal);
}

/* Icon style (theme.footer.social_style: icons — the default): round,
   borderless icon buttons instead of the text pills above. A built-in
   glyph (static/images/social/<platform>.svg) is drawn with a CSS mask so
   it takes the theme's charcoal/bronze colors; a custom uploaded icon is a
   plain <img> instead. */
.social-icons--icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
}

.social-icons--icons a:hover {
    border-color: transparent;
    background: transparent;
}

.social-icon,
.social-icon-img {
    display: block;
    width: 22px;
    height: 22px;
}

.social-icon {
    background-color: var(--color-charcoal);
    -webkit-mask-image: var(--icon);
    mask-image: var(--icon);
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: background-color 0.2s;
}

.social-icon-img {
    object-fit: contain;
    border-radius: 4px;
    transition: opacity 0.2s;
}

.social-icons--icons a:hover .social-icon {
    background-color: var(--color-bronze);
}

.social-icons--icons a:hover .social-icon-img {
    opacity: 0.75;
}

.footer-bottom {
    margin-top: 3rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--color-tan);
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-charcoal);
}

/* ============================================
   Responsive
   ============================================ */

/* Step one when the menu is too wide for the header: header.html's script adds
   .nav-compact, which tightens the gaps and text a little. Only if that is still
   not enough does it add .nav-collapsed (the hamburger menu). */
.site-header.nav-compact .logo-link {
    margin-right: calc(var(--logo-gap) * 0.75);
}

.site-header.nav-compact .main-nav > ul {
    gap: calc(var(--nav-gap) * 0.6);
}

.site-header.nav-compact .main-nav a,
.site-header.nav-compact .dropdown-toggle.label-toggle,
.site-header.nav-compact .submenu-toggle.label-toggle {
    font-size: calc(var(--nav-font-size) * 0.94);
}

/* The slide-out (hamburger) menu. Written twice, identically: once for narrow
   screens (so phones need no script) and once under .nav-collapsed, which
   header.html's script sets whenever the menu does not fit the header at any
   width. Change one, change both. */
@media (max-width: 900px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 280px;
        height: calc(100vh - var(--header-height));
        background: var(--color-white);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease;
        overflow-y: auto;
    }

    .main-nav.open {
        right: 0;
    }

    /* Long labels wrap inside the narrow panel (the desktop bar keeps them on one line). */
    .main-nav a,
    .dropdown-toggle.label-toggle,
    .submenu-toggle.label-toggle {
        white-space: normal;
        text-align: left;
    }

    .main-nav > ul {
        flex-direction: column;
        align-items: stretch;
        padding: 2rem;
        gap: 0;
    }

    .main-nav > ul > li {
        padding: 0.8rem 0;
        border-bottom: 1px solid var(--color-border);
    }

    /* A dropdown becomes an expandable section inside the slide-out panel. */
    .has-dropdown {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .dropdown-toggle.label-toggle {
        flex: 1;
        justify-content: space-between;
    }

    .has-dropdown > .dropdown {
        position: static;
        width: 100%;
        min-width: 0;
        border: none;
        box-shadow: none;
        padding: 0.4rem 0 0 1rem;
    }

    .dropdown a {
        padding: 0.5rem 0;
    }

    .dropdown a:hover {
        background: none;
    }

    /* A side menu is a further-indented expandable section inside its dropdown. */
    .has-submenu {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .submenu-toggle {
        padding: 0.35rem;
    }

    .submenu-toggle.label-toggle {
        padding: 0.5rem 0;
    }

    .has-submenu:hover > .submenu-toggle.label-toggle,
    .has-submenu > a:hover + .submenu-toggle {
        background: none;
    }

    .has-submenu > .submenu {
        position: static;
        width: 100%;
        min-width: 0;
        border: none;
        box-shadow: none;
        padding: 0 0 0 1rem;
    }

    .has-submenu.open > .submenu-toggle .caret {
        transform: translateY(2px) rotate(-135deg);
    }

    .nav-cta {
        display: inline-block;
        margin-top: 0.5rem;
    }
}

.site-header.nav-collapsed .nav-toggle {
    display: block;
}

.site-header.nav-collapsed .main-nav {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 280px;
    height: calc(100vh - var(--header-height));
    background: var(--color-white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
}

.site-header.nav-collapsed .main-nav.open {
    right: 0;
}

.site-header.nav-collapsed .main-nav a,
.site-header.nav-collapsed .dropdown-toggle.label-toggle,
.site-header.nav-collapsed .submenu-toggle.label-toggle {
    white-space: normal;
    text-align: left;
}

.site-header.nav-collapsed .main-nav > ul {
    flex-direction: column;
    align-items: stretch;
    padding: 2rem;
    gap: 0;
}

.site-header.nav-collapsed .main-nav > ul > li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--color-border);
}

/* A dropdown becomes an expandable section inside the slide-out panel. */
.site-header.nav-collapsed .has-dropdown {
    flex-wrap: wrap;
    justify-content: space-between;
}

.site-header.nav-collapsed .dropdown-toggle.label-toggle {
    flex: 1;
    justify-content: space-between;
}

.site-header.nav-collapsed .has-dropdown > .dropdown {
    position: static;
    width: 100%;
    min-width: 0;
    border: none;
    box-shadow: none;
    padding: 0.4rem 0 0 1rem;
}

.site-header.nav-collapsed .dropdown a {
    padding: 0.5rem 0;
}

.site-header.nav-collapsed .dropdown a:hover {
    background: none;
}

/* A side menu is a further-indented expandable section inside its dropdown. */
.site-header.nav-collapsed .has-submenu {
    flex-wrap: wrap;
    justify-content: space-between;
}

.site-header.nav-collapsed .submenu-toggle {
    padding: 0.35rem;
}

.site-header.nav-collapsed .submenu-toggle.label-toggle {
    padding: 0.5rem 0;
}

.site-header.nav-collapsed .has-submenu:hover > .submenu-toggle.label-toggle,
.site-header.nav-collapsed .has-submenu > a:hover + .submenu-toggle {
    background: none;
}

.site-header.nav-collapsed .has-submenu > .submenu {
    position: static;
    width: 100%;
    min-width: 0;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
}

.site-header.nav-collapsed .has-submenu .caret {
    transform: translateY(-2px) rotate(45deg);
}

.site-header.nav-collapsed .has-submenu.open > .submenu-toggle .caret {
    transform: translateY(2px) rotate(-135deg);
}

.site-header.nav-collapsed .nav-cta {
    display: inline-block;
    margin-top: 0.5rem;
}

@media (max-width: 900px) {
    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .hero {
        min-height: 70vh;
    }

    .hero-content {
        padding: var(--pad-t, 3rem) 2rem var(--pad-b, 3rem);
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: 2.4rem;
    }

    .audience-cards {
        grid-template-columns: 1fr;
    }

    .commitment-layout {
        grid-template-columns: 1fr;
    }

    .commitment-text h2 {
        text-align: center;
    }

    .pillar-grid {
        grid-template-columns: 1fr 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .newsletter-content {
        grid-template-columns: 1fr;
    }

    .team-member {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .team-member-info h2 {
        text-align: center;
    }

    .team-member-photo {
        max-width: 300px;
        margin: 0 auto;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-photo {
        margin: 0 auto;
    }

    .social-icons {
        justify-content: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .pillar-grid {
        grid-template-columns: 1fr;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    section {
        padding: 3.5rem 0;
    }
}
/* --- Generic Pages: no-image hero / subheading --- */
.subpage-hero.no-image {
    background: var(--color-charcoal);
}

.subpage-subheading {
    color: var(--color-tan);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* --- Numbered lists in page content (e.g. Why Evidence First) ---
   Plain markdown "1." lists get large 01/02/03 numerals, so editors never need custom HTML. */
.content-body ol {
    list-style: none;
    counter-reset: efs-num;
    margin: 0 0 2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.content-body ol > li {
    counter-increment: efs-num;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.1rem;
    line-height: 1.7;
}

.content-body ol > li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.content-body ol > li::before {
    content: counter(efs-num, decimal-leading-zero);
    flex: 0 0 auto;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 2rem;
    color: var(--color-tan);
    line-height: 1;
}

/* --- News --- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
}

.news-card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.news-card-body {
    padding: 1.5rem;
}

.news-date {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.news-substack-nudge {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

/* The site resets every margin to 0 and h3 has none of its own, so the
   heading touched its button. Same 1rem the h2 uses. */
.news-substack-nudge h3 {
    margin-bottom: 1rem;
}

/* --- Newsletter: our own signup form (it replaced Substack's iframe embed, 2026-11-06) ---
   Plain form, styled like the contact form (it reuses .form-group). Nothing on it scrolls, drags or
   transforms, so there is nothing for a finger to move: no touch-action, overflow or transform rules on purpose. */
.newsletter-signup {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.newsletter-signup .form-group label {
    text-align: left;
}

.newsletter-signup .btn {
    margin-top: 1rem;
    width: 100%;
}

.newsletter-signup .btn:focus-visible {
    outline: 3px solid var(--color-bronze);
    outline-offset: 2px;
}

.newsletter-signup .btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.newsletter-signup input[aria-invalid="true"] {
    border-color: #a12b2b;
}

.newsletter-note {
    margin-top: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--color-text);
    text-align: center;
}

.newsletter-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border-left: 4px solid var(--color-bronze);
    background: var(--color-cream);
    color: var(--color-charcoal);
    font-size: 0.95rem;
}

.newsletter-status.is-error {
    border-left-color: #a12b2b;
    color: #7a1f1f;
}

.newsletter-status[hidden] {
    display: none;
}

/* Placement — alignment, spacing, nudges
   Classes are only ever emitted by layouts/partials/placement.html when a
   placement value is actually set — an untouched section/element gets none
   of these classes and renders exactly as before. See CLAUDE.md/STATUS.md
   for the field-by-field list of what carries a `placement`,
   `*_placement` field.

   Sections: `sec-align-<left|center|right>` aligns everything in the section
   (headings, intro text, card text, photos, icon rows, buttons — see the
   Alignment rules below). `sec-pad-top-<scale>` / `sec-pad-bottom-<scale>`
   set padding-top/padding-bottom on the scale: none 0, s 32px, m 64px,
   l 96px, xl 128px. Grids keep their columns.

   Elements (buttons, icon rows, hero text blocks): wrapped in
   `<div class="place ...">` only when a value is set. `place-align-*`
   aligns the element and everything in it; with no align of its own the
   element follows its section ("Same as section"), or keeps the site's
   default position if the section has none either.
   `place-above-<scale>` / `place-below-<scale>` are margin-top/bottom on
   none 0, s 8px, m 16px, l 32px, xl 64px. A nudge is a
   `--nudge-x`/`--nudge-y` custom property (in 8px steps) read by
   `.place > *`'s transform; dropped below 768px so nudges never undermine
   mobile legibility. */
/* --- Alignment (sections and elements) ------------------------------------
   An alignment class sets two variables — --sec-text-align and --sec-justify —
   and EVERYTHING inside follows them: headings, intro text, card text, photos,
   icon rows, buttons. The rules are !important on purpose: the site's own
   styles centre things explicitly (`section h2`, `.section-subtitle`,
   `.commitment`, `.team-card`, `.page-hero`…), and an alignment an editor chose
   has to win over those. They only ever apply where an editor set one.
   Element alignment (.place-align-*) inside an aligned section simply
   re-sets the variables for its own subtree; "Same as section" sets nothing
   and inherits. Grids keep their columns — only what is inside them moves. */
.sec-align-left,   .place-align-left   { --sec-text-align: left;   --sec-justify: flex-start; --sec-ml: 0;    --sec-mr: auto; }
.sec-align-center, .place-align-center { --sec-text-align: center; --sec-justify: center;     --sec-ml: auto; --sec-mr: auto; }
.sec-align-right,  .place-align-right  { --sec-text-align: right;  --sec-justify: flex-end;   --sec-ml: auto; --sec-mr: 0; }

/* Text: the aligned element and everything in it (form fields and button
   labels keep their own alignment). */
:is(.sec-align-left, .sec-align-center, .sec-align-right, .place-align-left, .place-align-center, .place-align-right),
:is(.sec-align-left, .sec-align-center, .sec-align-right, .place-align-left, .place-align-center, .place-align-right) :not(input, textarea, select, button, .btn) {
    text-align: var(--sec-text-align) !important;
}

/* Narrow boxes the site centres with `margin: auto` (and fixed-size icons and
   photos) move to the chosen side as a whole, not just their text. */
:is(.sec-align-left, .sec-align-center, .sec-align-right, .place-align-left, .place-align-center, .place-align-right)
    :is(.section-subtitle, .commitment p, .content-body, .contact-form, .team-photo, .pillar-icon, .service-icon, .newsletter-signup) {
    margin-left: var(--sec-ml) !important;
    margin-right: var(--sec-mr) !important;
}

/* Flex rows (social icons, the Speakers Bureau button rows) follow the same side. */
:is(.sec-align-left, .sec-align-center, .sec-align-right, .place-align-left, .place-align-center, .place-align-right) :is(.social-icons, .bureau-actions, .bureau-cta) {
    justify-content: var(--sec-justify) !important;
}

/* Hero text block: it sits in a fixed-width column at the left of the hero,
   so its alignment moves the whole column too. */
.hero-content:has(> :is(.place-align-left, .place-align-center, .place-align-right)) {
    margin-left: var(--hero-ml, 0);
    margin-right: var(--hero-mr, 0);
}
.hero-content:has(> .place-align-center) { --hero-ml: auto; --hero-mr: auto; }
.hero-content:has(> .place-align-right)  { --hero-ml: auto; --hero-mr: 0; }
/* The column's padding is lopsided (more on the left, to inset it from the
   edge); make it even when centred and mirror it when right-aligned, so the
   text lands where it looks like it should. Below 900px it's already even. */
@media (min-width: 901px) {
    .hero-content:has(> .place-align-center) { padding-left: var(--pad-l, 3rem); padding-right: var(--pad-r, 3rem); }
    .hero-content:has(> .place-align-right)  { padding-left: var(--pad-l, 2rem); padding-right: var(--pad-r, 4rem); }
}

/* Page hero (subpages): its content box shrinks to fit the title, so give it
   the full width when the title block is aligned, or there's nowhere to move. */
.subpage-hero .container:has(> :is(.place-align-left, .place-align-center, .place-align-right)) {
    width: 100%;
}

.sec-pad-top-none { padding-top: 0; }
.sec-pad-top-s { padding-top: 32px; }
.sec-pad-top-m { padding-top: 64px; }
.sec-pad-top-l { padding-top: 96px; }
.sec-pad-top-xl { padding-top: 128px; }

.sec-pad-bottom-none { padding-bottom: 0; }
.sec-pad-bottom-s { padding-bottom: 32px; }
.sec-pad-bottom-m { padding-bottom: 64px; }
.sec-pad-bottom-l { padding-bottom: 96px; }
.sec-pad-bottom-xl { padding-bottom: 128px; }

/* A placed element's wrapper is a plain block: its alignment comes from the
   variables above (its own, or its section's for "Same as section"). With no
   alignment anywhere, the element keeps the site's default position — so
   setting only spacing or a nudge never moves it sideways. */
.place { display: block; }

.place-above-none { margin-top: 0; }
.place-above-s { margin-top: 8px; }
.place-above-m { margin-top: 16px; }
.place-above-l { margin-top: 32px; }
.place-above-xl { margin-top: 64px; }

.place-below-none { margin-bottom: 0; }
.place-below-s { margin-bottom: 8px; }
.place-below-m { margin-bottom: 16px; }
.place-below-l { margin-bottom: 32px; }
.place-below-xl { margin-bottom: 64px; }

.place > * {
    transform: translate(calc(var(--nudge-x, 0) * 8px), calc(var(--nudge-y, 0) * 8px));
}

@media (max-width: 767px) {
    .place > * {
        transform: none;
    }
}

/* ============================================================
   Image focus — focal point, zoom, phone focal point
   (editor "Image with focus" fields). Rules go directly below this line.
   ============================================================ */

/* A legacy string value never sets --focus-x/--focus-y, so this falls back
   to 50% 50% — the same crop as the plain "center" keyword these elements
   already used. Applying it unconditionally keeps layouts/*.html from ever
   needing to add this rule per-element for the no-zoom case. */
.hero,
.subpage-hero,
.audience-image,
.news-card-image {
    background-position: var(--focus-x, 50%) var(--focus-y, 50%);
}

/* Containers that must clip a zoomed inner ".focus-bg" layer or a zoomed
   <img class="has-focus-zoom">. Safe to apply unconditionally: with no zoom
   set, nothing inside ever exceeds the box, so this changes nothing visible. */
.subpage-hero,
.audience-image,
.news-card-image,
.commitment-image,
.team-member-photo {
    overflow: hidden;
}

.audience-image,
.news-card-image {
    position: relative;
}

.commitment-image img {
    object-fit: cover;
}

/* Zoomed background images (hero, page hero, audience cards, news cards)
   render on this absolutely-positioned inner layer — see layouts/partials/
   focus.html's has_zoom / layouts/index.html, pages/single.html,
   partials/sections/who_we_serve.html, news/list.html. */
.focus-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: var(--focus-x, 50%) var(--focus-y, 50%);
    transform: scale(calc(var(--zoom, 100) / 100));
    transform-origin: var(--focus-x, 50%) var(--focus-y, 50%);
    z-index: 0;
}

/* Zoomed <img> tags (commitment photo, team headshots, footer photo) scale
   in place; their container above already clips via overflow: hidden. */
img.has-focus-zoom {
    transform: scale(calc(var(--zoom, 100) / 100));
    transform-origin: var(--focus-x, 50%) var(--focus-y, 50%);
}

/* footer.html only wraps the footer photo in this frame when a zoom value
   is set (a plain circular avatar has no wrapper otherwise, so nothing to
   clip against). */
.footer-photo-frame {
    display: inline-block;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
}

.footer-photo-frame .footer-photo {
    width: 100%;
    height: 100%;
}

@media (max-width: 767px) {
    /* Phones use mobile_focus_x/y instead, when the field set them —
       falling back to the desktop focus point, then to centred. */
    .hero,
    .subpage-hero,
    .audience-image,
    .news-card-image,
    .focus-bg,
    img.has-focus-zoom {
        background-position: var(--focus-mx, var(--focus-x, 50%)) var(--focus-my, var(--focus-y, 50%));
        transform-origin: var(--focus-mx, var(--focus-x, 50%)) var(--focus-my, var(--focus-y, 50%));
    }
}

/* ============================================================
   Image resizing — phone-width background swap
   (build-time resized images; see layouts/partials/img.html)

   The hero (home + page heroes) and the zoomed ".focus-bg" layer inside
   them render a 1920w desktop image via the normal `background-image:
   url(...)` declaration, and ALSO carry a smaller 800w version in the
   `--bg-sm` custom property. `.has-bg-sm` is only added to an element when
   `--bg-sm` was actually set (see layouts/index.html, layouts/pages/
   single.html), so this rule never touches anything else.
   ============================================================ */
@media (max-width: 767px) {
    .has-bg-sm {
        background-image: var(--bg-sm);
    }
}

/* --- Speakers Bureau --- */
.bureau-intro { padding: 3rem 0 1rem; text-align: center; }
.bureau-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.bureau-grid-section { padding: 3rem 0 2rem; }
.bureau-general { padding: 0 0 4rem; }
.bureau-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2.5rem 2rem; }
.bureau-card { text-align: center; }
.bureau-photo img { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; margin: 0 auto 1rem; display: block; }
.bureau-card h2 { font-size: 1.4rem; margin-bottom: 0.2rem; }
.bureau-card h3 { color: var(--color-bronze); font-family: var(--font-body); font-weight: 500; font-size: 1rem; margin-bottom: 1rem; }
.bureau-expertise { font-size: 0.95rem; color: var(--color-text-light); margin-bottom: 0.8rem; }
.bureau-offers { margin-bottom: 1.2rem; }
.bureau-tag { display: inline-block; font-size: 0.8rem; border: 1px solid var(--color-border); border-radius: 999px; padding: 0.15rem 0.7rem; margin: 0.15rem; }
.bureau-actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }


/* ============================================================
   Page banner size and plain title (Pages → Banner Size)
   ============================================================ */
.subpage-hero.hero-compact {
    min-height: 0;
    padding: var(--pad-t, 3rem) 0 var(--pad-b, 2rem);
}

.page-title-plain {
    margin-top: var(--header-height);
    padding: var(--pad-t, 3rem) 0 var(--pad-b, 1.5rem);
    text-align: center;
}
.page-title-plain h1 { color: var(--color-charcoal); }
.page-title-plain-sub {
    color: var(--color-text-light);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* ============================================================
   Section style (Sections → Section style group)
   Emitted only when a section has a style set: layouts/partials/sec-wrap.html wraps
   the section in `.sec-wrap` + these classes. Mirrored in static/admin/preview/sections.js
   (styleWrap). A set background paints on the wrapper, so the section inside goes
   transparent (the site's per-kind background rules are !important).
   ============================================================ */
.sec-wrap { position: relative; }
.sec-has-bg > section,
.sec-has-bg > section.subpage-contact { background: transparent !important; }
.sec-wrap > * { position: relative; z-index: 1; }

.sec-bg-white       { background: var(--color-white); }
.sec-bg-cream       { background: var(--color-cream); }
.sec-bg-sand        { background: var(--color-sand); }
.sec-bg-light_pink  { background: var(--color-light-pink); }
.sec-bg-warm_white  { background: var(--color-warm-white); }
.sec-bg-tan         { background: var(--color-tan); }
.sec-bg-brown       { background: var(--color-brown); }
.sec-bg-charcoal    { background: var(--color-charcoal); }

.sec-bg-image {
    background-image: var(--sec-bg-img);
    background-size: cover;
    background-position: center;
}
.sec-ov-dark::before,
.sec-ov-light::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
}
.sec-ov-dark::before  { background: rgba(26, 26, 26, 0.6); }
.sec-ov-light::before { background: rgba(255, 255, 255, 0.7); }

/* Dark backgrounds (brown, charcoal, or a picture under a dark overlay): light text. */
.sec-dark,
.sec-dark :is(h1, h2, h3, h4, p, li, label, .content-body, .section-subtitle) { color: var(--color-white); }
.sec-dark a:not(.btn) { color: var(--color-tan); }

.sec-bw-thin   { --sec-bw: 1px; }
.sec-bw-medium { --sec-bw: 3px; }
.sec-bw-thick  { --sec-bw: 6px; }
.sec-border-top    { border-top: var(--sec-bw, 1px) solid; }
.sec-border-bottom { border-bottom: var(--sec-bw, 1px) solid; }
.sec-border-all    { border: var(--sec-bw, 1px) solid; }
/* colours come after the border shorthands so they win */
.sec-bc-tan      { border-color: var(--color-tan); }
.sec-bc-brown    { border-color: var(--color-brown); }
.sec-bc-charcoal { border-color: var(--color-charcoal); }
.sec-bc-sand     { border-color: var(--color-sand); }
.sec-bc-cream    { border-color: var(--color-cream); }
.sec-bc-white    { border-color: var(--color-white); }

.sec-w-contained { max-width: 1200px; }
.sec-w-narrow    { max-width: 800px; }
.sec-pos-left   { margin-left: 0;    margin-right: auto; }
.sec-pos-center { margin-left: auto; margin-right: auto; }
.sec-pos-right  { margin-left: auto; margin-right: 0; }
/* A narrow section pushed to a side keeps a little room from the screen edge. */
.sec-w-narrow.sec-pos-left  { margin-left: 2rem; }
.sec-w-narrow.sec-pos-right { margin-right: 2rem; }
@media (max-width: 900px) {
    /* On a phone a "narrow" section would only waste room: it keeps its width setting but never exceeds the screen. */
    .sec-w-contained, .sec-w-narrow { max-width: 100%; }
}

/* ============================================================
   Width and padding choices (Text Block Width / Content width / Padding fields)
   layouts/partials/width-pad.html turns the editor's choices into `has-tw tw-<name>` classes
   and `--pad-t|r|b|l` variables (plus `pad-t|r|b|l` classes) on: the home hero's
   `.hero-content`, a page's banner section (`.subpage-hero` / `.page-title-plain`) and a
   section's `.sec-wrap`. Blank fields add nothing, so the rules above keep today's look: the
   hero, banner and compact/plain-title padding rules read `var(--pad-*, <today's value>)`.
   A width is the whole box including its side padding (box-sizing: border-box). Mirrored in
   static/admin/preview/ (placement.js widthPad). Phones (900px and below): a width never
   exceeds the screen, side padding stays at the 2rem gutter, top/bottom padding still applies.
   ============================================================ */
.tw-narrow { --tw: 650px; }
.tw-medium { --tw: 800px; }
.tw-wide   { --tw: 1000px; }
.tw-xwide  { --tw: 1200px; }
.tw-full   { --tw: 100%; }

.hero-content.has-tw { width: 100%; max-width: var(--tw); }
.subpage-hero.has-tw > .container,
.page-title-plain.has-tw > .container { width: 100%; max-width: var(--tw); }
.subpage-hero > .container,
.page-title-plain > .container {
    padding-left: var(--pad-l, 2rem);
    padding-right: var(--pad-r, 2rem);
}

/* A section's Content width sizes its container; the narrower caps inside (intro line,
   commitment text, contact form, page text) are lifted so nothing stays capped behind it. */
.sec-wrap.has-tw > section > .container { max-width: var(--tw); }
.sec-wrap.has-tw > section :is(.section-subtitle, .contact-form, .content-body),
.sec-wrap.has-tw > .commitment p { max-width: none; }

/* Typed section padding beats the Space above/below presets and each section's own padding. */
.sec-wrap.pad-t > section { padding-top: var(--pad-t); }
.sec-wrap.pad-b > section { padding-bottom: var(--pad-b); }
@media (min-width: 901px) {
    .sec-wrap.pad-l > section { padding-left: var(--pad-l); }
    .sec-wrap.pad-r > section { padding-right: var(--pad-r); }
}

@media (max-width: 900px) {
    .hero-content.has-tw { max-width: 100%; }
    .subpage-hero > .container,
    .page-title-plain > .container { padding-left: 2rem; padding-right: 2rem; }
}

/* Rich-text pieces — alignment, indent, size, spacing and pictures inside markdown text.
   The editor's "Formatted text", "Picture with caption" and "Gap" pieces are stored as small HTML
   blocks in the markdown (see static/admin/components/rich-blocks.js, which is the contract for
   these class names). Nothing here applies to text that does not use them, so older pages render
   exactly as before. The spacing scale matches the Placement scale above in spirit but is for
   paragraphs: none 0, s 0.5rem, m 1rem, l 2rem, xl 4rem. */
.rt > :first-child { margin-top: 0; }
.rt > :last-child  { margin-bottom: 0; }
.rt-align-left   { text-align: left; }
.rt-align-center { text-align: center; }
.rt-align-right  { text-align: right; }
.rt-indent-1 { margin-left: 2rem; }
.rt-indent-2 { margin-left: 4rem; }
.rt-indent-3 { margin-left: 6rem; }
.rt-size-sm { font-size: 0.875em; }
.rt-size-lg { font-size: 1.25em; }
.rt-size-xl { font-size: 1.6em; line-height: 1.5; }
.rt-above-none { margin-top: 0; }
.rt-above-s  { margin-top: 0.5rem; }
.rt-above-m  { margin-top: 1rem; }
.rt-above-l  { margin-top: 2rem; }
.rt-above-xl { margin-top: 4rem; }
.rt-below-none { margin-bottom: 0; }
.rt-below-s  { margin-bottom: 0.5rem; }
.rt-below-m  { margin-bottom: 1rem; }
.rt-below-l  { margin-bottom: 2rem; }
.rt-below-xl { margin-bottom: 4rem; }
.rt-gap { height: 0; }
.rt-gap-s  { height: 0.5rem; }
.rt-gap-m  { height: 1rem; }
.rt-gap-l  { height: 2rem; }
.rt-gap-xl { height: 4rem; }

.rt-fig { margin: 0.5rem 0 1.5rem; }
.rt-fig p { margin: 0; }
.rt-fig img { display: block; width: 100%; height: auto; border-radius: 4px; }
.rt-fig figcaption { margin-top: 0.5rem; font-size: 0.875em; line-height: 1.5; color: var(--color-brown); text-align: center; }
.rt-w-25  { width: 25%; }
.rt-w-33  { width: 33.333%; }
.rt-w-50  { width: 50%; }
.rt-w-66  { width: 66.666%; }
.rt-w-100 { width: 100%; }
.rt-fig-center { margin-left: auto; margin-right: auto; }
.rt-fig-left   { float: left;  margin-right: 1.5rem; }
.rt-fig-right  { float: right; margin-left: 1.5rem; }
/* A picture that text wraps around is followed by a clearing line, only in text that has one. */
.content-body:has(.rt-fig)::after { content: ""; display: block; clear: both; }
@media (max-width: 700px) {
    /* On a phone nothing sits beside a picture, and indents halve so lines stay readable. */
    .rt-fig-left, .rt-fig-right { float: none; margin-left: auto; margin-right: auto; }
    .rt-w-25, .rt-w-33 { width: 50%; }
    .rt-w-50, .rt-w-66 { width: 75%; }
    .rt-indent-1 { margin-left: 1rem; }
    .rt-indent-2 { margin-left: 2rem; }
    .rt-indent-3 { margin-left: 3rem; }
}

/* --- Bulleted lists in page text ---
   The reset at the top zeroes all padding, so without this a bullet hangs outside the text column
   and a nested bullet does not indent. Numbered lists keep their own 01/02 style above. */
.content-body ul {
    list-style: disc outside;
    margin: 0 0 1.5rem;
    padding-left: 1.6rem;
}
.content-body ul ul {
    list-style-type: circle;
    margin: 0.4rem 0 0.4rem;
}
.content-body ul ul ul { list-style-type: square; }
.content-body ul > li { margin-bottom: 0.4rem; padding-left: 0.2rem; }
.content-body ul > li:last-child { margin-bottom: 0; }
.content-body li > p { margin-bottom: 0.5rem; }
.content-body li > p:last-child { margin-bottom: 0; }

/* --- Picture and text / Columns sections ---
   layouts/partials/sections/{picture_text,columns}.html, mirrored in
   static/admin/preview/sections.js (renderPictureText, renderColumns). */
.pt-grid {
    display: grid;
    gap: 3rem;
    align-items: center;
}
.pic-text.pt-valign-top .pt-grid { align-items: start; }
.pt-w-third { --pt-m: 1fr; --pt-t: 2fr; }
.pt-w-half { --pt-m: 1fr; --pt-t: 1fr; }
.pt-w-two_thirds { --pt-m: 2fr; --pt-t: 1fr; }
.pic-text.pt-side-left .pt-grid {
    grid-template-columns: minmax(0, var(--pt-m)) minmax(0, var(--pt-t));
    grid-template-areas: "media text";
}
.pic-text.pt-side-right .pt-grid {
    grid-template-columns: minmax(0, var(--pt-t)) minmax(0, var(--pt-m));
    grid-template-areas: "text media";
}
/* No picture chosen: the text takes the whole row. */
.pic-text.pt-side-left .pt-grid:not(:has(.pt-media)),
.pic-text.pt-side-right .pt-grid:not(:has(.pt-media)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text"; }
.pt-media { grid-area: media; }
.pt-text { grid-area: text; }
.pt-text h2 { text-align: left; }
.pt-text .content-body, .col-block .content-body { max-width: none; margin: 0; }
.pt-cta { margin-top: 1.5rem; }

/* Picture frames: the whole picture (Natural) or a crop around the chosen focus point. */
.pt-frame, .col-frame { overflow: hidden; border-radius: 6px; }
.pt-frame img, .col-frame img { display: block; width: 100%; height: auto; }
.pt-shape-landscape .pt-frame, .cols-shape-landscape .col-frame { aspect-ratio: 4 / 3; }
.pt-shape-square .pt-frame, .cols-shape-square .col-frame { aspect-ratio: 1 / 1; }
.pt-shape-portrait .pt-frame { aspect-ratio: 3 / 4; }
.cols-shape-round .col-frame { aspect-ratio: 1 / 1; border-radius: 50%; }
:is(.pt-shape-landscape, .pt-shape-square, .pt-shape-portrait) .pt-frame img,
:is(.cols-shape-landscape, .cols-shape-square, .cols-shape-round) .col-frame img {
    height: 100%;
    object-fit: cover;
    object-position: var(--focus-x, 50%) var(--focus-y, 50%);
}

.cols-grid { display: grid; gap: 2rem; margin-top: 2.5rem; align-items: start; }
.cols-section h2 + .cols-grid { margin-top: 2rem; }
.cols-n-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-n-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-n-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-block h3 { margin: 1rem 0 0.5rem; }
.col-frame + h3 { margin-top: 1rem; }
.col-block:not(:has(.col-frame)) h3:first-child { margin-top: 0; }
.col-block .content-body { font-size: 1rem; line-height: 1.7; }
.col-link { margin-top: 1rem; }
.cols-look-card .col-block {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
}
.cols-look-line .col-block { border-top: 3px solid var(--color-tan); padding-top: 1.25rem; }
.sec-dark .cols-look-card .col-block { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.25); }

@media (max-width: 1000px) {
    .cols-n-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .cols-n-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
    /* On a phone the picture sits above the text, whichever side it is on. */
    .pic-text.pt-side-left .pt-grid, .pic-text.pt-side-right .pt-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "media" "text";
        gap: 1.5rem;
    }
    .cols-n-2, .cols-n-4 { grid-template-columns: minmax(0, 1fr); }
}
