/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Logo image sizing (when using image logo) */
.logo-link {
    display: inline-block;
}

.logo-image {
    display: block;
    height: 72px; /* fixed max header logo height */
    width: auto;
    max-width: 100%;
}

.tagline {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Main content */
.main {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.1rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

/* Loading indicator */
.loading {
    text-align: center;
    padding: 3rem 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--accent-2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loading.hidden {
    display: none;
}

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

.gallery-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Make each gallery card a column so captions can be vertically centered */
.gallery-item {
    display: flex;
    flex-direction: column;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
    flex: 0 0 auto; /* keep image at fixed height */
}

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

.gallery-item-info {
    padding: 1rem;
    text-align: center;
}

.gallery-item-title {
    font-weight: 500;
    color: #2d3748;
    font-size: 1.1rem;
}

.gallery-caption {
    margin: 0;
    padding: 0 1rem;
    font-size: 0.95rem;
    color: #4a5568;
    text-align: center;
    flex: 1 1 auto; /* take remaining vertical space */
    display: flex;
    align-items: center; /* vertically center caption text */
    justify-content: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.modal-body {
    position: relative;
}

.image-container {
    position: relative;
    overflow: hidden;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

/* Modal loading overlay */
.modal-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.85);
    z-index: 10;
    gap: 0.5rem;
    text-align: center;
    color: #1f2937;
}

.modal-loading p {
    margin: 0;
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: grab;
}

.image-container img:active {
    cursor: grabbing;
}

.image-container img.zoomed {
    cursor: move;
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
}

.zoom-btn {
    background: linear-gradient(135deg, var(--blue-mid) 0%, var(--accent) 100%);
    color: white;
    border: 2px solid var(--accent-2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Error message */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #e53e3e;
    font-size: 1.1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .logo {
        font-size: 2.5rem;
    }

    .logo-image {
        height: 56px;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
    }
    
    .image-container {
        max-height: 60vh;
    }
    
    .zoom-controls {
        bottom: 0.5rem;
        right: 0.5rem;
    }
    
    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .hero {
        margin-bottom: 2rem;
    }
    
    .main {
        padding: 2rem 0;
    }
}
