/* ============================================================================
   Gallery styles — sit inside the Jekyll Architect theme layout
   ============================================================================ */

/* ── Category Nav ──────────────────────────────────────────────────────────── */

.categories-nav {
    margin-bottom: 1.5rem;
}

.categories-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
}

.category-button {
    padding: 0.4rem 1rem;
    border: 1px solid #d0d7de;
    border-radius: 20px;
    background: #fff;
    color: #444;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.category-button:hover {
    background: #f0f4f8;
    border-color: #0366d6;
    color: #0366d6;
}

.category-button.active {
    background: #0366d6;
    border-color: #0366d6;
    color: #fff;
}

/* ── Hero ───────────────────────────────────────────────────────────────────── */

.hero-section {
    margin-bottom: 2rem;
}

.hero-image-only {
    max-width: 340px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    cursor: pointer;
}

.hero-image-only img {
    width: 100%;
    display: block;
    transition: opacity 0.2s;
}

.hero-image-only:hover img {
    opacity: 0.88;
}

/* ── Gallery Grid ───────────────────────────────────────────────────────────── */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.gallery-section-label {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.25rem;
}

.gallery-item {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    background: #f6f8fa;
    transition: box-shadow 0.2s, transform 0.2s;
}

.gallery-item:hover {
    box-shadow: 0 4px 14px rgba(3,102,214,0.2);
    transform: translateY(-3px);
}

.gallery-item-image-wrap {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.gallery-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-item-image {
    transform: scale(1.04);
}

.gallery-item-badge {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    font-size: 0.65rem;
    background: rgba(0,0,0,0.45);
    color: #fff;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 102, 214, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-footer {
    padding: 0.5rem 0.65rem 0.6rem;
    border-top: 1px solid #eaecef;
    background: #fff;
}

.gallery-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #24292f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-story {
    font-size: 0.75rem;
    color: #68737d;
    margin-top: 0.15rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

/* ── Lightbox ───────────────────────────────────────────────────────────────── */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 650px;
    width: 90%;
    max-height: 90vh;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    background: #1b1f23;
}

.lightbox-info {
    padding: 1rem 1.25rem;
    border-top: 1px solid #eaecef;
}

.lightbox-title {
    font-size: 1rem;
    font-weight: 600;
    color: #24292f;
    margin: 0 0 0.25rem;
}

.lightbox-story {
    font-size: 0.875rem;
    color: #68737d;
    margin: 0;
    line-height: 1.6;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.25rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(3,102,214,0.5);
}

.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-prev  { top: 50%; left: 1rem;  transform: translateY(-50%); }
.lightbox-next  { top: 50%; right: 1rem; transform: translateY(-50%); }

/* ── Loading ────────────────────────────────────────────────────────────────── */

.loading {
    color: #888;
    font-size: 0.9rem;
    padding: 2rem 0;
}

.loading.hidden {
    display: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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