/* ─── Back-to-top button ─── */
    .mod-totop {
        position: fixed; right: 18px; bottom: 18px;
        width: 44px; height: 44px;
        display: none; align-items: center; justify-content: center;
        background: var(--mod-primary); color: #fff;
        border: 0; border-radius: 50%;
        box-shadow: 0 6px 16px rgba(0,0,0,.18);
        cursor: pointer; z-index: 9000;
        transition: transform .2s ease, background .2s ease;
        text-decoration: none;
        font-family: var(--mod-font-body);
    }
    .mod-totop:hover { background: var(--mod-primary-strong); transform: translateY(-3px); }
    .mod-totop.is-visible { display: inline-flex; }
    .mod-totop::before {
        content: ''; width: 12px; height: 12px;
        border-top: 2px solid #fff; border-left: 2px solid #fff;
        transform: rotate(45deg); margin-top: 4px;
    }
    @media print { .mod-totop { display: none !important; } }
    /* (980px bottom-offset removed 2026-06 — the floating "Get a Quote" pill it
       cleared no longer exists; the circle sits at its native corner again.) */

    /* ─── Sticky header polish (Divi already does position:fixed, this adds
            a soft shadow once you've scrolled past the top) ─── */
    #main-header.mod-stuck {
        box-shadow: 0 6px 24px rgba(0,0,0,.08);
    }

    /* Divi's search glyph was inside an 18px-wide, zero-height toggle. Give
       its actual button a 44px hitbox, keeping the glyph and adjacent nav in
       their existing positions with compensating margins. */
    body.et_header_style_left #main-header #et_top_search {
        width: 44px;
        height: 44px;
        margin: -13px -13px 0 9px;
        cursor: pointer;
    }
    body.et_header_style_left #main-header #et_search_icon {
        display: block;
        width: 100%;
        height: 100%;
    }
    body.et_header_style_left #main-header #et_search_icon::before {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
    }
    @media (max-width: 980px) {
        body.et_header_style_left #main-header #et_top_search {
            margin: -6px 22px 0 -13px;
        }
    }

    /* ─── Gallery lightbox (used by project galleries + any WP gallery) ─── */
    .mod-lightbox {
        position: fixed; inset: 0;
        background: rgba(0,0,0,.92);
        display: none; align-items: center; justify-content: center;
        z-index: 99999;
        animation: modlb-fade .18s ease-out;
    }
    .mod-lightbox.is-open { display: flex; }
    @keyframes modlb-fade { from { opacity: 0; } to { opacity: 1; } }
    .mod-lightbox__img {
        max-width: 92vw; max-height: 88vh;
        object-fit: contain;
        box-shadow: 0 24px 60px rgba(0,0,0,.45);
        border-radius: 4px;
    }
    .mod-lightbox__btn {
        position: absolute;
        background: rgba(26,41,32,.92); color: #fff;
        border: 1px solid rgba(255,255,255,.7); border-radius: 50%;
        box-sizing: border-box;
        width: 48px; height: 48px;
        display: inline-flex; align-items: center; justify-content: center;
        font-size: 22px; cursor: pointer;
        transition: background .15s ease;
        font-family: inherit;
    }
    .mod-lightbox__btn:hover { background: #1a2920; }
    .mod-lightbox__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
    .mod-lightbox__close { top: 18px; right: 18px; }
    .mod-lightbox__prev  { left: 18px; top: 50%; transform: translateY(-50%); }
    .mod-lightbox__next  { right: 18px; top: 50%; transform: translateY(-50%); }
    .mod-lightbox__caption {
        position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
        color: rgba(255,255,255,.85); font-size: 13px; letter-spacing: .04em;
        font-family: var(--mod-font-body);
        background: rgba(0,0,0,.4); padding: 6px 14px; border-radius: 20px;
    }
    @media (max-width: 640px) {
        .mod-lightbox__btn { width: 44px; height: 44px; font-size: 18px; }
        .mod-lightbox__close { top: 12px; right: 12px; }
        .mod-lightbox__prev { left: 8px; }
        .mod-lightbox__next { right: 8px; }
    }

    /* ─── Make gallery thumbs feel clickable ───
       (portfolio cards removed 2026-06: they navigate to case studies, not the
        lightbox, so the zoom-in cursor was misleading) */
    .gallery-icon a, .et_pb_gallery_item a {
        cursor: zoom-in;
    }

    /* ─── Custom 404 (re-tokened 2026-06 — was the pre-modernize palette) ─── */
    .mod-404 {
        text-align: center;
        padding: 80px 20px 100px;
        font-family: var(--mod-font-body);
        background: var(--mod-bg);
    }
    .mod-404__code {
        font-size: clamp(72px, 14vw, 160px);
        font-weight: 700;
        color: var(--mod-primary);
        font-family: var(--mod-font-display);
        line-height: 1; margin: 0 0 12px;
        letter-spacing: -.04em;
    }
    .mod-404__title {
        font-size: clamp(22px, 3.4vw, 32px);
        font-family: var(--mod-font-display);
        margin: 0 0 14px; color: var(--mod-ink); font-weight: 600;
    }
    .mod-404__sub {
        margin: 0 auto 36px; max-width: 560px;
        color: var(--mod-ink-muted); line-height: 1.55; font-size: 16px;
    }
    .mod-404__grid {
        /* centered flex, not a grid: with 5 tiles the remainder row stays centered
           at every width instead of leaving an orphan cell (design pass 2026-07) */
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        max-width: 720px; margin: 0 auto;
    }
    .mod-404__tile { flex: 0 1 168px; }
    .mod-404__tile {
        display: block;
        padding: 18px 16px;
        background: var(--mod-surface); border: 1px solid var(--mod-line);
        border-radius: 6px;
        text-decoration: none;
        color: var(--mod-ink);
        font-size: 14px; letter-spacing: .04em;
        transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    }
    .mod-404__tile:hover {
        transform: translateY(-2px);
        border-color: var(--mod-primary);
        box-shadow: 0 8px 18px rgba(45, 106, 79, .18);
    }
    .mod-404__tile strong { display: block; color: var(--mod-primary); font-size: 13px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 4px; font-weight: 700; }

    /* ─── Privacy Policy: long-form reading measure + stepped-down headings
           (full-width layout left ~1080px lines and h2s that shouted — design
           pass 2026-07) ─── */
    body.privacy-policy #left-area {
        float: none;
        width: 100%;
        max-width: 72ch;
        margin: 0 auto;
    }
    body.privacy-policy h1.entry-title { font-size: clamp(34px, 4vw, 46px); margin-bottom: 12px; }
    body.privacy-policy .entry-content h2 {
        font-size: clamp(22px, 2.2vw, 28px);
        line-height: 1.25;
        margin: 2em 0 .5em;
    }
    body.privacy-policy .entry-content p,
    body.privacy-policy .entry-content li { font-size: 16px; line-height: 1.75; }
    @media (prefers-reduced-motion: reduce) {
        .mod-totop,
        .mod-lightbox,
        .mod-lightbox__btn,
        .mod-404__tile,
        .mod-404__search button,
        .mod-search__submit {
            transition: none;
            animation: none;
        }
        .mod-totop:hover,
        .mod-404__tile:hover,
        .mod-404__search button:hover,
        .mod-search__submit:hover { transform: none; }
    }
