.gallery-header {
    text-align: center;
    padding: 80px 48px 48px;
    max-width: 700px;
    margin: 0 auto;
}

.gallery-header h1 {
    font-size: 42px;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.gallery-header p {
    font-size: 17px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px 96px;
}

.gallery-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-surface);
    transition: border-color 0.2s;
}

.gallery-card:hover {
    border-color: #555;
}

.gallery-card-img {
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}

.gallery-card-img img {
    display: block;
    width: 100%;
    height: auto;
}

.gallery-card-body {
    padding: 20px 22px 24px;
}

.gallery-card-body h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gallery-card-body p {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.gallery-card-body code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--yellow);
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    user-select: none;
    transition: transform 0.15s ease-out;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    z-index: 10;
}

.lightbox-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
    font-size: 32px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    z-index: 10;
    line-height: 1;
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.lightbox-caption {
    margin-top: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #eee;
}

.lightbox-counter {
    margin-top: 6px;
    font-size: 13px;
    color: #888;
    font-family: var(--font-mono);
}

.lightbox-zoom-hint {
    margin-top: 12px;
    font-size: 12px;
    color: #666;
    font-family: var(--font-mono);
    transition: color 0.2s;
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 24px 64px;
    }

    .gallery-header {
        padding: 56px 24px 36px;
    }

    .gallery-header h1 {
        font-size: 32px;
    }
}
