/**
 * Bluesky Gallery - Main Stylesheet
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #fafafa;
    color: #262626;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #dbdbdb;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 24px;
    font-weight: 400;
    color: #262626;
}

.header-link {
    color: #0095f6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.header-link:hover {
    color: #00376b;
}

/* Gallery Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state h2 {
    font-size: 24px;
    color: #262626;
    margin-bottom: 10px;
}

.empty-state p {
    color: #8e8e8e;
    margin-bottom: 20px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Post Card */
.post-card {
    background: white;
    border: 1px solid #dbdbdb;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Image Container with 4:5 aspect ratio */
.image-container {
    position: relative;
    width: 100%;
    padding-bottom: 125%; /* 4:5 aspect ratio (5/4 = 1.25) */
    overflow: hidden;
    background: #f0f0f0;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Multiple images indicator */
.image-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-content {
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    background: #000;
    display: flex;
    flex-direction: row;
    position: relative;
}

.lightbox-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-width: 0;
}

.lightbox-image img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.lightbox-sidebar {
    width: 300px;
    background: #000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.lightbox-caption {
    padding: 20px;
    background: #000;
    flex: 1;
    overflow-y: auto;
}

.lightbox-text {
    font-size: 12px;
    line-height: 1.6;
    color: #fff;
    margin-bottom: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.lightbox-date {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    color: #262626;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1001;
}

.lightbox-close:hover {
    background: white;
}

/* Image Navigation */
.image-nav {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #000;
    overflow-x: auto;
    border-top: 1px solid #333;
}

.image-nav-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.image-nav-thumb:hover,
.image-nav-thumb.active {
    border-color: #fff;
}

.image-nav-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox Navigation Arrows */
.lightbox-arrows {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: #000;
    justify-content: center;
    border-top: 1px solid #333;
}

.lightbox-arrow {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s;
}

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-arrow:active {
    transform: scale(0.95);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #8e8e8e;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .lightbox.active {
        padding: 0;
        align-items: flex-start;
    }
    
    .lightbox-content {
        flex-direction: column;
        max-width: 100%;
        max-height: 100vh;
    }
    
    .lightbox-image {
        max-height: 60vh;
    }
    
    .lightbox-image img {
        max-height: 60vh;
    }
    
    .lightbox-sidebar {
        width: 100%;
        max-height: 40vh;
    }
    
    .lightbox-close {
        top: 10px;
        right: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .container {
        padding: 20px 10px;
    }
}
