/* ================================
   BASE
   ================================ */

body {
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight:600;
}

p {
    margin: 0;
}

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

/* Gutenberg separator block — all 3 native styles (default, wide, dots).
   A lighter tint of the brand green rather than the full-saturation
   accent colour, so it reads as a subtle divider, not a loud bar. */
.wp-block-separator {
    background-color: #a0c177 !important;
    border-color: #a0c177 !important;
    color: #a0c177 !important;
    opacity: 0.6;
}

/* "Invisible (Spacer)" style — same spacing, no visible line. Give
   it a bit of height so it still reads as deliberate extra space
   rather than nothing at all. */
.wp-block-separator.is-style-invisible {
    background-color: transparent !important;
    border-color: transparent !important;
    opacity: 0;
    height: 0.5rem;
}

/* ================================
   LAYOUT
   ================================ */

.block {
    padding: 4rem 0;
}

/* Default cap is wide-size — blocks always render full-bleed (see .page-content > .block),
   so content inside must not exceed wide-size regardless of the block's align attribute. */
.block-inner {
    width: 100%;
    max-width: var(--wp--style--global--wide-size);
    margin: 0 auto;
    padding: 0 2rem;
}

.block-inner--narrow {
    max-width: var(--wp--style--global--content-size);
    padding: 0;
}

.block-inner--wide {
    max-width: var(--wp--style--global--wide-size);
}

/* ================================
BUTTONS
================================ */

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--wp--preset--color--accent);
    border-radius:7px;
    color: var(--wp--preset--color--white);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn:hover {
    opacity: 0.85;
}

.btn--secondary {
    background: var(--wp--preset--color--accent);
    color: var(--wp--preset--color--white);
}

.btn--secondary:hover {
    background: var(--wp--preset--color--primary);
}

.btn--primary {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

.btn--primary:hover {
    background: var(--wp--preset--color--accent);
}

/* ================================
PROSE
================================ */

/* Establishes a new block-formatting context so a first/last child's
   margin can never collapse through and escape this container -
   without that, margin-top on e.g. a heading that isn't reliably
   :first-child (leading whitespace, wpautop quirks, etc.) ends up
   as unpredictable space above/outside the box instead of a
   contained gap. */
.prose {
    display: flow-root;
}

/* Uniform rhythm: no top margin (the previous element's bottom
   margin already provides the gap), 1rem bottom margin, zeroed on
   the last child so a block doesn't end with trailing space. Scoped
   to DIRECT children only - .prose also wraps whole template content
   areas (single-service.php etc.), and without the ">" these rules
   would reach into other blocks' own internal headings/paragraphs
   nested arbitrarily deep inside (e.g. Steps' .step__heading, Card
   Grid's .card__heading), not just actual typed content. */
.prose > h1, .prose > h2, .prose > h3, .prose > h4, .prose > h5, .prose > h6,
.prose > p, .prose > ul, .prose > ol, .prose > .wp-block-buttons {
    margin-top: 0;
    margin-bottom: 1rem;
}

.prose > *:last-child {
    margin-bottom: 0;
}

/* The ACF WYSIWYG field (e.g. Rich Text's Content) edits inside its
   own TinyMCE iframe - a bare <body class="mce-content-body">, no
   .prose wrapper, so the rules above never reach it there even
   though add_editor_style() loads this file into that iframe too.
   Left with just the sitewide h1-h6/p margin:0 reset and nothing to
   restore it, elements end up touching. Frontend is unaffected (it
   only ever renders inside an actual .prose wrapper). */
.mce-content-body h1, .mce-content-body h2, .mce-content-body h3,
.mce-content-body h4, .mce-content-body h5, .mce-content-body h6,
.mce-content-body p, .mce-content-body ul, .mce-content-body ol {
    margin-top: 0;
    margin-bottom: 1rem;
}

.prose > h2,
.block-heading {
    font-size: 32px;
    font-weight: 700;
}

.prose > h2::after,
.block-heading::after {
    content: "";
    display: block;
    width: 3rem;
    height: 3px;
    margin-top: 0.5rem;
    background: var(--wp--preset--color--accent);
}

/* Headings that centre their text need the bar centred under it too
   - display:block default places it flush left regardless of the
   heading's own text-align. */
.team-filter-block__heading::after,
.testimonials-block__heading::after {
    margin-left: auto;
    margin-right: auto;
}

.prose > h3, .prose > h4, .prose > h5 {
    font-family: var(--wp--preset--font-family--primary);
}

.prose > h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.prose > h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wp--preset--color--dark);
}

.prose > h5 {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--wp--preset--color--muted);
}

.prose > ul, .prose > ol {
    padding-left: 1.5em;
}

.prose li + li {
    margin-top: 0.35em;
}

/* Contrast fix: a block with a dark/coloured background (chosen via
   Gutenberg's own block colour control) would otherwise keep these
   headings' own brand-coloured text (e.g. h3's primary blue), which
   can disappear entirely against a matching background. Covers any
   block using .prose for its content, not just one specific block. */
.has-primary-background-color .prose > h2,
.has-primary-background-color .prose > h3,
.has-primary-background-color .prose > h4,
.has-primary-background-color .prose > h5,
.has-dark-background-color .prose > h2,
.has-dark-background-color .prose > h3,
.has-dark-background-color .prose > h4,
.has-dark-background-color .prose > h5,
.has-accent-background-color .prose > h2,
.has-accent-background-color .prose > h3,
.has-accent-background-color .prose > h4,
.has-accent-background-color .prose > h5 {
    color: var(--wp--preset--color--white);
}

.has-primary-background-color .prose > h2::after,
.has-dark-background-color .prose > h2::after,
.has-accent-background-color .prose > h2::after {
    background: var(--wp--preset--color--white);
}

.prose blockquote {
    margin: 1.5em 0;
    padding: 1.5em 1.75em;
    border-radius: 1rem;
    background: var(--wp--preset--color--primary);
    font-style: italic;
    color: var(--wp--preset--color--white);
}

.prose blockquote p {
    color: inherit;
}

.prose > p a,
.prose > ul a,
.prose > ol a,
.prose > h1 a,
.prose > h2 a,
.prose > h3 a,
.prose > h4 a,
.prose > h5 a,
.prose > h6 a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.prose > img {
    margin-top: 1.5em;
    margin-bottom: 1.5em;
    border-radius: 2px;
}

.prose hr {
    border: none;
    border-top: 1px solid var(--wp--preset--color--neutral);
    margin: 2em 0;
}


/* ================================
ACCESSIBILITY
================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 999;
}

.skip-link:focus {
    top: 1rem;
}

:focus-visible {
    outline: 3px solid var(--wp--preset--color--accent);
    outline-offset: 3px;
}

:focus:not(:focus-visible) {
    outline: none;
}