/* =========================================================
   Module « Axes thématiques »
   - En-tête : titre | description | lien « Découvrir »
   - Grille de tuiles colorées (3 col. × 2 lignes)
   Couleur par tuile : variable --axe-color (champ ACF par terme),
   sinon palette de secours par position (nth-child).
   ========================================================= */

.module-axes-thematiques .axes-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
}

.module-axes-thematiques .axes-heading .bloctitle {
    display: flex;
    gap: 1.5rem;
}

.module-axes-thematiques .axes-heading .title-module {
    width: 24vw;
}

.module-axes-thematiques .axes-heading .subtitle {
    width: 32vw;
}

/* Neutralise la marge basse du composant titre dans ce contexte en ligne */
.module-axes-thematiques .axes-heading-title .bloc-title,
.module-axes-thematiques .axes-heading-title .title-section {
    margin-bottom: 0;
}

.module-axes-thematiques .axes-heading-desc {
    flex: 1 1 auto;
    margin: 0;
    max-width: 34rem;
    color: var(--color-text-light, #8a8a8a);
    font-size: 0.95rem;
    line-height: 1.5;
}

.module-axes-thematiques .axes-heading-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary, #b01f24);
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
    font-weight: 700;
}

.module-axes-thematiques .axes-heading-link-arrow {
    transition: transform 0.3s ease;
}

.module-axes-thematiques .axes-heading-link:hover .axes-heading-link-arrow {
    transform: translateX(4px);
}

/* --- Grille --- */
.module-axes-thematiques .axes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.module-axes-thematiques .axes-item {
    display: flex;
    background-color: var(--axe-color, #444);
    position: relative;
}

.module-axes-thematiques .axes-item::before {
    content: '';
    display: block;
    position: absolute;
    right: 0;
    bottom: 0;
    width: 187px;
    height: 101px;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg3IiBoZWlnaHQ9IjEwMSIgdmlld0JveD0iMCAwIDE4NyAxMDEiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMTMuMTg4IDBDMTQxLjA1NCAwLjAwMDE5ODczIDE2Ni4zNjYgMTAuMTc2NCAxODYuMDU1IDI2Ljk4NzNWMTAwLjcyNkgxODIuNzE4QzE3NS4yNjEgNjcuMTk3NSAxNDYuNDMzIDQzLjAwMDQgMTEzLjE4OCA0M0M3OS45NDIgNDMgNTEuMTEzIDY3LjE5NzIgNDMuNjU2MiAxMDAuNzI2SDBDOC4wMjkyMyA0NC4yODggNTUuMDQ5MyAwIDExMy4xODggMFoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=");
    background-repeat: no-repeat;
    background-size: contain;
    opacity: 0;
    transition: all .3s ease !important;
    z-index: 1;
}

.module-axes-thematiques .axes-item:hover::before {
    opacity: 0.3;
}

/* Palette de secours (si aucune couleur définie sur le terme) */
.module-axes-thematiques .axes-item--1:not([style]) {
    background-color: #847536;
}

.module-axes-thematiques .axes-item--2:not([style]) {
    background-color: #273075;
}

.module-axes-thematiques .axes-item--3:not([style]) {
    background-color: #6D7B3D;
}

.module-axes-thematiques .axes-item--4:not([style]) {
    background-color: #BB5833;
}

.module-axes-thematiques .axes-item--5:not([style]) {
    background-color: #6C1756;
}

.module-axes-thematiques .axes-item--6:not([style]) {
    background-color: #B92563;
}

.module-axes-thematiques .axes-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2.5rem;
    width: 100%;
    min-height: 150px;
    padding: 1.5rem;
    color: #fff;
    text-decoration: none;
    z-index: 2;
}

.module-axes-thematiques .axes-tile-title {
    font-size: 2rem;
    line-height: 1.25;
    font-family: var(--font-title);
}

.module-axes-thematiques .axes-tile-arrow {
    font-size: 1.1rem;
    transition: all 0.3s ease;
    width: fit-content;
    position: relative;
    left: 0;
}

.module-axes-thematiques a.axes-tile:hover {
    color: #fff;
}

.module-axes-thematiques a.axes-tile:hover .axes-tile-arrow {
    left: 85%;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .module-axes-thematiques .axes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 782px) {
    .module-axes-thematiques .axes-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .module-axes-thematiques .axes-grid {
        grid-template-columns: 1fr;
    }
}