/**
 * LA PAGE « TUTORIELS ».
 *
 * ⚠ TOUT EST ENFERME SOUS `.nl-tuto`. Cette feuille arrive dans un theme
 * qu'on ne controle pas : aucune regle ne doit sortir du bloc, sous peine de
 * repeindre des pages qui n'ont rien demande.
 *
 * ⭐ LES COULEURS SONT DES VARIABLES, EN HAUT ET NULLE PART AILLEURS. Accorder
 * la page a la charte du site se fait en changeant six lignes, sans relire le
 * reste.
 */

.nl-tuto {
    --nl-encre: #15211c;
    --nl-mine: #5d6a64;
    --nl-trait: #dcdfda;
    --nl-surface: #ffffff;
    --nl-teinte: #8d968f;
    --nl-colonnes: 3;

    --nl-titre: 1.0625rem;
    --nl-menu: 0.875rem;

    color: var(--nl-encre);
    container-type: inline-size;
}

.nl-tuto *,
.nl-tuto *::before,
.nl-tuto *::after {
    box-sizing: border-box;
}

.nl-tuto__invisible {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ── LA BARRE DE FILTRES ─────────────────────────────────────────────────
   Un filet bas, pas une boite : la barre appartient a la page, elle n'est
   pas un panneau pose dessus. */

.nl-tuto__barre {
    /* display: flex; */
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--nl-trait);
}

.nl-tuto__rubriques {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    justify-content: space-evenly;
}

.nl-rub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.4375rem;
    margin: 0;
    padding: 15px;
    border: 1px solid var(--nl-trait);
    border-radius: 3px;
    background: transparent;
    color: var(--nl-mine);
    font: inherit;
    font-size: var(--nl-menu);
    line-height: 1.2;
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
    max-width: 350px;
    width: 24%;
}

.nl-rub:hover {
    color: var(--nl-encre);
    border-color: var(--nl-mine);
}

.nl-rub__desc {
    font-size: 0.75rem;
    font-weight: 200;
}

/* ⭐ L'ETAT ACTIF PREND LA TEINTE DE SA RUBRIQUE, la meme que le filet des
   cartes correspondantes. Le lien entre le filtre et le resultat se voit
   sans avoir a le lire. */
.nl-rub.is-actif {
    background: #22632b;
    border-color: #ffffff;
    color: #fff;
}

.nl-rub[data-nl-rubrique=""].is-actif {
    background: var(--nl-encre);
    border-color: var(--nl-encre);
}

.nl-rub__nom {
    position: relative;
}

.nl-rub__n {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
  font-weight: 200;
}



/* Le champ de recherche : un trait, pas une boite de plus. */
.nl-tuto__chercher input {
    border-radius: 100px;
    margin-bottom: 20px;
}

.nl-tuto__champ {
    width: 100%;
    margin: 0;
    padding: 0.4375rem 0.125rem;
    border: 0;
    border-bottom: 1px solid var(--nl-trait);
    border-radius: 0;
    background: transparent;
    color: var(--nl-encre);
    font: inherit;
    font-size: var(--nl-menu);
    line-height: 1.3;
}

.nl-tuto__champ::placeholder {
    color: var(--nl-mine);
}

.nl-tuto__champ:focus {
    outline: none;
    border-bottom-color: var(--nl-encre);
    border-bottom-width: 2px;
    padding-bottom: calc(0.4375rem - 1px);
}

/* ── LA LEGENDE DE LA RUBRIQUE ───────────────────────────────────────────
   Elle prend la teinte de la rubrique par son filet de gauche : le lien avec
   le bouton actif se voit, sans avoir a repeter son nom. */

.nl-tuto__legende {
    max-width: 58ch;
    margin: 0.875rem 0 0;
    padding-left: 0.75rem;
    border-left: 2px solid var(--nl-teinte);
    color: var(--nl-mine);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.nl-tuto__legende[hidden] {
    display: none;
}

/* ── LES MOTS CLES ───────────────────────────────────────────────────────
   Volontairement plus discrets que les rubriques : ce sont deux niveaux de
   tri, ils ne doivent pas se disputer l'attention. */

.nl-tuto__mots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3125rem;
    margin-top: 0.875rem;
}

.nl-mot {
    margin: 0;
    padding: 0.1875rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 3px;
    background: rgba(21, 33, 28, 0.05);
    color: var(--nl-mine);
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.35;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.nl-mot:hover {
    color: var(--nl-encre);
    background: rgba(21, 33, 28, 0.1);
}

.nl-mot[aria-pressed="true"] {
    background: var(--nl-encre);
    color: #fff;
}

.nl-mot--tout {
    background: transparent;
    border-color: var(--nl-trait);
}

.nl-tuto__compte {
    margin: 1.25rem 0 0.875rem;
    color: var(--nl-mine);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

/* ── LA GRILLE ───────────────────────────────────────────────────────── */

.nl-tuto__grille {
    display: grid;
    grid-template-columns: repeat(var(--nl-colonnes), minmax(0, 1fr));
    gap: 1.75rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@container (max-width: 900px) {
    .nl-tuto__grille {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .nl-rub {
        width: 47.5%;
    }
}

@container (max-width: 560px) {
    .nl-tuto__grille {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .nl-rub {
        width: 100%;
        max-width: 100%;
    }
}

.nl-tuto__case[hidden] {
    display: none;
}

.nl-carte {
    height: 100%;

}

.nl-carte__lien {
    display: flex;
    flex-direction: column;
    gap: 0.6875rem;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    border-radius: 25px !important;
    position: relative;
}

.nl-carte__lien:focus-visible {
    outline: 2px solid var(--nl-encre);
    outline-offset: 4px;
}

/* ⭐ LE FILET DE COULEUR EST LE SEUL ORNEMENT DE LA CARTE, et il dit la
   rubrique. Pas d'ombre, pas de cadre : la vignette porte deja tout le
   poids visuel, en rajouter la noierait. */
.nl-carte__ecran {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    /* border-top: 3px solid var(--nl-teinte); */
    background: #0d1512;
}

.nl-carte__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.15s ease;
}

.nl-carte__lien:hover .nl-carte__image,
.nl-carte__lien:focus-visible .nl-carte__image {
    opacity: 0.72;
}

.nl-carte__jouer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.nl-carte__jouer svg {
    padding: 0.75rem 0.6875rem 0.75rem 0.8125rem;
    border-radius: 50%;
    background: rgba(13, 21, 18, 0.55);
    box-sizing: content-box;
    transition: background 0.15s ease, transform 0.15s ease;
}

.nl-carte__lien:hover .nl-carte__jouer svg,
.nl-carte__lien:focus-visible .nl-carte__jouer svg {
    background: #22632b;
    transform: scale(1.08);
}

.nl-carte__duree {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.125rem 0.3125rem;
    border-radius: 2px;
    background: rgba(13, 21, 18, 0.85);
    color: #fff;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.nl-carte__texte {
    display: block;
    padding: 10px;
    position: absolute;
    bottom: 0;

    backdrop-filter: blur(2.5px);
    -webkit-backdrop-filter: blur(2.5px);
    color: white;
    left: 0;
    right: 0;
}

.nl-carte__rubrique {
    display: block;
    margin-bottom: 0.1875rem;
    color: white;
    font-size: 0.75rem;
    line-height: 1.3;
}

.nl-carte__titre {
    display: block;
    font-size: var(--nl-titre);
    font-weight: 600;
    line-height: 1.35;
    text-wrap: balance;
}

.nl-carte__lien:hover .nl-carte__titre {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── LES ECRANS VIDES ────────────────────────────────────────────────── */

.nl-tuto__rien {
    margin: 2.5rem 0;
    color: var(--nl-mine);
    text-align: center;
}

.nl-tuto__reprise {
    margin-left: 0.375rem;
    padding: 0;
    border: 0;
    background: none;
    color: var(--nl-encre);
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.nl-tuto__note {
    margin: 0.5rem 0 0;
    color: var(--nl-mine);
    font-size: 0.8125rem;
    text-align: center;
}

/* ── LE LECTEUR ──────────────────────────────────────────────────────── */

.nl-lecteur {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.nl-lecteur[hidden] {
    display: none;
}

.nl-lecteur__fond {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 14, 0.88);
}

.nl-lecteur__boite {
    position: relative;
    width: min(100%, 62rem);
}

.nl-lecteur__titre {
    margin: 0 3rem 0.625rem 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
}

.nl-lecteur__cadre {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    background: #000;
}

.nl-lecteur__cadre iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.nl-lecteur__fermer {
    position: absolute;
    top: -0.25rem;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
}

.nl-lecteur__fermer:hover {
    background: rgba(255, 255, 255, 0.24);
}

.nl-lecteur__fermer:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ⚠ LE DEFILEMENT DE LA PAGE EST BLOQUE PENDANT LA LECTURE : sans cela, la
   molette fait glisser la page derriere le lecteur, ce qui donne
   l'impression que la modale a saute. */
body.nl-tuto-fige {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {

    .nl-tuto *,
    .nl-tuto *::before,
    .nl-tuto *::after {
        transition-duration: 0.01ms !important;
    }
}