/* === FONTS === */
@font-face {
    font-family: 'Director';
    src: url('Font/Director-Variable.woff2') format('woff2');
    font-weight: 100 900;
}

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

body {
    font-family: 'Director', system-ui, sans-serif;
    background: #fff;
    color: #1a1a1a;
    line-height: 1.5;
}

img { user-select: none; -webkit-user-drag: none; }

/* === HEADER === */
.header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 100;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.header-title {
    font-size: 1.4rem;
    font-weight: 500;
}

.header-subtitle {
    font-size: 0.9rem;
    color: #888;
}

.header-center { text-align: center; }

.header-count {
    font-size: 0.9rem;
    color: #888;
    transition: color 0.2s;
}

.header-count.filtered {
    color: #adbcd9;
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
}

.view-group {
    display: flex;
}

.view-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #e5e5e5;
    background: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}


.view-btn:not(:last-child) { border-right: none; }

.view-btn:hover { background: #f5f5f5; }

.view-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.header-link {
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 500;
}

.header-link:hover { color: #adbcd9; }

/* === SECTIONS === */
.section {
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
}

.section-summary {
    padding: 0.85rem 1.5rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-summary::-webkit-details-marker { display: none; }

.section-summary::before {
    content: "→";
    color: #888;
    display: inline-block;
    transition: transform 0.2s ease;
}

.section[open] > .section-summary::before {
    transform: rotate(90deg);
}

/* === BOÎTES === */
.boite-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.boite-nom { 
    font-weight: 500;
    min-width: 60px;
}

.boite-count { 
    color: #888; 
    font-size: 0.9rem;
    min-width: 80px;
}

.boite-theme { 
    color: #888; 
    font-size: 0.85rem; 
    margin-left: auto;
}

/* === À PROPOS === */
.prose-container {
    max-width: 42rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

.prose-container h2 {
    text-align: center;
    font-weight: 400;
    margin-bottom: 2rem;
}

.prose p {
    text-indent: 2em;
    margin-bottom: 0.25em;
    text-align: justify;
    line-height: 1.75;
}

.prose p:first-child { text-indent: 0; }

.signature {
    text-align: center;
    margin: 2.5rem 0;
    font-style: italic;
}

.bibliographie {
    list-style: none;
    font-size: 0.9rem;
    color: #666;
    border-top: 1px solid #e5e5e5;
    padding-top: 1.5rem;
}

.bibliographie li { margin-bottom: 0.5rem; }

/* Constellation Preview */
.constellation-preview {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.constellation-launch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 3rem;
    background: linear-gradient(135deg, #12121a 0%, #1a2a35 100%);
    border: 1px solid rgba(136, 197, 232, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.constellation-launch:hover {
    transform: translateY(-2px);
    border-color: rgba(136, 197, 232, 0.6);
    box-shadow: 0 8px 32px rgba(136, 197, 232, 0.15);
}

.launch-icon {
    font-size: 2.5rem;
    color: #88c5e8;
    line-height: 1;
}

.launch-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.constellation-hint {
    flex: 1;
}

.constellation-hint span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    display: block;
}

.constellation-hint ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.constellation-hint li {
    font-size: 0.8rem;
    color: #666;
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
}

.constellation-hint li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: #88c5e8;
}

/* === CRÉDITS === */
.credits-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    z-index: 150;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    padding: 2rem 1.5rem;
}

.credits-panel.open {
    transform: translateY(0);
}

.credits-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #888;
}

.credits-close:hover { color: #1a1a1a; }

.credits-content {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem 3rem;
}

.credits-row {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.credits-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.credits-value {
    font-size: 0.9rem;
}

.credits-footer {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: #888;
    font-style: italic;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e5e5;
}

/* === FILTRES === */
.filtres-resume {
    margin-left: auto;
    font-size: 0.85rem;
    color: #adbcd9;
}

.filtres-container {
    padding: 1rem 1.5rem 1.5rem;
}

.filtres-equation {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f8f8;
    border: 1px solid #e5e5e5;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.filtres-equation.visible { display: flex; }

.equation-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.equation-label {
    color: #888;
    font-size: 0.8rem;
}

.equation-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.equation-tag {
    display: inline-flex;
    align-items: center;
    background: #1a1a1a;
    color: #fff;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.equation-tag::after {
    content: "×";
    margin-left: 0.5rem;
    opacity: 0.6;
}

.equation-tag:hover { background: #adbcd9; }

.equation-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.equation-result {
    font-weight: 500;
    color: #adbcd9;
    font-size: 0.9rem;
}

.equation-reset {
    background: none;
    border: 1px solid #ddd;
    padding: 0.3rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.equation-reset:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.equation-add {
    background: #adbcd9;
    color: #fff;
    border: 1px solid #adbcd9;
    padding: 0.3rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.equation-add:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.filtres-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
}

.filtre-groupe { min-width: 0; }

.filtre-titre {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 0.5rem;
}

.filtre-options {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 0.5rem;
    margin-right: -0.5rem;
}

.filtre-options::-webkit-scrollbar {
    width: 4px;
}

.filtre-options::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
}

.filtre-options::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

.filtre-options::-webkit-scrollbar-thumb:hover {
    background: #adbcd9;
}

.filtre-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.85rem;
    cursor: pointer;
}

.filtre-item:hover { color: #adbcd9; }
.filtre-item.active { font-weight: 600; }

.filtre-item.active .filtre-label::before {
    content: "● ";
    color: #adbcd9;
}

.filtre-item.disabled {
    color: #ccc;
    pointer-events: none;
}

.filtre-count {
    font-size: 0.75rem;
    color: #888;
    min-width: 24px;
    text-align: right;
}

.filtre-item.active .filtre-count { color: #adbcd9; }
.filtre-item.disabled .filtre-count { color: #ddd; }

/* === GRILLE === */
.grille {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1.25rem 1.5rem 2rem;
    background: #fff;
}

.grille.compact {
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    padding: 0.5rem 1.5rem 1.5rem;
}

.grille.compact .carte-tags { display: none; }

/* === TABLE LUMINEUSE === */
.grille.lightable {
    background: #1a1a1a;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    padding: 2rem;
    min-height: 60vh;
}

.grille.lightable .carte {
    background: transparent;
    transition: transform 0.2s, box-shadow 0.2s;
}

.grille.lightable .carte > img {
    border: 3px solid #333;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
    transition: all 0.2s;
}

.grille.lightable .carte:hover > img {
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255,255,255,0.25);
    transform: scale(1.02);
}

.grille.lightable .carte-tags {
    background: transparent;
}

.grille.lightable .tag {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}

.grille.lightable .tag:hover {
    background: #adbcd9;
    color: #fff;
}

.grille.lightable .tag-ordre {
    background: rgba(173,188,217,0.8);
    color: #fff;
}

.grille.lightable .carte-add {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.2);
}

.grille.lightable .carte-add:hover {
    background: #adbcd9;
    color: #fff;
}

.grille.lightable .carte-add.active {
    background: #fff;
    color: #1a1a1a;
}

.grille.lightable .carte.has-note::after {
    background: rgba(0,0,0,0.8);
    color: #adbcd9;
}

.grille.liste {
    grid-template-columns: 1fr;
    gap: 0;
}

.grille.liste .carte {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 1.25rem;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.grille.liste .carte:last-child {
    border-bottom: none;
}

.grille.liste .carte > img {
    width: 140px;
    height: 95px;
    object-fit: cover;
}

.grille.liste .carte-tags {
    margin: 0;
    flex-wrap: wrap;
}

.carte { position: relative; }
.carte.hidden { display: none; }

.carte.has-note::after {
    content: "✎";
    position: absolute;
    top: 6px;
    right: 6px;
    background: #fff;
    color: #adbcd9;
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.carte > img {
    width: 100%;
    display: block;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.carte > img:hover {
    transform: scale(1.015);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.grille.compact .carte > img:hover {
    transform: scale(1.03);
}

.carte-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0.5rem;
}

.tag {
    padding: 3px 8px;
    background: #f0f0f0;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.tag:hover {
    background: #adbcd9;
    color: #fff;
}

.tag-ordre {
    background: #adbcd9;
    color: #fff;
    font-weight: 600;
    cursor: default;
}

.tag-ordre:hover { background: #adbcd9; }

.carte-add {
    width: 22px;
    height: 22px;
    background: #e5e5e5;
    color: #888;
    border: none;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.carte-add:hover {
    background: #adbcd9;
    color: #fff;
}

.carte-add.active { 
    background: #1a1a1a;
    color: #fff;
}

/* === LIGHTBOX === */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 200;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox.open { display: flex; }

.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    cursor: pointer;
    transition: transform 0.15s ease-out;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox img:active {
    transition: none;
}

.lightbox-zoom {
    position: absolute;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: #888;
    background: rgba(255,255,255,0.9);
    padding: 0.25rem 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.lightbox-zoom.visible {
    opacity: 1;
}

.lightbox-info {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.lightbox-ordre {
    font-size: 1rem;
    font-weight: 500;
}

.lightbox-hint {
    font-size: 0.8rem;
    color: #888;
}

.lightbox-hint.hidden { display: none; }

.lightbox-notes {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.lightbox:hover .lightbox-notes { opacity: 1; }

.lightbox-notes textarea {
    width: 220px;
    height: 90px;
    padding: 0.6rem;
    border: 1px solid #e5e5e5;
    font-family: inherit;
    font-size: 0.85rem;
    resize: none;
    background: #fff;
}

.lightbox-notes textarea:focus {
    outline: none;
    border-color: #adbcd9;
}

.lightbox-notes button {
    padding: 0.5rem;
    background: #1a1a1a;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
}

.lightbox-notes button:hover { background: #adbcd9; }


/* === INTRO === */
.intro {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #fff;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

.intro.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

/* === PARTIE GAUCHE : Image + Guide en overlay bas === */
.intro-image {
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
}

.intro-image img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

/* Caption photo */
.intro-image-caption {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    right: 1.25rem;
    font-size: 0.72rem;
    color: #ffffff;
    font-style: italic;
    line-height: 1.4;
    z-index: 2;
}

/* Guide en bas de l'image */
.intro-guide {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
    padding: 1.25rem 1.5rem;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.guide-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.guide-icon {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

.guide-text {
    font-size: 0.7rem;
    line-height: 1.4;
    color: #ccc
}

.guide-text strong {
    display: block;
    color: rgba(255,255,255,0.9);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
}

/* === PARTIE DROITE : Contenu textuel === */
.intro-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    max-width: 520px;
    margin: 0 auto;
    height: 100%;
}

/* Header */
.intro-header {
    margin-bottom: 2rem;
}

.intro-header h1 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.3rem;
    line-height: 1.15;
}

.intro-header p {
    color: #888;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

/* Séparateur discret */
.intro-header::after {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: #ddd;
    margin-top: 1.5rem;
}

/* Corps du texte */
.intro-body {
    color: #444;
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.intro-body p {
    margin-bottom: 0;
}

/* Bouton */
.intro-btn {
    background: #1a1a1a;
    color: #fff;
    border: none;
    padding: 0.9rem 2rem;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    align-self: flex-start;
}

.intro-btn:hover { 
    background: #adbcd9;
    transform: translateY(-1px);
}

/* === RESPONSIVE === */
@media (max-width: 1100px) {
    .intro-content {
        padding: 3rem 2.5rem;
        max-width: 100%;
    }
    
    .intro-guide {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    /* Cacher les 2 derniers items sur écrans moyens */
    .intro-guide .guide-item:nth-child(4),
    .intro-guide .guide-item:nth-child(5) {
        display: none;
    }
}

@media (max-width: 900px) {
    .intro {
        grid-template-columns: 1fr;
        grid-template-rows: 50vh auto;
    }
    
    .intro-image {
        height: 50vh;
    }
    
    .intro-content {
        padding: 2rem;
        justify-content: flex-start;
        height: auto;
        max-width: 600px;
    }
    
    .intro-header {
        margin-bottom: 1.5rem;
    }
    
    .intro-header h1 {
        font-size: 1.6rem;
    }
    
    .intro-guide {
        grid-template-columns: repeat(5, 1fr);
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .intro-guide .guide-item:nth-child(4),
    .intro-guide .guide-item:nth-child(5) {
        display: flex;
    }
    
    .guide-text span:not(strong) {
        display: none;
    }
}

@media (max-width: 600px) {
    .intro {
        grid-template-rows: 45vh auto;
    }
    
    .intro-content {
        padding: 1.5rem;
    }
    
    .intro-header h1 {
        font-size: 1.4rem;
    }
    
    .intro-header p {
        font-size: 0.9rem;
    }
    
    .intro-body {
        font-size: 0.88rem;
        line-height: 1.7;
        margin-bottom: 2rem;
    }
    
    .intro-guide {
        grid-template-columns: repeat(3, 1fr);
        padding: 0.75rem;
    }
    
    .intro-guide .guide-item:nth-child(4),
    .intro-guide .guide-item:nth-child(5) {
        display: none;
    }
    
    .guide-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .guide-text strong {
        font-size: 0.65rem;
    }
    
    .intro-btn {
        width: 100%;
        text-align: center;
    }
    
    .intro-image-caption {
        font-size: 0.65rem;
    }
}
/* === SÉLECTION === */
.selection-panel {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 320px;
    background: #fff;
    border: 1px solid #e5e5e5;
    z-index: 90;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    font-size: 0.8rem;
}

.selection-panel.empty {
    width: auto;
}

.selection-panel.empty .selection-body { display: none; }

.selection-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #e5e5e5;
    background: #fafafa;
}

.selection-panel.empty .selection-header {
    border-bottom: none;
}

.selection-title {
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.selection-count {
    margin-left: auto;
    font-size: 0.7rem;
    color: #fff;
    background: #adbcd9;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.selection-panel.empty .selection-count {
    background: #e5e5e5;
    color: #888;
}

.selection-body { 
    padding: 0.6rem 0.75rem; 
}

.selection-miniatures {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    margin-bottom: 0.6rem;
}

.selection-mini {
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: border-color 0.15s;
}

.selection-mini:hover { border-color: #adbcd9; }
.selection-mini.active { border-color: #1a1a1a; }

.selection-mini img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selection-mini button {
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 0.5rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selection-mini:hover button { opacity: 1; }

.selection-actions {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e5e5;
}

.selection-actions button {
    padding: 0.4rem 0.2rem;
    border: 1px solid #e5e5e5;
    background: #fff;
    font-family: inherit;
    font-size: 0.65rem;
    cursor: pointer;
    transition: all 0.15s;
}

.selection-actions button:hover:not(:disabled) {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.selection-actions button:disabled {
    opacity: 0.35;
    cursor: default;
}

.selection-actions button.btn-danger:hover:not(:disabled) {
    background: #d9534f;
    border-color: #d9534f;
}

/* === VISIONNEUSE / RÉTROPROJECTEUR === */
.visionneuse {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250;
    overflow: hidden;
}

.visionneuse.open { 
    display: block; 
}

/* Fond noir profond de la salle */
.visionneuse::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #000;
}

/* Faisceau lumineux du projecteur */
.projector-beam {
    position: absolute;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 120%;
    height: 140%;
    background: radial-gradient(
        ellipse 50% 60% at 50% 40%,
        rgba(255, 250, 235, 0.06) 0%,
        rgba(255, 248, 230, 0.03) 30%,
        rgba(255, 245, 220, 0.01) 50%,
        transparent 70%
    );
    pointer-events: none;
}

/* Écran de projection */
.projector-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Surface de l'écran (légère texture) */
.screen-surface {
    position: relative;
    padding: 20px;
}

/* Monture de diapositive */
.slide-mount {
    position: relative;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 50%, #252525 100%);
    padding: 8px;
    border-radius: 2px;
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.03),
        0 30px 80px rgba(0,0,0,0.8),
        inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Ouverture de la monture */
.slide-mount::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Film de la diapositive */
.slide-film {
    position: relative;
    overflow: hidden;
    background: #000;
}

.slide-film img {
    display: block;
    max-width: 85vw;
    max-height: 85vh;
}

/* Animation de changement de diapo */
.slide-mount.changing {
    animation: slideChange 0.4s ease-out;
}

@keyframes slideChange {
    0% { 
        opacity: 1;
    }
    15% { 
        opacity: 0;
    }
    30% {
        opacity: 0;
    }
    100% { 
        opacity: 1;
    }
}

/* Compteur discret */
.projector-counter {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 2px;
    opacity: 0;
    transition: opacity 0.3s;
}

.visionneuse:hover .projector-counter {
    opacity: 1;
}

/* Flèches de navigation sur les côtés */
.projector-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 80px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.projector-nav-left { left: 1.5rem; }
.projector-nav-right { right: 1.5rem; }

.visionneuse:hover .projector-nav {
    opacity: 1;
}

.projector-nav:hover {
    color: rgba(255,255,255,0.8);
}

/* Barre de contrôle en bas */
.projector-bar {
    position: absolute;
    bottom: 1rem;
    left: 1.5rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s;
}

.projector-bar.projector-bar-right {
    left: auto;
    right: 1.5rem;
}

.visionneuse:hover .projector-bar {
    opacity: 1;
}

.projector-bar-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.projector-bar-btn:hover {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border-color: rgba(255,255,255,0.3);
}

.projector-bar-btn.playing {
    color: #adbcd9;
    border-color: #adbcd9;
}

.projector-bar-btn.muted {
    color: rgba(255,255,255,0.3);
}

.projector-exit {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.2);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s;
}

.visionneuse:hover .projector-exit {
    opacity: 1;
}

.projector-exit:hover {
    color: rgba(255,255,255,0.6);
}

/* Curseur personnalisé dans la visionneuse */
.visionneuse:hover {
    cursor: default;
}

/* === FOND TEXTURE === */
body {
    background-image: url('images_def/fond-texture1.jpg');
    background-repeat: no-repeat;
    background-position: bottom center;
    background-size: 100% auto;
    background-attachment: fixed;
}

/* Masquer l'élément fond-texture s'il existe */
.fond-texture {
    display: none;
}



/* === CONSTELLATION === */
.constellation {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    background: radial-gradient(ellipse at center, #12121a 0%, #08080c 100%);
    z-index: 80;
    overflow: hidden;
}

.constellation.active {
    display: block;
}

.constellation svg {
    width: 100%;
    height: 100%;
    cursor: grab;
}

.constellation svg:active {
    cursor: grabbing;
}

/* Légende */
.constellation-legend {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(12px);
    padding: 1rem 1.25rem;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    z-index: 10;
    min-width: 140px;
}

.legend-title {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 0.35rem;
}

.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-sep {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 0.6rem 0;
}

.legend-hint {
    font-size: 0.55rem;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.1rem;
}

/* Contrôles */
.constellation-controls {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
}

.constellation-btn {
    padding: 0.45rem 0.9rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 2px;
    color: rgba(255,255,255,0.5);
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.constellation-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
}

/* Nœuds filtres */
.constellation .filter-node text {
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    font-family: inherit;
    pointer-events: none;
}

/* Liens entre filtres */
.constellation .filter-link {
    stroke-linecap: round;
    pointer-events: none;
}

/* Images */
.constellation .img-node image {
    transition: filter 0.15s, opacity 0.15s;
}

.constellation .img-node:hover image {
    filter: brightness(1.15);
}

/* Tooltip */
.constellation-tooltip {
    position: absolute;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    z-index: 100;
    max-width: 200px;
    overflow: hidden;
}

.constellation-tooltip.visible {
    opacity: 1;
}

.constellation-tooltip img {
    width: 100%;
    display: block;
}

.constellation-tooltip-info {
    padding: 0.5rem 0.7rem;
}

.constellation-tooltip-ordre {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a1a1a;
}

.constellation-tooltip-meta {
    font-size: 0.65rem;
    color: #888;
    line-height: 1.35;
    margin-top: 0.1rem;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .grille { grid-template-columns: repeat(3, 1fr); }
    .grille.compact { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 900px) {
    .intro {
        grid-template-columns: 1fr;
        grid-template-rows: 40vh 1fr;
    }
    
    .intro-content {
        padding: 2rem;
        max-width: 100%;
    }
    
    .intro-guide {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .grille { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 1rem; }
    .grille.compact { grid-template-columns: repeat(4, 1fr); }
    .boite-theme { display: none; }
    .filtres-grid { grid-template-columns: repeat(3, 1fr); }
    
    .header { grid-template-columns: 1fr 1fr; }
    .header-center { display: none; }
    .view-group { display: none; }
    
    /* Cacher constellation sur mobile */
    .view-btn[data-view="constellation"] { display: none; }
    .constellation { display: none !important; }
    
    .selection-panel {
        width: calc(100% - 3rem);
        right: 1.5rem;
        left: 1.5rem;
    }
    
    .credits-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 500px) {
    .header-subtitle { display: none; }
    .grille { gap: 0.75rem; padding: 0.75rem; }
    .grille.compact { grid-template-columns: repeat(3, 1fr); }
    .filtres-grid { grid-template-columns: 1fr 1fr; }
    
    .selection-panel {
        width: 100%;
        right: 0;
        left: 0;
        bottom: 0;
    }
    .selection-miniatures { grid-template-columns: repeat(5, 1fr); }
    
    .visionneuse-controls { padding: 1rem; gap: 1rem; }
    .visionneuse-nav { width: 40px; height: 40px; font-size: 1rem; }
    .visionneuse-close { padding: 0.4rem 0.75rem; font-size: 0.7rem; }
    
    .intro {
        grid-template-rows: 35vh 1fr;
    }
    
    .intro-content {
        padding: 1.5rem;
    }
    
    .intro-header h1 {
        font-size: 1.4rem;
    }
    
    .intro-body {
        font-size: 0.85rem;
    }
    
    .guide-item {
        gap: 0.6rem;
    }
    
    .guide-icon {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }
    
    .guide-text {
        font-size: 0.75rem;
    }
    
    .guide-text strong {
        font-size: 0.8rem;
    }
    
    .intro-btn {
        width: 100%;
        text-align: center;
    }
}