/* ==========================================================================
   1. POLICES ET VARIABLES
   ========================================================================= */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-VariableFont_opsz_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --text: #3e3e3e;
    --background: #f5f5f5;
    --border: #c5c5c5;
    --color-forge: #f17361;
    --color-forge-medium: #f8aca1;
    --color-forge-light: #fee5e2;
    --color-forge-dark: #c15c4e;
    --white: #ffffff;
    --grey: #eeeeee;
    --yellow: #f1c40f;
    --bleu-marianne: #000091;
    --tag-level-bg: #ffe9e9;
    --tag-level-txt: #a94442;
    --tag-theme1d-bg: #fff3e0;
    --tag-theme1d-txt: #e65100;
    --tag-theme2d-bg: #fff9db;
    --tag-theme2d-txt: #856404;
    --tag-profile-bg: #e8f5e9;
    --tag-profile-txt: #2e7d32;
    --tag-academy-bg: #f3e5f5;
    --tag-academy-txt: #6a1b9a;
    --tag-tags-bg: #e3f2fD;
    --tag-tags-txt: #1565c0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   2. LAYOUT ET BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text);
    background-color: var(--background);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.main-content {
    flex: 1;
    padding: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.d-none { display: none !important; }
.d-inline { display: inline-block !important; }
.d-flex { display: flex !important; }

/* ==========================================================================
   3. SQUELETTES AU DÉMARRAGE
   ========================================================================= */
.skeleton-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2.6rem;
    padding: 20px;
}

.skeleton-card {
    height: 350px;
    background-color: var(--grey); 
    background-image: linear-gradient(
        110deg, 
        var(--grey) 8%, 
        var(--background) 18%, 
        var(--grey) 33%
    );
    background-size: 200% 100%;
    animation: shine 1.5s linear infinite;
    border-radius: 8px;
}

@keyframes shine {
    to { background-position-x: -200%; }
}

.skeleton-container.d-none {
    display: none !important;
}

/* ==========================================================================
   4. BOUTONS
   ========================================================================== */
.btn-color, .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.btn-action i {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-color {
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white) !important;
}

.btn-color-forge { background-color: var(--color-forge); }
.btn-color-marianne { background-color: var(--bleu-marianne); }
.btn-color:hover { filter: brightness(1.2); }

.btn-action {
    flex: 0 0 44px;
    width: 44px;
    height: 38px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--bleu-marianne);
    position: relative;
}

.btn-action:hover, 
.btn-action.active {
    background-color: var(--grey);
    border-color: var(--border);
}

#resetAll:hover i {
    transform: rotate(-360deg);
}

.btn-action:active {
    transform: scale(0.95);
    background-color: var(--border);
}

#checkIcon { display: none; }

.btn-action.success #copyIcon { display: none; }
.btn-action.success #checkIcon { 
    display: inline-block; 
    animation: pop 0.2s ease-out;
}

@keyframes pop {
    0% { transform: scale(0.5); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   5. NAVIGATION
   ========================================================================== */
nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.nav-container {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 1.4rem;
    justify-content: space-between;
}

.nav-header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-header-mobile a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-header-mobile a i.fa-code-branch {
    color: var(--color-forge);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--bleu-marianne);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
    align-items: center;
}

nav a {
    text-decoration: none;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s ease;
}

nav a i {
    opacity: 0.6;
    transition: all 0.2s ease;
}

nav a:hover {
    color: var(--color-forge);
}

nav a:hover i {
    opacity: 1;
    color: var(--color-forge);
}

nav a[href*="primaire.forge.apps.education.fr"] {
    color: var(--color-forge);
    font-weight: 500;
}

nav a[href*="primaire.forge.apps.education.fr"] i {
    color: var(--color-forge);
    opacity: 1;
}

.logo-on-top {
    max-height: 1.5rem;
}


/* ==========================================================================
   6. BANNIÈRE D'ANNONCE
   ========================================================================== */
.announcement-banner {
    display: none;
    background-color: var(--bleu-marianne);
    color: var(--white);
    padding: 10px 20px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1001;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 1200px;
    margin-right: 30px;
}

.banner-icon {
    font-size: 1.1rem;
    color: var(--color-forge);
}

.banner-close {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

.banner-close:hover {
    opacity: 1;
}

/* ==========================================================================
   7. HEADER
   ========================================================================== */
header {
    padding: 20px 0 50px 0;
    background-color: var(--color-forge-light);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-logo {
    max-width: 500px;
    width: 100%;
    height: auto;
    min-width: 200px;
}

/* ==========================================================================
   8. RECHERCHE ET FILTRES
   ========================================================================== */
.search-area {
    background: var(--white);
    border-radius: 4px;
    padding: 1rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    margin-top: -40px;
    position: relative;
    z-index: 10;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
}

.search-main-row {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.input-group {
    flex: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    border: 2px solid var(--border);
    border-radius: 4px;
    padding: 4px 12px;
    background: var(--white);
}

.input-group input {
    border: none;
    outline: none;
    width: 100%;
    padding: 8px 0;
    font-size: 1rem;
}

.input-group i {
    color: var(--bleu-marianne);
    margin-right: 10px;
}

.filters-dropdown {
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    background: var(--white);
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-top: 10px;
}

.filters-dropdown.active {
    display: grid;
}

.filters-dropdown select {
    padding: 8px;
    border-radius: 4px;
    border: 2px solid var(--border);
    width: 100%;
    height: 38px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    background-color: var(--white);
    color: var(--text);
    transition: all 0.2s ease;
}

select#filterLevel:not(.is-selected) { background-color: var(--tag-level-bg); color: var(--tag-level-txt); }
select#filterTheme1D:not(.is-selected) { background-color: var(--tag-theme1d-bg); color: var(--tag-theme1d-txt); }
select#filterTheme2D:not(.is-selected) { background-color: var(--tag-theme2d-bg); color: var(--tag-theme2d-txt); }
select#filterProfile:not(.is-selected) { background-color: var(--tag-profile-bg); color: var(--tag-profile-txt); }
select#filterAcademy:not(.is-selected) { background-color: var(--tag-academy-bg); color: var(--tag-academy-txt); }
select#filterTags:not(.is-selected) { background-color: var(--tag-tags-bg); color: var(--tag-tags-txt); }

.filters-dropdown select option {
    background-color: var(--white);
    color: var(--text);
}

.no-results-container {
    grid-column: 1 / -1;
    padding: 5rem 0 1rem 0;
    text-align: center;
}

.no-results-text {
    padding: 1rem;
    font-size: 1.2rem;
}

/* ==========================================================================
   9. BARRE D'OUTILS PRINCIPALE
   ========================================================================== */
.results-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--grey);
}

.toolbar-info, 
.toolbar-actions {
    flex: 1;
    display: flex;
    align-items: center;
}

.toolbar-info {
    justify-content: flex-start;
    font-size: 1.1rem;
}

.toolbar-nav {
    flex: 0 auto;
}

.toolbar-actions {
    justify-content: flex-end;
    gap: 15px;
}

.results-stats strong {
    color: var(--color-forge);
    font-weight: 800;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.select-minimal {
    border: none;
    border-bottom: 1px dashed var(--bleu-marianne);
    color: var(--bleu-marianne);
    font-size: 1rem;
    font-weight: 600;
    background: transparent;
    cursor: pointer;
    padding: 2px 4px;
}

.sort-wrapper select option {
    background-color: var(--white);
    color: var(--text);
    font-weight: 500;
}


.btn-icon-toggle {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--bleu-marianne);
    transition: background 0.2s;
}

.btn-icon-toggle:hover {
    background: var(--grey);
}

/* ==========================================================================
   10. GRILLE ET TUILES
   ========================================================================== */
.ressources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.6rem;
    align-items: stretch;
}

.tuile {
    background: var(--white);
    border: 1px solid var(--border);
    border-bottom: 3px solid var(--border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

.tuile-header {
    position: relative;
    padding: 20px 45px 15px 15px;
    min-height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--white);
}

.tuile-header h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tuile-header h3 a {
    color: var(--bleu-marianne);
    text-decoration: none;
    display: inline-block;
    max-width: 305px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.tuile-header h3 a:hover {
    text-decoration: underline;
}

.icon-heart-expo {
    color: var(--color-forge);
    font-size: 0.8rem;
    margin-left: 0px;
    position: relative;
    top: -5px;
    cursor: pointer; /* Transforme le curseur en main (lien) */
    display: inline-block; /* Indispensable pour que le 'scale' fonctionne */
    transition: transform 0.2s ease; /* Pour que l'agrandissement soit fluide */
}

.icon-heart-expo:hover {
    transform: scale(1.2);
    color: var(--color-forge-dark); /* Petit bonus : change légèrement de couleur */
}

.tuile-img-link {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin-bottom: 5px;
    position: relative;
}

.tuile-img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tuile-img-link::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.06) 0%,
        transparent 15%,
        transparent 85%,
        rgba(0, 0, 0, 0.08) 100%
    );
    pointer-events: none;
}

.tuile-body {
    padding: 1rem 1.1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tuile-body p {
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.tuile-tags {
    margin-top: auto;
    padding: 10px 0 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-badge {
    font-size: 0.75rem;
    padding: 4px 4px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-transform: lowercase;
}

.tag-level { background: var(--tag-level-bg); color: var(--tag-level-txt); }
.tag-theme1d { background: var(--tag-theme1d-bg); color: var(--tag-theme1d-txt); }
.tag-theme2d { background: var(--tag-theme2d-bg); color: var(--tag-theme2d-txt); }
.tag-profile { background: var(--tag-profile-bg); color: var(--tag-profile-txt); }
.tag-academy { background: var(--tag-academy-bg); color: var(--tag-academy-txt); }
.tag-tags { background: var(--tag-tags-bg); color: var(--tag-tags-txt); }
.tag-badge:hover { filter: brightness(0.9); }

.tuile-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    min-height: 35px;
    background: var(--grey);
}

.tech-links {
    display: flex;
    gap: 5px;
}

.fav-toggle, .tech-link-icon {
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 10;
    background: none;
    border: none;
    padding: 3px;
    text-decoration: none;
    opacity: 0.5;
}

.fav-toggle {
    color: var(--color-forge-dark);
    display: flex;
    margin-left: auto;
    margin-right: -6px;
    margin-top: 2px;
}

.tech-link-icon {
    color: var(--bleu-marianne);
}

.fav-toggle:hover, .tech-link-icon:hover {
    transform: scale(1.2);
    opacity: 1;
}

.fav-toggle.is-fav {
    color: var(--yellow);
    opacity: 1;
}

.info-tooltip {
    cursor: help;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-tooltip:hover {
    opacity: 0.7;
}

.tchap-icon-link {
    position: absolute;
    top: 15px;
    right: 8px;
    width: 32px;
    height: 32px;
    z-index: 50;
    display: block;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tchap-icon-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)) grayscale(0.2);
    transition: filter 0.2s ease;
}

.tchap-icon-link:hover {
    transform: scale(1.15);
}

.tchap-icon-link:hover img {
    filter: grayscale(0);
}

/* ==========================================================================
   11. MODE LISTE - TITRE ET DESCRIPTIF UNIQUEMENT
   ========================================================================== */
.ressources-grid.view-list {
    grid-template-columns: 1fr;
    gap: 30px;
}

.view-list .tuile-img-link,
.view-list .icon-heart-expo,
.view-list .tuile-tags,
.view-list .tuile-footer,
.view-list .tchap-icon-link {
    display: none !important;
}

.view-list .tuile {
    display: block;
    padding: 15px 20px;
    min-height: auto;
    height: auto;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.view-list .tuile-header {
    display: block;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    min-height: auto !important;
}

.view-list .tuile-header h3 {
    margin: 0;
    padding: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.view-list .tuile-header h3 a {
    display: block;
    max-width: none;
    color: var(--bleu-marianne);
    font-weight: 700;
    font-size: 1.15rem;
    text-decoration: none;
}

.view-list .tuile-header h3 a:hover {
    text-decoration: underline;
}

.view-list .tuile-body {
    display: block;
    margin: 0;
    padding: 0;
    flex-grow: 0;
}

.view-list .tuile-body p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text);
    text-align: left;
    display: block;
    -webkit-line-clamp: none;
    overflow: visible;
}

/* ==========================================================================
   12. AIDE ET TOOLTIPS
   ========================================================================== */
.help-icon {
    font-size: 0.9em;
    color: var(--color-forge);
    cursor: help;
    margin-left: -2px;
    position: relative;
    top: -5px;
    vertical-align: middle;
    opacity: 0.8;
}

/* ==========================================================================
   13. PAGINATION
   ========================================================================== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--bleu-marianne);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.page-link:hover:not(.disabled), 
.page-link.active {
    background: var(--bleu-marianne);
    color: var(--white) !important;
    border-color: var(--bleu-marianne);
}

.page-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-link-dots {
    color: var(--text);
    opacity: 0.6;
    user-select: none;
    padding: 0 4px;
}

.pagination-header {
    margin: 0;
}

.pagination-footer {
    margin: 40px 0;
}

/* ==========================================================================
   14. SECTION INFOS FORGE
   ========================================================================== */
.infos-forge {
    background-color: var(--color-forge-light);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid rgba(241, 115, 97, 0.1);
}

.infos-forge .infos-text p {
    margin: 0.4rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

.infos-forge strong {
    color: var(--color-forge);
    font-weight: 800;
}

.infos-forge .infos-action {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    padding: 0 15px;
}

/* ==========================================================================
   15. BARRE D'ACTION PRE-FOOTER
   ========================================================================== */
.action-bar-prefooter {
    background-color: var(--color-forge-medium);
    padding: 2rem 0;
    display: flex;
    justify-content: center;
}

.action-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ==========================================================================
   16. FOOTER
   ========================================================================== */
footer {
    background-color: var(--color-forge);
    color: var(--white);
    padding: 2rem 0 1.5rem 0;
}

.footer-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.footer-container a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-container a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer-column-img img {
    width: 100%;
    height: auto;
    max-width: 200px;
}

.footer-column-text p { font-size: 1.1rem; }

.footer-column-text .forge-link { font-size: 0.95rem; font-weight: bold; }
.footer-column-text .slogan { font-style: italic; margin: 1rem 0 0 0; }

.footer-column-credits {
    font-size: 0.8rem;
    text-align: left;
}

.footer-column-credits ul {
    list-style: none;
    padding: 0;
}

.footer-column-credits li {
    margin-bottom: 0.3rem;
    padding-left: 1rem;
    position: relative;
}

.footer-column-credits li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: rgba(255,255,255,0.5);
}

.footer-column-text .legal-links {
    display: none;
}

/* ==========================================================================
   17. POST-FOOTER
   ========================================================================== */
.post-footer {
    background-color: var(--color-forge-dark);
    padding: 1.5rem 0;
    color: var(--white);
    text-align: center;
}

.post-footer .legal-links {
    margin: 0;
    font-size: 0.8rem;
}

.post-footer .legal-links a {
    color: var(--grey);
    text-decoration: none;
    margin: 0 5px;
}

.post-footer .legal-links a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   18. CHATBOT FLOTTANT
   ========================================================================== */
#chatbot-trigger {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: var(--color-forge);
    color: var(--white);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 2000;
    font-size: 1.5rem;
    transition: transform 0.3s ease, background-color 0.2s;
}

#chatbot-trigger:hover {
    transform: scale(1.1);
    background-color: var(--bleu-marianne);
}

#chatbot-container {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 400px;
    max-width: 90vw;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 2001;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-origin: bottom right;
}

.chatbot-hidden {
    opacity: 0;
    transform: scale(0) translateY(100px);
    pointer-events: none;
}

.chatbot-header {
    background-color: var(--bleu-marianne);
    color: var(--white);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.chatbot-header button {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* ==========================================================================
   19. RESPONSIVE
   ========================================================================== */

/* --- TABLETTES LARGES ET LAPTOPS (<= 1024px) --- */
@media (max-width: 1024px) {
    .filters-dropdown { grid-template-columns: repeat(3, 1fr); }
    .ressources-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
}

/* --- GRANDS ÉCRANS UNIQUEMENT (>= 992px) --- */
@media (min-width: 992px) {
    .footer-container {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 2rem;
    }
    .footer-column-img { flex: 0 0 210px; }
    .footer-column-text { flex: 1; padding-right: 2rem; }
    .footer-column-credits {
        flex: 0 0 360px;
        border-left: 1px solid rgba(255, 255, 255, 0.3);
        padding-left: 2rem;
    }
}

/* --- TABLETTES ET MOBILES (<= 992px) --- */
@media (max-width: 992px) {
    .results-toolbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .toolbar-info, 
    .toolbar-nav, 
    .toolbar-actions {
        flex: none;
        justify-content: center;
        width: 100%;
    }
    .toolbar-nav { order: -1; }
}

/* --- MOBILES (<= 768px) --- */
@media (max-width: 768px) {
    nav { padding: 0.5rem 0; }
    .nav-container { flex-direction: column; align-items: stretch; padding: 0; position: relative; }
    .nav-header-mobile { width: 100%; justify-content: space-between; padding: 0 10px; }
    .nav-header-mobile a { font-size: 0.95rem; }
    .nav-toggle { display: block; font-size: 1.2rem; padding: 2px 5px; }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 5px;
        gap: 0;
    }
    nav ul.active { display: flex; }
    nav ul li { width: 100%; border-top: 1px solid var(--border); }
    nav ul li a { padding: 8px 15px; width: 100%; font-size: 0.9rem; }

    .header-container { flex-direction: column; gap: 15px; text-align: center; }

    .search-main-row {
        display: grid;
        grid-template-columns: 1fr 44px 44px 44px;
        gap: 10px;
    }
    .input-group { grid-column: 1 / span 4; width: 100%; margin-bottom: 5px; }
    .btn-action { grid-row: auto; }
    
    .search-main-row .btn-color-marianne {
        grid-column: 1;
        grid-row: auto;
        width: 100%;
        max-width: none;
        padding: 10px;
    }

    .filters-dropdown { grid-template-columns: 1fr; gap: 8px; }

    .results-meta {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        text-align: center;
    }
    .results-count { grid-row: 1; }
    .sort-group { grid-row: 3; justify-content: center; }

    .pagination-header, 
    .pagination-footer {
        width: 100%;
        justify-content: center;
        order: 2;
    }

    .ressources-grid { grid-template-columns: 1fr; }

    .infos-forge { padding: 2rem 1rem; }
    .infos-forge p { font-size: 1rem; }
    .infos-forge .btn-color,
    .action-bar-prefooter .btn-color {
        width: 100%;
        max-width: 350px;
    }

    .action-container { flex-direction: column; width: 100%; }
}