/* Gallery Page Styles */
:root {
    --gallery-spacing: 15px;
    --transition-hover: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --gallery-item-height: 280px; /* Standard height for gallery items */
    --gallery-featured-height: 580px; /* Height for featured items */
}

/* Header Styles */
.gallery-header {
    position: relative;
    background-image: url('../images/spices-2.jpeg');
    background-size: cover;
    background-position: center center;
    min-height: 60vh;
    display: flex;
    align-items: center;
    color: var(--white);
    padding: 120px 0 100px;
    text-align: center;
    z-index: 1;
}

.gallery-header .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(45, 45, 45, 0.95) 0%, 
        rgba(45, 45, 45, 0.85) 50%,
        rgba(45, 45, 45, 0.75) 100%);
    z-index: -1;
}

.gallery-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zM36 0V4h-2V0h-4v4h4v4h2V4h4zm-30 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
    opacity: 0.5;
}

.gallery-badge {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--dark-bg);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.header-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    z-index: 1;
}

.header-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 70px;
}

/* Gallery Filter */
.gallery-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    padding: 8px 20px;
    background: var(--white);
    border: 1px solid var(--medium-bg);
    border-radius: 30px;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-standard);
}

.filter-btn:hover {
    background: rgba(45, 45, 45, 0.05);
    color: var(--primary-color);
}

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

/* Gallery Grid Layout with Uniform Image Sizes */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, opacity 0.3s ease;
    height: var(--gallery-item-height);
}

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

.gallery-item.featured {
    grid-column: span 2;
    grid-row: span 2;
    height: var(--gallery-featured-height);
}

.gallery-item-inner {
    position: relative;
    overflow: hidden;
    background: var(--primary-color);
    border-radius: 15px;
    width: 100%;
    height: 100%;
}

/* Image container to maintain aspect ratio */
.gallery-item-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-hover);
    border-radius: 15px;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--white);
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-hover);
    border-radius: 0 0 15px 15px;
}

.gallery-info {
    position: relative;
}

.gallery-info h5 {
    margin-bottom: 5px;
    font-size: 1.2rem;
    color: var(--white);
}

.gallery-info p {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.gallery-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-color);
    color: var(--dark-bg);
    font-size: 0.75rem;
    border-radius: 30px;
    font-weight: 600;
}

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

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

/* Load More Button */
.load-more-btn {
    padding: 12px 30px;
    border-radius: 50px;
    transition: var(--transition-standard);
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.gallery-counter {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 10px;
}

.counter-number {
    font-weight: 700;
    color: var(--primary-color);
}

.total-photos {
    color: var(--text-light);
}

/* Photo Stories Section */
.photo-stories-section {
    background-color: rgba(16, 71, 35, 0.03);
}

.story-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    height: 100%;
    transition: var(--transition-standard);
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Uniform story image sizes */
.story-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.story-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-standard);
}

.story-card:hover .story-image img {
    transform: scale(1.05);
}

.story-content {
    padding: 20px;
}

.story-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.story-content p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.story-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition-standard);
}

.story-link:hover {
    color: var(--primary-color);
}

.story-link i {
    transition: transform 0.3s ease;
}

.story-link:hover i {
    transform: translateX(5px);
}

/* Share Photos CTA */
.share-photos-cta {
    padding: 80px 0;
}

.cta-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e1e1e 100%);
    padding: 40px;
    border-radius: 20px;
    color: var(--white);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.cta-card h3 {
    color: var(--white);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.cta-card p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
    font-size: 1.1rem;
}

.cta-card .btn {
    padding: 12px 25px;
    font-weight: 600;
}

/* Gallery Modal Lightbox */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 80%;
    max-width: 1000px;
    max-height: 80vh;
    animation: zoom 0.3s ease;
}

@keyframes zoom {
    from {transform:scale(0.95); opacity: 0;}
    to {transform:scale(1); opacity: 1;}
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 1001;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-image-container {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
}

.modal-caption {
    margin: auto;
    width: 80%;
    text-align: center;
    padding: 20px;
    color: white;
}

.modal-title {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: white;
}

.modal-description {
    font-size: 1rem;
    margin-bottom: 10px;
    color: rgba(255,255,255,0.8);
}

.modal-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-color);
    color: var(--dark-bg);
    font-size: 0.75rem;
    border-radius: 30px;
    font-weight: 600;
}

.modal-prev,
.modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 15px;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    font-size: 18px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-standard);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-prev:hover,
.modal-next:hover {
    background: var(--accent-color);
    color: var(--dark-bg);
}

/* Responsive Styles */
@media (max-width: 1200px) {
    :root {
        --gallery-item-height: 250px;
        --gallery-featured-height: 520px;
    }
}

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-item.featured {
        grid-column: span 1;
        grid-row: span 1;
        height: var(--gallery-item-height);
    }
    
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
    
    :root {
        --gallery-item-height: 280px;
    }
}

@media (max-width: 767px) {
    .gallery-header {
        min-height: 50vh;
        padding: 100px 0 80px;
    }
    
    .gallery-filter {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: flex-start;
    }
    
    .filter-btn {
        white-space: nowrap;
        flex: 0 0 auto;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
    
    .story-image {
        height: 180px;
    }
    
    .story-card {
        margin-bottom: 20px;
    }
    
    .cta-card {
        padding: 30px;
        text-align: center;
    }
    
    .modal-prev,
    .modal-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    :root {
        --gallery-item-height: 250px;
    }
}

@media (max-width: 575px) {
    .gallery-header {
        min-height: 40vh;
    }
    
    .gallery-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    .header-wave svg {
        height: 40px;
    }
    
    .cta-card h3 {
        font-size: 1.5rem;
    }
    
    .cta-card p {
        font-size: 1rem;
    }
    
    .modal-image {
        max-height: 60vh;
    }
    
    .modal-caption {
        width: 100%;
        padding: 15px;
    }
    
    :root {
        --gallery-item-height: 220px;
    }
}
