@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    line-height: 1.6;
    /* Mobile optimizations */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overscroll-behavior: contain;
}

/* Header */
header {
    position: sticky;
    top: 0;
    background: rgba(250, 250, 250, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid #e0e0e0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    text-align: center;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800; /* Extra Bold */
    letter-spacing: 0.05em;
    font-size: 1.1rem;
    margin: 0;
}

.tagline {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.1rem;
    margin-bottom: 0;
}

/* Filter tags */
.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    text-align: center;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.filter-tag {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    color: #666;
    /* Mobile touch optimizations */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-tag:hover {
    border-color: #333;
    color: #333;
    transform: translateY(-1px);
}

.filter-tag.active {
    background: #1a1a1a;
    color: #fafafa;
    border-color: #1a1a1a;
}

.filter-tag.all {
    font-weight: 600;
}

/* Main Gallery */
.gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0 4rem;
}

.photo-item {
    margin-bottom: 4rem;
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.photo-item.filtered-out {
    display: none;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.photo-wrapper {
    position: relative;
    background: #fafafa;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    /* Mobile touch optimizations */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.photo-wrapper img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    display: block;
    transition: transform 0.3s ease;
    /* Prevent image selection and dragging on mobile */
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.photo-wrapper img:hover {
    transform: scale(1.02);
}

.photo-info {
    margin-top: 1rem;
    padding: 0 1rem;
}

.photo-caption {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.photo-tag {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: #888;
    cursor: pointer;
    transition: color 0.2s ease;
    /* Mobile touch optimizations */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 0.2rem 0.4rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.photo-tag:hover {
    color: #333;
}

.photo-tag:before {
    content: '#';
}

/* Fullscreen overlay */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

.fullscreen-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
}

.close-fullscreen {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.close-fullscreen:hover {
    transform: rotate(90deg);
}

/* Loading state */
.loading {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    text-align: center;
    padding: 2rem;
    color: #888;
}

/* Footer */
footer {
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
    margin-top: 4rem;
}

.footer-content {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

.footer-content p {
    margin: 0.25rem 0;
}

.footer-note {
    font-weight: 300;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    body {
        /* Prevent pull-to-refresh on mobile */
        overscroll-behavior-y: contain;
    }
    
    .header-content {
        padding: 1rem 1rem 0.5rem;
    }
    
    .filter-container {
        padding: 1rem;
        /* Improve scrolling on mobile filter tags */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-tags {
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .photo-item {
        margin-bottom: 3rem;
    }
    
    .photo-info {
        padding: 0 1rem;
    }
    
    /* Larger touch targets for mobile */
    .filter-tag {
        min-height: 48px;
        padding: 0.6rem 1rem;
        white-space: nowrap;
        margin-right: 0.5rem;
    }
    
    .photo-tag {
        min-height: 36px;
        padding: 0.4rem 0.6rem;
    }
}
/* Responsive adjustments */
@media (min-width: 768px) and (max-width: 1199px) {
    h1 {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 0.75rem;
        margin-top: 0.15rem;
    }
    
    .photo-item {
        margin-bottom: 6rem;
    }
    
    /* Add padding for screens smaller than 1200px */
    .gallery {
        padding: 0 1rem 4rem;
    }
    
    .photo-wrapper {
        border-radius: 2px;
    }
    
    /* Caption will be positioned by JavaScript but add some padding */
    .photo-info {
        padding: 0 1rem;
        transition: margin-left 0.2s ease;
    }
}

@media (min-width: 1200px) {
    h1 {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 0.75rem;
        margin-top: 0.15rem;
    }
    
    .photo-item {
        margin-bottom: 6rem;
    }
    
    /* No padding for large screens - caption aligns with image edge */
    .gallery {
        padding: 0 0 4rem;
    }
    
    .photo-wrapper {
        border-radius: 2px;
    }
    
    /* Caption will be positioned by JavaScript */
    .photo-info {
        padding: 0;
        transition: margin-left 0.2s ease;
    }
}