/* ============================================================
   index-layout.css — v3
   Sans carte. Tops en grille horizontale côte à côte.
   v3 : intégration de la grille 3 colonnes de la section carousels
   (événements de la semaine / commerces / associations), reprise du
   <style> qui était en inline dans index.php.
   ============================================================ */

/* ── Wrapper global ── */
.index-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px 16px;
}

/* ── Section carousels ── */
.carousels-section {
    display: flex;
    flex-direction: column;
    gap: 2;
    margin-bottom: 8px;
}

.carousels-section .section-filtreable > * > h4,
.carousels-section .section-filtreable h4:first-child {
    margin-top: 10px;
    margin-bottom: 6px;
}

/* ══════════════════════════════════════════
   GRILLE 3 COLONNES — carousels de l'accueil
   (reprise du <style> inline de index.php)
   - Gauche  : événements de la semaine (carousel vertical)
   - Centre  : commerces locaux / coup de cœur / récents / vus
   - Droite  : associations (carousel vertical)
══════════════════════════════════════════ */
.carousels-section--3col {
    display: grid;
    grid-template-columns: 174px minmax(0, 1fr) 160px;
    gap: 2px;
    align-items: start;
    width: 100%;
}
.col-carousels {
    min-width: 0; /* évite qu'un enfant large ne casse la colonne */
}
.col-evenements,
.col-asso {
    justify-self: center;
}
.col-centre {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}



/* ══════════════════════════════════════════
   TOPS — grille 6 colonnes côte à côte
   Desktop    : 6 colonnes (tous visibles)
   Tablette   : 6 colonnes × 2 lignes
   Mobile     : 3 colonne  (empilés)
   Paysage    : 3 colonnes × 2 lignes compactes
══════════════════════════════════════════ */
.tops-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    align-items: start;
}

/* Chaque top-block remplit sa colonne */
.tops-grid .section-filtreable {
    min-width: 0;   /* évite le débordement en grid */
}

/* ── Top block — compact ── */
.top-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 3px 3px 2px;
    box-shadow: var(--shadow);
    transition: background var(--t), border-color var(--t);
    height: 100%;
    min-width: 0;
}

.top-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1px;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--border);
    gap: 1px;
}
.top-block-header h5 {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-block-header select {
    font-size: .65rem;
    padding: 1px 1px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text-muted);
    cursor: pointer;
    max-width: 90px;
    flex-shrink: 0;
}

/* ── Liste tc ── */
.tc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* ── Item compact en 6 colonnes ── */
.tc-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 52px;
    overflow: hidden;
    border-radius: var(--r);
    cursor: pointer;
    transition: transform var(--t), box-shadow var(--t);
}
.tc-item:hover { transform: translateX(2px); box-shadow: var(--shadow); }

.tc-img-link { position: absolute; inset: 0; }
.tc-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--r);
}
.tc-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg,
        rgba(0,0,0,.55) 0%,
        rgba(0,0,0,.25) 60%,
        rgba(0,0,0,.08) 100%);
    border-radius: var(--r);
    pointer-events: none;
}

/* Rang */
.tc-rank {
    position: absolute;
    left: 6px; top: 50%;
    transform: translateY(-50%);
    font-size: 12px; font-weight: 800;
    color: #fff;
    z-index: 2;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.tc-rank.gold   i { color: #f1c40f; }
.tc-rank.silver i { color: #bdc3c7; }
.tc-rank.bronze i { color: #cd7f32; }

/* Nom */
.tc-name {
    position: absolute;
    bottom: 1px; left: 20px;
    font-size: 10px; font-weight: 700;
    color: #fff; z-index: 2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: calc(100% - 72px);
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
    transition: opacity var(--t);
}
.tc-item:hover .tc-name { opacity: 0; }

/* Ville au hover */
.tc-ville {
    position: absolute;
    bottom: 1px; left: 20px;
    font-size: 9.5px; font-weight: 600;
    color: rgba(255,255,255,.9); z-index: 2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: calc(100% - 72px);
    opacity: 0;
    transition: opacity var(--t);
    text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.tc-item:hover .tc-ville { opacity: 1; }

/* Haut droite */
.tc-top-right {
    position: absolute;
    top: 2px; right: 2px;
    display: flex; align-items: center; gap: 1px;
    z-index: 3;
}

.tc-favori-btn {
    width: 22px; height: 22px;
    border-radius: 50%; border: none;
    background: rgba(0,0,0,.35); color: #fff;
    font-size: 9px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background var(--t), transform var(--t);
    flex-shrink: 0;
}
.tc-favori-btn:hover      { background: rgba(231,76,60,.8); transform: scale(1.15); }
.tc-favori-btn[data-favori="1"] i { color: #e74c3c; }

.tc-score-block {
    display: flex; flex-direction: column;
    align-items: flex-end; gap: 1px;
}
.tc-note {
    font-size: 9px; font-weight: 700;
    padding: 1px 1px; border-radius: 4px;
    background: rgba(0,0,0,.45); color: #fff; line-height: 1;
}
.tc-note.prog-up   { background: rgba(26,188,156,.75); }
.tc-note.prog-down { background: rgba(231,76,60,.75); }

.tc-evals {
    font-size: 8px; color: rgba(255,255,255,.8);
    background: rgba(0,0,0,.3);
    padding: 1px 1px; border-radius: 3px;
    white-space: nowrap;
    opacity: 0; transition: opacity var(--t);
}
.tc-item:hover .tc-evals { opacity: 1; }

/* Loader */
.ranking-loader { display:flex; gap:1px; justify-content:center; align-items:center; }
.ranking-loader span {
    width:5px; height:5px; border-radius:50%;
    background: var(--accent);
    animation: rankPulse 1s infinite ease-in-out;
}
.ranking-loader span:nth-child(2) { animation-delay:.15s; }
.ranking-loader span:nth-child(3) { animation-delay:.30s; }
@keyframes rankPulse {
    0%,80%,100% { transform:scale(.6); opacity:.4; }
    40%         { transform:scale(1);  opacity:1;  }
}

.empty-state { padding:4px; text-align:center; color:var(--text-muted); font-size:.75rem; }
.empty-state-icon { font-size:1.2rem; margin-bottom:3px; }






























/* ══════════════════════════════════════════
   RESPONSIVE — TABLETTE (768–1024px)
   3 colonnes × 2 lignes
══════════════════════════════════════════ */
@media (max-width: 1024px) {
    .index-page { padding: 0 8px 16px; }

    .tops-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}



/* ══════════════════════════════════════════
   PAYSAGE MOBILE (dans ls-main)
   3 colonnes × 2 lignes compactes
══════════════════════════════════════════ */
@media (max-width: 1024px) and (orientation: landscape) {
    .index-page { padding: 0 4px 8px; }

    .tops-grid {
        grid-template-columns: repeat(4, 1fr);

    }

    .top-block { padding: 7px 8px 6px; }
    .tc-item   { height: 44px; }
    .tc-name   { font-size: 9.5px; }
}




/* ══════════════════════════════════════════
   RESPONSIVE — MOBILE (≤767px)
   1 colonne empilée
══════════════════════════════════════════ */
@media (max-width: 567px) {
    .index-page { padding: 0 1px 2px; }

    .tops-grid {
        grid-template-columns: repeat(3, 1fr);

    }

    .tc-item { height: 55px; }

    .carousels-section--3col {
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "evenements asso"
            "centre centre";
    }
    .col-evenements {
        grid-area: evenements;
        justify-self: stretch;
    }
    .col-asso {
        grid-area: asso;
        justify-self: stretch;
    }
    .col-centre {
        grid-area: centre;
    }
}

/* ── Responsive : sous 402px, gauche et droite passent côte à côte
   en une rangée (2 colonnes), puis le centre suit en pleine largeur ── */
@media (max-width: 402px) {
    .carousels-section--3col {
        
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "evenements asso"
            "centre centre";
    }
    .col-evenements {
        grid-area: evenements;
        justify-self: stretch;
    }
    .col-asso {
        grid-area: asso;
        justify-self: stretch;
    }
    .col-centre {
        grid-area: centre;
    }
}



/* ── Sous 200px, gauche/droite trop étroites pour deux carousels côte à
   côte : on repasse en une seule colonne empilée (événements, centre,
   association), dans l'ordre du DOM ── */
@media (max-width: 200px) {
    .carousels-section--3col {
        grid-template-columns: 1fr;
        grid-template-areas:
            "evenements"
            "centre"
            "asso";
    }
}


/* ══════════════════════════════════════════
   SECTION FILTREABLE — reset marges
══════════════════════════════════════════ */
.section-filtreable { margin-bottom: 0; }