/* ================================================================
 *  custom.css - D&Z site overrides
 * ================================================================ */

/* Home hero: keep the photo under a dark scrim (stage:after was behind the image) */
.custom-hero-stage > .absolute.inset-0:has(.custom-hero-img) {
    z-index: 0;
}

.custom-hero-stage:after {
    z-index: 1;
    background:
        linear-gradient(
            to top,
            color-mix(in srgb, var(--custom-ink, #141414) 92%, transparent) 0%,
            color-mix(in srgb, var(--custom-ink, #141414) 72%, transparent) 42%,
            color-mix(in srgb, var(--custom-ink, #141414) 45%, transparent) 100%
        ),
        linear-gradient(
            to right,
            color-mix(in srgb, var(--custom-ink, #141414) 55%, transparent) 0%,
            transparent 62%
        );
}

.custom-hero-stage > .custom-hero-copy {
    z-index: 2;
}

/* Inner-page photo heroes: stronger full-bleed darken */
.custom-ph-stage > .custom-hero-img + .absolute.inset-0,
.custom-ph-stage > [class*='bg-gradient'] {
    background:
        linear-gradient(
            to top,
            color-mix(in srgb, var(--custom-ink, #141414) 92%, transparent) 0%,
            color-mix(in srgb, var(--custom-ink, #141414) 68%, transparent) 48%,
            color-mix(in srgb, var(--custom-ink, #141414) 42%, transparent) 100%
        ) !important;
}

/* Home hero: content-height on desktop (no full-viewport empty band above copy) */
.custom-hero {
    min-height: 0 !important;
}

.custom-hero-stage {
    min-height: max(22rem, min(62svh, 32rem)) !important;
}

@media (width >= 64rem) {
    #cn-hero.custom-hero {
        min-height: min(58svh, 34rem) !important;
    }

    #cn-hero .custom-hero-stage {
        min-height: 0 !important;
        justify-content: center !important;
    }

    #cn-hero .custom-hero-copy {
        padding-top: clamp(1.5rem, 1rem + 1vw, 2.25rem) !important;
        padding-bottom: clamp(1.5rem, 1rem + 1vw, 2.25rem) !important;
    }

    #cn-hero .custom-hero-column > div:not(.cn-ct-form-anchor) {
        justify-content: center !important;
        padding-top: clamp(1.5rem, 1rem + 1vw, 2.25rem) !important;
        padding-bottom: clamp(1.5rem, 1rem + 1vw, 2.25rem) !important;
        gap: 1.75rem !important;
    }

    .custom-ph-stage {
        min-height: max(28rem, calc(100svh - var(--header-h, 4.5rem))) !important;
    }
}

/* Page + home headers: more room under title / in the accent column */
.custom-ph .custom-hero-copy,
.custom-hero .custom-hero-copy {
    padding-bottom: clamp(2.75rem, 2rem + 2.5vw, 4.5rem);
}

.custom-ph .custom-hero-column > div:not(.cn-ct-form-anchor),
.custom-hero .custom-hero-column > div:not(.cn-ct-form-anchor) {
    padding-bottom: clamp(2.75rem, 2rem + 2vw, 4.25rem);
}

/* Fixed solid header - stays flush to the viewport (Lenis breaks sticky) */
.site-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: var(--z-sticky, 50);
    background: #fff !important;
    border-bottom: 1px solid color-mix(in srgb, var(--custom-ink, #141414) 10%, transparent);
    box-shadow: none !important;
    transform: none !important;
}

/* Reserve the bar height so page content is not hidden underneath */
body {
    padding-top: var(--header-h, 4.5rem);
}

.site-header.scrolled {
    box-shadow:
        0 1px 0 color-mix(in srgb, var(--custom-ink, #141414) 8%, transparent),
        0 12px 32px -24px color-mix(in srgb, var(--custom-ink, #141414) 40%, transparent) !important;
}

/* Mobile header Contact - template hides .nav-actions .btn under 1024px */
.site-header .custom-header-contact {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding-inline: 0.95rem;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

@media (width <= 1023px) {
    .site-header .nav-actions .custom-header-contact {
        display: inline-flex !important;
    }
}

/* Above-the-fold hero: paint immediately (data-anim starts at opacity:0 until IO) */
.custom-hero-copy [data-anim],
.custom-ph-stage .custom-hero-copy [data-anim],
.custom-contact-form-col [data-anim] {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
}

.site-header .brand {
    color: var(--color-primary-ink);
}

.site-header .nav-link {
    color: var(--color-dark);
}

.site-header .hamburger {
    color: var(--color-dark);
}

/* Drop header Free Estimate - it sits on the orange column and fights the copy */
.site-header .custom-nav-action {
    display: none !important;
}

/* Accent / quick-facts column: bigger type so it matches the photo header */
.custom-hero-column:not(.custom-contact-form-col) .eyebrow {
    font-size: 0.8125rem;
    letter-spacing: 0.12em;
}

.custom-hero-column:not(.custom-contact-form-col) h2 {
    font-size: clamp(2.25rem, 1.4rem + 2.4vw, 3.25rem) !important;
    line-height: 1.05 !important;
}

/* Contact: form beside the photo stage (precompiled Tailwind lacks wider arbitrary cols) */
@media (width >= 64rem) {
    .custom-ph--contact {
        grid-template-columns: minmax(0, 1fr) minmax(24rem, 40%) !important;
    }
}

.custom-contact-form-col {
    background: var(--color-bg, #fff);
    color: var(--color-dark, #141414);
    box-shadow: -24px 0 48px -36px color-mix(in srgb, var(--custom-ink, #141414) 28%, transparent);
}

/* Form hash target: sit flush under the fixed header (JS also snaps precisely) */
#cn-ct-form.cn-ct-form-anchor,
#cn-ct-form {
    scroll-margin-top: var(--header-h, 4.5rem) !important;
    scroll-margin-bottom: 0 !important;
}

.cn-ct-form-anchor {
    display: block;
    height: 0;
    width: 0;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    pointer-events: none;
}

/* Desktop: tighter top padding above Free Estimate / form */
@media (width >= 64rem) {
    .custom-contact-form-col .custom-contact-form-panel {
        padding-top: 1rem !important; /* was lg:pt-8 (2rem) */
    }
}

/* Empty hash target must not show the theme focus ring (red corner at viewport edge). */
.cn-ct-form-anchor:focus,
.cn-ct-form-anchor:focus-visible {
    outline: none;
}

.custom-contact-form-col .form-label {
    color: color-mix(in srgb, var(--custom-ink, #141414) 72%, transparent);
}

.custom-contact-form-col.custom-hero-column {
    background-image: none;
}

.custom-contact-form-col.custom-hero-column:before {
    display: none;
}

.custom-contact-map {
    min-height: min(22rem, 55svh);
}

.custom-contact-map iframe {
    display: block;
    width: 100%;
    height: min(28rem, 60svh);
    border: 0;
}

.custom-hero-column .custom-project-specs > div {
    padding-block: 1rem;
}

.custom-hero-column .custom-project-specs dt {
    font-size: 1rem;
}

.custom-hero-column .custom-project-specs dd {
    font-size: 1.0625rem;
}

.custom-hero-column ul {
    font-size: 1.0625rem;
    line-height: 1.45;
}

/* Mobile stack: less empty photo, more air in the orange panel */
@media (width < 64rem) {
    .custom-hero {
        min-height: 0 !important;
    }

    .custom-ph-stage {
        min-height: min(20rem, calc(100svh - var(--header-h, 4.5rem) - 12rem)) !important;
    }

    .custom-hero-stage {
        min-height: min(22rem, calc(70svh - var(--header-h, 4.5rem))) !important;
    }

    .custom-ph .custom-hero-copy,
    .custom-hero .custom-hero-copy {
        padding-bottom: 2.75rem !important;
    }

    .custom-ph .custom-hero-column:not(.custom-contact-form-col) > div,
    .custom-hero .custom-hero-column > div {
        justify-content: flex-start;
        gap: 1.85rem !important;
        padding-top: 3rem !important;
        padding-bottom: 3.25rem !important;
    }

    .custom-ph .custom-hero-column ul {
        gap: 1.05rem !important;
    }

    .custom-hero-column:not(.custom-contact-form-col) .eyebrow {
        font-size: 0.875rem;
    }

    .custom-hero-column:not(.custom-contact-form-col) h2 {
        font-size: clamp(2.375rem, 8vw, 3rem) !important;
        margin-top: 1rem !important;
    }

    .custom-hero-column .leading-relaxed {
        font-size: 1.0625rem;
        line-height: 1.55;
    }

    .custom-hero-column .custom-project-specs > div {
        padding-block: 1.05rem;
    }

    .custom-hero-column .custom-project-specs dt,
    .custom-hero-column .custom-project-specs dd {
        font-size: 1.0625rem;
    }

    .custom-contact-form-col .custom-contact-form-panel {
        padding-top: 2.5rem !important;
        padding-bottom: 2.75rem !important;
    }

    .custom-contact-map iframe {
        height: min(22rem, 50svh);
    }
}

/* Service tiles: darker base so titles read on bright job photos */
.custom-tile:after {
    background-image: linear-gradient(
        to top,
        color-mix(in srgb, var(--custom-ink, #141414) 92%, transparent) 0%,
        color-mix(in srgb, var(--custom-ink, #141414) 55%, transparent) 48%,
        color-mix(in srgb, var(--custom-ink, #141414) 28%, transparent) 100%
    );
}

.custom-tile:hover:after,
.custom-tile:focus-visible:after {
    background-color: color-mix(in srgb, var(--custom-ink, #141414) 35%, transparent);
}

/* Outline-light CTAs: white fill by default (more attention), ghost on hover */
.btn-outline-light {
    background: #fff !important;
    border-color: #fff !important;
    color: var(--color-dark, #141414) !important;
}

.btn-outline-light:is(:hover, :focus-visible) {
    background: transparent !important;
    border-color: #fff !important;
    color: #fff !important;
    box-shadow: none !important;
}

/* Dark footer / dark bands: Free Estimate = white default, brand red on hover */
.site-footer .btn-primary[href*='cn-ct-form'],
.site-footer--dark .btn-primary[href*='cn-ct-form'],
.footer-headline .btn-primary[href*='cn-ct-form'],
.nav-panel-cta .btn-primary[href*='cn-ct-form'] {
    background: #fff !important;
    border-color: #fff !important;
    color: var(--color-primary-ink, #b0121a) !important;
}

.site-footer .btn-primary[href*='cn-ct-form']:is(:hover, :focus-visible),
.site-footer--dark .btn-primary[href*='cn-ct-form']:is(:hover, :focus-visible),
.footer-headline .btn-primary[href*='cn-ct-form']:is(:hover, :focus-visible),
.nav-panel-cta .btn-primary[href*='cn-ct-form']:is(:hover, :focus-visible) {
    background: var(--color-primary, #e51922) !important;
    border-color: var(--color-primary, #e51922) !important;
    color: #fff !important;
}

/* Keyword interlinks */
.custom-inline-link {
    color: var(--color-primary-ink, var(--primary-ink, #B0121A));
    text-decoration: underline;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

.custom-inline-link:hover,
.custom-inline-link:focus-visible {
    text-decoration-thickness: 2px;
}

.custom-inline-link--on-dark {
    color: #fff;
    text-decoration-color: color-mix(in srgb, #fff 55%, transparent);
}

.custom-related-list a {
    font-weight: 600;
    line-height: 1.35;
}


/* Services dropdown: room for keyword anchors */
.site-header .nav-cascade > .cascade-panel.custom-menu {
    min-width: 18.5rem;
}

.site-header .nav-cascade > .cascade-panel .cascade-item {
    white-space: normal;
    line-height: 1.3;
}


/* Locations nested town menus */
.site-header .nav-cascade > .cascade-panel.custom-menu .cascade-item--sub > .cascade-panel.custom-menu {
    min-width: 17.5rem;
}
