/* ============================================================
   Galerie — grille de tableaux + visionneuse plein écran
   ============================================================ */

.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    max-width: 1180px;
    margin: 0 auto 40px auto;
    padding: 0 32px;
    flex-wrap: wrap;
}
.gallery-tab {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    padding: 11px 22px;
    border-radius: 999px;
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}
.gallery-tab:hover { border-color: var(--accent-light); color: var(--accent); }
.gallery-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 2px var(--gold); }
.gallery-tab .count { opacity: 0.75; font-weight: 500; margin-left: 4px; }

.gallery-section {
    display: none;
    max-width: 1180px;
    margin: 0 auto 40px auto;
    padding: 0 32px;
}
.gallery-section.active { display: block; }

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

.gallery-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); outline: 1px solid var(--gold); outline-offset: -1px; }

.gallery-card .thumb-wrap {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--surface-alt);
    cursor: zoom-in;
    position: relative;
}
.gallery-card .thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.gallery-card .thumb-wrap:hover img { transform: scale(1.06); }
.gallery-card .thumb-wrap::after {
    content: '\2295';
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(44, 31, 18, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.gallery-card .thumb-wrap:hover::after { opacity: 1; }

.gallery-card .infos { padding: 14px 16px 16px 16px; }
.gallery-card h3 {
    font-size: 1.05rem;
    font-family: var(--font-body);
    font-weight: 700;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gallery-card .prix {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 600;
}

/* ---------- Visionneuse (lightbox) ---------- */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(24, 16, 8, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay .lightbox-img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    cursor: default;
}
.lightbox-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: max(18px, env(safe-area-inset-bottom));
    text-align: center;
    color: #f4ece0;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    padding: 0 80px;
}
.lightbox-close {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1001;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.lightbox-close:hover { color: var(--gold); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(178, 92, 46, 0.85);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    transition: background 0.2s;
}
.lightbox-nav:hover { background: var(--accent-dark); }
.lightbox-prev { left: max(12px, env(safe-area-inset-left)); }
.lightbox-next { right: max(12px, env(safe-area-inset-right)); }

body.lightbox-open { overflow: hidden; }

@media (max-width: 700px) {
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
    .lightbox-overlay .lightbox-img { max-width: 96vw; max-height: 82vh; }
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.2rem; }
    .lightbox-caption { font-size: 0.95rem; padding: 0 60px; bottom: 10px; }
}
