/* Base Card Styling */
.closedCard, .openedCard {
    background: #ffffff;
    border-radius: 12px;
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #e1e8ed;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

/* Hover effect for the closed state */
.closedCard:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Expanded State Elevation */
.openedCard {
    flex-direction: column;
    box-shadow: 0 12px 30px rgba(108, 92, 231, 0.15);
    border-color: #6c5ce7;
}

/* The "Head" container (Button + Name) */
.closedCard div, .openedCard div {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* The Expand/Collapse Button */
.closedCard button, .openedCard button {
    background: #f1f2f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.closedCard button:hover, .openedCard button:hover {
    background: #6c5ce7;
    color: white;
}

/* Project Name Label */
.closedCard label:first-of-type,
.openedCard label:first-of-type {
    font-weight: 700;
    font-size: 1.2rem;
    color: #2d3436;
    cursor: pointer;
}

.closedCard label.cardHead:hover,
.openedCard label.cardHead:hover
{
    color: #6c5ce7;
    text-decoration: underline;
}

/* Resume/Description Text */
.closedCard label:last-of-type,
.openedCard label:last-of-type {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #636e72;
    display: block;
    transition: opacity 0.3s ease;
}

/* Page Title Styling */
h1 {
    text-align: center;
    font-family: 'Segoe UI', sans-serif;
    color: #2d3436;
    margin-top: 30px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* ===== Base layout ===== */
#page{
    width: min(1120px, 92vw);
    margin: 32px auto;
    padding: 18px;
    box-sizing: border-box;
    display : grid;

    background: transparent; /* on évite le gros pavé */
}

/* ===== Top bar ===== */
#topBar{
    display: inline-flex;           /* shrink to content */
    gap: 10px;
    padding: 8px;
    border-radius: 999px;

    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(20, 20, 20, 0.10);
    box-shadow: 0 10px 24px rgba(0,0,0,0.10);

    position: sticky;
    top: 16px;
    z-index: 50;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* centré */
    margin: 0 auto 18px;
    left: 50%;
    transform: translateX(-50%);
}

/* Onglets */
#topBar > label{
    padding: 10px 14px;
    border-radius: 999px;

    font: 700 14px/1.1 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Arial;
    color: rgba(10, 12, 20, 0.72);
    cursor: pointer;
    user-select: none;

    background: transparent;
    border: 1px solid transparent;

    transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

#topBar > label:hover{
    background: rgba(124, 92, 255, 0.10);
    border-color: rgba(124, 92, 255, 0.18);
    transform: translateY(-1px);
}

/* Onglet actif (on le gère via une classe en JS, voir plus bas) */
#topBar > label.active{
    color: rgba(255,255,255,0.96);
    background: linear-gradient(135deg, #7c5cff, #22d3ee);
    box-shadow: 0 10px 18px rgba(124, 92, 255, 0.25);
    border-color: rgba(255,255,255,0.35);
}

/* ===== Contenu ===== */
.liste{
    display: none;           /* pas de "vide" */
    visibility: hidden;
    opacity: 0;

    transition: opacity 180ms ease;
}

.liste.active{
    display: flex;
    visibility: visible;
    opacity: 1;
    /*grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));*/
    flex-wrap : wrap;
    gap: 18px;
    /*align-items: start;*/
    justify-content : center;
    padding: 6px;
    align-items: stretch;
}

/* Les cartes doivent être des blocs et prendre une taille cohérente */
.liste.active > *{
  display: block;
  flex: 1 1 280px;   /* min width ~280px, puis wrap */
  max-width: 420px;  /* optionnel pour éviter des cartes trop larges */
  box-sizing: border-box;
}

/* Bonus: si tes ProjectCard sont des custom elements, ça aide la mise en page */
.liste > *{
    width: 100%;
    min-width: 0;
}

/* Mobile */
@media (max-width: 560px){
    #topBar{
        width: max-content;
        max-width: 92vw;
        overflow-x: auto;
    }
    .liste.active{
        /*grid-template-columns: 1fr;*/
        justify-content:stretch;
    }
}