/* ═══════════════════════════════════════════════════════════════════
   SOLTEKKERS: PORTFOLIO STACK CSS
   
   Stacking mechanic:
     • .st-portfolio-stack is a tall spacer (height set by JS)
     • .st-portfolio-stack__stage becomes position:fixed during scroll
     • Each .st-portfolio-card is absolutely positioned inside stage
     • JS drives transform/height based on scroll progress
     • Cards transition from: below viewport → active → collapsed (heading)
     • Collapsed cards show only their heading bar at the top
   
   All colours, fonts, and spacing from root variables in style.css
   ═══════════════════════════════════════════════════════════════════ */

/* ── Section wrapper ──────────────────────────────────────────────── */
.st-portfolio-archive {
    background: var(--bg-body);
    overflow: visible;
}

/* ── Archive header ───────────────────────────────────────────────── */
.st-portfolio-archive__header {
    max-width: 900px;
}

.st-portfolio-archive__desc {
    font-family: var(--font-text);
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 18px 0 0;
    max-width: 520px;
}

/* ═══════════════════════════════════════════════════════════════════
   STACK CONTAINER: tall spacer creates scroll room
   ═══════════════════════════════════════════════════════════════════ */
.st-portfolio-stack {
    position: relative;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════════
   STAGE: pinned to viewport during scroll
   ═══════════════════════════════════════════════════════════════════ */
.st-portfolio-stack__stage {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════
   INDIVIDUAL CARD
   Absolutely positioned within stage. JS drives y position and height.
   ═══════════════════════════════════════════════════════════════════ */
.st-portfolio-card {
    position: absolute;
    left: 0;
    width: 100%;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    overflow: hidden;
    will-change: transform, height;
    transition: background 0.45s ease, border-color 0.45s ease;
}

/* ── Card head (always visible heading bar) ───────────────────────── */
.st-portfolio-card__head {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 52px;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.st-portfolio-card__count {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-right: 14px;
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.st-portfolio-card__head .st-portfolio-card__title {
    font-size: 1.1rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

/* ── Card body (hidden when collapsed) ────────────────────────────── */
.st-portfolio-card__body {
    width: 100%;
    height: calc(100% - 80px);
    overflow: hidden;
}

/* ── Inner two-column grid ─────────────────────────────────────────── */
.st-portfolio-card__inner {
    display: grid;
    grid-template-columns: 38fr 62fr;
    height: 100%;
    width: 100%;
}

/* ── LEFT column ──────────────────────────────────────────────────── */
.st-portfolio-card__left {
    display: flex;
    flex-direction: column;
    padding: 80px 52px 60px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.45s ease;
    overflow: hidden;
}

.st-portfolio-card__title {
    font-family: var(--font-heading);
    font-size: clamp(2.4rem, 4vw, 4.5rem);
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1.0;
    text-transform: uppercase;
    margin: 0 0 28px;
    transition: color 0.45s ease;
}

.st-portfolio-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.st-portfolio-card__tag {
    font-family: "Georgia", Georgia, serif;
    font-style: italic;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.60);
    padding: 6px 18px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 40px;
    white-space: nowrap;
    transition: color 0.45s ease, border-color 0.45s ease;
}

.st-portfolio-card__desc {
    font-family: var(--font-text);
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.65;
    margin: auto 0 0;
    max-width: 440px;
    transition: color 0.45s ease;
}

/* ── RIGHT column ─────────────────────────────────────────────────── */
.st-portfolio-card__right {
    position: relative;
    overflow: hidden;
    padding: 24px 24px 24px 0;
}

.st-portfolio-card__image {
    position: absolute;
    inset: 24px 24px 24px 0;
    width: calc(100% - 24px);
    height: calc(100% - 48px);
    border-radius: 12px;
    object-fit: cover;
    display: block;
    transition: transform 0.75s ease, filter 0.45s ease;
}

.st-portfolio-card__right::before {
    content: '';
    position: absolute;
    inset: 24px 24px 24px 0;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(0,0,0,0.68) 0%, rgba(0,0,0,0.18) 42%, transparent 72%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.45s ease;
}

.st-portfolio-card__metric {
    position: absolute;
    top: 52px;
    left: 28px;
    z-index: 2;
}

.st-portfolio-card__metric-val {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 3.8vw, 4rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    letter-spacing: -0.03em;
}

.st-portfolio-card__metric-lbl {
    font-family: var(--font-text);
    font-size: 0.88rem;
    color: rgba(255,255,255,0.82);
    margin-top: 6px;
    line-height: 1.35;
    max-width: 280px;
}

.st-portfolio-card__cta {
    position: absolute;
    top: 52px;
    right: 48px;
    z-index: 3;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    color: #ffffff;
    background: var(--color-primary);
    border: 1.5px solid var(--color-primary);
    padding: 11px 24px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s ease, color 0.25s ease;
}

.st-portfolio-card__cta:hover {
    background: transparent;
    color: var(--color-primary);
}

/* ═══════════════════════════════════════════════════════════════════
   HOVER STATE
   ═══════════════════════════════════════════════════════════════════ */
.st-portfolio-card:hover {
    background: #ffffff;
    border-top-color: rgba(0,0,0,0.10);
}

.st-portfolio-card:hover .st-portfolio-card__head {
    background: #ffffff;
    border-bottom-color: rgba(0,0,0,0.08);
}

.st-portfolio-card:hover .st-portfolio-card__left {
    border-right-color: rgba(0,0,0,0.08);
}

.st-portfolio-card:hover .st-portfolio-card__title {
    color: #000000;
}

.st-portfolio-card:hover .st-portfolio-card__desc {
    color: rgba(0,0,0,0.70);
}

.st-portfolio-card:hover .st-portfolio-card__tag {
    border-color: rgba(0,0,0,0.18);
    color: rgba(0,0,0,0.60);
}

.st-portfolio-card:hover .st-portfolio-card__image {
    transform: scale(1.04);
}

.st-portfolio-card:hover .st-portfolio-card__right::before {
    opacity: 0.75;
}

.st-portfolio-card:hover .st-portfolio-card__cta {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   COUNTER + PROGRESS: fixed overlays
   ═══════════════════════════════════════════════════════════════════ */
.st-portfolio-stack__counter {
    position: fixed;
    bottom: 40px;
    right: 52px;
    z-index: 100;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.50);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.st-portfolio-stack__counter.is-visible {
    opacity: 1;
}

.st-portfolio-stack__progress {
    position: fixed;
    bottom: 40px;
    left: 52px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.st-portfolio-stack__progress.is-visible {
    opacity: 1;
}

.st-portfolio-stack__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.28);
    transition: background 0.35s ease, transform 0.35s ease;
}

.st-portfolio-stack__dot.is-active {
    background: var(--color-primary);
    transform: scale(1.55);
}

/* ── Empty state ──────────────────────────────────────────────────── */
.st-portfolio-archive__empty {
    padding: 80px 5vw;
    text-align: center;
}

.st-portfolio-archive__empty-icon {
    font-size: 3.5rem;
    margin-bottom: 20px;
    display: block;
}

.st-portfolio-archive__empty-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px;
    text-transform: uppercase;
}

.st-portfolio-archive__empty-text {
    font-family: var(--font-text);
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .st-portfolio-card__inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .st-portfolio-card__left {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        padding: 40px 28px 28px;
    }

    .st-portfolio-card__right {
        padding: 0 20px 20px;
    }

    .st-portfolio-card__image {
        inset: 0 20px 20px 20px;
        width: calc(100% - 40px);
        height: calc(100% - 20px);
    }

    .st-portfolio-card__right::before {
        display: none;
    }

    .st-portfolio-card__title {
        font-size: 2rem;
    }

    .st-portfolio-card__head {
        padding: 0 28px;
    }

    .st-portfolio-card__head .st-portfolio-card__title {
        font-size: 0.95rem;
    }

    .st-portfolio-card__cta {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
        top: 20px;
        right: 20px;
        padding: 9px 20px;
        font-size: 0.7rem;
    }
}

@media (max-width: 600px) {
    .st-portfolio-card__left {
        padding: 32px 20px 22px;
    }

    .st-portfolio-card__title {
        font-size: 1.75rem;
    }

    .st-portfolio-card__desc {
        display: none;
    }

    .st-portfolio-stack__counter {
        right: 20px;
        bottom: 28px;
    }

    .st-portfolio-stack__progress {
        left: 20px;
        bottom: 28px;
    }

    .st-portfolio-card__head {
        padding: 0 20px;
        height: 80px;
    }

    .st-portfolio-card__head .st-portfolio-card__title {
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .st-portfolio-card__left { padding: 28px 16px 18px; }
    .st-portfolio-card__right { padding: 0 14px 14px; }
    .st-portfolio-card__head { padding: 0 16px; }
    .st-portfolio-card__title { font-size: 1.4rem; }
    .st-portfolio-card__head .st-portfolio-card__title { font-size: 0.78rem; }
    .st-portfolio-card__cta { padding: 7px 14px; font-size: 0.65rem; top: 14px; right: 14px; }
    .st-portfolio-card__image { inset: 0 14px 14px 14px; width: calc(100% - 28px); height: calc(100% - 14px); }
    .st-gallery-modal__close { top: 12px; right: 12px; width: 32px; height: 32px; }
    .st-gallery-modal__details { padding: 10px 12px 8px; }
    .st-gallery-modal__grid { padding: 8px 10px 12px; gap: 6px; }
    .st-gallery-modal__grid .st-gallery-grid__item { width: calc((100% - 6px) / 2); }
}

/* ═══════════════════════════════════════════════════════════════════
   GALLERY: Behance‑inspired modal with green beep button
   ═══════════════════════════════════════════════════════════════════ */

/* ── Gallery button ── */
.st-portfolio-card__gallery-btn {
    position: absolute;
    bottom: 52px;
    right: 48px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: #000;
    border: 1.5px solid #22c55e;
    border-radius: 8px;
    color: #22c55e;
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 12px rgba(34,197,94,0.15);
}
.st-portfolio-card__gallery-btn svg {
    transition: transform 0.3s ease;
}
.st-portfolio-card__gallery-btn:hover {
    background: #22c55e;
    color: #000;
    box-shadow: 0 0 24px rgba(34,197,94,0.35);
}
.st-portfolio-card__gallery-btn:hover svg {
    transform: translateX(4px);
}

/* ── Green beep pulse ── */
.st-gallery-btn-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 10px;
    border: 2px solid #22c55e;
    opacity: 0;
    pointer-events: none;
    animation: st-gallery-beep 1.8s ease-out infinite;
}
@keyframes st-gallery-beep {
    0%   { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   GALLERY MODAL: Full‑screen scrollable slide‑in overlay
   ═══════════════════════════════════════════════════════════════════ */
.st-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0s 0.5s;
}
.st-gallery-modal[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

/* ── Backdrop ── */
.st-gallery-modal__backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-body, #080808);
}

/* ── Panel with slide‑in (scrolls with modal) ── */
.st-gallery-modal__panel {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    background: var(--bg-body, #080808);
    display: flex;
    padding-top: 56px;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.st-gallery-modal[aria-hidden="false"] .st-gallery-modal__panel {
    transform: translateX(0);
}

/* ── Close button (stays fixed while content scrolls) ── */
.st-gallery-modal__close {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 100;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}
.st-gallery-modal__close:hover {
    border-color: var(--color-primary, #FF7A00);
    color: var(--color-primary, #FF7A00);
}

/* ── Loading (fixed overlay within modal) ── */
.st-gallery-modal__loading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: var(--bg-body, #080808);
    color: rgba(255,255,255,0.30);
    font-family: var(--font-text);
    font-size: 0.88rem;
}
.st-gallery-modal__spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.06);
    border-top-color: var(--color-primary, #FF7A00);
    border-right-color: var(--color-primary, #FF7A00);
    border-radius: 50%;
    animation: st-gallery-spin 0.8s linear infinite;
}
@keyframes st-gallery-spin {
    to { transform: rotate(360deg); }
}

.st-gallery-modal__empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.25);
    font-family: var(--font-text);
    font-size: 0.9rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Details panel (left, sticky within modal scroll) ── */
.st-gallery-modal__details {
    width: 290px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    padding: 32px 24px 32px 32px;
    border-right: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
    background: var(--bg-elevated, rgba(255,255,255,0.02));
}

.st-gallery-modal__details-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1), transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.st-gallery-modal__details.is-visible .st-gallery-modal__details-inner {
    opacity: 1;
    transform: translateY(0);
}

.st-gd-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #fff);
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.3;
}

.st-gd-desc {
    font-family: var(--font-text);
    font-size: 0.82rem;
    color: var(--text-desc, rgba(255,255,255,0.55));
    line-height: 1.65;
    margin: 0;
}

.st-gd-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.st-gd-meta__item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.st-gd-meta__label {
    font-family: var(--font-heading);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted, rgba(255,255,255,0.35));
}
.st-gd-meta__value {
    font-family: var(--font-text);
    font-size: 0.85rem;
    color: var(--text-secondary, rgba(255,255,255,0.5));
}

/* ── View Project link (green accent) ── */
.st-gd-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--theme-green, #00c853);
    text-decoration: none;
    padding: 9px 16px;
    border: 1px solid rgba(0,200,83,0.2);
    border-radius: 8px;
    transition: all 0.25s ease;
    align-self: flex-start;
    margin-top: 6px;
}
.st-gd-link:hover {
    background: rgba(0,200,83,0.08);
    border-color: rgba(0,200,83,0.4);
    color: #00e676;
}

/* ── Grid (right side, scrolls with modal) ── */
.st-gallery-modal__grid {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px 24px 24px;
    align-content: start;
}
.st-gallery-grid__item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: none;
    padding: 0;
    background: #181818;
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.35s ease;
    opacity: 0;
    animation: st-grid-in 0.4s cubic-bezier(0.22,1,0.36,1) forwards;
    width: calc((100% - 20px) / 3);
    flex-shrink: 0;
}
.st-gallery-grid__item:nth-child(1) { animation-delay: 0.02s; }
.st-gallery-grid__item:nth-child(2) { animation-delay: 0.06s; }
.st-gallery-grid__item:nth-child(3) { animation-delay: 0.10s; }
.st-gallery-grid__item:nth-child(4) { animation-delay: 0.14s; }
.st-gallery-grid__item:nth-child(5) { animation-delay: 0.18s; }
.st-gallery-grid__item:nth-child(6) { animation-delay: 0.22s; }
.st-gallery-grid__item:nth-child(7) { animation-delay: 0.26s; }
.st-gallery-grid__item:nth-child(8) { animation-delay: 0.30s; }
.st-gallery-grid__item:nth-child(n+9) { animation-delay: 0.34s; }

@keyframes st-grid-in {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.st-gallery-grid__item:hover {
    transform: scale(1.03);
    box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.st-gallery-grid__item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    pointer-events: none;
}

.st-gallery-grid__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.st-gallery-grid__item:hover .st-gallery-grid__img {
    transform: scale(1.08);
}

/* ═══════════════════════════════════════════════════════════════════
   FULLSCREEN VIEWER: Modern split layout with zoom / filmstrip
   ═══════════════════════════════════════════════════════════════════ */
.st-gallery-viewer {
    position: fixed;
    inset: 0;
    z-index: 21000;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(34,197,94,0.035) 0%, transparent 60%),
        #000;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.st-gallery-viewer[aria-hidden="false"] {
    visibility: visible;
    opacity: 1;
}

/* ── Top bar ── */
.st-gv-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px 10px;
    -webkit-app-region: no-drag;
    flex-shrink: 0;
}

.st-gv-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    color: rgba(255,255,255,0.50);
    cursor: pointer;
    transition: all 0.22s ease;
    padding: 0;
    line-height: 1;
}
.st-gv-btn:hover {
    background: rgba(255,255,255,0.10);
    color: #fff;
    border-color: #22c55e;
}
.st-gv-btn--close {
    border-radius: 50%;
}
.st-gv-btn--nav {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.st-gv-counter {
    font-family: var(--font-heading);
    font-size: 0.78rem;
    color: rgba(255,255,255,0.30);
    letter-spacing: 0.03em;
    flex: 1;
    text-align: center;
}

.st-gv-zoom {
    display: flex;
    gap: 6px;
}

/* ── Main area (image left + thumbs right) ── */
.st-gv-main {
    display: flex;
    flex: 1;
    min-height: 0;
    padding: 0 18px;
    gap: 14px;
}

/* Image area */
.st-gv-image-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(0,0,0,0.35);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.st-gv-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    transition: transform 0.15s ease;
    will-change: transform;
    backface-visibility: hidden;
}

/* Thumbnail column (right) */
.st-gv-thumbs {
    width: 140px;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
    padding: 4px 0;
}
.st-gv-thumbs::-webkit-scrollbar { width: 3px; }
.st-gv-thumbs::-webkit-scrollbar-track { background: transparent; }
.st-gv-thumbs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
}

.st-gv-thumb {
    flex-shrink: 0;
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0;
    background: #181818;
    transition: border-color 0.22s ease, transform 0.22s ease;
}
.st-gv-thumb:hover {
    border-color: rgba(255,255,255,0.15);
    transform: scale(1.02);
}
.st-gv-thumb.is-active {
    border-color: #22c55e;
}
.st-gv-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Bottom: arrows + filmstrip ── */
.st-gv-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px 14px;
    flex-shrink: 0;
}

.st-gv-filmstrip {
    flex: 1;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.06) transparent;
    padding: 2px 0;
    min-width: 0;
}
.st-gv-filmstrip::-webkit-scrollbar { height: 2px; }
.st-gv-filmstrip::-webkit-scrollbar-track { background: transparent; }
.st-gv-filmstrip::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.06);
    border-radius: 1px;
}

.st-gv-filmstrip__item {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0;
    background: #181818;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.st-gv-filmstrip__item:hover {
    border-color: rgba(255,255,255,0.15);
    transform: scale(1.05);
}
.st-gv-filmstrip__item.is-active {
    border-color: #22c55e;
}
.st-gv-filmstrip__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Single-image: hide thumbs, filmstrip, nav */
.st-gallery-viewer[data-single="true"] .st-gv-thumbs,
.st-gallery-viewer[data-single="true"] .st-gv-filmstrip,
.st-gallery-viewer[data-single="true"] .st-gv-btn--nav,
.st-gallery-viewer[data-single="true"] .st-gv-counter {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════
   GALLERY RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .st-portfolio-card__gallery-btn {
        bottom: 20px;
        right: 20px;
        padding: 8px 16px;
        font-size: 0.65rem;
    }
    .st-gallery-modal__details {
        width: 240px;
        padding: 24px 18px 24px 24px;
    }
    .st-gallery-modal__grid {
        padding: 14px 18px 18px;
    }
    .st-gallery-modal__grid .st-gallery-grid__item {
        width: calc((100% - 10px) / 2);
    }
    .st-gv-thumbs {
        width: 100px;
    }
}

@media (max-width: 600px) {
    .st-gallery-modal__panel {
        flex-direction: column;
    }
    .st-gallery-modal__details {
        position: static;
        width: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.06));
        padding: 14px 16px 10px;
    }
    .st-gallery-modal__details-inner {
        gap: 8px;
    }
    .st-gd-desc {
        font-size: 0.75rem;
    }
    .st-gd-meta {
        flex-direction: row;
        gap: 16px;
    }
    .st-gd-link {
        font-size: 0.72rem;
        padding: 6px 12px;
    }
    .st-gallery-modal__grid {
        flex: none;
        gap: 8px;
        padding: 10px 12px 14px;
    }
    .st-gallery-modal__grid .st-gallery-grid__item {
        width: calc((100% - 8px) / 2);
    }
    /* Stack viewer vertically on mobile */
    .st-gv-main {
        flex-direction: column;
        padding: 0 10px;
    }
    .st-gv-image-wrap {
        flex: 1;
        border-radius: 8px;
    }
    .st-gv-thumbs {
        display: none;
    }
    .st-gv-bottom {
        padding: 8px 10px 10px;
    }
    .st-gv-filmstrip__item {
        width: 40px;
        height: 40px;
    }
    .st-gv-top {
        padding: 8px 10px 6px;
    }
}
