/* Portfolio image system — scoped to cards, case studies and native lightbox. */

.hq-product-cover {
    max-width: 55rem;
    margin: 1.2rem 0 1.6rem;
}

.hq-product-cover > .hq-portfolio-cover {
    border: 1px solid var(--hq-line, #d5deea);
}

.hq-portfolio-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hq-portfolio-card > .hq-portfolio-cover {
    width: calc(100% + 2.8rem);
    margin: -1.35rem -1.4rem 1.2rem;
    border-radius: 17px 17px 0 0;
}

.hq-portfolio-card > .hq-btn,
.hq-portfolio-card > .hq-card-more {
    align-self: flex-start;
    margin-top: auto;
}

.hq-portfolio-cover {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #eaf0f8;
    aspect-ratio: 16 / 9;
    cursor: zoom-in;
    isolation: isolate;
}

.hq-portfolio-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 180ms ease;
}

.hq-portfolio-cover:hover img,
.hq-portfolio-cover:focus-visible img {
    transform: scale(1.025);
}

.hq-portfolio-cover:focus-visible {
    outline: 3px solid var(--hq-accent, #175cd3);
    outline-offset: 3px;
}

.hq-portfolio-cover__action {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    background: rgba(9, 24, 47, 0.87);
    color: #fff;
    font-family: Manrope, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 3px 12px rgba(5, 18, 35, 0.15);
    pointer-events: none;
}

.hq-case-hero {
    max-width: 68rem;
    margin-bottom: 2.25rem;
}

.hq-case-hero > .hq-portfolio-cover {
    border: 1px solid var(--hq-line, #d5deea);
    border-radius: 22px;
    box-shadow: 0 20px 55px rgba(8, 28, 57, 0.09);
}

.hq-case-hero .hq-portfolio-cover img,
.hq-case-gallery .hq-portfolio-cover img {
    object-fit: contain;
    object-position: center;
}

.hq-portfolio-gallery-item {
    height: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--hq-line, #d5deea);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(11, 31, 58, 0.04);
}

.hq-portfolio-gallery-item > .hq-portfolio-cover {
    border-radius: 17px 17px 0 0;
}

.hq-portfolio-gallery-item figcaption {
    padding: 0.85rem 1.2rem;
    color: var(--hq-navy, #0b1f3a);
    font-family: Manrope, "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.hq-image-lightbox {
    width: fit-content;
    max-width: 96vw;
    max-height: 95vh;
    max-height: 95dvh;
    margin: auto;
    padding: 0;
    border: 0;
    overflow: visible;
    background: transparent;
    color: #fff;
}

.hq-image-lightbox::backdrop {
    background: rgba(5, 14, 28, 0.88);
    backdrop-filter: blur(5px);
}

.hq-image-lightbox__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    max-height: 95dvh;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: #091629;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
}

.hq-image-lightbox__panel img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(90vw, 1320px);
    max-height: calc(91dvh - 5rem);
    object-fit: contain;
    border-radius: 9px;
}

.hq-image-lightbox__caption {
    max-width: 56rem;
    margin: 0;
    padding: 0 2.5rem 0.15rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #e9eef7;
    text-align: center;
}

.hq-image-lightbox__close {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(5, 14, 28, 0.9);
    color: #fff;
    font-size: 1.85rem;
    line-height: 1;
    cursor: pointer;
}

.hq-image-lightbox__close:hover,
.hq-image-lightbox__close:focus-visible {
    background: #fff;
    color: #081628;
}

.hq-image-lightbox__close:focus-visible {
    outline: 3px solid #6ba7ff;
    outline-offset: 3px;
}

@media (max-width: 575.98px) {
    .hq-portfolio-cover__action {
        right: 0.5rem;
        bottom: 0.5rem;
        padding: 0.3rem 0.55rem;
        font-size: 0.72rem;
    }

    .hq-image-lightbox__panel {
        padding: 0.5rem;
        border-radius: 12px;
    }

    .hq-image-lightbox__panel img {
        max-width: 92vw;
    }

    .hq-image-lightbox__caption {
        padding: 0 2rem 0.1rem;
        font-size: 0.78rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hq-portfolio-cover img {
        transition: none;
    }
}
