/* gallery.css - Temple Image Gallery Styles */

/* Gallery Layout */
.gallery-container {
    padding: 40px 0;
    background: linear-gradient(135deg, rgba(47, 49, 147, 0.03) 0%, rgba(245, 130, 32, 0.03) 100%);
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-title {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.gallery-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--secondary-color);
}

.gallery-subtitle {
    color: #666;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery Navigation */
.gallery-nav {
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}

.gallery-categories {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.gallery-category {
    margin: 0;
}

.gallery-category-btn {
    background: white;
    border: 2px solid #e0e0e0;
    color: #333;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
}

.gallery-category-btn:hover,
.gallery-category-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
}

/* Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Make gallery cards clickable */
.gallery-card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

/* Masonry Layout */
.gallery-masonry {
    column-count: 4;
    column-gap: 20px;
    margin-bottom: 30px;
    margin: 0 auto;
    column-gap: 20px;
}


/*.gallery-item {
    display: inline-block;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}*/

.gallery-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

/* Gallery Card Styles */
.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.gallery-image-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    aspect-ratio: 4/3;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.1);
}

/* Image Overlay */
.gallery-overlay { 
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(47, 49, 147, 0) 0%, rgba(47, 49, 147, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px 12px 0 0;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.gallery-card:hover .overlay-content {
    transform: translateY(0);
}

.overlay-icon {
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 1.2rem;
}

/* Card Info */
.gallery-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-caption {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.4;
}

.gallery-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #888;
}

.gallery-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gallery-category-badge {
    background: rgba(47, 49, 147, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Gallery Actions */
.gallery-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.gallery-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.gallery-btn:hover {
    background: var(--primary-color);
    color: white;
}

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

/* Fancybox Customization */
.fancybox__container {
    z-index: 99999;
}

.fancybox__slide {
    padding: 0;
}

.fancybox__content {
    background: none;
    padding: 0;
}

.fancybox__image {
    border-radius: 8px;
}

.fancybox__caption {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 20px;
    border-radius: 0 0 8px 8px;
}

/* Loading Animation */
.gallery-loading {
    text-align: center;
    padding: 40px 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

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

@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .gallery-masonry {
        column-count: 2;
    }
    
    .gallery-title {
        font-size: 2rem;
    }
    
    .gallery-categories {
        justify-content: center;
        padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .gallery-masonry {
        column-count: 2;
    }
    .gallery-container {
        padding: 30px 0;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .gallery-masonry {
        column-count: 2;
        column-gap: 15px;
    }
    
    .gallery-category-btn {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
    
    .gallery-info {
        padding: 15px;
    }
    
    .gallery-caption {
        font-size: 1rem;
    }
    
    .gallery-title {
        font-size: 1.75rem;
    }
    
    .gallery-subtitle {
        font-size: 1rem;
        padding: 0 15px;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .gallery-masonry {
        column-count: 3;
    }
}
@media (min-width: 992px) {
    .gallery-masonry {
        column-count: 4;
    }
}


@media (max-width: 576px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .gallery-masonry {
        column-count: 1;
    }
    
    .gallery-categories {
        flex-direction: column;
        align-items: center;
    }
    
    .gallery-category {
        width: 100%;
        max-width: 250px;
    }
    
    .gallery-category-btn {
        width: 100%;
        padding: 10px;
        text-align: center;
    }
    
    .gallery-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .gallery-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .gallery-header {
        margin-bottom: 30px;
    }
}

@media (max-width: 400px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-image-wrapper {
        aspect-ratio: 16/9;
    }
    
    .gallery-meta {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .gallery-card:hover {
        transform: none;
    }
    
    .gallery-overlay {
        opacity: 0.8;
        background: rgba(47, 49, 147, 0.6);
    }
    
    .overlay-content {
        transform: translateY(0);
    }
    
    .gallery-category-btn:hover {
        transform: none;
    }
    
    .gallery-btn:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .gallery-container {
        background: rgba(0, 0, 0, 0.05);
    }
    
    .gallery-card {
        background: #1a1a1a;
        border: 1px solid #333;
    }
    
    .gallery-caption {
        color: #fff;
    }
    
    .gallery-description {
        color: #aaa;
    }
    
    .gallery-category-btn {
        background: #222;
        color: #fff;
        border-color: #444;
    }
    
    .gallery-meta {
        border-top-color: #333;
        color: #999;
    }
}

/* Print Styles */
@media print {
    .gallery-nav,
    .gallery-actions,
    .gallery-overlay {
        display: none !important;
    }
    
    .gallery-grid {
        display: block;
    }
    
    .gallery-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .gallery-image {
        max-height: 300px;
        object-fit: contain;
    }
}
        