/* ==========================================================================
   Service detail pages
   One stylesheet shared by all eight service pages. Each page keeps its own
   class prefix in the markup, so the selectors below are grouped by prefix.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero — the header overlays it, the photograph fills it, and the title sits
   at the foot of the frame rather than floating in the middle.
   -------------------------------------------------------------------------- */

.construction-hero,
.electrical-hero,
.equipment-hero,
.extralow-hero,
.instrumentation-hero,
.mechanical-hero,
.piping-hero,
.structural-hero {
    position: relative;
    min-height: clamp(440px, 64vh, 660px);
    overflow: hidden;
    background-color: var(--ink);
}

.construction-banner,
.electrical-banner,
.equipment-banner,
.extralow-banner,
.instrumentation-banner,
.mechanical-banner,
.piping-banner,
.structural-banner {
    position: absolute;
    inset: 0;
}

.construction-banner img,
.electrical-banner img,
.equipment-banner img,
.extralow-banner img,
.instrumentation-banner img,
.mechanical-banner img,
.piping-banner img,
.structural-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Light at the top so the photograph reads behind the transparent header,
   heavy at the foot where the title sits. */
.construction-overlay,
.electrical-overlay,
.equipment-overlay,
.extralow-overlay,
.instrumentation-overlay,
.mechanical-overlay,
.piping-overlay,
.structural-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding-block: calc(var(--header-h) + var(--space-12)) clamp(40px, 6vw, 76px);
    background: linear-gradient(180deg,
        rgba(10, 12, 16, 0.58) 0%,
        rgba(10, 12, 16, 0.22) 38%,
        rgba(10, 12, 16, 0.86) 100%);
}

.construction-overlay > .container,
.electrical-overlay > .container,
.equipment-overlay > .container,
.extralow-overlay > .container,
.instrumentation-overlay > .container,
.mechanical-overlay > .container,
.piping-overlay > .container,
.structural-overlay > .container {
    width: 100%;
}

.construction-title,
.electrical-title,
.equipment-title,
.extralow-title,
.instrumentation-title,
.mechanical-title,
.piping-title,
.structural-title {
    max-width: none;
    margin: 0;
    padding: 0;
    text-align: left;
    color: #fff;
}

.construction-title h1,
.electrical-title h1,
.equipment-title h1,
.extralow-title h1,
.instrumentation-title h1,
.mechanical-title h1,
.piping-title h1,
.structural-title h1 {
    max-width: 17ch;
    margin: 0 0 var(--space-6);
    font-size: clamp(2.25rem, 1.4rem + 3.4vw, 4rem);
    line-height: 1.05;
    color: #fff;
}

/* The accent rule above the standfirst is the same device the section
   mastheads use further down the page. */
.construction-title p,
.electrical-title p,
.equipment-title p,
.extralow-title p,
.instrumentation-title p,
.mechanical-title p,
.piping-title p,
.structural-title p {
    display: inline-block;
    max-width: 46ch;
    margin: 0;
    padding-top: var(--space-5);
    border-top: 2px solid var(--primary-color);
    color: rgba(255, 255, 255, 0.86);
    font-size: var(--text-lg);
    line-height: var(--leading-snug);
}

/* --------------------------------------------------------------------------
   Body
   -------------------------------------------------------------------------- */

.construction-services,
.electrical-services,
.equipment-services,
.extralow-services,
.instrumentation-services,
.mechanical-services,
.piping-services,
.structural-services {
    position: relative;
    padding-block: clamp(64px, 8vw, 112px) 0;
    background-color: var(--surface-subtle);
}

/* The page supplies --section-bg. Desaturating and flattening the photograph
   lets it read as a visible backdrop while keeping enough contrast under the
   copy. */
.construction-services::before,
.electrical-services::before,
.equipment-services::before,
.extralow-services::before,
.instrumentation-services::before,
.mechanical-services::before,
.piping-services::before,
.structural-services::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--section-bg, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: grayscale(1) contrast(0.8) brightness(1.05);
    opacity: 0.09;
    pointer-events: none;
}

.construction-services > .container,
.electrical-services > .container,
.equipment-services > .container,
.extralow-services > .container,
.instrumentation-services > .container,
.mechanical-services > .container,
.piping-services > .container,
.structural-services > .container {
    position: relative;
    z-index: 1;
}

/* Section masthead comes from `.section-head` in the design system; the
   heading is set larger here because it opens the page's main content. */
.service-intro > h2 {
    font-size: clamp(1.875rem, 1.35rem + 2.2vw, 2.875rem);
}

.service-intro > p {
    font-size: var(--text-lg);
}

/* Scope of work ------------------------------------------------------------
   A ruled schedule: index numeral, discipline, then what it covers.
   -------------------------------------------------------------------------- */

.services-wrapper {
    display: block;
    margin: 0;
    counter-reset: service;
    border-bottom: 1px solid var(--line);
}

.service-detail {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(170px, 250px) minmax(0, 1fr);
    gap: var(--space-3) clamp(20px, 3vw, 48px);
    margin: 0;
    padding: clamp(24px, 3vw, 40px) 0;
    counter-increment: service;
    border-top: 1px solid var(--line);
    transition: background-color var(--dur) var(--ease);
}

.service-detail:hover {
    background-color: rgba(255, 255, 255, 0.55);
}

/* The pseudo-element is a grid item, so the numeral takes the first column.
   Set large and pale, it indexes the schedule without competing with the
   headings. */
.service-detail::before {
    content: counter(service, decimal-leading-zero);
    color: var(--line-strong);
    font-size: clamp(1.5rem, 1.15rem + 1vw, 2.125rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    transition: color var(--dur) var(--ease);
}

.service-detail:hover::before {
    color: var(--primary-color);
}

.service-detail h3 {
    margin: 0;
    font-size: var(--text-lg);
    line-height: var(--leading-snug);
    color: var(--ink);
}

.service-detail p {
    max-width: 72ch;
    margin: 0;
    padding: 0;
    color: var(--body);
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
}

/* Decorative disc left over in the original markup. It added colour without
   meaning, so it is hidden rather than removed from every template. */
.service-icon-bg {
    display: none;
}

/* Project gallery ----------------------------------------------------------
   Full-bleed and asymmetric: one lead frame with two stacked beside it. All
   eight pages carry exactly three images, so the composition is consistent.
   `50%` resolves against the container's content box, so the strip centres on
   the viewport; the half-scrollbar overhang is clipped by
   `body { overflow-x: hidden }`.
   -------------------------------------------------------------------------- */

.projects-section {
    margin-top: clamp(48px, 6vw, 88px);
    padding-top: clamp(40px, 5vw, 64px);
    border-top: 1px solid var(--line);
}

.projects-section .section-title {
    margin-bottom: var(--space-4);
}

.section-subtitle {
    max-width: 62ch;
    margin: 0 auto var(--space-10);
    text-align: center;
    color: var(--muted);
    font-size: var(--text-md);
    line-height: var(--leading-normal);
}

.construction-gallery,
.electrical-gallery,
.equipment-gallery,
.extralow-gallery,
.instrumentation-gallery,
.mechanical-gallery,
.piping-gallery,
.structural-gallery {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 2px;
    height: clamp(420px, 46vw, 640px);
    width: 100vw;
    margin: clamp(32px, 4vw, 56px) 0 0;
    margin-inline: calc(50% - 50vw);
}

.gallery-item {
    position: relative;
    height: auto;
    overflow: hidden;
    border: none;
    border-radius: 0;
    background-color: var(--surface-sunken);
}

.gallery-item:first-child {
    grid-row: 1 / span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--ease);
}

.gallery-item:hover img {
    transform: scale(1.04);
}

/* Closing call to action ---------------------------------------------------
   Full-bleed light band, laid out on the same two-column rhythm as the
   mastheads: heading left, supporting copy and actions right. A hairline
   at each edge separates it from the white page above and the footer below.
   -------------------------------------------------------------------------- */

.cta-section {
    width: 100vw;
    margin-block: clamp(56px, 7vw, 96px) 0;
    margin-inline: calc(50% - 50vw);
    padding: clamp(56px, 7vw, 104px) var(--gutter);
    text-align: left;
    background-color: var(--surface-sunken);
    border-top: 1px solid var(--line);
    border-radius: 0;
    color: var(--body);
}

.cta-content {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(0, 1.05fr);
    gap: clamp(24px, 4vw, 72px);
    align-items: start;
    max-width: calc(var(--container-max) - 2 * var(--gutter));
    margin-inline: auto;
    padding-top: clamp(28px, 3vw, 40px);
    border-top: 2px solid var(--primary-color);
}

.cta-content h3 {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.625rem);
    line-height: var(--leading-tight);
    color: var(--ink);
}

.cta-content p {
    grid-column: 2;
    grid-row: 1;
    max-width: 52ch;
    margin: 0;
    font-size: var(--text-md);
    line-height: var(--leading-normal);
}

.cta-buttons {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-8);
}

.cta-section .cta-button.primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.cta-section .cta-button.primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Outlined against a light ground now, so the border and label take the
   neutral tokens rather than translucent white. */
.cta-section .cta-button.secondary {
    background-color: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.cta-section .cta-button.secondary:hover {
    background-color: var(--surface);
    border-color: var(--ink);
    color: var(--ink);
}

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

@media (max-width: 1024px) {
    .construction-gallery,
.electrical-gallery,
.equipment-gallery,
.extralow-gallery,
.instrumentation-gallery,
.mechanical-gallery,
.piping-gallery,
.structural-gallery {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: repeat(3, minmax(0, 1fr));
        height: clamp(520px, 78vw, 720px);
    }

    .gallery-item:first-child {
        grid-column: 1 / span 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 860px) {
    /* Each row becomes numeral, then title over description. */
    .service-detail {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: var(--space-2) var(--space-4);
        padding-block: var(--space-6);
    }

    .service-detail h3,
    .service-detail p {
        grid-column: 2;
    }

    .cta-content {
        grid-template-columns: 1fr;
        gap: var(--space-5);
    }

    .cta-content h3,
    .cta-content p,
    .cta-buttons {
        grid-column: 1;
    }

    .cta-content h3 { grid-row: 1; }
    .cta-content p { grid-row: 2; }
    .cta-buttons { grid-row: 3; margin-top: var(--space-6); }
}

@media (max-width: 700px) {
    .construction-hero,
.electrical-hero,
.equipment-hero,
.extralow-hero,
.instrumentation-hero,
.mechanical-hero,
.piping-hero,
.structural-hero {
        min-height: clamp(360px, 72vh, 520px);
    }

    .construction-title,
.electrical-title,
.equipment-title,
.extralow-title,
.instrumentation-title,
.mechanical-title,
.piping-title,
.structural-title {
        max-width: none;
    }

    .construction-gallery,
.electrical-gallery,
.equipment-gallery,
.extralow-gallery,
.instrumentation-gallery,
.mechanical-gallery,
.piping-gallery,
.structural-gallery {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, minmax(0, 1fr));
        height: auto;
    }

    .gallery-item {
        height: clamp(220px, 56vw, 300px);
    }

    .gallery-item:first-child {
        grid-column: 1;
        grid-row: auto;
        height: clamp(260px, 64vw, 340px);
    }

    .cta-buttons .cta-button {
        width: 100%;
    }
}
