/* Professional gallery page */

.Gallery {
    display: flex;
    width: 100%;
    flex-direction: column;
    background: #f4f6f8;
}

/* Header */

.gallery-hero {
    position: relative;
    display: flex;
    width: 100%;
    min-height: min(70vh, 650px);
    align-items: center;
    padding: calc(76px + clamp(48px, 7vw, 76px)) clamp(24px, 8vw, 112px) clamp(92px, 10vw, 124px);
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(5, 20, 39, 0.96) 0%, rgba(5, 20, 39, 0.88) 46%, rgba(5, 20, 39, 0.58) 76%, rgba(5, 20, 39, 0.38) 100%),
        url("../media/galeria/photo-scania-r500.jpg") 72% 60% / cover no-repeat;
}

.gallery-hero::after {
    content: none;
}

.gallery-hero-content {
    position: relative;
    z-index: 1;
    width: min(680px, 100%);
    color: var(--white);
}

.gallery-hero-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin: 0 0 14px;
    padding: 6px 11px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 3px;
    background: rgba(5, 20, 39, 0.42);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.gallery-hero-header {
    margin: 0;
    color: var(--white);
    font-size: clamp(50px, 7vw, 78px);
    line-height: 1;
    font-weight: 700;
}

.gallery-hero-header::after {
    content: "";
    display: block;
    width: 82px;
    height: 4px;
    margin-top: 18px;
    background: var(--accent);
}

.gallery-hero-copy {
    max-width: 580px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.5;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.42);
}

.gallery-hero-stats {
    display: flex;
    flex-wrap: wrap;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.32);
}

.gallery-hero-stat {
    display: inline-flex;
    align-items: baseline;
    min-height: 0;
    padding: 0 22px;
    gap: 7px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
    font-weight: 500;
}

.gallery-hero-stat:first-child {
    padding-left: 0;
    border-left: 0;
}

.gallery-hero-stat strong {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
}

@media only screen and (min-width: 1024px) {
    .gallery-hero {
        min-height: min(66vh, 610px);
        background: var(--navy);
    }

    .gallery-hero::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 52%;
        background:
            linear-gradient(rgba(5, 20, 39, 0.16), rgba(5, 20, 39, 0.16)),
            url("../media/galeria/photo-scania-r500.jpg") center 62% / cover no-repeat;
    }

    .gallery-hero::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 52%;
        width: 1px;
        background: rgba(255, 255, 255, 0.18);
    }

    .gallery-hero-content {
        width: min(620px, 46%);
    }

    .gallery-hero-copy {
        max-width: 540px;
    }
}

/* Gallery content */

.gallery-main {
    width: 100%;
    background: #f4f6f8;
}

.gallery-section {
    width: min(1240px, 100%);
    margin: 0 auto;
    padding: clamp(72px, 8vw, 96px) clamp(20px, 4vw, 48px) clamp(44px, 5vw, 64px);
}

.gallery-title {
    width: auto;
    margin: 0;
    color: var(--navy);
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.15;
    font-weight: 700;
    text-align: left;
}

.gallery-title::after {
    content: none;
}

.gallery-intro {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
    text-align: left;
}

/* Filter toolbar */

.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 26px 0 20px;
    padding-bottom: 16px;
    gap: 20px;
    border-bottom: 1px solid #cfd7df;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 5px;
    border: 1px solid rgba(11, 31, 58, 0.12);
    border-radius: 14px;
    background: linear-gradient(180deg, #f8f3ea 0%, #eef2f5 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 3px 10px rgba(11, 31, 58, 0.05);
}

.gallery-filter {
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: border-color 170ms ease, background-color 170ms ease, box-shadow 170ms ease, color 170ms ease, transform 170ms ease;
}

.gallery-filter:hover {
    border-color: rgba(11, 31, 58, 0.12);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 3px 8px rgba(11, 31, 58, 0.07);
    transform: translateY(-1px);
}

.gallery-filter.is-active {
    border-color: #0b1f3a;
    background: linear-gradient(135deg, #12395d 0%, #0b1f3a 100%);
    color: var(--white);
    box-shadow:
        inset 0 -3px 0 var(--accent),
        0 4px 10px rgba(11, 31, 58, 0.18);
}

.gallery-filter:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.gallery-count {
    flex: 0 0 auto;
    margin: 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(11, 31, 58, 0.05);
    color: #6b7785;
    font-size: 13px;
    font-weight: 500;
}

/* Uniform portfolio grid */

.gallery-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.gallery-card,
.gallery-card--tall,
.gallery-card--feature {
    position: relative;
    display: block;
    grid-row: auto;
    grid-column: auto;
    margin: 0;
    overflow: hidden;
    border: 1px solid #d2dae2;
    border-radius: 3px;
    background: #ffffff;
    box-shadow: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 350ms ease, transform 350ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.gallery-card.is-visible {
    opacity: 1;
    transform: none;
}

.gallery-card.is-hidden {
    display: none;
}

.gallery-card:hover {
    border-color: #9eabb8;
    box-shadow: 0 6px 18px rgba(14, 30, 52, 0.1);
}

.gallery-link {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.gallery-link::after {
    content: none;
}

.gallery-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    border-radius: 0;
}

.gallery-media {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-bottom: 1px solid #d2dae2;
    transition: none;
}

.gallery-card:hover .gallery-media {
    transform: none;
}

.gallery-card-caption {
    position: static;
    display: flex;
    min-height: 76px;
    flex-direction: column;
    justify-content: center;
    padding: 15px 16px 16px;
    gap: 4px;
    background: #ffffff;
    color: var(--navy);
}

.gallery-card-caption strong {
    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: none;
}

.gallery-card-caption span {
    color: #6b7785;
    font-size: 13px;
    font-weight: 500;
}

/* Video indicators */

.gallery-play {
    position: absolute;
    top: calc((100% - 76px) / 2);
    left: 50%;
    z-index: 2;
    width: 48px;
    height: 48px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: rgba(11, 31, 58, 0.82);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transform: translate(-50%, -50%);
    transition: background-color 150ms ease;
}

.gallery-play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 53%;
    border-style: solid;
    border-width: 8px 0 8px 13px;
    border-color: transparent transparent transparent #ffffff;
    transform: translate(-50%, -50%);
}

.gallery-card:hover .gallery-play {
    border-color: #ffffff;
    background: var(--navy);
    transform: translate(-50%, -50%);
}

.gallery-card:hover .gallery-play::before {
    border-left-color: #ffffff;
}

.gallery-chip {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 3px;
    background: rgba(11, 31, 58, 0.84);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* Contact callout */

.gallery-cta {
    display: flex;
    width: min(1144px, calc(100% - 40px));
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin: 0 auto;
    padding: clamp(30px, 4vw, 46px);
    gap: 28px;
    border: 0;
    border-left: 5px solid var(--accent);
    border-radius: 0;
    background: var(--navy);
    color: var(--white);
    box-shadow: none;
}

.gallery-main .gallery-cta {
    margin-bottom: clamp(58px, 7vw, 88px);
}

.gallery-cta-copy {
    display: flex;
    max-width: 660px;
    flex-direction: column;
    gap: 10px;
}

.gallery-cta-eyebrow {
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-cta-title {
    margin: 0;
    color: var(--white);
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.2;
    font-weight: 700;
}

.gallery-cta-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 16px;
    line-height: 1.6;
}

.gallery-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.gallery-cta-button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.gallery-cta-button:hover {
    text-decoration: none;
    transform: none;
}

.gallery-cta-button--primary {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #17202a;
    box-shadow: none;
}

.gallery-cta-button--primary:hover {
    border-color: #ffb326;
    background: #ffb326;
    color: #17202a;
}

.gallery-cta-button--secondary {
    border: 1px solid rgba(255, 255, 255, 0.48);
    background: transparent;
    color: var(--white);
}

.gallery-cta-button--secondary:hover {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.gallery-cta-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Media viewer */

body.lightbox-open {
    overflow: hidden;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(16px, 3vw, 32px) clamp(64px, 9vw, 110px);
    background: rgba(4, 12, 24, 0.96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.gallery-lightbox[hidden] {
    display: none;
}

.lightbox-stage {
    display: flex;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

.lightbox-stage img,
.lightbox-stage video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 2px;
    background: #000000;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.52);
}

.lightbox-stage video {
    width: auto;
    height: 100%;
}

.lightbox-loading {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: lightbox-spin 800ms linear infinite;
}

@keyframes lightbox-spin {
    to {
        transform: rotate(360deg);
    }
}

.lightbox-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 10px 6px;
    gap: 4px;
    text-align: center;
}

.lightbox-caption {
    margin: 0;
    color: var(--white);
    font-size: clamp(16px, 2vw, 19px);
    font-weight: 600;
}

.lightbox-caption span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 13px;
    font-weight: 400;
}

.lightbox-counter {
    margin: 0;
    color: rgba(255, 255, 255, 0.52);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    z-index: 2;
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 3px;
    background: #0b1f3a;
    color: var(--white);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #17202a;
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.lightbox-close {
    top: 18px;
    right: 18px;
    font-size: 17px;
}

.lightbox-nav {
    top: 50%;
    padding-bottom: 4px;
    font-size: 28px;
    transform: translateY(-50%);
}

.lightbox-nav:hover {
    transform: translateY(-50%);
}

.lightbox-nav--prev {
    left: clamp(10px, 2.4vw, 28px);
}

.lightbox-nav--next {
    right: clamp(10px, 2.4vw, 28px);
}

/* Responsive layout */

@media only screen and (max-width: 1080px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }

    .gallery-cta {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media only screen and (min-width: 641px) and (max-width: 1023px) {
    .gallery-hero {
        min-height: 560px;
        background-image:
            linear-gradient(90deg, rgba(5, 20, 39, 0.94) 0%, rgba(5, 20, 39, 0.82) 48%, rgba(5, 20, 39, 0.48) 100%),
            url("../media/galeria/photo-scania-r500.jpg");
        background-position: 62% 58%;
    }

    .gallery-hero-content {
        max-width: 650px;
    }

    .gallery-toolbar {
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .gallery-filters {
        max-width: 720px;
    }
}

@media only screen and (max-width: 640px) {
    .gallery-hero {
        min-height: 470px;
        padding: calc(70px + 46px) 22px 84px;
        background-image:
            linear-gradient(rgba(5, 20, 39, 0.72), rgba(5, 20, 39, 0.82)),
            url("../media/galeria/photo-scania-r500.jpg");
        background-position: 66% 56%;
        background-size: cover;
    }

    .gallery-hero-header {
        font-size: clamp(40px, 13vw, 52px);
    }

    .gallery-hero-copy {
        max-width: 31ch;
        margin-top: 18px;
        font-size: 16px;
    }

    .gallery-hero-stats {
        row-gap: 12px;
        margin-top: 24px;
        padding-top: 18px;
    }

    .gallery-hero-stat {
        padding: 0 12px;
        font-size: 12px;
    }

    .gallery-hero-stat strong {
        font-size: 17px;
    }

    .gallery-section {
        padding: 52px 18px 42px;
    }

    .gallery-title {
        font-size: 30px;
    }

    .gallery-intro {
        font-size: 16px;
    }

    .gallery-toolbar {
        align-items: flex-start;
        flex-direction: column;
        margin-top: 26px;
        gap: 12px;
    }

    .gallery-filters {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
        padding: 6px;
    }

    .gallery-filter {
        width: 100%;
        min-height: 50px;
        padding: 8px 9px;
        font-size: 13.5px;
        line-height: 1.25;
        white-space: normal;
    }

    .gallery-count {
        align-self: flex-end;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .gallery-card,
    .gallery-card--tall,
    .gallery-card--feature {
        aspect-ratio: auto;
    }

    .gallery-cta {
        width: calc(100% - 36px);
        padding: 28px 22px;
    }

    .gallery-cta-actions {
        width: 100%;
        flex-direction: column;
    }

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

    .gallery-lightbox {
        padding: 12px 12px 8px;
    }

    .lightbox-stage {
        margin-top: 54px;
    }

    .lightbox-close,
    .lightbox-nav {
        width: 40px;
        height: 40px;
    }

    .lightbox-nav {
        top: auto;
        bottom: 92px;
        transform: none;
    }

    .lightbox-nav:hover {
        transform: none;
    }

    .lightbox-nav--prev {
        left: 14px;
    }

    .lightbox-nav--next {
        right: 14px;
    }

    .lightbox-footer {
        padding-bottom: 10px;
    }
}

@media only screen and (max-width: 380px) {
    .gallery-hero {
        min-height: 500px;
        padding-right: 18px;
        padding-left: 18px;
    }

    .gallery-hero-stat {
        padding: 0 9px;
    }

    .gallery-filter {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 12.5px;
    }

    .gallery-section {
        padding-right: 14px;
        padding-left: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .gallery-filter,
    .gallery-cta-button,
    .gallery-lightbox,
    .lightbox-close,
    .lightbox-nav {
        transition: none !important;
    }

    .lightbox-loading {
        animation-duration: 2400ms;
    }
}
