/* Ressources : grille claire, aperçus lisibles et ligne bleue entre les groupes. */
html:has(body .resources-main) { color-scheme: light; background: #fff; }
body:has(.resources-main) {
    --resources-blue: #0091ff;
    --resources-ink: #111;
    position: relative;
    isolation: isolate;
    background: #fff;
    color: var(--resources-ink);
}
body:has(.resources-main)::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    transform: translateX(-50%);
    background: var(--resources-blue);
    pointer-events: none;
}
body:has(.resources-main) > :is(.site-header, .resources-main, .site-footer) { position: relative; z-index: 1; }
.resources-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(40px, 6vw, 64px);
    width: min(100% - 40px, 1100px);
    margin: 18px auto 76px;
    overflow-wrap: anywhere;
}
.resources-main > * { min-width: 0; }
.resources-heading { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(100%, 900px); background: #fff; }
.resources-main h1 {
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 14px 20px;
    background: #fff;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    font-weight: 500;
    letter-spacing: .1em;
    line-height: 1.35;
    text-align: center;
}
.resources-introduction { width: min(100%, 680px); padding: 12px 20px; background: #fff; font-size: clamp(1rem, 1.2vw, 1.12rem); line-height: 1.75; text-align: center; }
.resources-introduction > :first-child { margin-top: 0; }
.resources-introduction > :last-child { margin-bottom: 0; }
.resources-introduction:empty { display: none; }
.resource-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(100%, 900px); padding: 12px; background: #fff; }
.resource-filters a { display: inline-flex; align-items: center; min-height: 44px; padding: 7px 12px; border: 1px solid #777; border-radius: 4px; color: #111; font-size: .875rem; text-decoration: none; }
.resource-filters a:hover { border-color: #005baa; color: #005baa; }
.resource-filters [aria-current] { border-color: #005baa; background: #eaf5ff; color: #005baa; font-weight: 600; }
.resource-section { width: 100%; padding: 12px 16px; background: #fff; }
.resource-section h2 { margin: 0 0 24px; font-size: 1rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.resource-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; list-style: none; margin: 0; padding: 0; align-items: start; }
.resource-card { display: flex; flex-direction: column; min-width: 0; padding: 14px 0 0; border-top: 1px solid #ddd; background: #fff; }
.resource-title { margin: 0 0 14px; font-size: 1.0625rem; font-weight: 600; line-height: 1.4; }
.resource-preview { position: relative; display: flex; align-items: center; justify-content: center; height: 240px; background: #f6f6f6; text-decoration: none; cursor: zoom-in; }
.resource-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.resource-preview-hint { position: absolute; right: 6px; bottom: 6px; padding: 3px 6px; background: #fff; color: #111; font-size: .75rem; line-height: 1.3; }
.resource-preview-unavailable { cursor: default; }
.resource-preview p { margin: 0; padding: 8px; color: #555; font-size: .875rem; text-align: center; }
.resource-details { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding-top: 12px; }
.resource-format,
.resource-file-info { margin: 0; color: #555; font-size: .8125rem; line-height: 1.4; }
.resource-description { margin: 4px 0; font-size: .875rem; }
.resource-description summary { min-height: 44px; padding: 9px 0; cursor: pointer; }
.resource-description p { margin: 4px 0 8px; line-height: 1.6; }
.resource-download { display: flex; align-items: center; justify-content: center; max-width: 100%; min-height: 44px; margin-top: 8px; padding: 8px 12px; border: 1px solid #005baa; border-radius: 4px; color: #005baa; font-size: .8125rem; font-weight: 600; text-align: center; text-decoration: none; }
.resource-download:hover { background: #eaf5ff; }
.resource-unavailable { margin: 8px 0 0; color: #555; font-size: .875rem; }
.resources-main :is(a, summary):focus-visible,
.resource-lightbox button:focus-visible { outline: 2px solid var(--resources-blue, #0091ff); outline-offset: 4px; }
.resource-pagination { width: min(100%, 680px); padding: 8px 16px; background: #fff; }
.resource-pagination ul { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.resource-pagination a,
.resource-pagination span { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px; }
.resource-pagination .current { border-bottom: 2px solid var(--resources-blue); font-weight: 600; }
.resources-empty,
.resources-main > a { width: min(100%, 680px); margin: 0; padding: 12px 20px; background: #fff; text-align: center; }
.resources-main > a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; color: #005baa; }
.resource-lightbox { width: min(94vw, 1200px); max-width: 94vw; max-height: 94dvh; padding: 0; border: 0; background: transparent; color: #111; overflow: auto; }
.resource-lightbox::backdrop { background: rgba(0, 0, 0, .72); }
.resource-lightbox-panel { padding: 12px; border: 1px solid #ddd; border-radius: 4px; background: #fff; }
.resource-lightbox-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.resource-lightbox h2 { margin: 8px 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.resource-lightbox-close { flex-shrink: 0; min-height: 44px; padding: 8px 12px; border: 1px solid #005baa; border-radius: 4px; background: #fff; color: #005baa; cursor: pointer; }
.resource-lightbox-stage { display: flex; align-items: center; justify-content: center; min-height: 80px; }
.resource-lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(90dvh - 120px); object-fit: contain; }
.resource-lightbox-error { color: #9d1c1c; }
html.resource-preview-open { overflow: hidden; }
@media (min-width: 640px) {
    .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
    .resource-preview { height: 220px; }
}
@media (min-width: 900px) { .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 40rem) {
    .resources-main { width: min(100% - 36px, 1100px); margin-top: 12px; margin-bottom: 56px; gap: 40px; }
    .resources-main h1 { padding: 12px; font-size: clamp(1.3rem, 5vw, 1.65rem); }
    .resources-introduction,
    .resource-section { padding: 10px 12px; }
    .resource-filters { padding-inline: 8px; }
}
