.gallery-page {
    background: #111;
}

.gallery-hero {
    min-height: 58vh;
    display: flex;
    align-items: flex-end;
    padding: 150px 6% 85px;
    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.94),
            rgba(0, 0, 0, 0.3)
        ),
        url("../images/hero.jpg") center / cover no-repeat;
}

.gallery-hero-content {
    max-width: 800px;
}

.page-label,
.section-label {
    margin-bottom: 14px;
    color: #d62828;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.gallery-hero h2 {
    margin-bottom: 22px;
    font-size: clamp(46px, 7vw, 78px);
    line-height: 1;
}

.gallery-hero p:last-child {
    max-width: 680px;
    color: #d0d0d0;
    font-size: 20px;
    line-height: 1.7;
}

/* Gallery */

.gallery-section {
    padding: 115px 6%;
}

.section-heading {
    max-width: 760px;
    margin: 0 auto 60px;
    text-align: center;
}

.section-heading h2 {
    margin-bottom: 18px;
    font-size: clamp(38px, 5vw, 56px);
}

.section-heading > p:last-child {
    color: #bdbdbd;
    font-size: 18px;
    line-height: 1.7;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 330px;
    gap: 24px;
    max-width: 1450px;
    margin: 0 auto;
}

.gallery-card {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: #1a1a1a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.gallery-card-wide {
    grid-column: span 2;
}

.gallery-card-tall {
    grid-row: span 2;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition:
        transform 0.45s ease,
        filter 0.45s ease;
}

.gallery-card:hover img {
    transform: scale(1.07);
    filter: brightness(0.72);
}

.gallery-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 26px;
    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.88),
            transparent 62%
        );
    text-align: left;
}

.gallery-card-overlay strong {
    margin-bottom: 7px;
    color: white;
    font-size: 23px;
}

.gallery-card-overlay small {
    color: #cfcfcf;
    font-size: 14px;
}

/* Bottom CTA */

.gallery-note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 50px;
    padding: 85px 8%;
    background: #181818;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.gallery-note > div {
    max-width: 760px;
}

.gallery-note h2 {
    margin-bottom: 16px;
    font-size: clamp(34px, 5vw, 52px);
}

.gallery-note p:last-child {
    color: #bdbdbd;
    font-size: 18px;
    line-height: 1.7;
}

.gallery-button {
    flex-shrink: 0;
    padding: 16px 28px;
    color: white;
    background: #d62828;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.gallery-button:hover {
    background: #ef233c;
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(214, 40, 40, 0.25);
}

/* Lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(10px);
}

.lightbox.open {
    display: flex;
}

.lightbox-content {
    max-width: 1100px;
    max-height: 88vh;
    text-align: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 78vh;
    border-radius: 10px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
}

.lightbox-title {
    margin-top: 18px;
    color: white;
    font-size: 20px;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    color: white;
    background: transparent;
    border: none;
    font-size: 48px;
    line-height: 1;
    cursor: pointer;
    transition:
        color 0.2s ease,
        transform 0.2s ease;
}

.lightbox-close:hover {
    color: #ef4444;
    transform: scale(1.08);
}

/* =========================
   INDIVIDUAL IMAGE POSITIONING
========================= */

/* Show more of the lower mechanical components */
.mechanical-work img {
    object-position: center 72%;
}

/* Move the service subject slightly towards the centre */
.routine-service img {
    object-position: 46% 58%;
}

/* Keep the connector and diagram more central */
.electrical-diagnostics img {
    object-position: 60% center;
}

/* Responsive */

@media (max-width: 950px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-card-wide {
        grid-column: span 1;
    }

    .gallery-note {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 650px) {
    .gallery-hero,
    .gallery-section,
    .gallery-note {
        padding-left: 20px;
        padding-right: 20px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 300px;
    }

    .gallery-card-tall {
        grid-row: span 1;
    }

    .lightbox {
        padding: 20px;
    }

    .lightbox-close {
        top: 15px;
        right: 18px;
    }
}