.resources-toolbar {
    display: grid;
    grid-template-columns: 1.4fr repeat(2, minmax(160px, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
    margin-top: 1.5rem;
}

.resources-field {
    display: grid;
    gap: 0.35rem;
}

.resources-field label {
    color: var(--muted, #64748b);
    font-size: 0.82rem;
    font-weight: 700;
}

.resources-field input,
.resources-field select {
    width: 100%;
    min-height: 44px;
    padding: 0.7rem 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    color: #061326;
    font: inherit;
}

.resources-field input:focus,
.resources-field select:focus {
    border-color: rgba(14, 165, 233, 0.85);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.resources-count {
    margin-top: 1rem;
    color: var(--muted, #64748b);
    font-size: 0.95rem;
}

.resources-count a {
    color: #0284c7;
    font-weight: 700;
    text-underline-offset: 3px;
}

#resources-list {
    scroll-margin-top: 100px;
}

/* ==========================================================
   Liste compacte des ressources
   ========================================================== */

.resources-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.resource-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    min-height: 0;
    padding: 1.15rem 1.3rem;
    color: inherit;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.resource-card:hover {
    transform: translateY(-2px);
    border-color: rgba(14, 165, 233, 0.3);
    box-shadow: 0 16px 36px rgba(6, 19, 38, 0.09);
}

.resource-card:hover .resource-card__title {
    color: var(--primary, #0ea5e9);
}

.resource-card__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.resource-card__image {
    width: 150px;
    height: 150px;
    flex: 0 0 150px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    background: rgba(14, 165, 233, 0.08);
    box-shadow: 0 6px 16px rgba(6, 19, 38, 0.09);
}

.resource-card__image img {
    display: block;
    width: 150px;
    height: 150px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.resource-card__badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    width: 100%;
}

.resource-chip {
    --resource-chip-color: #0ea5e9;

    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.3rem 0.55rem;
    border: 1px solid color-mix(
        in srgb,
        var(--resource-chip-color) 22%,
        transparent
    );
    border-radius: 999px;
    background: color-mix(
        in srgb,
        var(--resource-chip-color) 10%,
        #ffffff
    );
    color: #075985;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
}

.resource-card__body {
    min-width: 0;
}

.resource-card__type {
    margin-bottom: 0.25rem;
    color: #0284c7;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.resource-card__title {
    margin: 0;
    color: white;
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.3;
    letter-spacing: -0.015em;
    transition: color 0.2s ease;
}

.resource-card__summary {
    display: -webkit-box;
    overflow: hidden;
    line-clamp: 2;              /* Standard */
    -webkit-line-clamp: 2;      /* Compatibilité */
    -webkit-box-orient: vertical;
    margin: 0.45rem 0 0;
    color: var(--muted, #64748b);
    font-size: 0.88rem;
    line-height: 1.55;
}

.resource-card__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content:space-between;
    gap: 0.35rem 1rem;
    margin-top: 0.65rem;
    color: var(--muted, #64748b);
    font-size: 0.75rem;
    line-height: 1.4;
}

.resource-card__meta{
    display:flex;
    flex-wrap:wrap;
    gap:.35rem 1rem;
}

.resource-card__meta span + span::before{
    content:"•";
    margin-right:1rem;
    color:#94a3b8;
}

.resource-empty {
    margin-top: 1.5rem;
    padding: 2rem;
    text-align: center;
}

/* ==========================================================
   Types de ressources
   ========================================================== */

.resource-type-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.resource-type-card {
    color: inherit;
    text-decoration: none;
}

.resource-type-card h3 {
    margin-bottom: 0.4rem;
}

/* ==========================================================
   Responsive liste et filtres
   ========================================================== */

@media (max-width: 980px) {
    .resources-toolbar,
    .resource-type-grid {
        grid-template-columns: 1fr 1fr;
    }

    .resources-toolbar .btn {
        width: 100%;
    }

    .resource-card {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 1rem;
        padding: 1rem;
    }

    .resource-card__summary {
        line-clamp: 3;
        -webkit-line-clamp: 3;
    }
}

@media (max-width: 680px) {
    .resources-toolbar,
    .resource-type-grid {
        grid-template-columns: 1fr;
    }

    .resources-grid {
        gap: 0.75rem;
    }

    .resource-card {
        grid-template-columns: 70px minmax(0, 1fr);
        gap: 0.85rem;
        padding: 0.9rem;
    }

    .resource-card__aside {
        gap: 0.6rem;
    }

    .resource-card__badges {
        width: auto;
    }

    .resource-chip {
        padding: 0.25rem 0.4rem;
        font-size: 0.61rem;
        line-height: 1.2;
    }

    .resource-card__type {
        font-size: 0.65rem;
    }

    .resource-card__title {
        font-size: 0.98rem;
    }

    .resource-card__summary {
        margin-top: 0.35rem;
        font-size: 0.82rem;
        line-height: 1.45;
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }

    .resource-card__footer {
        gap: 0.25rem 0.6rem;
        margin-top: 0.5rem;
        font-size: 0.7rem;
    }

    .resource-card__footer span + span::before {
        margin-right: 0.6rem;
    }
}

/* ==========================================================
   Ancienne page de détail
   Conservée pour compatibilité
   ========================================================== */

.resource-detail {
    min-height: 100vh;
    background: #fff;
}

.resource-header {
    padding: 5rem 0 3rem;
    background:
        radial-gradient(
            circle at top left,
            rgba(14, 165, 233, 0.12),
            transparent 32rem
        ),
        #f8fafc;
}

.resource-header__container {
    max-width: 920px;
}

.resource-header__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.resource-label {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 800;
}

.resource-header h1 {
    max-width: 900px;
    margin: 0;
    color: #061326;
    font-size: clamp(2.2rem, 5vw, 4.2rem);
    line-height: 1.08;
}

.resource-header__subtitle {
    max-width: 780px;
    margin: 1.25rem 0 0;
    color: #475569;
    font-size: 1.25rem;
    line-height: 1.6;
}

.resource-header__details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.25rem;
    margin-top: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

.resource-cover {
    padding-top: 2rem;
}

.resource-cover .container {
    max-width: 1100px;
}

.resource-cover img {
    display: block;
    width: 100%;
    max-height: 620px;
    object-fit: cover;
    border-radius: 24px;
}

.resource-layout {
    max-width: 920px;
}

.resource-content {
    color: #334155;
    font-size: 1.08rem;
    line-height: 1.8;
}

.resource-summary {
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid #0ea5e9;
    border-radius: 0 16px 16px 0;
    background: #f8fafc;
    color: #334155;
    font-size: 1.12rem;
    font-weight: 600;
}

.resource-rich-content h2 {
    margin: 2.5rem 0 1rem;
    color: #061326;
    font-size: 1.8rem;
    line-height: 1.25;
}

.resource-rich-content h3 {
    margin: 2rem 0 0.85rem;
    color: #061326;
    font-size: 1.4rem;
    line-height: 1.3;
}

.resource-rich-content h4 {
    margin: 1.6rem 0 0.75rem;
    color: #061326;
}

.resource-rich-content p {
    margin: 0 0 1.25rem;
}

.resource-rich-content ul,
.resource-rich-content ol {
    margin: 0 0 1.4rem;
    padding-left: 1.5rem;
}

.resource-rich-content li {
    margin-bottom: 0.45rem;
}

.resource-rich-content blockquote {
    margin: 2rem 0;
    padding: 1.2rem 1.5rem;
    border-left: 4px solid #0ea5e9;
    background: #f8fafc;
    color: #334155;
}

.resource-rich-content a {
    color: #0284c7;
    font-weight: 700;
}

.resource-rich-content table {
    width: 100%;
    margin: 1.75rem 0;
    border-collapse: collapse;
}

.resource-rich-content th,
.resource-rich-content td {
    padding: 0.75rem;
    border: 1px solid #cbd5e1;
    text-align: left;
}

.resource-rich-content th {
    background: #f1f5f9;
    color: #061326;
}

@media (max-width: 680px) {
    .resource-header {
        padding: 3.5rem 0 2.5rem;
    }

    .resource-header h1 {
        font-size: 2.25rem;
    }

    .resource-content {
        font-size: 1rem;
    }
}