/* AI Citizen Experiment Gallery */

:root {
    --bg-color: #0a0a0f;
    --text-color: #e0e0e0;
    --text-muted: #888;
    --accent-color: #6b5b95;
    --card-bg: #16161d;
    --card-border: #2a2a35;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 3rem 1rem 2rem;
    border-bottom: 1px solid var(--card-border);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Main gallery */
main {
    flex: 1;
    padding: 2rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

#loading {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

/* Gallery grid */
#gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.gallery-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

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

.gallery-item-prompt {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-item-meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#lightbox.hidden {
    display: none;
}

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

#lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

#lightbox-info {
    margin-top: 1.5rem;
    text-align: center;
    max-width: 600px;
}

#lightbox-prompt {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

#lightbox-caption {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

#lightbox-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

#lightbox-close,
#lightbox-prev,
#lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

#lightbox-close:hover,
#lightbox-prev:hover,
#lightbox-next:hover {
    opacity: 1;
}

#lightbox-close {
    top: 1rem;
    right: 1rem;
}

#lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

#lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.75rem;
    }

    #gallery-container {
        grid-template-columns: 1fr;
    }

    #lightbox-prev,
    #lightbox-next {
        display: none;
    }
}
