/* assets/css/pages/gallery.css */

/* 1. Header Styling */
.gallery-header {
    text-align: center;
    padding: var(--spacing-xl) 0 2rem 0;
    margin-bottom: 0;
}

.gallery-header h1 {
    color: var(--color-primary);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gallery-header .lead {
    color: #666;
    font-size: 1.2rem;
}

/* 2. Category Chips - Single Row, No Wrap */
.category-chips-container {
    position: relative;
    max-width: 800px; /* Constrained width */
    width: 90%; /* Responsive width */
    margin: 0 auto 3rem auto;
    padding: 0 20px;
    display: block;
    text-align: center;
}

.category-chips-list {
    display: inline-flex; /* content-based width */
    gap: 15px;
    overflow-x: auto;
    padding: 10px 40px 10px 5px; /* Extra padding right for fade */
    white-space: nowrap;
    align-items: center;
    max-width: 100%;
    
    /* Scroll visual cues */
    scrollbar-width: none; /* Hide scrollbar Firefox */
    -ms-overflow-style: none;
    
    /* Fade Effect on sides */
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 90%, transparent 100%);
}

.category-chips-list::-webkit-scrollbar {
    display: none;
}

.category-chip {
    padding: 8px 24px;
    border: 1px solid #ddd;
    border-radius: 50px;
    background: transparent;
    color: #333;
    font-family: var(--font-body);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    font-size: 0.95rem;
}

.category-chip:hover {
    border-color: var(--color-colorado-gold);
}

.category-chip.active {
    background: #000; /* Dark Filled */
    color: #fff;
    border-color: #000;
}

/* 3. 3D Carousel Section */
.gallery-carousel-section {
    position: relative;
    padding: 2rem 0 5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    perspective: 1000px; /* Essential for 3D */
    overflow: hidden;
}

.carousel-3d-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    height: 380px; /* Reduced Height */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem; /* Restored margin */
}

.carousel-item {
    position: absolute;
    width: 260px; /* Reduced Width */
    height: 320px; /* Reduced Height */
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    cursor: pointer;
    /* Default State: Hidden/Back */
    opacity: 0;
    z-index: 0;
    transform: translateX(0) scale(0.8);
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* Let click pass to container */
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 20px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Active Center Item */
.carousel-item.active {
    width: 300px; /* Reduced Active Width */
    height: 380px; /* Reduced Active Height */
    z-index: 10;
    opacity: 1;
    transform: translateX(0) scale(1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.carousel-item.active .carousel-overlay {
    opacity: 1;
}

/* Left Item */
.carousel-item.prev {
    transform: translateX(-160px) scale(0.85); /* Adjusted Translate */
    z-index: 5;
    opacity: 0.6;
}

/* Right Item */
.carousel-item.next {
    transform: translateX(160px) scale(0.85); /* Adjusted Translate */
    z-index: 5;
    opacity: 0.6;
}

/* Far Left/Right (Hidden or faded more) */
.carousel-item.prev-2 {
    transform: translateX(-300px) scale(0.7); /* Adjusted Translate */
    z-index: 1;
    opacity: 0.3;
}

.carousel-item.next-2 {
    transform: translateX(300px) scale(0.7); /* Adjusted Translate */
    z-index: 1;
    opacity: 0.3;
}

/* 4. Navigation Arrows */
.carousel-nav-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 1rem;
}

.carousel-nav {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid #333;
    background: transparent;
    color: #333;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.carousel-nav:hover {
    background: #333;
    color: #fff;
    transform: scale(1.1);
}

/* 5. Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.gallery-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.modal-caption {
    text-align: center;
    color: #fff;
    margin-top: 15px;
    font-size: 1.2rem;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    z-index: 3;
    background: none;
    border: none;
    line-height: 1;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2rem;
    background: rgba(255,255,255,0.1);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 3;
    border: none;
    transition: background 0.3s;
}

.modal-nav:hover {
    background: rgba(255,255,255,0.3);
}

.modal-nav.disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

.modal-nav.prev { left: 40px; }
.modal-nav.next { right: 40px; }

.modal-counter {
    position: absolute;
    top: 30px;
    left: 40px;
    color: #aaa;
    z-index: 3;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-3d-container {
        height: 350px;
    }
    
    .carousel-item.active {
        width: 280px;
        height: 350px;
    }
    
    .carousel-item.prev, .carousel-item.next {
        transform: translateX(-40px) scale(0.85); /* Less translation on mobile */
    }
    .carousel-item.next {
        transform: translateX(40px) scale(0.85);
    }
    
    .carousel-item.prev-2, .carousel-item.next-2 {
        opacity: 0; /* Hide 2nd items on mobile */
    }

    .category-chips-list {
        overflow-x: auto; /* Allow scroll on mobile */
    }
}
