.gallery-category-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
}

.gallery-category-card {
    position: relative;
    display: block;
    min-height: 300px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 8px;
    background: #050505;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    text-decoration: none;
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.gallery-category-card:hover,
.gallery-category-card:focus-visible {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.52);
    box-shadow: 0 34px 86px rgba(0, 0, 0, 0.38);
    outline: none;
}

.gallery-category-card img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
    opacity: 0.78;
    transition: transform 0.7s ease, opacity 0.32s ease;
}

.gallery-category-card:hover img,
.gallery-category-card:focus-visible img {
    transform: scale(1.06);
    opacity: 0.92;
}

.gallery-category-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.55rem;
    padding: 1.35rem;
    color: #fff;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.82));
}

.gallery-category-overlay i {
    width: 2.55rem;
    height: 2.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0a;
    background: #D4AF37;
    border-radius: 50%;
    font-size: 1rem;
}

.gallery-category-overlay strong {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.95rem, 3vw, 2.65rem);
    line-height: 0.98;
    font-weight: 500;
    letter-spacing: 0;
}

.gallery-category-overlay small {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

#gallery-grid.gallery-project-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.4rem;
    max-width: 1480px;
    margin: 0 auto;
}

.project-card {
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.42);
    box-shadow: 0 28px 76px rgba(0, 0, 0, 0.34);
}

.project-main {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    min-height: clamp(220px, 24vw, 320px);
    background: #050505;
    cursor: zoom-in;
    outline: none;
}

.project-main img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.55s ease, opacity 0.22s ease;
}

.project-main:hover img,
.project-main:focus-visible img {
    transform: scale(1.035);
    opacity: 0.9;
}

.project-main:focus-visible {
    box-shadow: inset 0 0 0 2px #D4AF37;
}

.project-expand {
    position: absolute;
    right: 0.85rem;
    top: 0.85rem;
    width: 2.35rem;
    height: 2.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D4AF37;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 50%;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.project-main:hover .project-expand,
.project-main:focus-visible .project-expand {
    opacity: 1;
    transform: translateY(0);
}

.project-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1rem 0.55rem;
}

.project-title {
    min-width: 0;
    color: #fff;
    font-family: "Cormorant Garamond", serif;
    font-size: 1.16rem;
    line-height: 1.05;
    font-weight: 500;
    letter-spacing: 0;
}

.project-count {
    flex: 0 0 auto;
    color: rgba(212, 175, 55, 0.78);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.project-thumbs {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0 1rem 1rem;
}

.project-thumb {
    position: relative;
    display: block;
    flex: 0 0 clamp(48px, 4vw, 68px);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    background: #111;
    cursor: zoom-in;
    opacity: 0.72;
    transition: transform 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.project-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    transition: transform 0.28s ease;
}

.project-thumb:hover,
.project-thumb:focus-visible,
.project-thumb.active {
    z-index: 2;
    opacity: 1;
    transform: translateY(-2px) scale(1.03);
    border-color: #D4AF37;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.42);
}

.project-thumb:hover img,
.project-thumb:focus-visible img,
.project-thumb.active img {
    transform: scale(1.06);
}

.project-thumb:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 2px;
}

.gallery-empty-state {
    grid-column: 1 / -1;
    padding: 4rem 1.5rem;
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.035);
    text-align: center;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.05;
}

#lightbox {
    z-index: 99999 !important;
}

#lightbox.open {
    padding: 2rem;
}

#lightbox #lb-img {
    max-width: 90vw;
    max-height: calc(100vh - 120px);
    object-fit: contain;
}

#lb-counter {
    bottom: 18px;
}

@media (max-width: 920px) {
    .gallery-category-grid {
        grid-template-columns: minmax(0, 1fr);
        max-width: 620px;
    }
}

@media (max-width: 560px) {
    .gallery-category-card,
    .gallery-category-card img {
        min-height: 220px;
    }

    .gallery-category-overlay {
        padding: 1.05rem;
    }

    #gallery-grid.gallery-project-grid {
        gap: 1rem;
    }

    .project-main {
        min-height: 200px;
    }

    .project-meta {
        padding: 0.85rem 0.85rem 0.65rem;
    }

    .project-thumbs {
        gap: 0.45rem;
        padding: 0.65rem 0.85rem 0.9rem;
    }

    .project-thumb {
        flex-basis: 48px;
    }

    #lightbox.open {
        padding: 1rem;
    }

    #lightbox #lb-img {
        max-width: 92vw;
        max-height: calc(100vh - 110px);
    }
}
