/* ==========================================================================
   Psy.Link — Rubrique « Ressources » (index, archives de catégorie, article)
   Dépend de site.css (tokens, base, boutons), de accueil.css (vignettes
   .carte-ressource, sections mutualisées) et de motif.css (corps d'article :
   .section-article, .article-grille, .article-sommaire, .article-contenu).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. En-têtes clairs (index et article)
   -------------------------------------------------------------------------- */
.ressources-heros,
.ressource-heros {
    background: linear-gradient(180deg, var(--doux) 0%, var(--blanc) 100%);
    border-bottom: 1px solid var(--ligne);
    padding: 46px 0 40px;
}

/* Le fil d'ariane de motif.css est prévu pour un fond sombre : sur ces
   en-têtes clairs, il faut reprendre les couleurs de texte courantes. */
.fil-ariane-clair {
    color: var(--gris-clair);
}

.fil-ariane-clair a {
    color: var(--gris);
}

.fil-ariane-clair a:hover {
    color: var(--vert-fonce);
}

.ressources-heros h1,
.ressource-heros h1 {
    font-family: var(--ff-titre);
    color: var(--encre);
    letter-spacing: -.02em;
    line-height: 1.15;
    margin: 10px 0 14px;
    font-size: clamp(30px, 4vw, 44px);
}

.ressources-heros-accroche,
.ressource-heros-chapeau {
    font-size: 17px;
    line-height: 1.6;
    color: var(--gris);
    max-width: 62ch;
    margin: 0;
}

/* --------------------------------------------------------------------------
   2. Index : filtres par rubrique
   -------------------------------------------------------------------------- */
.ressources-filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 26px;
}

.puce-filtre {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--rayon-pill);
    border: 1px solid var(--ligne);
    background: var(--blanc);
    color: var(--encre);
    font-size: 14px;
    font-weight: 600;
    transition: border-color .2s ease, background .2s ease, color .2s ease;
}

.puce-filtre span {
    font-size: 12px;
    font-weight: 700;
    color: var(--gris-clair);
}

.puce-filtre:hover {
    border-color: var(--vert);
    color: var(--vert-fonce);
}

/* Pas de .active : conflit avec Bootstrap/Metronic ailleurs dans le projet. */
.puce-filtre.est-courante {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.puce-filtre.est-courante span {
    color: rgba(255, 255, 255, .7);
}

/* --------------------------------------------------------------------------
   3. Index : article à la une, grille, pagination
   -------------------------------------------------------------------------- */
/* L'en-tête de rubrique porte déjà sa respiration : la liste s'en rapproche. */
.section-ressources-index {
    background: var(--blanc);
    padding-top: 40px;
}

.ressource-une {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid var(--ligne);
    border-radius: var(--rayon);
    overflow: hidden;
    box-shadow: var(--ombre-sm);
    margin-bottom: 30px;
    transition: transform .24s ease, box-shadow .24s ease;
}

.ressource-une:hover {
    transform: translateY(-4px);
    box-shadow: var(--ombre);
}

.ressource-une-image {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--menthe);
    min-height: 280px;
}

.ressource-une-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.ressource-une:hover .ressource-une-image img {
    transform: scale(1.04);
}

.ressource-une-corps {
    display: flex;
    flex-direction: column;
    padding: 32px 34px 28px;
}

.ressource-une-categorie {
    position: static;
    align-self: flex-start;
    margin-bottom: 14px;
    background: var(--menthe);
}

.ressource-une-corps strong {
    font-family: var(--ff-titre);
    font-size: clamp(22px, 2.3vw, 28px);
    line-height: 1.2;
    letter-spacing: -.015em;
    color: var(--encre);
    margin-bottom: 12px;
}

.ressource-une-chapeau {
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--gris);
    margin-bottom: 22px;
}

.ressource-une .carte-ressource-pied {
    margin-top: auto;
}

.ressources-vide {
    text-align: center;
    color: var(--gris);
    padding: 40px 0;
}

.ressources-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 36px;
}

.ressources-pagination-etat {
    font-size: 14px;
    color: var(--gris-clair);
}

/* --------------------------------------------------------------------------
   4. Article : en-tête
   -------------------------------------------------------------------------- */
.ressource-heros-grille {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 44px;
    align-items: center;
}

.ressource-heros-image {
    position: relative;
    border-radius: var(--rayon);
    overflow: hidden;
    box-shadow: var(--ombre);
    background: var(--menthe);
    aspect-ratio: 16 / 10;
}

.ressource-heros-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ressource-heros-etiquette {
    position: absolute;
    top: 14px;
    left: 14px;
    background: rgba(255, 255, 255, .93);
    color: var(--teal);
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: var(--rayon-pill);
}

.ressource-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 20px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--ligne);
    font-size: 13.5px;
    color: var(--gris-clair);
}

.ressource-meta-auteur {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.ressource-meta-auteur strong {
    font-size: 14.5px;
    color: var(--encre);
}

/* --------------------------------------------------------------------------
   5. Article : corps
   -------------------------------------------------------------------------- */
/* Sans sommaire, .article-grille laisserait une colonne vide : on recentre. */
.section-article-ressource .article-grille>.article-contenu:only-child {
    grid-column: 1 / -1;
    max-width: 760px;
    margin: 0 auto;
}

.ressource-renvoi-motif {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin: 34px 0 8px;
    padding: 22px 26px;
    border: 1px solid var(--ligne);
    border-left: 4px solid var(--vert);
    border-radius: var(--rayon-sm);
    background: var(--doux);
}

.ressource-renvoi-motif strong {
    display: block;
    font-family: var(--ff-titre);
    font-size: 17px;
    color: var(--encre);
    margin-bottom: 4px;
}

.ressource-renvoi-motif p {
    margin: 0;
    font-size: 14.5px;
    color: var(--gris);
}

/* --------------------------------------------------------------------------
   6. Adaptations
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {

    .ressource-heros-grille,
    .ressource-une {
        grid-template-columns: 1fr;
    }

    .ressource-heros-grille {
        gap: 28px;
    }

    /* L'illustration passe sous le texte : elle ne doit plus dominer l'écran. */
    .ressource-heros-image {
        aspect-ratio: 16 / 9;
    }

    .ressource-une-image {
        min-height: 220px;
        aspect-ratio: 16 / 9;
    }

    .ressource-une-corps {
        padding: 26px 24px 22px;
    }
}

@media (max-width: 640px) {

    .ressources-heros,
    .ressource-heros {
        padding: 32px 0 28px;
    }

    .ressource-renvoi-motif {
        padding: 20px;
    }

    .ressources-pagination {
        flex-wrap: wrap;
    }
}
