/*
 * Business Services cluster - shared layer.
 *
 * One component vocabulary for the three B2B pages (/business-services/,
 * /trade-repair-services/, /services-for-schools/), extracted from the
 * Gutenberg HTML blocks on 15.08.2026 and rebuilt against the v4.2 design
 * system (DESIGN-LANGUAGE.md): semantic tokens only, border-colour hovers,
 * no gradient-clipped text, no eyebrows, canonical <details> FAQ, via-tick
 * list markers, zero !important (the #ff-b2b ID wins every specificity race).
 *
 * Load order is handled by includes/core/b2b-assets.php:
 *   b2b-shared -> b2b-{hub|trade|schools}
 *
 * Global Layer-2 tokens (--action, --surface-alt, --border-interactive, ...)
 * are inlined into <head> from the theme's tokens.css on every page, so this
 * file consumes them directly and defines only cluster-local aliases.
 */

/* ---------- Wrapper, reset, base type ---------- */

#ff-b2b {
    /* Cluster-local aliases (values resolve from :root ff-tokens v4.0.0) */
    --tint-teal: var(--wash-brand-soft);
    --tint-amber: var(--wash-warm-soft);
    --tint-deep: light-dark(rgba(0, 95, 115, 0.10), rgba(77, 201, 222, 0.12));

    position: relative;
    width: 100%;
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.6;
    color: var(--content-body);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* The reset covers the pages' own markup. It stops at the form: WPForms
   output is styled by the canonical component in the theme's
   wp-integration.css, and an id selector would otherwise flatten every
   field and label gap in it (same pattern as #ff-quote). */
#ff-b2b *:not(.wpforms-container *),
#ff-b2b *:not(.wpforms-container *)::before,
#ff-b2b *:not(.wpforms-container *)::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

#ff-b2b h1, #ff-b2b h2, #ff-b2b h3, #ff-b2b h4,
#ff-b2b p, #ff-b2b a, #ff-b2b li, #ff-b2b span, #ff-b2b strong,
#ff-b2b button, #ff-b2b label, #ff-b2b summary,
#ff-b2b input, #ff-b2b textarea, #ff-b2b select {
    font-family: inherit;
}

/* Smooth in-page anchors without JS; reduced-motion pass below disables it. */
html:has(#ff-b2b) {
    scroll-behavior: smooth;
}

#ff-b2b section[id] {
    scroll-margin-top: 96px;
}

/* ---------- Typography (v4) ---------- */

#ff-b2b h1,
#ff-b2b .ffb-h1 {
    font-size: var(--text-h1, clamp(2rem, 5vw, 3.5rem));
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--content);
    margin-bottom: 1.5rem;
    text-wrap: balance;
}

#ff-b2b h2,
#ff-b2b .ffb-h2 {
    font-size: var(--text-h2, clamp(2rem, 5vw, 2.75rem));
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--content);
    margin-bottom: 1rem;
}

#ff-b2b h3,
#ff-b2b .ffb-h3 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--content);
    margin-bottom: 0.75rem;
}

#ff-b2b h4,
#ff-b2b .ffb-h4 {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--content);
    margin-bottom: 0.5rem;
}

#ff-b2b p,
#ff-b2b .ffb-text {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--content-body);
    margin-bottom: 1.25rem;
}

#ff-b2b a {
    color: var(--action);
    text-decoration: none;
    transition: color 0.2s ease;
}

#ff-b2b a:hover {
    color: var(--action-hover);
}

/*
 * Operative phrase (v4.2 heading hierarchy): 1-3 words of the H1 carried in
 * solid --action. Replaces the retired gradient-clipped span.
 */
#ff-b2b .ffb-op {
    color: var(--action);
}

#ff-b2b .ffb-hero-title .ffb-op {
    display: block;
}

/* ---------- Layout scaffolding ---------- */

#ff-b2b .ffb-container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 2rem;
}

#ff-b2b .ffb-section {
    padding: var(--section-y, 4rem) 0;
    position: relative;
}

/* Flat alternation is the whole background system. */
#ff-b2b .ffb-section--alt {
    background: var(--surface-alt);
}

/* Canonical section header (v4): 46rem measure, clamped bottom rhythm. */
#ff-b2b .ffb-section-header {
    text-align: center;
    max-width: 46rem;
    margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
}

#ff-b2b .ffb-section-header .ffb-h2 {
    margin-bottom: 0.75rem;
}

#ff-b2b .ffb-section-subtitle {
    font-size: 1.125rem;
    color: var(--content-body);
    margin-bottom: 0;
}

/* ---------- Hero ---------- */

#ff-b2b .ffb-hero {
    padding: 2.5rem 0;
    background: var(--surface);
    position: relative;
    overflow: hidden;
}

/* No hero atmosphere. The corner glows that used to sit here came out on
   3 Sep 2026 (Marcin): the B2B heroes carry a photograph and a stat row, and
   a teal wash behind them added nothing the picture was not already doing. */

#ff-b2b .ffb-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: clamp(2rem, 4vw, 4rem);
    align-items: center;
    min-height: 440px;
    position: relative;
    z-index: 2;
}

#ff-b2b .ffb-hero-title {
    margin: 0 0 1.5rem 0;
}

#ff-b2b .ffb-hero-description {
    font-size: clamp(15px, 1.6vw, 17px);
    color: var(--content-body);
    line-height: 1.65;
    margin-bottom: 0;
    max-width: 520px;
}

#ff-b2b .ffb-hero-actions {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

#ff-b2b .ffb-hero-visual {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

#ff-b2b .ffb-hero-image {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
    overflow: hidden;
    border-radius: var(--radius, 12px);
    border: 1px solid var(--border-subtle);
}

#ff-b2b .ffb-hero-image img {
    width: 100%;
    height: 100%;
    min-height: 400px;
    object-fit: cover;
    object-position: center;
    display: block;
    /* Subtle vibrancy boost - livelier colour without looking processed. */
    filter: saturate(1.18) contrast(1.04);
}

/* Audience chips under the hero copy. */
#ff-b2b .ffb-hero-clients {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

#ff-b2b .ffb-hero-clients-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--content);
}

/* Tag / chip (v4 tag spec, link-able). */
#ff-b2b .ffb-tag,
#ff-b2b .ffb-hero-client-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--action);
    background: var(--wash-brand-soft);
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: var(--transition-border, border-color 0.25s ease);
}

#ff-b2b a.ffb-hero-client-tag:hover {
    border-color: var(--border-active);
    color: var(--action);
}

/* Hero stat strip (numerals in solid --action - no gradient fills). */
#ff-b2b .ffb-stats {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    margin-top: 2.25rem;
}

#ff-b2b .ffb-stat-number {
    font-size: clamp(1.5rem, 2.5vw, 1.9rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--action);
}

#ff-b2b .ffb-stat-number .ffb-star {
    color: var(--accent-warm-text);
}

#ff-b2b .ffb-stat-label {
    font-size: 0.8125rem;
    color: var(--content-secondary);
    margin-top: 0.25rem;
}

/* ---------- Buttons ---------- */

#ff-b2b .ffb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: var(--radius, 12px);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    border: none;
    background: var(--action);
    color: var(--surface);
}

#ff-b2b .ffb-btn:hover {
    background: var(--action-hover);
    color: var(--surface);
}

#ff-b2b .ffb-btn-secondary {
    background: var(--surface);
    color: var(--action);
    border: 2px solid var(--action);
}

#ff-b2b .ffb-btn-secondary:hover {
    background: var(--surface);
    color: var(--action-hover);
    border-color: var(--action-hover);
}

/* Small functional nudge on button/link arrows - the only motion they get. */
#ff-b2b .ffb-arrow-link svg {
    transition: transform 0.2s ease;
}

#ff-b2b .ffb-arrow-link:hover svg {
    transform: translateX(3px);
}

#ff-b2b .ffb-arrow-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--action);
}

#ff-b2b .ffb-arrow-link:hover {
    color: var(--action-hover);
}

/* ---------- Cards ---------- */

/*
 * One card rule for the whole cluster: teal hairline at rest, border-colour
 * intensifies on hover. No lift, no scale, no shadow.
 */
#ff-b2b .ffb-card {
    background: var(--surface);
    border: 1px solid var(--border-interactive);
    border-radius: var(--radius, 12px);
    padding: 2rem;
    transition: var(--transition-border, border-color 0.25s ease);
    position: relative;
}

#ff-b2b .ffb-card:hover {
    border-color: var(--border-active);
}

/* Icon tile inside cards. */
#ff-b2b .ffb-icon-tile {
    width: 52px;
    height: 52px;
    background: var(--tint-teal);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--action);
    margin-bottom: 1.25rem;
}

#ff-b2b .ffb-icon-tile svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Generic inline SVG sizing. */
#ff-b2b svg {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

#ff-b2b .ffb-icon {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

#ff-b2b .ffb-icon-large { width: 30px; height: 30px; }
#ff-b2b .ffb-icon-small { width: 16px; height: 16px; }

/* ---------- Lists: via-tick marker (house motif, list-marker role only) ---------- */

#ff-b2b .ffb-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

#ff-b2b .ffb-list li {
    position: relative;
    padding-left: 1.6rem;
    margin-bottom: 0.6rem;
    font-size: 0.9375rem;
    color: var(--content-body);
    line-height: 1.55;
}

#ff-b2b .ffb-list li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 0.42em;
    width: 9px;
    height: 9px;
    border: 2px solid var(--accent-line);
    border-radius: 50%;
    background: var(--surface);
}

/* ---------- Disclosure: cards' "Read more" on native <details> ---------- */

#ff-b2b details.ffb-more {
    margin-top: 0.25rem;
}

#ff-b2b details.ffb-more > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--action);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

#ff-b2b details.ffb-more > summary::-webkit-details-marker {
    display: none;
}

#ff-b2b details.ffb-more > summary:hover {
    color: var(--action-hover);
}

#ff-b2b details.ffb-more > summary::after {
    content: '';
    width: 15px;
    height: 15px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007a92' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.3s ease;
}

#ff-b2b details.ffb-more[open] > summary::after {
    transform: rotate(180deg);
}

#ff-b2b details.ffb-more > summary .ffb-when-open { display: none; }
#ff-b2b details.ffb-more[open] > summary .ffb-when-open { display: inline; }
#ff-b2b details.ffb-more[open] > summary .ffb-when-closed { display: none; }

#ff-b2b details.ffb-more > .ffb-more-body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* ---------- FAQ (canonical v4: native <details>/<summary>) ---------- */

#ff-b2b .ffb-faq-container {
    max-width: 900px;
    margin: 0 auto;
}

#ff-b2b .ff-faq {
    border: 1px solid var(--border-interactive);
    border-radius: var(--radius, 12px);
    background: var(--surface);
    transition: var(--transition-border, border-color 0.25s ease);
}

#ff-b2b .ff-faq + .ff-faq {
    margin-top: 0.75rem;
}

#ff-b2b .ff-faq:hover {
    border-color: var(--border-active);
}

#ff-b2b .ff-faq summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--content);
}

#ff-b2b .ff-faq summary::-webkit-details-marker {
    display: none;
}

#ff-b2b .ff-faq summary svg {
    flex: none;
    transition: transform 0.3s ease;
    color: var(--accent);
}

#ff-b2b .ff-faq[open] summary svg {
    transform: rotate(45deg);
}

#ff-b2b .ff-faq .a {
    padding: 0 1.5rem 1.25rem;
}

#ff-b2b .ff-faq .a p {
    font-size: 1rem;
    margin-bottom: 0;
}

#ff-b2b .ff-faq .a p + p {
    margin-top: 0.75rem;
}

/* ---------- Forms (WPForms restyled to SEC-06) ---------- */

#ff-b2b .ffb-form-container {
    background: transparent;
    border: none;
    padding: 2rem 0 0 0;
}

/*
 * WPForms: deliberately NOT restyled here. The theme's canonical form
 * component (wp-integration.css, loaded site-wide) styles every field -
 * including the 2px inset --accent focus edge - so the B2B forms render
 * identically to /get-a-quote/ and /contact-us/. Overriding it from an ID
 * scope was the 15.08 mistake; removed 16.08.
 */

/* ---------- Accessibility ---------- */

/* Form fields are excluded on purpose: the theme's canonical component
   (wp-integration.css) draws their focus as a 2px inset --accent edge, and
   an outer outline here would double it. */
#ff-b2b a:focus-visible,
#ff-b2b button:focus-visible,
#ff-b2b summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    html:has(#ff-b2b) {
        scroll-behavior: auto;
    }

    #ff-b2b *,
    #ff-b2b *::before,
    #ff-b2b *::after {
        animation: none !important;   /* Reduced-motion override */
        transition: none !important;  /* Reduced-motion override */
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
    #ff-b2b .ffb-hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        min-height: auto;
    }

    #ff-b2b .ffb-hero-visual {
        min-height: 300px;
        order: 2;
    }

    #ff-b2b .ffb-hero-image,
    #ff-b2b .ffb-hero-image img {
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    #ff-b2b .ffb-container {
        padding: 0 1.5rem;
    }

    #ff-b2b .ffb-section {
        padding: 3rem 0;
    }

    #ff-b2b .ffb-hero-actions {
        flex-direction: column;
    }

    #ff-b2b .ffb-btn {
        width: 100%;
    }

    #ff-b2b .ff-faq summary {
        padding: 1.1rem 1.25rem;
        font-size: 1rem;
    }

    #ff-b2b .ff-faq .a {
        padding: 0 1.25rem 1.1rem;
    }

    #ff-b2b .ffb-stats {
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    #ff-b2b .ffb-card {
        padding: 1.5rem;
    }
}
