/* Gallery Page Styles */

:root {
    --isuzu-red: #E4002B;
    --isuzu-dark: #1a1a1a;
    --isuzu-black: #000000;
    --isuzu-gray: #666666;
    --isuzu-light-gray: #f8f8f8;
    --isuzu-white: #ffffff;
    --border-color: #e5e5e5;
    --font-primary: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--isuzu-dark);
    line-height: 1.6;
    background: var(--isuzu-white);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Page Hero */
.gallery-overlay {
    inset: 0;
    position: absolute;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    width: 100%;
    height: 100%;
    border-radius: 1em;
}

.page-hero {
    margin: 7em 1em 0 1em;
    padding: 10rem 0 10rem;
    text-align: center;
    background: var(--isuzu-light-gray);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    position: relative;
    border-radius: 1em;
}

.page-hero .container {
    background-color: #00000050;
    width: fit-content;
    padding: 1.5em ;
    border-radius: 8px;
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 2;
    /* margin: 0 auto; */
}

.page-hero h1 {
    font-family: var(--font-secondary);
    font-size: 3.5rem;
    font-weight: 500;
    color: var(--isuzu-red);
    margin-bottom: 0.5rem;
}

.page-hero p {
    font-size: 1.25rem;
    color: var(--isuzu-white);
}

/* Gallery Section */
.gallery-section {
    padding: 4rem 0 6rem;
    background: var(--isuzu-light-gray);
}

/* Category Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--isuzu-white);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--isuzu-dark);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--isuzu-red);
}

.filter-btn.active {
    background: var(--isuzu-red);
    color: var(--isuzu-white);
    border-color: var(--isuzu-red);
}

.filter-btn .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 0.5rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    font-size: 0.875rem;
    font-weight: 700;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
}

/* Masonry Gallery Grid */
.gallery-grid {
    column-count: 4;
    column-gap: 1.2rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.2rem;
    background: var(--isuzu-white);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gallery-item.show {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item.hidden {
    display: none;
}

/* Masonry Item Sizes */
.gallery-item[data-size="regular"] {
    height: auto;
}

.gallery-item[data-size="tall"] img {
    aspect-ratio: 3/4;
}

.gallery-item[data-size="wide"] img {
    aspect-ratio: 16/10;
}

.gallery-item[data-size="regular"] img {
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Effect */
.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Overlay Info */
.gallery-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
    color: var(--isuzu-white);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay-info {
    opacity: 1;
    transform: translateY(0);
}

.gallery-overlay-info h3 {
    font-family: var(--font-secondary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--isuzu-white);
}

.gallery-overlay-info p {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 3rem;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: var(--isuzu-red);
    color: var(--isuzu-white);
    border: none;
    border-radius: 50px;
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(228, 0, 43, 0.3);
}

.btn-load-more:hover {
    background: #c00024;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(228, 0, 43, 0.4);
}

.btn-load-more svg {
    transition: transform 0.3s ease;
}

.btn-load-more:hover svg {
    transform: translateY(3px);
}

/* Expanded Image Overlay */
.expanded-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.expanded-overlay.active {
    opacity: 1;
    visibility: visible;
}

.close-expanded {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--isuzu-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2001;
}

.close-expanded:hover {
    background: var(--isuzu-red);
    border-color: var(--isuzu-red);
    transform: rotate(90deg);
}

.expanded-content {
    max-width: 1000px;
    width: 100%;
    background: var(--isuzu-white);
    border-radius: 16px;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.expanded-overlay.active .expanded-content {
    transform: scale(1);
}

.expanded-image-container {
    position: relative;
    width: 100%;
    background: var(--isuzu-black);
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 60vh;
}

.expanded-image-container img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    display: block;
    object-fit: contain;
    animation: zoomIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from {
        transform: scale(0.95);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.expanded-details {
    padding: 2rem;
    background: var(--isuzu-white);
}

.expanded-details h2 {
    font-family: var(--font-secondary);
    font-size: 2rem;
    font-weight: 700;
    color: var(--isuzu-black);
    margin-bottom: 0.75rem;
}

.expanded-details p {
    font-size: 1.125rem;
    color: var(--isuzu-gray);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.expanded-category {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--isuzu-light-gray);
    color: var(--isuzu-red);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Responsive */
@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        column-count: 2;
    }

    .gallery-filters {
        gap: 0.75rem;
    }

    .filter-btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .page-hero {
        padding: 6rem 8px 6rem;
    }

    /* .page-hero .container {
        padding: 1.25em 2em;
    } */

    .page-hero h1 {
        font-size: 2.5rem;
    }

    .page-hero p {
        font-size: 1.125rem;
    }

    .gallery-section {
        padding: 3rem 0 4rem;
    }

    .gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-btn {
        justify-content: space-between;
    }

    .expanded-overlay {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 5rem;
    }

    .expanded-content {
        max-width: 100%;
    }

    .expanded-image-container {
        max-height: 50vh;
    }

    .expanded-image-container img {
        max-height: 50vh;
    }

    .close-expanded {
        position: fixed;
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }

    .expanded-details {
        padding: 1.5rem;
    }

    .expanded-details h2 {
        font-size: 1.5rem;
    }

    .expanded-details p {
        font-size: 1rem;
    }
}

@media (max-width: 600px) {
    .gallery-grid {
        column-count: 1;
    }



    .page-hero h1 {
        font-size: 2rem;
    }

    .page-hero p {
        font-size: 1rem;
    }

    .filter-btn .count {
        min-width: 24px;
        height: 24px;
        font-size: 0.8125rem;
    }

    .expanded-overlay {
        padding: 0.75rem;
        padding-top: 4rem;
    }

    .expanded-content {
        border-radius: 12px;
    }

    .expanded-image-container {
        max-height: 40vh;
    }

    .expanded-image-container img {
        max-height: 40vh;
    }

    .expanded-details {
        padding: 1.25rem;
    }

    .expanded-details h2 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .expanded-details p {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }

    .expanded-category {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Stagger Animation */
.gallery-item:nth-child(1) { transition-delay: 0s; }
.gallery-item:nth-child(2) { transition-delay: 0.05s; }
.gallery-item:nth-child(3) { transition-delay: 0.1s; }
.gallery-item:nth-child(4) { transition-delay: 0.15s; }
.gallery-item:nth-child(5) { transition-delay: 0.2s; }
.gallery-item:nth-child(6) { transition-delay: 0.25s; }
.gallery-item:nth-child(7) { transition-delay: 0.3s; }
.gallery-item:nth-child(8) { transition-delay: 0.35s; }
.gallery-item:nth-child(n+9) { transition-delay: 0.4s; }