/* Page SEO departement : styles specifiques, tokens cs-* uniquement */

.dept-header {
    margin-bottom: 2rem;
}

.dept-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.dept-header .meta {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

.dept-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.dept-stat {
    text-align: center;
    padding: 1.25rem;
}

.dept-stat-number {
    font-size: 2rem;
    font-weight: 800;
    display: block;
}

.dept-stat-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.dept-rankings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.dept-ranking h2 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cs-teal-soft);
}

.ranking-list {
    list-style: none;
    padding: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--cs-bg-subtle);
}

.ranking-position {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cs-teal-soft);
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    flex-shrink: 0;
}

.ranking-name {
    flex: 1;
    font-size: 0.9rem;
}

.ranking-name a {
    color: var(--color-text);
}

.ranking-score {
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Full commune list */
.commune-list-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cs-teal-soft);
}

.commune-table-wrapper {
    overflow-x: auto;
}

.commune-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.commune-table th,
.commune-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--cs-line);
}

.commune-table th {
    background: var(--cs-bg-subtle);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.commune-table tr:hover {
    background: var(--cs-bg-subtle);
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--cs-paper);
}

/* --- 5 dimensions : cartes chef-lieu --- */
.dept-dims-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.dept-dim {
    background: var(--cs-paper);
    border: 1px solid var(--cs-line);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* garde la taille d'origine (52px, radius 10) : la COULEUR vient de cs-class-letter--X */
.dept-dim__badge {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    font-size: 1.625rem;
    margin-bottom: 0.5rem;
}

.dept-dim__badge.dept-dim__badge--na {
    font-size: 0.75rem;
}

.dept-dim__nom {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--cs-ink-deep);
    margin-bottom: 0.25rem;
}

.dept-dim__label {
    font-size: 0.6875rem;
    color: var(--cs-mute);
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.dept-dim__detail {
    font-size: 0.625rem;
    color: var(--cs-mute);
    line-height: 1.45;
}

/* Lettre de classe neutre (donnee absente) */
.cs-class-letter--na {
    background: var(--cs-line);
    color: var(--cs-mute);
}

/* --- Couleurs de texte par classe (remplace les hex .color du backend) --- */
.dept-classe-txt--a { color: var(--dpe-a); }
.dept-classe-txt--b { color: var(--dpe-b); }
.dept-classe-txt--c { color: var(--cs-ink); }
.dept-classe-txt--d { color: var(--cs-ink); }
.dept-classe-txt--e { color: var(--dpe-e); }
.dept-classe-txt--f { color: var(--dpe-f); }
.dept-classe-txt--g { color: var(--dpe-g); }

/* Cas vide (aucune classe) */
.dept-classe-txt--na { color: var(--cs-mute); }

/* --- Titres de section reutilisables --- */
.dept-h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cs-teal-soft);
}
.dept-h2--sm {
    font-size: 1.2rem;
}

/* --- Pagination --- */
.dept-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.dept-page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.dept-page-num {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--cs-line);
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.dept-page-num--active {
    padding: 0.5rem 0.75rem;
    background: var(--color-primary);
    color: var(--cs-paper);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
}

.dept-page-ellipsis {
    color: var(--color-text-muted);
}

.dept-page-info {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-left: 0.5rem;
}

/* --- FAQ --- */
.dept-faq {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dept-faq__item {
    border: 1px solid var(--cs-line);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    background: var(--cs-paper);
}

.dept-faq__q {
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}

.dept-faq__a {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--cs-mute);
}

/* --- Explorer (navigation interne) --- */
.dept-explore {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dept-explore__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--cs-paper);
    border: 1px solid var(--cs-line);
    border-radius: 10px;
    color: var(--cs-ink-deep);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.dept-explore__link--primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--cs-paper);
    font-weight: 600;
}

/* --- Resume factuel (GEO) --- */
.dept-geo-summary {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--cs-bg-subtle);
    border-radius: 10px;
    border: 1px solid var(--cs-line);
}

.dept-geo-summary__text {
    font-size: 0.93rem;
    line-height: 1.7;
    color: var(--cs-ink);
    margin: 0;
}

@media (max-width: 768px) {
    .dept-rankings { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
    .dept-dims-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 720px) {
    .dept-dims-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .dept-dims-grid {
        grid-template-columns: 1fr;
    }
}
