/* ============================================================
   ling-rank.css — CORPS des pages « classement » du vertical LINGUA.
   Le HERO vient de ling-article.css (.ling-article-hero--split), chargé juste
   avant : on ne définit ici que le sommaire, les sections numérotées et les
   médias. Tout est préfixé .ling-rank-.

   Repris de rank.css (modèle tourisme) avec la largeur de colonne du vertical
   lingua (940px, comme ling-article) au lieu des 760px du tourisme.
   ============================================================ */

.ling-rank {
    --lr-text: 940px;          /* largeur de la colonne de lecture (= ling-article) */
    --lr-ink: #0f172a;
    --lr-muted: #64748b;
    --lr-line: #e6e8ee;
    --lr-soft: #f6f8fc;
    --lr-accent: var(--color-primary, #3b82f6);
    --lr-accent-hover: var(--color-primary-dark, #2563eb);
}

/* ---- Sommaire ---- */
.ling-rank-toc {
    max-width: var(--lr-text);
    margin: 4.5rem auto 0;          /* respiration après le hero (cf. ling-article) */
    padding: 1.5rem;
    background: var(--lr-soft);
    border: 1px solid var(--lr-line);
    border-radius: 16px;
    width: calc(100% - 2 * var(--padding-x, 1.25rem));
}
.ling-rank-toc-title {
    margin: 0 0 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--lr-muted);
}
.ling-rank-toc-list {
    list-style: none;
    counter-reset: lrtoc;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
}
@media (min-width: 720px) { .ling-rank-toc-list { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
.ling-rank-toc-list a {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    color: var(--lr-ink);
    text-decoration: none;
    font-size: 0.97rem;
    line-height: 1.5;
    transition: color 0.15s ease;
}
.ling-rank-toc-list a:hover,
.ling-rank-toc-list a.is-active { color: var(--lr-accent); }
.ling-rank-toc-list a.is-active { font-weight: 600; }
.ling-rank-toc-num {
    flex: 0 0 auto;
    min-width: 1.35rem;
    font-weight: 700;
    color: var(--lr-accent);
    font-variant-numeric: tabular-nums;
}

/* ---- Contenu : sections numérotées en flux vertical ---- */
.ling-rank-content {
    counter-reset: lr;
    max-width: var(--lr-text);
    margin: 4rem auto 4.5rem;
    padding: 0 var(--padding-x, 1.25rem);
}
.ling-rank-content > section {
    counter-increment: lr;
    scroll-margin-top: 90px;
}
.ling-rank-content > section:not(:first-child) {
    margin-top: 4.75rem;
    padding-top: 4.75rem;
    border-top: 1px solid var(--lr-line);
}
.ling-rank-content > section > h2 {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0 0 1.1rem;
    scroll-margin-top: 90px;
    color: var(--lr-ink);
}
/* La numérotation est portée par le CSS : les <h2> en base ne doivent PAS
   contenir « 1. » en dur, sinon double numérotation. */
.ling-rank-content > section > h2::before {
    content: counter(lr);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 12px;
    background: var(--lr-accent);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

/* Corps de texte */
.ling-rank-content p,
.ling-rank-content ul,
.ling-rank-content ol { font-size: 1.02rem; line-height: 1.75; color: #334155; }
.ling-rank-content > section > * + * { margin-top: 1rem; }
.ling-rank-content h3 { font-size: 1.12rem; line-height: 1.4; color: var(--lr-ink); margin-top: 1.7rem; }
.ling-rank-content ul,
.ling-rank-content ol { padding-left: 1.25rem; }
.ling-rank-content li + li { margin-top: 0.4rem; }
.ling-rank-content a {
    color: var(--lr-accent);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
}
.ling-rank-content a:hover { color: var(--lr-accent-hover); }

/* ---- Média de section : regroupé sous le <h2> ---- */
.ling-rank-media { margin: 0.25rem 0 1.6rem; }
.ling-rank-media > * + * { margin-top: 0.75rem; }

/* Images : hauteur plafonnée, recadrage cover. 1 / 2 colonnes / 1 pleine + 2. */
.ling-rank-imgs { display: grid; gap: 0.75rem; }
.ling-rank-imgs--1 { grid-template-columns: 1fr; }
.ling-rank-imgs--2 { grid-template-columns: 1fr 1fr; }
.ling-rank-imgs--3 { grid-template-columns: 1fr 1fr; }
.ling-rank-imgs--3 > .ling-rank-figure:first-child { grid-column: 1 / -1; }
.ling-rank-imgs--grid { grid-template-columns: repeat(2, 1fr); }
.ling-rank-imgs .ling-rank-figure { margin: 0; }
.ling-rank-imgs .ling-rank-figure img {
    display: block;
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 14px;
}
/* Une image seule est plus haute : c'est l'illustration principale de l'entrée */
.ling-rank-imgs--1 .ling-rank-figure img { height: 340px; }

/* Fond « skeleton » pendant le chargement + angles identiques à l'image
   (sinon on voit les coins gris du <picture> dépasser). */
.ling-rank-imgs .ling-rank-figure picture {
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: var(--lr-soft);
}
.ling-rank-imgs .ling-rank-figure picture img { border-radius: inherit; }

/* ---- Vidéo YouTube au clic (poster -> iframe) ---- */
.ling-rank-media .ling-rank-figure.ling-rank-video { margin: 0; }
.ling-rank-video-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 14px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}
.ling-rank-video-thumb img,
.ling-rank-video-thumb picture,
.ling-rank-video-thumb iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}
.ling-rank-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    pointer-events: none;
    opacity: 0.92;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.ling-rank-video-thumb:hover .ling-rank-play-btn { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
.ling-rank-video-thumb.is-playing { cursor: default; }
.ling-rank-video-thumb.is-playing .ling-rank-play-btn { display: none; }

/* ---- Tableau d'activités ---- */
.ling-rank-table-wrap { overflow-x: auto; margin-top: 1.25rem; }
.ling-rank-actc-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ling-rank-actc-table th {
    text-align: left;
    padding: 0.7rem 0.75rem;
    border-bottom: 2px solid var(--lr-line);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--lr-muted);
}
.ling-rank-actc-table td { padding: 0.75rem; border-bottom: 1px solid var(--lr-line); vertical-align: middle; }
.ling-rank-actc-formule { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--lr-ink); }
.ling-rank-actc-thumb img { display: block; width: 88px; height: 60px; object-fit: cover; border-radius: 8px; }
.ling-rank-actc-name { font-weight: 600; line-height: 1.35; }
.ling-rank-price { font-weight: 700; white-space: nowrap; }

/* ---- Conclusion ---- */
.ling-rank-conclusion {
    max-width: var(--lr-text);
    margin: 0 auto 5rem;
    padding: 1.75rem;
    background: var(--lr-soft);
    border: 1px solid var(--lr-line);
    border-radius: 16px;
    width: calc(100% - 2 * var(--padding-x, 1.25rem));
}
.ling-rank-conclusion > * + * { margin-top: 1rem; }
.ling-rank-conclusion p { font-size: 1.02rem; line-height: 1.75; color: #334155; }

/* ---- Mobile ---- */
@media (max-width: 700px) {
    .ling-rank-toc { padding: 1.2rem; }
    .ling-rank-content > section:not(:first-child) { margin-top: 3.25rem; padding-top: 3.25rem; }
    .ling-rank-content > section > h2 { gap: 0.65rem; }
    .ling-rank-content > section > h2::before { width: 2.1rem; height: 2.1rem; font-size: 0.95rem; }
    /* En mobile chaque image passe pleine largeur : la grille 2 colonnes
       donnerait des vignettes trop petites pour être lisibles. */
    .ling-rank-imgs,
    .ling-rank-imgs--2,
    .ling-rank-imgs--3,
    .ling-rank-imgs--grid { grid-template-columns: 1fr; }
    .ling-rank-imgs--3 > .ling-rank-figure:first-child { grid-column: auto; }
    .ling-rank-imgs .ling-rank-figure img,
    .ling-rank-imgs--1 .ling-rank-figure img { height: 220px; }
    .ling-rank-conclusion { padding: 1.4rem 1.2rem; }
    /* Tableau d'activités : en cartes empilées */
    .ling-rank-actc-table thead { display: none; }
    .ling-rank-actc-table tr { display: block; border-bottom: 1px solid var(--lr-line); padding: 0.6rem 0; }
    .ling-rank-actc-table td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: 0.35rem 0; }
    .ling-rank-actc-table td[data-label]::before {
        content: attr(data-label);
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--lr-muted);
    }
}
