/* P2.4 : uniquement les regroupements du catalogue et les trois raccourcis. */
.public-resource-catalog .resource-available > h2,
.public-resource-catalog .resource-announcements > h2 {
    margin-bottom: var(--space-6);
}
.public-resource-catalog .resource-announcements,
.public-resource-catalog .resource-suggestion {
    margin-top: var(--space-10);
}
.public-resource-catalog .resource-announcements-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}
.public-resource-catalog .resource-announcement {
    min-width: 0;
    padding: var(--space-4);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}
.public-resource-catalog .resource-announcement-status {
    display: block;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-2);
}
.public-resource-catalog .resource-announcement .template-card-title {
    font-size: var(--fs-base);
}
.public-resource-catalog .resource-announcement-meta {
    color: var(--text-secondary);
    font-size: var(--fs-xs);
}
/* La suggestion existante reste distincte des six outils et des six annonces. */
.public-resource-catalog .resource-suggestion .request-template {
    min-height: 0;
}
/* Couleurs explicites pour que a:hover ne rende pas ce nouveau libellé pâle. */
.tpl-header .resource-tool-shortcut {
    margin-top: var(--space-6);
    max-width: 100%;
    white-space: normal;
    text-align: center;
    background: #0F766E;
    color: #FFFFFF;
    border-color: #0F766E;
    font-size: var(--fs-base);
}
.tpl-header .resource-tool-shortcut:hover,
.tpl-header .resource-tool-shortcut:active {
    background: #115E59;
    color: #FFFFFF;
    border-color: #115E59;
}
.tpl-header .resource-tool-shortcut:focus-visible {
    outline: 3px solid #0F172A;
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #FFFFFF;
}
[data-theme="dark"] .tpl-header .resource-tool-shortcut {
    background: #2DD4BF;
    color: #030712;
    border-color: #2DD4BF;
}
[data-theme="dark"] .tpl-header .resource-tool-shortcut:hover,
[data-theme="dark"] .tpl-header .resource-tool-shortcut:active {
    background: #5EEAD4;
    color: #030712;
    border-color: #5EEAD4;
}
@media (max-width: 1024px) {
    .public-resource-catalog .resource-announcements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .public-resource-catalog .resource-announcements-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* P2.5 : pilote Templates uniquement. Les règles P2.4 ci-dessus sont intactes. */
body.templates-pilot {
    --catalog-accent: #0F766E;
    --catalog-soft: #ECFDF5;
    --catalog-border: #D8E1E8;
}
[data-theme="dark"] body.templates-pilot {
    --catalog-accent: #5EEAD4;
    --catalog-soft: #0B302B;
    --catalog-border: #293548;
}
body.templates-pilot .templates-header {
    padding: calc(var(--header-height) + 40px) 0 24px;
    background: var(--bg-dark);
}
body.templates-pilot .templates-header .header-grid-layout {
    grid-template-columns: minmax(0, 1fr) 164px;
    gap: 32px;
    text-align: left !important;
}
body.templates-pilot .templates-header h1 {
    font-size: clamp(2.25rem, 4vw, 3rem);
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-primary);
    margin-bottom: 0;
}
body.templates-pilot .templates-header .header-description {
    max-width: 720px;
    margin: 12px 0 0;
}
body.templates-pilot .templates-header .header-illustration-container {
    max-width: 164px;
    margin: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    aspect-ratio: 1;
    box-shadow: none;
}
body.templates-pilot .templates-header .header-illustration-container:hover {
    transform: none;
    box-shadow: none;
}
body.templates-pilot .templates-main {
    padding-top: 24px;
    padding-bottom: 48px;
}
body.templates-pilot .resource-available > h2,
body.templates-pilot .resource-announcements > h2 {
    font-size: 1.75rem;
    margin-bottom: 24px;
}
body.templates-pilot .resource-available > .templates-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
body.templates-pilot .resource-available .template-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    text-align: left;
    border-color: var(--catalog-border);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.025);
    overflow: visible;
}
body.templates-pilot .resource-available .template-card:hover {
    border-color: var(--catalog-accent);
    box-shadow: none;
}
body.templates-pilot .resource-available .template-card-preview {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-bottom: 16px;
    border-radius: 12px;
    background: var(--catalog-soft);
    color: var(--catalog-accent);
    font-size: 24px;
}
body.templates-pilot .resource-available .template-card-preview::before {
    content: none;
}
body.templates-pilot .resource-available .template-card:hover .template-card-preview {
    transform: none;
}
body.templates-pilot .resource-available .template-card-title {
    margin-bottom: 10px;
}
body.templates-pilot .resource-available .template-card-description {
    line-height: 1.65;
    margin-bottom: 20px;
}
body.templates-pilot .resource-available .template-card-meta {
    margin-top: auto;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
body.templates-pilot .resource-available .template-formats {
    flex-wrap: wrap;
}
body.templates-pilot .resource-available .format-badge {
    background: var(--bg-surface-light);
    color: var(--text-secondary);
}
body.templates-pilot .resource-available .format-badge.pdf {
    background: #FFF1F2;
    color: #9F1239;
}
body.templates-pilot .resource-available .format-badge.excel {
    /* Surcharge locale du style inline historique, sans changer son contenu. */
    background: #ECFDF5 !important;
    color: #065F46 !important;
}
[data-theme="dark"] body.templates-pilot .resource-available .format-badge.pdf {
    background: #3B1824;
    color: #FDA4AF;
}
[data-theme="dark"] body.templates-pilot .resource-available .format-badge.excel {
    background: #0B302B !important;
    color: #6EE7B7 !important;
}
body.templates-pilot .resource-available .template-cta .btn,
body.templates-pilot .resource-yellow .btn,
body.templates-pilot .resource-suggestion .btn {
    background: var(--bg-surface);
    color: var(--catalog-accent);
    border-color: var(--catalog-accent);
    border-radius: 10px;
    box-shadow: none;
    font-weight: 600;
}
body.templates-pilot .resource-available .template-card:hover .template-cta .btn,
body.templates-pilot .resource-yellow .btn:hover,
body.templates-pilot .resource-suggestion .btn:hover {
    background: var(--catalog-soft);
    color: var(--catalog-accent);
}
body.templates-pilot .resource-available .template-card:focus-visible,
body.templates-pilot .resource-yellow .btn:focus-visible,
body.templates-pilot .resource-suggestion .btn:focus-visible,
body.templates-pilot .resource-info .btn:focus-visible {
    outline: 3px solid var(--catalog-accent);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px var(--bg-surface);
}
body.templates-pilot .resource-yellow {
    padding: 24px !important;
    border-color: var(--catalog-border);
    border-left: 4px solid #B45309;
    border-radius: 16px;
    box-shadow: none;
}
body.templates-pilot .resource-yellow h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}
body.templates-pilot .resource-yellow p {
    max-width: 80ch;
    color: var(--text-secondary);
}
body.templates-pilot .resource-info {
    border-color: var(--catalog-border);
    border-radius: 16px;
    box-shadow: none;
}
body.templates-pilot .resource-info h3 {
    font-size: 1.5rem;
}
body.templates-pilot .resource-info .btn {
    background: #0F766E;
    color: #FFFFFF;
    border-color: #0F766E;
    border-radius: 10px;
    box-shadow: none;
}
body.templates-pilot .resource-info .btn:hover {
    background: #115E59;
    color: #FFFFFF;
    border-color: #115E59;
}
[data-theme="dark"] body.templates-pilot .resource-info .btn {
    background: #2DD4BF;
    color: #030712;
    border-color: #2DD4BF;
}
[data-theme="dark"] body.templates-pilot .resource-info .btn:hover {
    background: #5EEAD4;
    color: #030712;
    border-color: #5EEAD4;
}
@media (max-width: 1024px) {
    body.templates-pilot .resource-available > .templates-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    body.templates-pilot .templates-header {
        padding-top: calc(var(--header-height) + 24px);
    }
    /* P3.2 : titre et illustration ensemble, description sur toute la largeur. */
    body.templates-pilot .templates-header .header-grid-layout {
        grid-template-columns: minmax(0, 1fr) clamp(120px, 34vw, 136px);
        gap: 16px;
    }
    body.templates-pilot .templates-header .header-text-content {
        display: contents;
    }
    body.templates-pilot .templates-header h1 {
        grid-column: 1;
        grid-row: 1;
        align-self: center;
        font-size: clamp(1.75rem, 8vw, 2rem);
    }
    body.templates-pilot .templates-header .header-description {
        grid-column: 1 / -1;
        grid-row: 2;
        margin: 0;
    }
    body.templates-pilot .templates-header .header-illustration-container {
        grid-column: 2;
        grid-row: 1;
        max-width: 136px;
    }
    body.templates-pilot .resource-available > .templates-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    body.templates-pilot .resource-available .template-card {
        padding: 20px;
    }
}
