/* =========================
   LAYOUT GLOBAL
========================= */
.layout-recherche {
    display: flex;
    gap: 60px;
    padding: 40px;
}

/* =========================
   MENU GAUCHE
========================= */
#nav-continents {
    width: 260px;
}

.nav-item {
    padding: 15px;
    margin: 10px 0;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    color: black;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: 0.3s;
}

.nav-item[data-continent="europe"] { background: #7da2c7; }
.nav-item[data-continent="afrique"] { background: #caa67a; }
.nav-item[data-continent="ameriques"] { background: #c97a7a; }
.nav-item[data-continent="asie"] { background: #c9c07a; }
.nav-item[data-continent="oceanie"] { background: #7ac9a3; }

.nav-item:hover {
    transform: translateX(6px);
}

/* =========================
   SOUS MENU
========================= */
.nav-sous-menu {
    margin-left: 15px;
    padding-left: 10px;
    border-left: 3px solid #b89b6d;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-pays {
    padding: 8px;
    background: #f8f1e4;
    border: 2px solid #b89b6d;
    border-radius: 6px;
    cursor: pointer;
}

.nav-pays:hover {
    background: #e6dccb;
}

/* =========================
   CONTENU DROITE
========================= */
.contenu-droite {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =========================
   MEUBLE GLOBAL
========================= */
#liste {   
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 60px;
    margin-top: 40px;
    padding: 50px;
    width: 100%;
    max-width: 1200px;
    background: linear-gradient(145deg, #8b5a2b, #5a3b22);
    border-radius: 20px;
    box-shadow:
        inset 0 0 40px rgba(0,0,0,0.6),
        0 30px 60px rgba(0,0,0,0.7);
    position: relative;
}

/* =========================
   COLONNES
========================= */
.colonne-meuble {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* =========================
   BLOC PERIODE
========================= */
.bloc-periode {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.bloc-periode.open {
    z-index: 100;
}

/* =========================
   TIROIR PERIODE
========================= */
.titre-periode {
    width: 300px;
    height: 65px;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 15px;
    font-weight: bold;
    color: white;

    background-image: url("../images/bois_tiroir.jpg");
    background-size: cover;

    border: 2px solid #5a3b22;
    border-radius: 8px;

    box-shadow:
        inset 0 3px 6px rgba(255,255,255,0.2),
        inset 0 -6px 14px rgba(0,0,0,0.6),
        0 10px 20px rgba(0,0,0,0.5);

    cursor: pointer;
    transition: 0.25s;
    position: relative;
}

.titre-periode:hover {
    transform: translateY(-4px) scale(1.02);
}

/* poignée */
.titre-periode::after {
    content: "";
    width: 40px;
    height: 6px;
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #d6d6d6, #444);
    border-radius: 6px;
}

/* =========================
   CONTENU PERIODE
========================= */
.contenu-periode {
    position: absolute;
    top: 85px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);

    width: 850px;

    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    justify-items: center;

    background: linear-gradient(145deg, #c8945f, #a86e3c);
    border-radius: 12px;
    padding: 20px;

    opacity: 0;
    pointer-events: none;

    transition: 0.3s;

    box-shadow:
        0 25px 50px rgba(0,0,0,0.5),
        inset 0 0 10px rgba(0,0,0,0.5);

    z-index: 200;
}

.bloc-periode.open .contenu-periode {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* =========================
   TIROIR ANNEE
========================= */
.bloc-annee {
    position: relative;
    width: 150px;
    height: 100px;
    cursor: pointer;
    z-index: 1;
}

.bloc-annee.open {
    z-index: 1000;
}

/* FACE */
.face-tiroir {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 16px;
    font-weight: bold;
    color: white;

    background-image: url("../images/bois_tiroir.jpg");
    background-size: cover;

    border: 2px solid #5a3b22;
    border-radius: 6px;

    box-shadow:
        inset 0 3px 6px rgba(255,255,255,0.2),
        inset 0 -6px 14px rgba(0,0,0,0.6),
        0 10px 20px rgba(0,0,0,0.5);

    transition: 0.3s;
}

/* poignée */
.face-tiroir::after {
    content: "";
    width: 30px;
    height: 6px;
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #d6d6d6, #444);
    border-radius: 6px;
}

/* hover */
.bloc-annee:hover .face-tiroir {
    transform: translateY(-5px) scale(1.03);
}

/* ouvert */
.bloc-annee.open .face-tiroir {
    transform: translateY(-12px) scale(1.05);
}

/* =========================
   INTERIEUR TIROIR
========================= */
.interieur-tiroir {
    position: absolute;
    top: 120px;
    left: 0; /* 🔥 aligné à gauche du tiroir */
    width: 950px;
    max-width: calc(100vw - 300px); /* 🔥 évite de sortir écran */
    background: linear-gradient(145deg, #c8945f, #a86e3c);
    border-radius: 12px;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow:
        0 20px 40px rgba(0,0,0,0.4),
        inset 0 0 10px rgba(0,0,0,0.5);
    z-index: 2000;
}

.bloc-annee.open .interieur-tiroir {
    opacity: 1;
    transform: translateY(0); /* 🔥 plus de translateX */
    pointer-events: auto;
}

/* =========================
   TIMBRE
========================= */

.nom {
    font-size: 12px;
    font-weight: bold;
    max-height: 40px;
    overflow: hidden;
    margin-bottom: 6px;
    text-align: center;
}

.timbre {
    width: 120px;
    height: 160px;
    background: #f5efe6;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0,0,0,0.35);
    transition: 0.25s;
}

.timbre:hover {
    transform: scale(1.08);
}

.timbre img {
    max-width: 80px;
    max-height: 60px;
    object-fit: contain;
    margin: 6px 0; 
}

.numero {
    font-size: 11px;
    font-weight: bold;
    margin-top: 10px; 
}

.cote {
    font-size: 10px;
    margin-top: 8px;
}

/* =========================
   COULEURS
========================= */
.timbre-neuf { border: 3px solid #27ae60; background: #eafaf1; }
.timbre-charniere { border: 3px solid #f1c40f; background: #fef9e7; }
.timbre-oblitere { border: 3px solid #2980b9; background: #ebf5fb; }
.timbre-impossible { border: 3px solid #7f8c8d; background: #ecf0f1; opacity: 0.5; }
.timbre-vide { background: #f5efe6; }


/* =========================
   MODE RECHERCHE PROPRE
========================= */
#liste.mode-recherche {
    display: grid !important;
    /* 👉 8 colonnes fixes */
    grid-template-columns: repeat(6, 1fr);
    gap: 25px;
    justify-items: center;
    align-items: start;
    padding: 20px;
}

@media (max-width: 1200px) {
    #liste.mode-recherche {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 800px) {
    #liste.mode-recherche {
        grid-template-columns: repeat(4, 1fr);
    }
}

.lien-timbre{
    text-decoration:none;
    color:inherit;
    display:inline-block;
}