/*
 * Layout + components (_docs/CSS-ARCHITECTURE.md).
 * One top-level class per component, everything nested inside it, BEM names,
 * tokens only. Mobile-first; breakpoints 30em / 48em / 62em / >64em / 75em.
 *
 * Look and measurements match the live theme (Bootstrap 3 + theme.css),
 * measured from computed styles in task 1.1.
 */

/* Base ------------------------------------------------------------------ */
body {
    padding-top: var(--header-height);   /* fixed header */
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--fs-body);
    font-weight: var(--fw-light);
    line-height: var(--lh-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all var(--duration-fast) ease-in-out;
}

strong,
b {
    font-weight: var(--fw-bold);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-heading);
    font-family: var(--font-heading);
    font-weight: var(--fw-medium);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading);
}

/* Live heading sizes stepped at 480 / 768 / 1200px */
h1 {
    margin: var(--space-xxl) 0 0;
    font-size: var(--fs-h1, 1.8em);
    font-weight: var(--fw-light);
    line-height: 1.25;
    letter-spacing: var(--ls-h1);
    text-align: center;

    @media (width >= 30em) {
        --fs-h1: 2.3em;
        margin-block-end: var(--space-xxl);
    }

    @media (width >= 48em) {
        --fs-h1: 2.1em;
        text-align: start;

        &::after {
            content: "";
            display: block;
            width: var(--h1-rule-width);
            height: var(--border-hairline);
            margin: var(--space-xxl) 0 var(--space-m);
            border-bottom: var(--border-hairline) dashed var(--color-neutral);
        }
    }

    @media (width >= 75em) {
        --fs-h1: var(--fs-xxl);
        margin-block-end: var(--space-xl);
    }
}

h2 {
    margin: var(--space-xxl) 0 var(--space-s);
    font-size: 1.5em;
    font-weight: var(--fw-semibold);

    @media (width >= 48em) {
        font-size: 1.3em;
    }

    @media (width >= 75em) {
        margin: var(--space-m) 0 var(--h2-gap);
        font-size: 1.55em;
    }
}

h3,
h4,
h5,
h6 {
    margin: var(--space-xxl) 0 var(--tick-gap);   /* live: 20px 0 5px */
    font-size: 0.9em;

    @media (width >= 48em) {
        font-size: 1em;
    }

    @media (width >= 75em) {
        font-size: var(--fs-l);
    }
}

sup {
    position: relative;
    top: -0.5em;
    font-size: 75%;
    line-height: 0;
    vertical-align: baseline;
}

p,
ul {
    margin-block-end: var(--space-3xl);
}

/* D20: keyboard focus is visible (live removed all outlines); mouse focus isn't. */
:focus:not(:focus-visible) {
    outline: none;
}

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

/* .container: centred page width with the live gutters --------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-gutter);
}

/* .icon: inline SVG replacing Font Awesome 4 (components/icon.php) ----- */
.icon {
    display: inline-block;
    width: auto;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
}

/* .side-tab: fixed, rotated Buy Now / Get A Quote tabs (desktop only) --- */
.side-tab {
    display: none;
    position: fixed;
    right: 0;
    z-index: 100;
    transform: rotate(-90deg);
    transition: all var(--duration-fast) ease-in-out;

    &.side-tab--shop {
        top: var(--side-tab-shop-top);
        transform-origin: var(--side-tab-shop-origin);
    }

    &.side-tab--quote {
        top: var(--side-tab-quote-top);
        transform-origin: var(--side-tab-quote-origin);
    }

    & .side-tab__title {
        margin: 0;
        padding: 0;
        background: var(--color-header);
        font-family: var(--font-heading);
        font-size: var(--fs-l);
        font-weight: var(--fw-medium);
        letter-spacing: var(--ls-heading);
        text-align: center;
        transition: all var(--duration-fast) ease-in-out;
    }

    &.side-tab--shop .side-tab__title {
        background: var(--color-accent);
    }

    & .side-tab__link {
        display: block;
        min-height: var(--side-tab-height);
        padding-inline: var(--space-4xl);
        color: var(--color-neutral-lightest);
        line-height: var(--side-tab-height);
    }

    /* Hover, and the periodic "nag" on Buy Now (site.js; off with reduced motion) */
    &:hover,
    &[data-nag] {
        right: var(--space-m);
    }

    & .side-tab__title:hover,
    &[data-nag] .side-tab__title {
        padding-bottom: var(--space-m);
        background: var(--color-accent);
    }

    @media (width > 64em) {
        display: block;
    }

    @media (prefers-reduced-motion: reduce) {
        &,
        & .side-tab__title {
            transition: none;
        }
    }
}

/* .site-header: fixed bar with logo + phone ------------------------------ */
.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1030;
    min-height: var(--header-height);
    background-color: var(--color-header);
    border-bottom: var(--border-hairline) solid var(--color-header);

    & .site-header__inner {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: space-between;
        width: 100%;
        max-width: var(--container-max);
        margin-inline: auto;
        padding-inline: var(--container-gutter);
    }

    & .site-header__brand {
        display: flex;
        align-items: center;
        height: var(--header-height);
    }

    & .site-header__logo {
        display: block;
    }

    & .site-header__phone {
        display: none;
        padding-inline-start: var(--space-4xl);
        color: var(--color-neutral);
        font-family: var(--font-heading);
        font-size: var(--fs-m);
        font-weight: var(--fw-medium);
        line-height: var(--header-height);
    }

    @media (width >= 48em) {
        & .site-header__inner {
            flex-wrap: nowrap;
        }
    }

    @media (width >= 62em) {
        & .site-header__phone {
            display: inline-block;
        }
    }
}

/* .site-nav: main menu, Uses & Applications dropdown, mobile toggle ------ */
.site-nav {
    flex: 1 0 100%;

    & .site-nav__toggle {
        position: absolute;
        top: var(--menu-button-top);
        right: var(--space-m);
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: var(--space-xs);
        width: var(--menu-button-width);
        height: var(--menu-button-height);
        padding: 0 var(--space-m);
        background-color: var(--color-overlay-strong);
        border: var(--border-hairline) solid transparent;
        border-radius: 0;
        cursor: pointer;

        &[hidden] {
            display: none;
        }
    }

    & .site-nav__bar {
        display: block;
        width: var(--menu-bar-width);
        height: var(--menu-bar-height);
        background-color: var(--color-neutral-lightest);
        border-radius: var(--radius-bar);
    }

    /* Mobile panel: in the header, under the bar. Live capped it at 420px
       and scrolled; D20 removes the cap. */
    & .site-nav__list {
        margin: 0 calc(var(--space-xl) * -1);
        padding: var(--menu-panel-pad) 0;
        list-style: none;
        border-top: var(--border-hairline) solid var(--color-header-rule);
        box-shadow: inset 0 var(--border-hairline) 0 var(--color-inset-light);
    }

    /* With JS the panel starts closed; without JS it just shows. */
    & .site-nav__toggle:not([hidden])[aria-expanded="false"] + .site-nav__list {
        display: none;
    }

    & .site-nav__item {
        position: relative;
    }

    & .site-nav__link {
        display: block;
        width: 100%;
        padding: var(--space-m) var(--space-xl);
        background: none;
        border: 0;
        color: var(--color-on-dark);
        font: inherit;
        font-family: var(--font-heading);
        font-weight: var(--fw-medium);
        line-height: var(--lh-ui);
        letter-spacing: var(--ls-nav);
        text-align: left;
        text-transform: uppercase;
        cursor: pointer;
    }

    & .site-nav__sub-toggle[aria-expanded="true"] {
        color: var(--color-neutral-lightest);
        background-color: var(--color-header);
    }

    & .site-nav__sub {
        display: none;
        margin: var(--border-hairline) 0 0;
        padding: 0;
        list-style: none;
        font-size: var(--fs-xs);
    }

    & .site-nav__sub-toggle[aria-expanded="true"] + .site-nav__sub {
        display: block;
    }

    & .site-nav__sub-link {
        display: block;
        padding: var(--space-l) var(--space-xl);
        color: var(--color-neutral-muted);
        font-family: var(--font-heading);
        font-weight: var(--fw-medium);
        line-height: var(--lh-ui);
        white-space: nowrap;

        &:hover,
        &:focus-visible,
        &[aria-current="page"] {
            color: var(--color-neutral-lightest);
        }
    }

    @media (width >= 48em) {
        flex: 0 1 auto;
        margin-inline-start: auto;

        & .site-nav__toggle:not([hidden]) {
            display: none;
        }

        & .site-nav__list,
        & .site-nav__toggle:not([hidden])[aria-expanded="false"] + .site-nav__list {
            display: flex;
            align-items: flex-start;
            margin: 0 calc(var(--space-xl) * -1) 0 0;
            padding: 0;
            border: 0;
            box-shadow: none;
        }

        & .site-nav__item {
            padding-inline: var(--space-xl);
            font-size: var(--fs-xs);
        }

        & .site-nav__link {
            padding: var(--nav-link-pad-top) 0 var(--nav-link-pad-bottom);
        }

        & .site-nav__link[aria-current],
        & .site-nav__item:has([aria-current="page"]) > .site-nav__sub-toggle {
            border-bottom: var(--nav-current-rule) solid var(--color-accent);
        }

        & .site-nav__sub {
            position: absolute;
            top: 100%;
            right: 0;
            z-index: 1000;
            min-width: var(--dropdown-min);
            background-color: var(--color-surface);
            background-clip: padding-box;
            border: var(--border-hairline) solid var(--color-neutral-mid);
            border-top: 0;
            border-radius: 0 0 var(--radius-s) var(--radius-s);
            box-shadow: var(--shadow-dropdown);

            /* Invisible bridge over the 1px gap above the menu, so the
               pointer never "leaves" between button and menu (hover, 2.3) */
            &::before {
                content: "";
                position: absolute;
                inset: calc(var(--border-hairline) * -1) 0 auto;
                height: var(--border-hairline);
            }
        }

        & .site-nav__sub-link {
            padding: var(--space-l) var(--space-xxl);
            color: var(--color-neutral-darker);
            line-height: var(--lh-menu);

            &:hover,
            &:focus-visible {
                color: var(--color-neutral-darkest);
                background-color: var(--color-overlay-hover);
            }

            &[aria-current="page"] {
                color: var(--color-neutral-lightest);
                background-color: var(--color-accent);
            }
        }
    }
}

/* .site-footer ------------------------------------------------------------ */
.site-footer {
    padding-block: var(--space-5xl);
    background: var(--color-surface);

    & .site-footer__inner {
        width: 100%;
        max-width: var(--container-max);
        margin-inline: auto;
        padding-inline: var(--container-gutter);
    }

    & .site-footer__number {
        margin: var(--space-xxl) 0 var(--space-m);
        font-size: var(--fs-xl);
        font-weight: var(--fw-light);
        letter-spacing: var(--ls-heading);
    }

    & .site-footer__legal {
        font-size: var(--fs-xs);

        & a {
            color: var(--color-link);
        }
    }

    & .site-footer__links {
        padding: 0;
        list-style: none;
    }

    & .site-footer__item {
        display: inline-block;
        margin-inline-end: var(--space-xxs);
        font-size: var(--fs-xs);
    }

    & .site-footer__link {
        padding: var(--space-xs) var(--space-xl) var(--space-s);
        background: var(--color-neutral-pale);
        border-radius: var(--radius-pill);
        color: var(--color-link);
        font-weight: var(--fw-regular);
    }

    @media (width >= 75em) {
        & .site-footer__number {
            margin-block-start: var(--space-m);
        }
    }

    /* Live quirk: on the uses pages `.case-study h2 { margin: 0 }` also
       removes the top margin of the footer's "Call:" heading. */
    .page-use & .site-footer__number {
        margin-block-start: 0;
    }
}

/* .site-main: page content area (live .row.content) --------------------- */
.site-main {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding: var(--main-pad-top) var(--container-gutter) var(--main-pad-bottom);
}

/* .page-title: the H1 row at the top of a page -------------------------- */
.page-title {
    display: flow-root;   /* keep the H1 rule's margin inside, as live's floated column did */
    margin-block-end: var(--space-xxl);

    & h1 {
        margin-block-end: 0;
    }

    /* D22: on the page grey, live's orange is 4.39:1; #c34306 reaches AA */
    & .page-title__accent {
        color: var(--color-accent-on-grey);
    }
}

/* .home-intro: diagram card | slideshow + Why + ticks (home) ------------ */
.home-intro {
    display: grid;
    margin-block-end: var(--space-4xl);

    & .home-intro__card {
        margin-block-end: var(--space-4xl);   /* live's mobile-only spacer */
        background: var(--color-surface);
    }

    & .home-intro__logo {
        padding: var(--space-5xl) var(--panel-pad) var(--space-m);

        & img {
            max-width: var(--logo-max-mobile);
        }
    }

    & .home-intro__text {
        margin: 0;
        padding: 0 var(--panel-pad) var(--panel-pad);
    }

    & .home-intro__diagram img {
        width: 100%;
    }

    & .home-intro__why {
        padding: var(--space-4xl) var(--panel-pad) var(--space-m);
        background: var(--color-surface);

        & p {
            margin: 0;
        }
    }

    /* Live's WPBakery separator: a 4px light band (dashed top edge) */
    & .home-intro__rule {
        position: relative;
        z-index: 1;
        height: var(--separator-height);
        background: var(--color-surface);

        &::after {
            content: "";
            position: absolute;
            inset: 100% 0 auto;
            border-top: var(--border-hairline) dashed var(--color-rule-light);
            border-bottom: var(--separator-band) solid var(--color-rule-light);
        }
    }

    /* +1px: live's two-column clearfix (:after, display: table, height 1px) */
    & .home-intro__ticks {
        padding: var(--panel-pad) var(--panel-pad) calc(var(--space-4xl) + var(--border-hairline));
        background: var(--color-surface);
    }

    @media (width >= 48em) {
        & .home-intro__logo img {
            max-width: 100%;
        }
    }

    @media (width >= 62em) {
        grid-template-columns: 1fr 1fr;
        column-gap: var(--space-4xl);
        align-items: start;

        & .home-intro__card {
            margin-block-end: 0;
        }
    }
}

/* .tick-list: green-tick bullet list (live .bullets-tick) ---------------- */
.tick-list {
    & .tick-list__column {
        margin: var(--space-xl) 0 0;
        padding: 0;
        list-style: none;
    }

    & .tick-list__item {
        margin-inline-start: var(--tick-indent);
        padding-bottom: var(--space-xl);
        line-height: 140%;

        /* The tick sits where live's Font Awesome glyph sat (1em box,
           descent .143em). */
        &::before {
            content: "";
            display: inline-block;
            width: 1em;
            height: 1em;
            margin-inline: var(--tick-pull) var(--tick-gap);
            vertical-align: -0.142857em;
            background-color: var(--color-brand);
            mask: var(--icon-check) no-repeat 0 0 / 1em 1em;
        }
    }

    /* Home page (live .home .bullets-tick): smaller, tighter, no top margin.
       Live's FA line box also made the first line of each tick 1px taller at
       the 14.85px desktop size only; --tick-lift reproduces that (measured
       against the real font, task 1.2). */
    &.tick-list--compact {
        & .tick-list__column {
            margin-top: 0;
        }

        & .tick-list__item {
            padding-bottom: var(--space-m);
            font-size: var(--fs-xs);
            line-height: 130%;

            @media (width >= 48em) {
                &::before {
                    margin-top: var(--tick-lift);
                }
            }
        }
    }

    &.tick-list--two-col {
        @media (width >= 48em) {
            display: grid;
            grid-template-columns: 48% 48%;
            justify-content: space-between;
            align-items: start;
        }
    }
}

/* .slideshow: fading gallery (live Flexslider fade) ---------------------- */
.slideshow {
    position: relative;
    background: var(--color-surface);
    touch-action: pan-y;   /* horizontal swipes go to slideshow.js; vertical still scrolls */

    /* Slides + arrows + pause; clipped because the parked arrows sit outside
       (live: body overflow-x hidden). The dots sit below the stage. */
    & .slideshow__stage {
        position: relative;
        overflow: hidden;
    }

    & .slideshow__slides {
        display: grid;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    & .slideshow__slide {
        grid-area: 1 / 1;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--duration-fade) ease, visibility 0s linear var(--duration-fade);

        &[data-active] {
            z-index: 1;
            opacity: 1;
            visibility: visible;
            transition: opacity var(--duration-fade) ease;
        }
    }

    & .slideshow__image {
        width: 100%;
    }

    /* Prev/next: hidden off the edges, slide in at 70% on hover (live) */
    & .slideshow__nav {
        position: absolute;
        top: 50%;
        z-index: 10;
        width: var(--slider-nav-size);
        height: var(--slider-nav-size);
        margin-top: calc(var(--slider-nav-size) / -2);
        padding: 0;
        overflow: hidden;
        background: none;
        border: 0;
        color: var(--color-slider-nav);
        font-size: var(--slider-nav-size);
        line-height: 1;
        opacity: 0;
        cursor: pointer;
        transition: all var(--duration-slider-nav) ease-in-out;

        &[hidden] {
            display: none;
        }

        & .icon {
            vertical-align: top;
            filter: drop-shadow(1px 1px 0 var(--color-slider-nav-shadow));
        }
    }

    & .slideshow__nav--prev {
        left: var(--slider-nav-offset);
        text-align: left;
    }

    & .slideshow__nav--next {
        right: var(--slider-nav-offset);
        text-align: right;
    }

    &:hover .slideshow__nav,
    & .slideshow__nav:focus-visible {
        opacity: 0.7;
    }

    &:hover .slideshow__nav--prev,
    & .slideshow__nav--prev:focus-visible {
        left: var(--space-m);
    }

    &:hover .slideshow__nav--next,
    & .slideshow__nav--next:focus-visible {
        right: var(--space-m);
    }

    & .slideshow__nav:hover {
        opacity: 1;
    }

    /* Pause/play (D22): small grey round button, bottom right, always visible */
    & .slideshow__toggle {
        position: absolute;
        right: var(--space-m);
        bottom: var(--space-m);
        z-index: 10;
        display: grid;
        place-items: center;
        width: var(--slider-toggle-size);
        height: var(--slider-toggle-size);
        padding: 0;
        background: var(--color-slider-toggle);
        border: 0;
        border-radius: var(--radius-round);
        color: var(--color-neutral-lightest);
        font-size: var(--slider-toggle-icon);
        opacity: 0.8;
        cursor: pointer;
        transition: opacity var(--duration-fast);

        &:hover,
        &:focus-visible {
            opacity: 1;
        }

        &[hidden] {
            display: none;
        }

        & .icon {
            grid-area: 1 / 1;
            vertical-align: top;
        }

        &[data-state="playing"] .slideshow__toggle-play,
        &[data-state="paused"] .slideshow__toggle-pause {
            display: none;
        }
    }

    /* Live Flexslider paging (uses pages): 11px dots, 6px apart, 15px below */
    & .slideshow__dots {
        display: flex;
        justify-content: center;
        gap: var(--space-s);
        margin: var(--space-xl) 0 0;
        padding: 0;
        list-style: none;

        & li {
            padding-bottom: var(--space-m);
            line-height: 0;
        }
    }

    & .slideshow__dot {
        position: relative;
        width: var(--dot-size);
        height: var(--dot-size);
        padding: 0;
        background: var(--color-dot);
        border: 0;
        border-radius: var(--radius-pill);
        font-size: 0;
        cursor: pointer;

        &[aria-current="true"] {
            background: var(--color-accent);
        }

        /* Invisible hit area (D23): 24px tall and the dot's whole slot
           (dot + half the gap each side), so the gaps aren't dead space.
           Same look; the dots are 17px apart, so it can't be 24px wide
           without overlapping the next dot. */
        &::after {
            content: "";
            position: absolute;
            inset: calc((var(--dot-size) - var(--dot-hit)) / 2) calc(var(--space-s) / -2);
        }
    }

    @media (prefers-reduced-motion: reduce) {
        & .slideshow__slide,
        & .slideshow__slide[data-active],
        & .slideshow__nav {
            transition: none;
        }
    }
}

/* .product-tiers / .product-card: the three EasyPad tiers ---------------- */
.product-tiers {
    display: grid;
    margin-block-end: var(--section-gap);
    background: var(--color-surface);

    @media (width >= 62em) {
        grid-template-columns: repeat(3, 1fr);
        align-items: start;
    }
}

.product-card {
    padding: var(--panel-pad) var(--panel-pad) var(--space-xxl);

    & .product-card__thumb {
        margin-block-end: var(--card-thumb-gap);
    }

    & .product-card__logo {
        margin-block-end: var(--space-l);
    }

    & .product-card__text {
        margin: 0 0 var(--panel-pad);
    }

    & .product-card__highlight {
        color: var(--color-accent);
    }

    & .product-card__button {
        display: inline-block;
        margin-block-end: var(--card-button-gap);
        padding: var(--button-pad-block) var(--space-xxl);
        background-color: var(--color-accent);
        border: var(--border-hairline) solid transparent;
        border-radius: var(--radius-button);
        color: var(--color-neutral-lightest);
        font-family: var(--font-heading);
        font-size: var(--button-font);
        font-weight: var(--fw-semibold);
        line-height: normal;
        vertical-align: top;
    }
}

/* .uses-grid: Uses & Applications links (live .app-link) ----------------- */
.uses-grid {
    & .uses-grid__head {
        padding: var(--space-4xl) var(--space-xxl) var(--tick-gap);
        background: var(--color-surface);
    }

    & .uses-grid__title {
        margin-block-end: 0;
    }

    /* White 31px band, then live's 1px dashed line below it */
    & .uses-grid__rule {
        height: calc(var(--separator-height) + var(--border-hairline));
        background: var(--color-surface);
        background-clip: padding-box;
        border-bottom: var(--border-hairline) dashed var(--color-neutral);
    }

    & .uses-grid__item {
        position: relative;
        background: var(--color-surface);

        &:nth-of-type(even) {
            background: var(--color-surface-50);
        }
    }

    & .uses-grid__name {
        margin: 0;
        font-size: 1.05em;
        line-height: 130%;
        letter-spacing: 0;
    }

    & .uses-grid__link {
        position: relative;
        display: block;
        padding: var(--uses-link-pad-block) var(--uses-link-pad-end) var(--uses-link-pad-block) var(--space-m);
        color: var(--color-accent);

        &:hover {
            color: var(--color-heading);
        }

        /* Green round button with a white arrow (live: Font Awesome ::after) */
        &::before,
        &::after {
            content: "";
            position: absolute;
            top: var(--space-xl);
            right: var(--space-xl);
            z-index: 100;
            font-size: 1.5em;
        }

        &::before {
            width: calc(var(--space-m) + var(--uses-arrow-pad) + 0.857143em);
            height: calc(var(--space-xxl) + 1lh);
            margin-top: var(--border-hairline);
            background: var(--color-brand);
            border-radius: var(--radius-pill);
        }

        &::after {
            top: calc(var(--space-xl) + var(--border-hairline) + var(--space-m) + (1lh - 1em) / 2);
            right: calc(var(--space-xl) + var(--uses-arrow-pad));
            width: 0.857143em;
            height: 1em;
            background: var(--color-neutral-lightest);
            mask: var(--icon-arrow-right) no-repeat 0 0 / 100% 100%;
        }
    }

    /* The "Park Homes" row is :nth-of-type(even) on live too (.alt) */
    @media (width >= 48em) {
        & .uses-grid__link {
            padding-inline-start: var(--space-xxl);
        }
    }
}

/* .prefooter: Instagram, Useful Downloads, Shedbase (every page) ---------- */
.prefooter {
    padding: var(--prefooter-pad-top) 0 var(--space-xxl);
    background: var(--color-prefooter);
    border-top: var(--border-hairline) dashed var(--color-neutral);

    & .prefooter__inner {
        width: 100%;
        max-width: var(--container-max);
        margin-inline: auto;
        padding-inline: var(--container-gutter);
    }
}

/* .promo-bar: the rounded Instagram / Shedbase bars ---------------------- */
.promo-bar {
    margin: var(--promo-gap) 0;
    padding: var(--promo-pad) var(--promo-pad) var(--promo-pad-bottom);
    border-radius: var(--radius-m);
    color: var(--color-neutral-lightest);
    font-family: var(--font-heading);
    font-size: var(--fs-l);
    font-weight: var(--fw-semibold);
    text-align: center;
    transition: all var(--duration-fast) ease-in-out;

    &:hover {
        background: var(--color-heading);
        cursor: pointer;
    }

    & .promo-bar__icon {
        margin: calc(var(--promo-icon) * -1) auto var(--space-m);

        & img {
            margin-inline: auto;
        }
    }

    & .promo-bar__text {
        margin: 0;
    }

    & .promo-bar__link {
        color: var(--color-neutral-lightest);
    }

    &.promo-bar--instagram {
        background: var(--color-promo-dark);

        & .promo-bar__icon {
            width: var(--promo-icon);
            height: var(--promo-icon);
            padding: var(--space-m);
            background: var(--color-prefooter);
            border-radius: var(--radius-round);
        }
    }

    &.promo-bar--shedbase {
        margin-block-end: var(--space-xxl);
        background: var(--color-brand);
    }

    &.promo-bar--instagram:hover,
    &.promo-bar--shedbase:hover {
        background: var(--color-heading);
    }
}

/* .downloads: Useful Downloads tiles (equal heights, as live's JS did) ---- */
.downloads {
    & .downloads__icon {
        color: var(--color-heading);
        font-size: 1.5em;
        text-align: center;

        /* Live's FA glyph filled the line box exactly (font-size = line-height) */
        & .icon {
            vertical-align: top;
        }
    }

    & .downloads__title {
        margin: 0 0 var(--space-xxl);
        text-align: center;
    }

    & .downloads__list {
        display: grid;
        grid-auto-rows: 1fr;
        margin: 0 calc(var(--space-xl) * -1);
        padding: 0;
        list-style: none;
    }

    & .downloads__item {
        padding: var(--space-m);
    }

    & .downloads__link {
        display: block;
        height: 100%;
        padding: var(--tile-pad) var(--tile-pad) var(--space-xxl);
        background: var(--color-surface-70);
        text-align: center;
        transition: all var(--duration-fast) ease-in-out;

        &:hover {
            padding-top: var(--tile-pad-hover);
            background: var(--color-surface);

            & .downloads__file,
            & .downloads__label,
            & .downloads__name {
                color: var(--color-heading);
            }
        }
    }

    & .downloads__file {
        margin: var(--space-m) 0 var(--tick-gap);
        color: var(--color-accent);
        font-size: 2.5em;
        vertical-align: top;
    }

    & .downloads__label {
        display: block;
        margin: var(--tile-gap) 0;
        color: var(--color-text);
        font-size: var(--fs-xs);
    }

    & .downloads__name {
        color: var(--color-heading);
        font-family: var(--font-heading);
        font-size: var(--fs-m);
        font-weight: var(--fw-light);
    }

    @media (width >= 48em) {
        & .downloads__list {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (width > 64em) {
        & .downloads__list {
            grid-template-columns: repeat(5, 1fr);
        }
    }
}

/* .shop-cta: "Visit our online shop" block (every page) ------------------ */
.shop-cta {
    padding: var(--space-m) 0 var(--space-4xl);
    background: var(--color-bg);
    border-block: var(--border-hairline) dashed var(--color-neutral);
    text-align: center;

    & .shop-cta__inner {
        width: 100%;
        max-width: var(--container-max);
        margin-inline: auto;
        padding-inline: var(--container-gutter);
    }

    & .shop-cta__icon {
        margin-inline: auto;
    }

    & .shop-cta__title {
        margin: var(--space-m) 0 var(--space-xxl);
        font-size: 1.55em;
    }

    & .shop-cta__button {
        padding: var(--button-s-pad-block) var(--space-xxl);
        background: var(--color-accent);
        color: var(--color-neutral-lightest);
        font-family: var(--font-heading);
        font-weight: var(--fw-semibold);
        text-transform: uppercase;
    }
}

/* .lightbox: shared image viewer (lightbox.js; live Lightbox2 look) ------- */
.lightbox {
    position: fixed;
    inset: var(--lightbox-top) 0 auto;
    max-width: none;
    max-height: none;
    margin: 0 auto;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    line-height: 0;
    text-align: center;

    &::backdrop {
        background: var(--color-backdrop);
    }

    &[open],
    &[open]::backdrop {
        animation: lightbox-in var(--duration-fade) ease;
    }

    & .lightbox__body {
        display: inline-block;
        text-align: start;
    }

    & .lightbox__frame {
        position: relative;
        touch-action: pan-y;   /* horizontal swipes go to lightbox.js */
        background: var(--color-surface);
        border-radius: var(--radius-s);
    }

    & .lightbox__image {
        display: block;
        width: auto;
        height: auto;
        max-width: calc(100vw - var(--space-xxl));
        max-height: calc(100vh - var(--lightbox-top) - 4.375rem);
        border: var(--lightbox-border) solid var(--color-surface);
        border-radius: var(--radius-xs);
        transition: opacity var(--duration-fade) ease;

        &[data-loading] {
            opacity: 0;
        }
    }

    & .lightbox__nav {
        position: absolute;
        top: 0;
        z-index: 10;
        height: 100%;
        padding: 0;
        background-color: transparent;
        background-repeat: no-repeat;
        border: 0;
        opacity: 0;
        cursor: pointer;
        transition: opacity var(--duration-fade);

        &:hover,
        &:focus-visible {
            opacity: 1;
        }

        &[hidden] {
            display: none;
        }
    }

    & .lightbox__nav--prev {
        left: 0;
        width: var(--lightbox-nav-prev);
        background-image: url("../img/lightbox/prev.png");
        background-position: left 48%;
    }

    & .lightbox__nav--next {
        right: 0;
        width: var(--lightbox-nav-next);
        background-image: url("../img/lightbox/next.png");
        background-position: right 48%;
    }

    & .lightbox__data {
        display: flow-root;
        padding: var(--tick-gap) var(--space-xs) 0;
        color: var(--color-lightbox-text);
        line-height: 1.1em;
    }

    & .lightbox__number {
        float: left;
        padding-bottom: 1em;
        color: var(--color-lightbox-number);
        font-size: var(--lightbox-fs);
    }

    & .lightbox__close {
        float: right;
        width: var(--lightbox-close);
        height: var(--lightbox-close);
        padding: 0;
        background: url("../img/lightbox/close.png") top right no-repeat;
        border: 0;
        opacity: 0.7;
        cursor: pointer;
        transition: opacity var(--duration-fast);

        &:hover,
        &:focus-visible {
            opacity: 1;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        &[open],
        &[open]::backdrop {
            animation: none;
        }

        & .lightbox__image,
        & .lightbox__nav {
            transition: none;
        }
    }
}

@keyframes lightbox-in {
    from {
        opacity: 0;
    }
}

/* .page-title--application: uses pages' orange "Application:" (CSS, as live).
   Live's H1 column there has WPBakery's default 35px margin, which the H1
   rule's 10px margin collapses into (the home page used a custom 20px). */
.page-title--application {
    display: block;
    margin-block-end: var(--section-gap);
}

.page-title--application h1::before {
    content: "Application: ";
    display: inline-block;
    padding-right: var(--space-m);
    color: var(--color-accent-on-grey);   /* on the page grey (D22) */
}

/* .use-page: Uses & Applications layout (live 8/4 WPBakery columns) ------- */
.use-page {
    display: grid;
    align-items: start;

    & .use-page__main,
    & .use-page__side {
        margin-block-end: var(--use-space);
    }

    & .use-page__logo {
        padding: var(--use-logo-pad-top) var(--use-panel-pad) var(--use-logo-pad-bottom);
        background: var(--color-surface);
    }

    & .use-page__intro {
        padding: var(--space-m) var(--use-panel-pad);
        background: var(--color-surface);

        & p {
            margin: 0;
        }
    }

    /* Live has a separator here, but the slideshow paints over its line */
    & .use-page__spacer {
        height: var(--use-spacer);
        background: var(--color-surface);
    }

    & .use-page__gallery {
        padding-bottom: calc(var(--use-gallery-pad-bottom) - var(--space-xl) - var(--dot-size) - var(--space-m));
        background: var(--color-surface);
    }

    & .use-page__benefits-head {
        padding: var(--use-panel-pad) var(--space-xxl) 0 var(--use-panel-pad);
        background: var(--color-surface);

        & h2 {
            margin: 0;
        }
    }

    /* Live's #bbb separator: a 4px band (dashed top edge) under a 26px panel */
    & .use-page__rule {
        position: relative;
        z-index: 1;
        height: var(--use-rule-height);
        margin-bottom: var(--border-hairline);
        background: var(--color-surface);

        &::after {
            content: "";
            position: absolute;
            inset: 100% 0 auto;
            border-top: var(--border-hairline) dashed var(--color-neutral);
            border-bottom: var(--separator-band) solid var(--color-neutral);
        }
    }

    /* Top padding varies per page on live (15 or 20px): set from the content data */
    & .use-page__benefits {
        padding: var(--benefits-pad-top, var(--space-xl)) var(--use-panel-pad) var(--space-xxl);
        background: var(--color-surface);
    }

    /* Sidebar separators: a 3px white band; only the dashed top edge of
       live's line shows (the next block paints over the rest). */
    & .use-page__hairline {
        position: relative;
        height: var(--use-hairline);
        background: var(--color-surface);

        &::after {
            content: "";
            position: absolute;
            inset: var(--use-hairline-offset) 0 auto;
            border-top: var(--border-hairline) dashed var(--color-rule-light);
        }
    }

    & .use-page__space {
        height: var(--use-space);
    }

    @media (width >= 62em) {
        grid-template-columns: calc(66.6667% - var(--use-col-gap) / 3) 1fr;
        column-gap: var(--use-col-gap);
    }
}

/* .use-video: "Installation Video" (YouTube, youtube-nocookie) ----------- */
.use-video {
    & .use-video__head {
        padding: var(--use-panel-pad) var(--space-xxl) var(--space-xxl) var(--use-panel-pad);
        background: var(--color-surface);

        & h2 {
            margin: 0;
        }
    }

    & .use-video__frame {
        position: relative;
        aspect-ratio: 16 / 9;
        background: var(--color-surface);
        container-type: inline-size;   /* .youtube follows the player's own size steps */

        & iframe {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            border: 0;
        }
    }
}

/* .use-detail: sidebar icon blocks (live .two-col-icon .detail) ---------- */
.use-detail {
    background: var(--color-surface);

    & .use-detail__text {
        position: relative;
        padding: var(--use-detail-pad-top) var(--space-xxl) var(--panel-pad) var(--use-panel-pad);

        /* Green Font Awesome icon (info 2.6em, doc/quote 2.4em) */
        &::before {
            content: "";
            position: absolute;
            top: var(--use-detail-icon-top);
            left: var(--use-panel-pad);
            width: var(--glyph-width, 0.857143em);
            height: 1em;
            font-size: 2.4em;
            background-color: var(--color-brand);
            mask: var(--glyph) no-repeat 0 0 / 100% 100%;
        }

        & a {
            text-decoration: underline;       /* links in text not by colour alone (D23) */
        }
    }

    &.use-detail--info .use-detail__text::before {
        --glyph: var(--icon-info-circle);
        font-size: 2.6em;
    }

    &.use-detail--doc .use-detail__text::before {
        --glyph: var(--icon-file-pdf-o);
    }

    &.use-detail--quote .use-detail__text::before {
        --glyph: var(--icon-comments);
        --glyph-width: 1em;
    }

    &.use-detail--has-grid .use-detail__text {
        padding-bottom: 0;
    }

    & h3 {
        margin: 0;
        font-size: 1.05em;
        line-height: 120%;
        letter-spacing: 0;
    }

    & p {
        margin: 0;
        padding-top: var(--tick-gap);
        font-size: 0.95em;
        line-height: 135%;
    }

    & a {
        color: var(--color-link);
    }

    & .image-grid {
        padding: var(--space-xxl) var(--use-panel-pad);
    }
}

/* .image-grid: thumbnails that open the lightbox (live WPBakery image grid) */
.image-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    list-style: none;

    & .image-grid__item {
        position: relative;
        width: var(--grid-item);
        margin: 0 var(--grid-gap) var(--grid-gap) 0;
        background: var(--color-surface);
        box-shadow: var(--shadow-grid);
    }

    & .image-grid__link {
        position: relative;
        display: block;
        transition: all var(--duration-fast) ease-in-out;

        &:hover {
            opacity: 0.5;
        }

        /* Orange zoom badge, bottom right (live: FA search-plus) */
        &::before,
        &::after {
            content: "";
            position: absolute;
            right: 0;
            bottom: 0;
            z-index: 100;
            width: var(--grid-badge);
            height: var(--grid-badge);
        }

        &::before {
            background: var(--color-accent);
        }

        &::after {
            font-size: var(--fs-xs);
            background: var(--color-neutral-lightest);
            mask: var(--icon-search-plus) no-repeat var(--grid-badge-pad) var(--grid-badge-pad) / 0.928571em 1em;
        }
    }

    & .image-grid__image {
        width: 100%;
    }
}

/* .page-title--archive: /news/ and the category page (live .archive h1) --- */
.page-title--archive {
    display: block;
    margin: 0;

    /* Live's global h1 bottom margin (0 / 20 / 15px), plus 25px padding */
    & h1 {
        margin-block-end: 0;
        padding-bottom: var(--space-3xl);

        @media (width >= 30em) {
            margin-block-end: var(--space-xxl);
        }

        @media (width >= 75em) {
            margin-block-end: var(--space-xl);
        }
    }
}

/* .news-grid / .news-card: archive cards (live #masonry-wrap .post) ------- */
.news-grid {
    display: grid;
    align-items: start;
    margin: 0 calc(var(--news-gap) * -1);

    @media (width >= 48em) {
        grid-template-columns: repeat(2, 1fr);
    }

    @media (width >= 62em) {
        grid-template-columns: repeat(4, 1fr);
    }
}

.news-card {
    margin-bottom: var(--news-card-gap);
    padding: 0 var(--news-gap);

    & .news-card__thumb img {
        width: 100%;
    }

    & .news-card__inner {
        padding: var(--space-xxs) var(--space-xxl) var(--space-3xl);
        background: var(--color-surface);
    }

    & .news-card__title {
        & a {
            color: var(--color-link);
        }
    }

    & .news-card__excerpt {
        font-size: 0.95em;
        line-height: 140%;
    }

    & .news-card__link {
        margin-bottom: var(--space-m);

        & a {
            display: inline-block;
            padding: var(--button-s-pad-block) var(--space-xxl);
            background: var(--color-neutral-lighter);
            border-radius: var(--radius-pill);
            color: var(--color-link);
            font-weight: var(--fw-regular);

            &:hover {
                background: var(--color-accent);
                color: var(--color-neutral-lightest);
            }
        }
    }

    & .news-card__meta {
        padding-top: var(--space-m);
        color: var(--color-heading);

        &::before {
            content: "";
            display: block;
            width: var(--news-meta-rule);
            height: var(--news-meta-rule-height);
            margin-bottom: var(--space-m);
            background: var(--color-rule-faint);
        }

        & p {
            margin: 0;
            font-size: var(--fs-xxs);
            line-height: 130%;
        }

        & span {
            font-weight: var(--fw-semibold);
        }
    }
}

/* .post-layout / .post: the news article (live .article) ------------------ */
.post-layout {
    display: grid;
    align-items: start;

    & .post-layout__aside {
        padding-top: var(--space-xxl);
    }

    @media (width >= 48em) {
        & .post-layout__aside {
            padding-left: var(--space-xl);
        }
    }

    @media (width >= 62em) {
        grid-template-columns: calc(75% - var(--space-xs) * 1.875) 1fr;
        column-gap: var(--post-side-gap);

        & .post-layout__aside {
            padding-left: 0;
        }
    }
}

.post {
    padding: var(--space-4xl);
    background: var(--color-surface);

    & .post__title {
        color: var(--color-link);
        text-align: start;

        &::after {
            display: none;
        }
    }

    & .post__meta {
        margin-bottom: var(--space-xxl);
        padding-top: var(--space-m);
        border-block: var(--border-hairline) dashed var(--color-neutral);
        color: var(--color-heading);
        font-size: var(--fs-xs);

        & p {
            margin-bottom: var(--space-l);
        }

        & span {
            font-weight: var(--fw-semibold);
        }
    }

    & .post__thumb {
        margin-bottom: var(--panel-pad);

        & img {
            width: 100%;
        }
    }

    & .post__body a {
        color: var(--color-link);
        text-decoration: underline;           /* D23 */
    }
}

/* .share: plain share links with AddToAny's look (D19: no script) --------- */
.share {
    margin-top: var(--space-5xl);
    padding-top: var(--space-4xl);

    & .share__header {
        margin: 0 0 1rem;
        color: var(--color-neutral-darkest);
        font-size: var(--fs-xxs);
        font-weight: var(--fw-semibold);
        text-transform: uppercase;
    }

    & .share__links {
        line-height: var(--share-size);
    }

    & .share__link {
        display: inline-block;
        padding: 0 var(--share-gap);
        font-size: var(--share-size);
        line-height: var(--share-size);
        vertical-align: middle;

        &:hover {
            opacity: 0.75;
        }
    }

    & .share__icon {
        display: inline-block;
        width: var(--share-size);
        height: var(--share-size);
        border-radius: var(--radius-s);
        vertical-align: baseline;
    }
}

/* .widget: sidebar "Categories" (live widget_categories) ------------------- */
.widget {
    margin-bottom: var(--widget-gap);

    & .widget__title {
        margin-bottom: var(--tick-gap);
        padding-bottom: var(--button-s-pad-block);
        border-bottom: var(--border-hairline) dashed var(--color-neutral);
        font-size: var(--fs-s);
    }

    & .widget__list {
        padding: 0;
        list-style: none;
    }

    & .widget__item {
        padding: var(--button-s-pad-block) 0;
        border-bottom: var(--border-hairline) dashed var(--color-neutral);
        font-weight: var(--fw-regular);

        & a {
            color: var(--color-link);
        }
    }
}

/* .page-title--text: H1 in a WPBakery text column (default 35px gap) ------ */
.page-title--text {
    display: block;
    margin-block-end: var(--section-gap);
}

/* .prose: verbatim text blocks (legal pages, form intros) ---------------- */
.prose {
    margin-bottom: var(--section-gap);   /* live WPBakery text column */

    /* Live: base.css zeroes list padding; theme .content li indents 17px */
    & ul {
        padding: 0;
    }

    & li {
        margin-inline-start: var(--tick-indent);
        padding-bottom: var(--space-m);
    }

    & a {
        color: var(--color-accent-on-grey);   /* links sit on the page grey (D22) */
        text-decoration: underline;           /* links in text not by colour alone (D23) */
    }

    & h3 {
        margin-top: var(--space-xxl);
    }

    & > :last-child {
        margin-bottom: 0;
    }
}

/* .cookie-table: the approved cookie list on /cookies-policy/ (D21i) ------ */
.cookie-table {
    & .cookie-table__table {
        width: 100%;
        margin-bottom: var(--space-3xl);
        border-collapse: collapse;
        text-align: start;
    }

    & th,
    & td {
        padding: var(--space-s) var(--space-l) var(--space-s) 0;
        border-bottom: var(--border-hairline) dashed var(--color-neutral);
        text-align: start;
        vertical-align: top;
    }

    & th {
        color: var(--color-heading);
        font-weight: var(--fw-semibold);
    }

    & code {
        font-family: inherit;
        font-weight: var(--fw-regular);
    }
}

/* .accent: live's inline orange spans in copy (H1s, sidebar headings) ----- */
.accent {
    color: var(--color-accent);
}

/* Orange text on the page grey uses the AA shade (D22) */
.page-title .accent,
.form-page__side .accent {
    color: var(--color-accent-on-grey);
}

/* .consent: cookie banner (task 1.7, D8/D21h). Fixed, so no layout shift;
   shown by its inline script. Don't set display on .consent itself, or the
   [hidden] attribute stops hiding it. */
.consent {
    position: fixed;
    inset: auto 0 0;
    z-index: var(--consent-z);
    background: var(--consent-bg);
    border-top: var(--border-hairline) solid var(--consent-border);
    box-shadow: var(--consent-shadow);
    color: var(--consent-text);
    font-size: var(--fs-xs);

    & .consent__inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: var(--space-l) var(--space-xxl);
        max-width: var(--container-max);
        margin-inline: auto;
        padding: var(--space-xl) var(--container-gutter);
    }

    & .consent__text {
        flex: 1 1 30rem;
        margin: 0;

        &:focus {
            outline: none;
        }

        & a {
            color: inherit;
            text-decoration: underline;
        }
    }

    & .consent__actions {
        display: flex;
        gap: var(--space-m);
    }

    /* Accept and Reject: identical style and size (equal weight) */
    & .consent__button {
        min-width: var(--consent-button-min);
        padding: var(--space-m) var(--space-xxl);
        background: var(--consent-button-bg);
        border: var(--border-hairline) solid var(--consent-button-bg);
        border-radius: var(--radius-s);
        color: var(--consent-button-text);
        font-family: var(--font-heading);
        font-size: var(--fs-s);
        font-weight: var(--fw-semibold);
        line-height: 1.2;
        cursor: pointer;
        transition: background-color var(--duration-fast) ease-in-out;

        &:hover {
            background: var(--consent-button-hover);
        }

        &:focus-visible {
            outline: 2px solid var(--consent-button-bg);
            outline-offset: 2px;
        }
    }

    /* Desktop/tablet (D23): a card in the bottom-right corner, copy above
       two equal buttons. Below 48em it stays the full-width bottom bar. */
    @media (width >= 48em) {
        inset: auto var(--consent-card-offset) var(--consent-card-offset) auto;
        width: min(var(--consent-card-width), calc(100vw - 2 * var(--consent-card-offset)));
        border: var(--border-hairline) solid var(--consent-border);
        border-radius: var(--radius-s);
        box-shadow: var(--consent-card-shadow);

        & .consent__inner {
            flex-direction: column;
            align-items: stretch;
            gap: var(--space-xl);
            max-width: none;
            padding: var(--consent-card-pad);
        }

        & .consent__text {
            flex: none;
        }

        & .consent__button {
            flex: 1 1 0;
            min-width: 0;
        }
    }

    /* Where the side tabs show (> 64em) and the window is too short for
       the card to sit below them (tabs end 473px down), it moves left of
       the tabs' strip instead, so it never covers Buy Now or Get A Quote
       (nudge included). */
    @media (width > 64em) and (height < 43.75em) {
        right: var(--consent-tabs-clear);
    }
}

