:root {
    --bg-color: #0f0f0f;
    --bg-hero: #0f0f0f;
    --bg-section: #181818;
    --bg-card: #222222;
    --text-color: #ffffff;
    --accent-color: #3a3a3a;
    --text-muted: #3a3a3a;
    --nav-height: 100px;
}

html {
    background-color: var(--bg-color);
}

body {
    margin: 0;
    padding: 0;
    padding-top: var(--nav-height);
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* body:not(.index-page) .navbar .brand-name,
body:not(.index-page) .navbar .nav-link {
    color: var(--text-color);
    transition: color 0.3s ease, background-color 0.3s ease;
} */

.index-page .navbar .brand-name,
.index-page .navbar .nav-link {
    color: #ffffff;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.navbar.work-active {
    background-color: var(--bg-color);
}

.navbar.work-active .brand-name,
.navbar.work-active .nav-link {
    color: var(--text-color);
}

.brand-name:hover {
    color: var(--text-color);
    cursor: pointer;
}

.nav-link {
    color: var(--text-muted) !important;
}

.nav-link:hover {
    color: var(--text-color) !important;
}

#navMenu {
    background-color: var(--bg-color) !important;
}

.work-section {
    background-color: var(--bg-color);
    color: var(--text-color);
    opacity: 1;
    transform: translateY(0);
    transition: 1s ease;
    position: relative;
    z-index: 3;
    flex: 1;
    overflow: visible;
    min-height: 70vh;
    top: 0;
}

.work-header{
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#work-back-btn {
    position: absolute;
    padding: 0 !important;
    left: 0;
    background-color: transparent;
    border: none;
    font-size: 1.4rem;
    color: var(--text-color);
    opacity: 0;
    transform: translateX(20px);
}

#work-back-btn.animate {
    animation: arrowFadeLeft 0.5s ease forwards;
}

@keyframes arrowFadeLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.work-title {
    margin: 0;
    display: inline-block;
    overflow: hidden;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-color);
}

.work-title span{
    display: inline-block;
    transform: translateY(100%);
}

.work-title.active span{
    transform: translateY(0);
    transition: transform 0.7s ease;
}

.gallery-card {
    opacity: 0;
    transform: translateY(40px);
    position: relative;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 10px;
    background-color: var(--bg-card);
}

.gallery-card.active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.gallery-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--accent-color);
    opacity: 0.6;
    animation: blinkSkeleton 2.5s infinite alternate;
    z-index: 1;
}

.gallery-card.loaded::before {
    display: none;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-card.loaded .gallery-img {
    opacity: 1;
}

@keyframes blinkSkeleton {
    0% { opacity: 0.5; }
    50% { opacity: 0.65; }
    100% { opacity: 0.5; }
}

.gallery {
    column-count: 3;
    column-gap: 10px;
    width: 100%;
    margin: 50px auto;
}
/* 
.category {
    margin: 0 auto !important;
    width: 100vw;
} */

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 450px);
    gap: 10px;
    margin-top: 30px;
    justify-items: center;
    justify-content: center;
}

.subcategory-grid {
    display: grid;
    max-width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px !important;
    margin-top: 30px;
    justify-items: center;
    justify-content: center;
}

.subcategory-grid:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, 450px) !important;
    justify-content: center;
}

.category-box, .subcategory-box {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    cursor: pointer;
    border-radius: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.3s ease;
}

.category-box:hover, .subcategory-box:hover {
    transform: scale(1.03);
}

.category-overlay, .subcategory-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(33, 33, 33, 0.5);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: 600;
    font-size: 1.2rem;
    transition: opacity 0.3s ease;
}

.category-text, .subcategory-text {
    font-weight: 100;
    padding-inline: 5px;
    font-family: Arial, sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-color);
}

.subcategory-box .subcategory-overlay {
    padding-inline: 5px !important;
}

.category-box:hover .category-overlay,
.subcategory-box:hover .subcategory-overlay {
    opacity: 1;
}

.category-box,
.subcategory-box {
    opacity: 0;
    transform: translateY(40px);
}

.category-box.active,
.subcategory-box.active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.image-slot {
    width: 100%;
    height: auto;
    overflow: visible;
}

.image-filter {
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.gallery-card img:hover {
    cursor: pointer;
}

@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    body {
        padding-top: calc(var(--nav-height) - 100px);
    }

    .lightbox-arrow {
        display: none;
    }

    .lightbox {
        padding-bottom: 100px;
    }

    .lightbox-close {
        font-size: 1.5rem;
        top: 10px;
        right: 15px;
    }

    .lightbox img {
        width: 95%;
        height: auto;
    }

    #lightbox-swipe-text {
        display: block !important;
    }

    .lightbox-skeleton {
        margin: 0 auto;
        margin-bottom: 80px !important;
        width: 85%;
        height: 75% !important;
    }
}


@media (min-width: 769px) and (max-width: 1024px) {
    .work-title {
        font-size: 0.8rem;
    }

    .gallery {
        column-count: 2;
        column-gap: 12px;
        width: 95%;
    }

    #work-filter .filter-btn {
        font-size: 0.85rem;
        padding: 6px 14px;
    }
}

@media (max-width: 768px) {
    .work-section {
        margin-top: 50px;
        padding: 0;
        transform: none;
        opacity: 1;
        border-radius: 0 !important;
    }


}
@media (max-width: 768px) {
    .container {
        padding: 0 12px;
        width: 100%;
    }

    .work-header {
        justify-content: center;
        margin-bottom: 25px;

    }

    #work-back-btn {
        font-size: 1.2rem;
        left: 5px;
    }

    .work-title {
        font-size: 0.8rem;
        letter-spacing: 0;
    }

    .work-title span {
        transform: translateY(100%);
    }

    .category-overlay,
    .subcategory-overlay {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.5);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .gallery {
        column-count: 2;
        column-gap: 8px;
        width: 100%;
        margin-top: 0;
    }

    .gallery-card {
        margin-bottom: 8px;
    }

    .gallery-img {
        width: 100%;
        height: auto;
        display: block;
    }

    .subcategory-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        padding: 0 !important;
    }

    .category-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
        justify-items: center;
    }

    .category-box,
    .subcategory-box {
        width: 100% !important;
        padding-top: 0;
        height: auto;
        aspect-ratio: auto;
        min-height: 180px;
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
    }

    .category-text,
    .subcategory-text {
        font-weight: 500;
        font-size: 0.7rem;
        padding-inline: 5px;
    }

    .subcategory-grid:has(> :nth-child(2):last-child) {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
        justify-content: center;
    }
}
/* Full-screen lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-color);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    transition: opacity 0.4s ease;
    opacity: 0;
}

.lightbox.show img {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    z-index: 10000;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: var(--text-color);
    cursor: pointer;
    z-index: 10000;
    user-select: none;
    padding: 0 10px;
}

#lightbox-prev {
    left: 30px;
}

#lightbox-next {
    right: 30px;
}

#lightbox-swipe-text {
    position: absolute;
    bottom: 50px;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    color: #5e5e5e;
    user-select: none;
    display: none;
}

#pagination {
    margin-top: 40px;
}

#pagination button {
    background-color: var(--bg-card);
    width: 70px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
    border: none;
    color: #f2f2f2;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

#pagination button:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: #ffffff;
}

#pagination button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (hover: none), (max-width: 1024px) {
    .category-box .category-overlay,
    .subcategory-box .subcategory-overlay {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

.lightbox-skeleton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    max-width: 1200px;
    max-height: 800px;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* border-radius: 12px; */
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 0.7; }
    100% { opacity: 0.5; }
}
/* 
.lightbox img {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.4s ease;
} */

.lightbox img {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1001; /* above skeleton */
    opacity: 0;
    transition: opacity 0.4s ease;
}