/* ==========================================================================
 * GALERIE SPE - DETAIL V3
 * ========================================================================== */

/* --- 1. VARIABLES --- */
:root {
    --accent: #ff6233;
    --text-main: #0f172a;
    --text-light: #64748b;
    --page-bg: #ffffff;
    --border-color: #e2e8f0;
    --bg-dark-trans: rgba(12, 12, 12, 0.95);
}

/* --- 2. DARK MODE --- */
html[data-theme="dark"],
html[data-pd-theme="dark"] {
    --text-main: #f8fafc;
    --text-light: #94a3b8;
    --page-bg: #0f172a;
    --border-color: #334155;
}

body {
    background: var(--page-bg);
    color: var(--text-main);
    margin: 0;
}

/* --- 3. HEADER & BREADCRUMB --- */
.v3-spe-detail-header {
    position: relative;
    text-align: center;
    padding: 120px 20px 100px 20px;
    background-size: cover;
    background-position: center;
    color: white;
}

.v3-spe-detail-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,23,42,0.6), rgba(15,23,42,0.95));
}

.v3-spe-detail-header-content {
    position: relative;
    z-index: 2;
    max-width: 1000px;
    margin: 0 auto;
}

.v3-hero-breadcrumb {
    margin-bottom: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.v3-hero-breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.v3-hero-breadcrumb a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

.v3-hero-breadcrumb a:hover {
    color: var(--accent);
}

.v3-hero-breadcrumb .separator {
    color: rgba(255, 255, 255, 0.3);
}

.v3-hero-breadcrumb span[aria-current="page"] {
    color: #ffffff;
}

.v3-spe-detail-header h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    margin-bottom: 20px;
}

/* --- 4. GRILLE MASONRY --- */
.masonry-gallery {
    max-width: 1600px;
    margin: -40px auto 80px auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.masonry-gallery .grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    aspect-ratio: 2/3;
    background: #0f172a;
    border: 1px solid var(--border-color);
    transition: transform 0.4s, border-color 0.4s;
}

.grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.grid-item:hover img {
    transform: scale(1.05);
}

.grid-item:hover {
    border-color: var(--accent);
}

/* --- 5. LÉGENDES SUR LES IMAGES (HOVER) --- */
.v3-masonry-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s ease;
}

.grid-item:hover .v3-masonry-caption-overlay {
    transform: translateY(0);
    opacity: 1;
}

.v3-caption-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.3;
    margin-bottom: 4px;
}

.v3-caption-author {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- 6. LIGHTBOX ORIGINALE --- */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: var(--bg-dark-trans);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    place-items: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-backdrop.is-open {
    display: grid;
    opacity: 1;
}

.lightbox-content {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 1rem;
    place-items: center;
    max-width: 100%;
}

.lightbox-image-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 95vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    user-select: none;
}

.lightbox-caption {
    color: #fff;
    text-align: center;
    padding: 0.5rem;
    font-family: inherit;
}

.lightbox-caption .caption-text {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 600;
}

.lightbox-caption .caption-author {
    font-size: 0.95rem;
    margin-top: 0.3rem;
    font-style: italic;
    color: var(--accent);
}

/* --- 7. BOUTONS DE NAVIGATION LIGHTBOX --- */
.lightbox-nav,
.lightbox-close {
    position: fixed;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
    width: 50px;
    height: 50px;
    z-index: 10001;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

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

.lightbox-nav:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.08);
}

.lightbox-close {
    top: 20px;
    right: 20px;
    background: transparent;
    font-size: 2.5rem;
}

.lightbox-close:hover {
    background: var(--accent);
    transform: scale(1.08);
}

/* --- 8. BOUTON FLOTTANT RETOUR --- */
.v3-floating-back {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--accent);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(255, 98, 51, 0.4);
    z-index: 100;
    transition: transform 0.3s, background-color 0.3s;
}

.v3-floating-back svg {
    width: 28px;
    height: 28px;
}

.v3-floating-back:hover {
    transform: scale(1.15) translateY(-5px);
    background-color: #e05328;
    color: #fff;
}
