/**
 * Photo Gallery Styles
 * 
 * Styles for photo albums archive, single album, and lightbox carousel
 * 
 * @package CSI_Diocese_Theme
 * @since 1.0.0
 */

/* ============================================
   ARCHIVE PAGE - ALBUM GRID
   ============================================ */

.photo-gallery-archive {
    background-color: #f8f9fa;
    padding-bottom: 4rem;
}

.page-hero {
    background-color: var(--color-primary, #1E5BA8);
    background-image: linear-gradient(135deg, var(--color-primary, #1E5BA8) 0%, var(--color-secondary, #6B2C5C) 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    padding: 4rem 0 3rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.page-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(30, 91, 168, 0.75) 0%, rgba(107, 44, 92, 0.75) 100%);
    z-index: 1;
}

.page-hero-content {
    position: relative;
    z-index: 2;
}

.page-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Gallery Filters */
.page-intro {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.page-intro .page-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #495057;
}

.gallery-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group label {
    font-weight: 600;
    color: #495057;
}

.region-filter {
    padding: 0.5rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
}

.filter-results {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Albums Grid */
.photo-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.album-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.album-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.album-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Album Cover */
.album-cover {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-card:hover .album-cover img {
    transform: scale(1.1);
}

.album-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: rgba(255, 255, 255, 0.6);
}

.album-count-badge {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(10px);
}

/* Album Info */
.album-info {
    padding: 1.5rem;
}

.album-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.album-region-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e7f3ff;
    color: #0066cc;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.album-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #212529;
    line-height: 1.4;
}

.album-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.album-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.album-meta svg {
    flex-shrink: 0;
}

.album-excerpt {
    font-size: 0.95rem;
    color: #495057;
    line-height: 1.6;
    margin: 0;
}

/* No Albums Found */
.no-albums-found {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.no-albums-found svg {
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.no-albums-found h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* Pagination */
.gallery-pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.gallery-pagination .page-numbers {
    display: inline-flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.gallery-pagination a,
.gallery-pagination span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    transition: all 0.2s;
}

.gallery-pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.gallery-pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: 600;
}

/* ============================================
   SINGLE ALBUM PAGE
   ============================================ */

.single-photo-album {
    background-color: #f8f9fa;
    padding-bottom: 4rem;
}

/* Album badges in hero */
.page-hero .album-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.page-hero .album-region-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Album meta in hero */
.page-hero .album-meta-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1rem 0 1.5rem;
    font-size: 0.95rem;
}

.page-hero .album-meta-hero .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.page-hero .album-meta-hero svg {
    flex-shrink: 0;
    color: white;
    opacity: 0.95;
}

/* Back button in hero */
.page-hero .hero-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.page-hero .hero-back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-4px);
    color: white;
}

.page-hero .hero-back-btn svg {
    transition: transform 0.3s ease;
}

.page-hero .hero-back-btn:hover svg {
    transform: translateX(-3px);
}

/* Album Description */
.album-description {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin: -3rem auto 2rem;
    max-width: 800px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    position: relative;
    z-index: 10;
}

.album-description p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #495057;
    margin-bottom: 0;
}

.album-photographer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    margin-bottom: 2rem;
    color: #6c757d;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.album-photographer svg {
    color: #667eea;
}

/* Photo Gallery Grid */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.07);
    transition: all 0.3s ease;
}

.photo-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.1);
}

.photo-caption-preview {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    font-size: 0.875rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-item:hover .photo-caption-preview {
    opacity: 1;
}

/* ============================================
   LIGHTBOX CAROUSEL
   ============================================ */

.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lightbox-caption {
    color: white;
    font-size: 1rem;
    margin-top: 1rem;
    text-align: center;
    max-width: 600px;
    line-height: 1.5;
}

.lightbox-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-top: 0.75rem;
    font-weight: 600;
}

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lightbox-close {
    top: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* No Photos Message */
.no-photos-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
    background: white;
    border-radius: 12px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .gallery-filters {
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .region-filter {
        width: 100%;
    }
    
    .photo-albums-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .album-hero .album-title {
        font-size: 1.75rem;
    }
    
    .album-description {
        margin: -2rem 1rem 2rem;
        padding: 1.5rem;
    }
    
    .photo-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }
    
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 48px;
        height: 48px;
    }
    
    .lightbox-prev {
        left: 0.5rem;
    }
    
    .lightbox-next {
        right: 0.5rem;
    }
    
    #lightbox-image {
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .page-hero .album-meta-hero {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .page-hero .hero-back-btn {
        font-size: 0.9rem;
        padding: 0.65rem 1.25rem;
    }
    
    .photo-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
