/**
 * Gallery Components CSS
 * Reusable gallery styles for photo displays across the site
 */

/* Photo Gallery Masonry Layout */
.photo-gallery {
    column-count: 3;
    column-gap: 1.5rem;
}

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

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

/* Photo Item Card */
.photo-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    position: relative;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-item a {
    display: block;
    overflow: hidden;
    border-radius: 1rem;
    position: relative;
}

.photo-item img {
    width: 100%;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-item a::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, 0.15);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.photo-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

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

.photo-item:hover a::after {
    opacity: 1;
}

.photo-meta {
    padding: 0.75rem;
    background: white;
}

/* Gallery Filter Tabs */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 2px solid #D1D5DB;
    background: white;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.filter-btn.active {
    background: #2563EB;
    border-color: #2563EB;
    color: white;
}

/* Gallery Header */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.gallery-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #2C3E50;
    font-size: 1.875rem;
}

.gallery-count {
    font-size: 0.875rem;
    color: #6B7280;
}

/* Grid Layout Alternative */
.photo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .photo-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Gallery Loading State */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.gallery-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #E5E7EB;
    border-top-color: #2563EB;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Gallery Empty State */
.gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #6B7280;
}

.gallery-empty svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    opacity: 0.3;
}

.gallery-empty h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.gallery-empty p {
    font-size: 0.875rem;
}

/* ============================================
   Gallery Card Component
   A card for displaying gallery collections
   ============================================ */

.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.gallery-card:focus {
    outline: 2px solid #2563EB;
    outline-offset: 2px;
}

/* Image Section - Fixed Height for Consistency */
.gallery-card__image-wrapper {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    height: 200px; /* Fixed height for consistent cards */
}

.gallery-card--compact .gallery-card__image-wrapper {
    height: 160px;
}

.gallery-card--featured .gallery-card__image-wrapper {
    height: 280px;
}

.gallery-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%; /* Favor top of image */
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-card__image {
    transform: scale(1.05);
}

.gallery-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e5e7eb;
}

/* Badge */
.gallery-card__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
    z-index: 2;
}

/* Hover Overlay */
.gallery-card__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.25rem;
    z-index: 1;
}

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

.gallery-card__overlay-content {
    color: white;
}

.gallery-card__image-count {
    font-size: 0.875rem;
    opacity: 0.75;
    margin-bottom: 0.25rem;
}

.gallery-card__overlay-title {
    font-size: 1.125rem;
    font-weight: 700;
}

/* Content Section */
.gallery-card__content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-card__title {
    font-weight: 700;
    font-size: 1.125rem;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.gallery-card__location {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.gallery-card__location svg {
    flex-shrink: 0;
}

.gallery-card__description {
    font-size: 0.875rem;
    color: #4B5563;
    margin-bottom: 0.75rem;
    line-height: 1.5;
    flex: 1;
}

/* Stats Row */
.gallery-card__stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #E5E7EB;
    margin-top: auto;
}

.gallery-card__stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6B7280;
}

.gallery-card__stat svg {
    width: 1rem;
    height: 1rem;
}

/* Grid Layout for Gallery Cards */
.gallery-cards-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .gallery-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1280px) {
    .gallery-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
