:root {
    --brand-green: #256764;
    --brand-green-dark: #173f3f;
    --brand-green-deep: #0f3433;
    --brand-orange: #e14924;
    --brand-orange-dark: #c23827;
    --brand-blue: #75a4bf;
    --brand-black: #171715;
    --brand-white: #ffffff;
    --brand-off-white: #f7f6f2;
    --brand-grey: #ececea;
    --text-muted: #5b5b58;
    --shadow-soft: 0 10px 30px rgb(23 23 21 / 8%);
    --radius: 12px;
    --container-wide: 1380px;
    --font-main:
        "Mulish",
        "Segoe UI",
        Arial,
        sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Empêche tout débordement horizontal de rétrécir la page entière */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--brand-black);
    background: var(--brand-white);
    font-family: var(--font-main);
    line-height: 1.5;
}

html,
body,
button,
input,
textarea,
select {
    font-family: var(--font-main);
}

h1,
h2,
h3,
.site-brand__text strong,
.main-menu a {
    font-family: var(--font-main);
    font-weight: 700;
}

body.menu-open {
    overflow: hidden;
}

/* ===== IMAGES RESPONSIVES (adaptation à tous les écrans) ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container-wide {
    width: min(calc(100% - 64px), var(--container-wide));
    margin-inline: auto;
}

.content-wide {
    width: min(calc(100% - 48px), 1100px);
    margin-inline: auto;
}

.content-narrow {
    width: min(calc(100% - 48px), 820px);
    margin-inline: auto;
}

/* Header */
.site-header {
    position: relative;
    z-index: 100;
    background: var(--brand-white);
    border-top: 1px solid #dededb;
    border-bottom: 1px solid #ececea;
}

.site-header__inner {
    min-height: 108px;
    display: grid;
    grid-template-columns: minmax(310px, 1fr) auto 58px;
    align-items: center;
    gap: 36px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    text-decoration: none;
}

.site-brand__logo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    flex: 0 0 auto;
}

.site-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    text-transform: uppercase;
}

.site-brand__overline {
    font-size: 20px;
    letter-spacing: .02em;
}

.site-brand__text strong {
    margin-top: 3px;
    color: var(--brand-green-dark);
    font-size: clamp(25px, 2.1vw, 34px);
    font-weight: 800;
}

.site-brand__text small {
    margin-top: 7px;
    color: var(--brand-orange);
    font-size: 13px;
    text-transform: none;
}

.main-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 3vw, 52px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-menu a {
    position: relative;
    display: block;
    padding: 41px 0 33px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
}

.main-menu a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
    height: 3px;
    background: var(--brand-orange);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 180ms ease;
}

.main-menu a:hover::after,
.current-menu-item > a::after,
.current_page_item > a::after {
    transform: scaleX(1);
}

.search-toggle,
.menu-toggle {
    display: inline-grid;
    place-items: center;
    border: 0;
    color: var(--brand-green-dark);
    background: transparent;
    cursor: pointer;
}

.search-toggle {
    width: 46px;
    height: 46px;
    border: 1.5px solid var(--brand-green);
    border-radius: 50%;
}

.search-toggle svg {
    width: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.menu-toggle {
    display: none;
    width: 48px;
    height: 48px;
    gap: 5px;
}

.menu-toggle span:not(.screen-reader-text) {
    width: 31px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.site-search-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 16px 32px;
    background: var(--brand-white);
    box-shadow: var(--shadow-soft);
}

.site-search-panel form {
    display: flex;
    width: min(100%, 760px);
    margin-inline: auto;
}

.site-search-panel input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border: 1px solid #d8d8d4;
    border-radius: 8px 0 0 8px;
}

.site-search-panel button {
    padding: 0 22px;
    color: #fff;
    border: 0;
    background: var(--brand-green);
    border-radius: 0 8px 8px 0;
}

/* Hero */
.home-hero {
    position: relative;
    min-height: 390px;
    overflow: hidden;
    color: var(--brand-white);
    background-image: var(--hero-image);
    background-position: center;
    background-size: cover;
}

.home-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(12 20 20 / 82%) 0%, rgb(12 20 20 / 68%) 40%, rgb(12 20 20 / 55%) 100%);
}

.home-hero__content {
    position: relative;
    z-index: 3;
    padding-top: 63px;
    padding-bottom: 76px;
}

.home-hero__eyebrow {
    margin: 0;
    font-size: clamp(34px, 3.4vw, 46px);
    font-weight: 400;
}

.home-hero h1 {
    margin: -3px 0 4px;
    font-size: clamp(52px, 6.3vw, 78px);
    line-height: .98;
    text-transform: uppercase;
}

.home-hero__description {
    max-width: 520px;
    margin: 15px 0 0;
    font-size: clamp(16px, 1.4vw, 21px);
    font-weight: 600;
}

.home-hero__actions {
    display: flex;
    gap: 14px;
    margin-top: 22px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-width: 220px;
    gap: 22px;
    padding: 15px 22px;
    color: #fff;
    border: 1px solid rgb(255 255 255 / 45%);
    border-radius: 9px;
    font-weight: 800;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgb(0 0 0 / 18%);
}

.button--green {
    background: rgb(15 52 51 / 85%);
}

.button--orange {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
}

.button-grid-icon {
    font-size: 24px;
    line-height: 1;
}

.hero-ribbon {
    position: absolute;
    left: -6%;
    width: 112%;
    z-index: 4;
    transform-origin: center;
    pointer-events: none;
}

.hero-ribbon--orange {
    bottom: 1px;
    height: 30px;
    background: var(--brand-orange);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: rotate(-1.5deg);
}

.hero-ribbon--green {
    bottom: -17px;
    height: 36px;
    background: var(--brand-green-dark);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: rotate(.7deg);
}

/* Homepage layout */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, .92fr);
    grid-template-areas:
        "featured mayor"
        "news quick";
    gap: 30px 60px;
    padding-top: 38px;
    padding-bottom: 45px;
}

.home-panel--featured { grid-area: featured; }
.home-panel--mayor { grid-area: mayor; }
.home-panel--news { grid-area: news; }
.home-panel--quick-links { grid-area: quick; align-self: start; }

.section-title {
    position: relative;
    margin: 0 0 18px;
    color: var(--brand-green-dark);
    font-size: clamp(18px, 1.65vw, 23px);
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.section-title::after {
    content: "";
    display: block;
    width: 30px;
    height: 3px;
    margin-top: 7px;
    background: var(--brand-orange);
}

.section-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.see-all-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    color: var(--brand-green-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.see-all-link span {
    font-size: 21px;
    line-height: 1;
    transition: transform 180ms ease;
}

.see-all-link:hover {
    color: var(--brand-orange);
}

.see-all-link:hover span {
    transform: translateX(4px);
}

.featured-news-card {
    display: grid;
    grid-template-columns: 48% 52%;
    min-height: 190px;
    overflow: hidden;
    background: #f5f4f2;
    border-radius: 10px;
}

.featured-news-card__image {
    display: block;
    min-height: 100%;
    overflow: hidden;
    background: var(--brand-grey);
}

.featured-news-card__photo,
.news-card__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;   /* recadrage centré — ajuste si besoin (ex. 'top center') */
}

.featured-news-card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 25px 30px;
}

.news-date {
    color: var(--brand-orange);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.featured-news-card h3,
.news-card h3,
.news-card h2 {
    margin: 9px 0 12px;
    font-size: 18px;
    line-height: 1.25;
}

.featured-news-card h3 a,
.news-card h3 a,
.news-card h2 a {
    text-decoration: none;
}

.featured-news-card p {
    margin: 0 0 14px;
    color: #3f3f3c;
    font-size: 14px;
    line-height: 1.55;
}

.text-link {
    color: var(--brand-orange);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
}

.image-placeholder {
    display: grid;
    width: 100%;
    min-height: 160px;
    height: 100%;
    place-items: center;
    color: #777;
    background: #ececea;
}

.mayor-card {
    display: grid;
    grid-template-columns: 42% 58%;
    gap: 30px;
    align-items: start;    /* la photo garde sa taille, ne s'étire pas */
}

.mayor-card__photo {
    display: block;
    width: 100%;
    height: auto;          /* le cadre prend la hauteur naturelle de la photo */
    border-radius: 10px;
}

.mayor-card__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mayor-card__content h3 {
    margin: 0 0 9px;
    font-size: 16px;
}

.mayor-card__content p {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.5;
}

.mayor-card__content strong {
    color: var(--brand-orange);
    font-size: 13px;
}

.mayor-card__content > span {
    margin-bottom: 10px;
    color: var(--brand-orange);
    font-size: 12px;
}

/* Carousel */
.news-carousel {
    position: relative;
}

.news-carousel__viewport {
    overflow: hidden;
    touch-action: pan-y;
}

.news-carousel__track {
    display: flex;
    gap: 18px;
    transition: transform 500ms ease;
    will-change: transform;
}

.news-card {
    flex: 0 0 calc((100% - 36px) / 3);
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e4e1;
    border-radius: 9px;
}

.news-card__image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 8.8;
    background: var(--brand-grey);
}

.news-card__body {
    padding: 12px 14px 14px;
}

.news-card h3,
.news-card h2 {
    min-height: 44px;
    margin: 6px 0 9px;
    font-size: 14px;
}

/* Flèches du carousel masquées : navigation par les points + défilement auto.
   Le !important neutralise toutes les autres règles (desktop, mobile...). */
.carousel-arrow {
    display: none !important;
}

.carousel-arrow--prev { left: -42px; }
.carousel-arrow--next { right: -42px; }

.news-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 17px;
}

.news-carousel__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #cfceca;
    cursor: pointer;
}

.news-carousel__dot.is-active {
    background: var(--brand-orange);
}

/* Quick links */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.quick-link {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 21px;
    text-decoration: none;
    background: #fff;
    border: 1px solid #ecebe8;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgb(23 23 21 / 6%);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.quick-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgb(23 23 21 / 10%);
}

.quick-link__icon {
    min-width: 45px;
    color: var(--brand-green-dark);
    font-size: 31px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
}

.quick-link__icon--orange {
    color: var(--brand-orange);
}

.quick-link > span:last-child {
    font-size: 12px;
    font-weight: 900;
    line-height: 1.25;
    text-transform: uppercase;
}

/* Footer */
.site-footer {
    color: #fff;
    background: linear-gradient(120deg, var(--brand-green-deep), var(--brand-green-dark));
    border-top: 4px solid var(--brand-orange);
}

.site-footer__main {
    display: grid;
    grid-template-columns: 1.6fr .8fr .9fr 1.1fr;
    gap: 46px;
    padding-top: 28px;
    padding-bottom: 25px;
}

.site-brand--footer {
    color: #fff;
}

.site-brand--footer .site-brand__logo {
    width: 62px;
    height: 62px;
}

.site-brand--footer .site-brand__overline,
.site-brand--footer .site-brand__text strong {
    color: #fff;
}

.site-brand--footer .site-brand__text strong {
    font-size: 24px;
}

.site-brand--footer .site-brand__text small {
    font-size: 11px;
}

.footer-brand p {
    max-width: 360px;
    margin: 14px 0 0;
    color: rgb(255 255 255 / 82%);
    font-size: 12px;
}

.footer-column {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.footer-column h2 {
    margin: 0 0 5px;
    font-size: 13px;
    text-transform: uppercase;
}

.footer-column a,
.footer-column p {
    margin: 0;
    color: rgb(255 255 255 / 86%);
    font-size: 12px;
    text-decoration: none;
}

.footer-socials {
    display: flex;
    gap: 12px;
    margin-top: 9px;
}

.footer-socials a {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 75%);
    border-radius: 50%;
    font-weight: 700;
}

.site-footer__bottom {
    padding: 8px 20px;
    text-align: center;
    background: rgb(0 0 0 / 18%);
}

.site-footer__bottom p {
    margin: 0;
    font-size: 12px;
}

/* Custom article and archive pages */
.single-news__header,
.news-archive-header {
    padding: 70px 0 48px;
    color: #fff;
    background: var(--brand-green-dark);
}

.single-news__header h1,
.news-archive-header h1 {
    margin: 12px 0;
    font-size: clamp(38px, 6vw, 70px);
    line-height: 1.05;
}

.single-news__back {
    color: #fff;
    text-decoration: none;
}

.single-news__image {
    margin-top: 40px;
}

.single-news__image img {
    width: 100%;
    max-height: 650px;
    object-fit: cover;
    object-position: top center;   /* garde le haut de l'image quand elle est rognée */
    border-radius: 14px;
}

.single-news__content {
    padding-top: 42px;
    padding-bottom: 80px;
    font-size: 18px;
    line-height: 1.8;
}

/* Images à l'intérieur d'un article : toute l'image reste visible, rien coupé */
.single-news__content img {
    width: auto;               /* pas d'étirement forcé */
    max-width: 100%;           /* ne dépasse jamais la largeur de l'écran */
    height: auto;
    max-height: 80vh;          /* évite qu'un schéma très haut prenne tout l'écran */
    object-fit: contain;
    margin: 24px auto;         /* centrée avec un peu d'espace */
    border-radius: 10px;
}

.news-archive-header p {
    margin: 0 0 8px;
    color: var(--brand-orange);
    font-weight: 800;
    text-transform: uppercase;
}

.news-archive-content {
    padding-top: 60px;
    padding-bottom: 70px;
}

.news-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.news-archive-grid .news-card {
    flex: initial;
}

.news-archive-grid .news-card p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Cartes de la page "Toutes les actualités" : on garde le HAUT de l'image
   quand elle doit être rognée (visages non coupés).
   Ratio 4/3 (plus haut que large) pour limiter le rognage vertical. */
.news-archive-grid .news-card__image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--brand-grey);
}

.news-archive-grid .news-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;   /* recadrage par le haut */
}

.news-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 46px;
}

.news-pagination .page-numbers {
    min-width: 42px;
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 8px 12px;
    color: var(--brand-green-dark);
    background: var(--brand-off-white);
    border-radius: 6px;
    text-decoration: none;
}

.news-pagination .current {
    color: #fff;
    background: var(--brand-green-dark);
}

.generic-page {
    min-height: 50vh;
    padding-top: 60px;
    padding-bottom: 60px;
}

/* Liens supplémentaires mobile/tablette */
.mobile-extra-menu {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
}
/* ==========================================================
   TABLETTE
   ========================================================== */
@media (max-width: 1180px) {
    .site-header__inner {
        grid-template-columns: minmax(260px, 1fr) auto 50px;
        gap: 20px;
    }

    .site-brand__logo {
        width: 70px;
        height: 70px;
    }

    .site-brand__overline {
        font-size: 17px;
    }

    .main-menu {
        gap: 22px;
    }

    .main-menu a {
        font-size: 12px;
    }

    .home-layout {
        grid-template-columns: minmax(0, 1fr) minmax(340px, .82fr);
        gap: 30px;
    }

    .carousel-arrow--prev { left: -16px; }
    .carousel-arrow--next { right: -16px; }
}

@media (max-width: 980px) {
    .site-header__inner {
        min-height: 98px;
        grid-template-columns: 54px 1fr 54px;
    }

    .menu-toggle {
        display: grid;
    }

    .site-brand {
        justify-self: center;
    }

    .site-navigation {
        position: fixed;
        inset: 98px 0 0;
        z-index: 200;
        padding: 20px 28px 40px;
        background: var(--brand-white);
        transform: translateX(-100%);
        transition: transform 260ms ease;
    }

    .site-navigation.is-open {
        transform: translateX(0);
    }

    .main-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .main-menu a {
        padding: 17px 0;
        border-bottom: 1px solid #ececea;
        font-size: 16px;
    }

    .main-menu a::after {
        display: none;
    }

    .home-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "featured"
            "mayor"
            "news"
            "quick";
        gap: 34px;
    }

    .news-card {
        flex-basis: calc((100% - 18px) / 2);
    }

    .news-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-footer__main {
        grid-template-columns: 1.4fr 1fr 1fr;
    }

    .footer-contact {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 16px 24px;
    }

    .footer-contact h2 {
        flex-basis: 100%;
    }

    .mobile-extra-menu {
    display: block;
}

.mobile-extra-menu li {
    margin: 0;
    padding: 0;
}

.mobile-extra-menu a {
    display: block;
    padding: 17px 0;

    color: var(--brand-black);

    border-bottom: 1px solid #ececea;

    font-size: 16px;
    font-weight: 700;

    text-decoration: none;
    text-transform: uppercase;
}

.mobile-extra-menu a:hover {
    color: var(--brand-orange);
}
}

/* ==========================================================
   MOBILE (un seul bloc, fusionné)
   ========================================================== */
@media (max-width: 700px) {
    /* --- Garde-fous largeur : rien ne déborde de l'écran --- */
    html,
    body {
        width: 100%;
        max-width: 100%;
        margin: 0;
        overflow-x: hidden;
    }

    .site-header,
    .home-page,
    .home-hero,
    .home-layout,
    .site-footer {
        width: 100%;
        max-width: 100%;
    }

    .container-wide {
        width: calc(100% - 36px);
        max-width: none;
        margin-right: auto;
        margin-left: auto;
    }

    /* --- Police adaptée au mobile --- */
    body {
        font-size: 15px;
    }

    /* Images dans un article : entièrement visibles sur mobile */
    .single-news__content img {
        max-height: 65vh;
    }

    .site-header__inner {
        width: calc(100% - 24px);
        max-width: none;
        min-height: 106px;
        gap: 7px;
        margin-right: auto;
        margin-left: auto;
    }

    .site-brand {
        gap: 9px;
    }

    .site-brand__logo {
        width: 66px;
        height: 66px;
    }

    .site-brand__overline {
        font-size: 15px;
    }

    .site-brand__text strong {
        font-size: 23px;
    }

    .site-brand__text small {
        margin-top: 5px;
        font-size: 10px;
    }

    .menu-toggle {
        width: 42px;
        height: 42px;
    }

    .menu-toggle span:not(.screen-reader-text) {
        width: 27px;
    }

    .search-toggle {
        width: 43px;
        height: 43px;
    }

    .site-navigation {
        inset: 106px 0 0;
    }

    /* --- Hero --- */
    .home-hero {
        display: block;
        min-width: 0;
        min-height: 520px;
        /* Cadrage centré sur le bâtiment de la mairie.
           Ajuste ce pourcentage si besoin :
           - plus petit (ex. 40%) = décale la vue vers la gauche
           - plus grand (ex. 70%) = décale la vue vers la droite */
        background-position: center 30%;
    }

    .home-hero__overlay {
        background: linear-gradient(90deg, rgb(12 20 20 / 82%) 0%, rgb(12 20 20 / 70%) 58%, rgb(12 20 20 / 60%) 100%);
    }

    .home-hero__content {
        padding-top: 50px;
        padding-bottom: 96px;
    }

    .home-hero__eyebrow {
        font-size: clamp(26px, 8vw, 34px);
    }

    .home-hero h1 {
        max-width: 100%;
        font-size: clamp(40px, 12vw, 59px);
    }

    .home-hero__description {
        max-width: 330px;
        font-size: clamp(15px, 4.5vw, 18px);
    }

    .home-hero__actions {
        width: min(100%, 315px);
        flex-direction: column;
        gap: 10px;
    }

    .button {
        width: 100%;
        min-width: 0;
        padding: 14px 19px;
        font-size: clamp(13px, 3.6vw, 15px);
    }

    .hero-ribbon--orange {
        height: 25px;
        transform: rotate(-2.2deg);
    }

    .hero-ribbon--green {
        bottom: -14px;
        height: 30px;
        transform: rotate(1.4deg);
    }

    /* --- Layout home : une seule colonne --- */
    .home-layout {
        display: grid;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr);
        padding-top: 38px;
        padding-bottom: 38px;
    }

    .home-panel,
    .featured-news-card,
    .mayor-card,
    .news-carousel,
    .quick-links-grid {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .section-title {
        font-size: clamp(17px, 5vw, 20px);
    }

    /* --- Flash Info --- */
    .featured-news-card {
        grid-template-columns: minmax(0, 1fr);   /* image au-dessus, texte en dessous */
        min-height: 0;
    }

    .featured-news-card__image,
    .featured-news-card__body {
        width: 100%;
        min-width: 0;
    }

    .featured-news-card__image {
        min-height: 0;
    }

    .featured-news-card__photo {
        width: 100%;
        height: auto;                 /* le cadre suit la photo, pas de recadrage */
        object-fit: initial;
    }

    .featured-news-card__body {
        padding: 16px 14px;
    }

    .featured-news-card h3 {
        margin: 7px 0 9px;
        font-size: clamp(14px, 4.2vw, 16px);
    }

    .featured-news-card p {
        font-size: clamp(12px, 3.5vw, 13px);
        line-height: 1.45;
    }

    /* --- Mot du maire --- */
    .mayor-card {
        grid-template-columns: 37% 63%;
        gap: 18px;
    }

    .mayor-card__photo {
        height: auto;
        object-fit: initial;   /* le cadre suit la photo, pas de recadrage */
    }

    .mayor-card__content h3 {
        font-size: clamp(14px, 4vw, 15px);
    }

    .mayor-card__content p {
        font-size: clamp(11px, 3.4vw, 12.5px);
    }

    .see-all-link {
        display: inline-flex;
        gap: 10px;
        align-items: center;
        white-space: nowrap;
    }

    /* --- Carousel : le rail peut être large, le viewport le masque --- */
    .news-carousel__viewport {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;          /* garde-fou : le rail ne déborde jamais de l'écran */
    }

    /* IMPORTANT : ne PAS mettre de max-width sur le track,
       sinon le défilement (transform) casse la mise en page. */
    .news-carousel__track {
        max-width: none;
    }

    .news-card {
        flex-basis: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .news-card__image {
        aspect-ratio: auto;    /* le cadre suit la photo, pas de recadrage */
    }

    .news-card__photo {
        height: auto;
        object-fit: initial;
    }

    /* Page "Toutes les actualités" sur mobile : on garde le recadrage par le haut
       (contrairement à la home où l'image est affichée entière). */
    .news-archive-grid .news-card__image {
        aspect-ratio: 16 / 11;
    }

    .news-archive-grid .news-card__photo {
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

    .carousel-arrow {
        display: none;
    }

    /* --- Accès rapides --- */
    .quick-links-grid {
        gap: 12px;
    }

    .quick-link {
        min-height: 126px;
        flex-direction: column;
        justify-content: center;
        gap: 10px;
        padding: 16px 10px;
        text-align: center;
    }

    .quick-link__icon {
        font-size: 42px;
    }

    .quick-link > span:last-child {
        font-size: 12px;
    }

    /* --- Footer --- */
    .site-footer__main {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding-top: 24px;
        padding-bottom: 18px;
        text-align: center;
    }

    .footer-brand p,
    .footer-column:not(.footer-contact) {
        display: none;
    }

    .site-brand--footer {
        justify-content: center;
    }

    .footer-contact {
        display: block;
        width: 100%;
    }

    .footer-contact h2,
    .footer-contact > p {
        display: none;
    }

    .footer-socials {
        justify-content: center;
        gap: 28px;
        margin-top: 18px;
    }

    .footer-socials a {
        width: 46px;
        height: 46px;
        font-size: 19px;
    }

    .site-footer__bottom {
        padding: 10px 16px 14px;
    }

    /* --- Pages article / archive --- */
    .news-archive-grid {
        grid-template-columns: 1fr;
    }

    .single-news__header,
    .news-archive-header {
        padding: 48px 0 34px;
    }

    .single-news__content {
        padding-top: 30px;
        font-size: 16px;
    }

    img {
        max-width: 100%;
    }
}

/* ==========================================================
   TRÈS PETITS ÉCRANS
   ========================================================== */
@media (max-width: 390px) {
    .site-brand__logo {
        width: 58px;
        height: 58px;
    }

    .site-brand__overline {
        font-size: 13px;
    }

    .site-brand__text strong {
        font-size: 20px;
    }

    .site-brand__text small {
        font-size: 9px;
    }

    /* Images d'article encore plus contraintes sur très petits écrans */
    .single-news__content img {
        max-height: 55vh;
    }

    .featured-news-card {
        grid-template-columns: 1fr;
    }

    .featured-news-card__image {
        aspect-ratio: auto;    /* le cadre suit la photo */
    }

    .mayor-card {
        grid-template-columns: 1fr;
    }

    .mayor-card__photo {
        width: 58%;
        height: auto;
    }
}

/* ==========================================================
   CORRECTIONS ORDINATEUR UNIQUEMENT
   Aucun changement sur tablette ou téléphone.
   ========================================================== */
@media (min-width: 1181px) {
    .single-news__image img {
        width: 100%;
        height: 650px;
        max-height: none;
        object-fit: cover;
        object-position: center top;
        border-radius: 14px;
    }

    .carousel-arrow {
        top: 96px;
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 30px;
        line-height: 1;
        transform: translateY(-50%);
    }

    .carousel-arrow--prev {
        left: -20px;
    }

    .carousel-arrow--next {
        right: -20px;
    }
}

/* ==========================================================
   ACCESSIBILITÉ : mouvement réduit
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==========================================================
   NAVIGATION PRINCIPALE — rubriques + sous-menus
   (inspirée du site de la ville de Grand-Bassam)
   ========================================================== */

:root {
    --nav-transition: 220ms cubic-bezier(.2, .7, .2, 1);
}

.submenu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.submenu-toggle__chevron {
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--nav-transition), margin var(--nav-transition);
}

.sub-menu {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---------- Ordinateur ---------- */
@media (min-width: 981px) {
    .site-header__inner {
        min-height: 84px;
        grid-template-columns: auto 1fr;
        gap: 32px;
    }

    .site-brand__logo {
        width: 62px;
        height: 62px;
    }

    .site-brand__overline {
        font-size: 14px;
        font-weight: 500;
    }

    .site-brand__text strong {
        font-size: clamp(22px, 1.8vw, 28px);
    }

    .site-navigation {
        justify-self: end;
    }

    .main-menu {
        gap: clamp(18px, 2.4vw, 38px);
    }

    .main-menu > li {
        position: relative;
    }

    .main-menu > li > a,
    .main-menu > li > .submenu-toggle {
        position: relative;
        display: inline-flex;
        align-items: center;
        padding: 30px 0;
        color: var(--brand-green-dark);
        font-size: 15px;
        font-weight: 600;
        text-transform: none;
        letter-spacing: 0;
        transition: color var(--nav-transition);
    }

    /* Trait orange sous la rubrique */
    .main-menu > li > a::after,
    .main-menu > li > .submenu-toggle::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 20px;
        height: 2px;
        background: var(--brand-orange);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform var(--nav-transition);
    }

    /* Titre orange au survol / à la page active */
    .main-menu > li > a:hover,
    .main-menu > li > a:focus-visible,
    .main-menu > li:hover > .submenu-toggle,
    .main-menu > li:focus-within > .submenu-toggle,
    .main-menu > li.is-open > .submenu-toggle,
    .main-menu > .current-menu-item > a,
    .main-menu > .current-menu-ancestor > .submenu-toggle {
        color: var(--brand-orange);
    }

    .main-menu > li > a:hover::after,
    .main-menu > li:hover > .submenu-toggle::after,
    .main-menu > li.is-open > .submenu-toggle::after,
    .main-menu > .current-menu-item > a::after,
    .main-menu > .current-menu-ancestor > .submenu-toggle::after {
        transform: scaleX(1);
    }

    .main-menu > li:hover .submenu-toggle__chevron,
    .main-menu > li.is-open .submenu-toggle__chevron {
        margin-top: 3px;
        transform: rotate(-135deg);
    }

    /* Sous-menu déroulant */
    .sub-menu {
        position: absolute;
        top: calc(100% - 8px);
        left: -22px;
        z-index: 120;
        min-width: 270px;
        padding: 10px 0;
        background: var(--brand-white);
        border-top: 3px solid var(--brand-orange);
        border-radius: 0 0 10px 10px;
        box-shadow: 0 18px 40px rgb(23 23 21 / 14%);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition:
            opacity var(--nav-transition),
            transform var(--nav-transition),
            visibility 0s linear 220ms;
    }

    .main-menu > li:hover > .sub-menu,
    .main-menu > li:focus-within > .sub-menu,
    .main-menu > li.is-open > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        transition:
            opacity var(--nav-transition),
            transform var(--nav-transition),
            visibility 0s;
    }

    .sub-menu a {
        display: block;
        padding: 11px 22px;
        color: var(--brand-green-dark);
        font-size: 14px;
        font-weight: 500;
        line-height: 1.35;
        text-decoration: none;
        text-transform: none;
        transition:
            color var(--nav-transition),
            background-color var(--nav-transition),
            padding-left var(--nav-transition);
    }

    .sub-menu a::after {
        display: none;
    }

    .sub-menu a:hover,
    .sub-menu a:focus-visible,
    .sub-menu .current-menu-item > a {
        padding-left: 28px;
        color: var(--brand-orange);
        background: var(--brand-off-white);
    }
}

/* Tablette (981–1180 px) : on resserre un peu */
@media (min-width: 981px) and (max-width: 1180px) {
    .site-header__inner {
        gap: 20px;
    }

    .main-menu > li > a,
    .main-menu > li > .submenu-toggle {
        font-size: 13px;
    }
}

/* ---------- Tablette / téléphone (menu latéral existant) ---------- */
@media (max-width: 980px) {
    .main-menu > li > .submenu-toggle {
        display: flex;
        justify-content: space-between;
        width: 100%;
        padding: 17px 0;
        border-bottom: 1px solid #ececea;
        font-size: 16px;
        font-weight: 700;
        text-align: left;
        text-transform: uppercase;
    }

    .main-menu > li > a {
        font-weight: 700;
    }

    .main-menu a:hover,
    .submenu-toggle:hover,
    .main-menu li.is-open > .submenu-toggle {
        color: var(--brand-orange);
    }

    .main-menu li.is-open .submenu-toggle__chevron {
        margin-top: 3px;
        transform: rotate(-135deg);
    }

    .sub-menu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 300ms ease;
    }

    .main-menu li.is-open > .sub-menu {
        max-height: 420px;
    }

    .main-menu .sub-menu a {
        padding: 14px 0 14px 18px;
        font-size: 14px;
        font-weight: 600;
        text-transform: none;
    }

    .site-navigation {
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sub-menu,
    .submenu-toggle__chevron,
    .main-menu a,
    .submenu-toggle {
        transition: none !important;
    }
}


/* ==========================================================
   HARMONISATION DU SITE (style Grand-Bassam)
   Les sélecteurs commencent par "body" pour passer devant
   les fichiers CSS propres à chaque page.
   ========================================================== */

:root {
    --banner-green-light: #2f7f7a;
    --banner-green: #256764;
    --hover-speed: 380ms;
    --hover-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- 1. Police Mulish sur tout le site ---------- */
body,
body *:not(#wpadminbar):not(#wpadminbar *) {
    font-family: var(--font-main) !important;
}

/* ---------- 2. Bandeaux de titre des pages ---------- */
body .acts-hero,
body .administration-hero,
body .municipal-services-hero,
body .contact-hero,
body .cooperation-hero,
body .city-hero,
body .organs-hero,
body .phototech-hero,
body .services-hero,
body .news-archive-header,
body .single-news__header {
    display: block;
    min-height: 0;
    padding: clamp(70px, 8vw, 110px) 0;
    color: #fff;
    text-align: center;
    background: linear-gradient(120deg, var(--banner-green-light), var(--banner-green));
    border-bottom: 0;
}

/* Pas d'image ni de décorations dans les bandeaux */
body .acts-hero::after,
body .administration-hero::after,
body .municipal-services-hero::after,
body .contact-hero::after,
body .cooperation-hero::after,
body .city-hero::after,
body .organs-hero::after,
body .phototech-hero::after,
body .services-hero::after,
body .city-hero__background,
body .city-hero__overlay,
body .administration-hero__decoration,
body .organs-hero__shape {
    display: none;
}

body .administration-hero__container,
body .organs-hero__content,
body .city-hero__content {
    padding-top: 0;
    padding-bottom: 0;
}

/* Titre centré */
body .acts-hero h1,
body .administration-hero h1,
body .municipal-services-hero__title,
body .contact-hero h1,
body .cooperation-hero h1,
body .city-hero h1,
body .organs-hero h1,
body .phototech-hero h1,
body .services-hero__title,
body .news-archive-header h1,
body .single-news__header h1 {
    max-width: 1000px;
    margin: 0 auto;
    color: #fff;
    font-size: clamp(32px, 5vw, 58px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0;
    text-transform: uppercase;
    overflow-wrap: normal;
}

/* Petit trait orange sous le titre */
body .acts-hero h1::after,
body .administration-hero h1::after,
body .municipal-services-hero__title::after,
body .contact-hero h1::after,
body .cooperation-hero h1::after,
body .city-hero h1::after,
body .organs-hero h1::after,
body .phototech-hero h1::after,
body .services-hero__title::after,
body .news-archive-header h1::after,
body .single-news__header h1::after {
    content: "";
    display: block;
    width: 64px;
    height: 3px;
    margin: 22px auto 0;
    background: var(--brand-orange);
    border-radius: 3px;
}

/* Sous-titre / description centrés */
body .acts-hero p,
body .administration-hero p,
body .municipal-services-hero p,
body .contact-hero p,
body .cooperation-hero p,
body .city-hero p,
body .organs-hero p,
body .phototech-hero p,
body .services-hero p,
body .news-archive-header p,
body .news-archive-header span,
body .single-news__header p {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

body .acts-hero__description,
body .administration-hero__description,
body .municipal-services-hero__description,
body .contact-hero__description,
body .cooperation-hero__description,
body .city-hero p:not(.city-eyebrow),
body .organs-hero__description,
body .phototech-hero__description,
body .services-hero__description,
body .news-archive-header span,
body .single-news__header p {
    display: block;
    margin-top: 20px;
    color: rgb(255 255 255 / 90%);
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.6;
}

body .single-news__header .single-news__back {
    display: inline-block;
    margin-bottom: 14px;
    transition: color var(--hover-speed) var(--hover-ease);
}

body .single-news__header .single-news__back:hover {
    color: var(--brand-orange);
}

/* Page Le Maire : on garde la photo, on éclaircit seulement le vert */
body .mayor-hero {
    background: linear-gradient(120deg, var(--banner-green-light), var(--banner-green));
}

/* ---------- 3. Titres qui deviennent orange (animation) ---------- */
body main :is(h1, h2, h3, h4) a,
body main a :is(h2, h3, h4),
body .text-link,
body .see-all-link,
body .site-footer a {
    transition: color var(--hover-speed) var(--hover-ease);
}

body main :is(h1, h2, h3, h4) a:hover,
body main a:hover :is(h2, h3, h4),
body .text-link:hover,
body .see-all-link:hover,
body .site-footer a:hover {
    color: var(--brand-orange);
}

/* Cartes d'actualités : le bloc texte se remplit d'orange */
body .news-card,
body .featured-news-card {
    transition: box-shadow var(--hover-speed) var(--hover-ease), transform var(--hover-speed) var(--hover-ease);
}

body .news-card__body,
body .featured-news-card__body {
    background-image: linear-gradient(var(--brand-orange), var(--brand-orange));
    background-repeat: no-repeat;
    background-position: bottom;
    background-size: 100% 0;
    transition: background-size var(--hover-speed) var(--hover-ease);
}

body .news-card__photo,
body .featured-news-card__photo {
    transition: transform 600ms var(--hover-ease);
}

body .news-card :is(.news-date, h2 a, h3 a, p, .text-link),
body .featured-news-card :is(.news-date, h3 a, p, .text-link) {
    transition: color var(--hover-speed) var(--hover-ease);
}

body .news-card:hover,
body .featured-news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgb(23 23 21 / 12%);
}

body .news-card:hover .news-card__body,
body .featured-news-card:hover .featured-news-card__body {
    background-size: 100% 100%;
}

body .news-card:hover :is(.news-date, h2 a, h3 a, p, .text-link),
body .featured-news-card:hover :is(.news-date, h3 a, p, .text-link) {
    color: #fff;
}

body .news-card:hover .news-card__photo,
body .featured-news-card:hover .featured-news-card__photo {
    transform: scale(1.05);
}

/* Accès rapides : remplissage orange de gauche à droite */
body .quick-link {
    background-color: #fff;
    background-image: linear-gradient(var(--brand-orange), var(--brand-orange));
    background-repeat: no-repeat;
    background-position: left;
    background-size: 0 100%;
    transition:
        background-size var(--hover-speed) var(--hover-ease),
        transform var(--hover-speed) var(--hover-ease),
        box-shadow var(--hover-speed) var(--hover-ease);
}

body .quick-link > span {
    transition: color var(--hover-speed) var(--hover-ease);
}

body .quick-link:hover {
    background-size: 100% 100%;
}

body .quick-link:hover > span,
body .quick-link:hover .quick-link__icon,
body .quick-link:hover .quick-link__icon--orange {
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    body .news-card,
    body .featured-news-card,
    body .news-card__body,
    body .featured-news-card__body,
    body .news-card__photo,
    body .featured-news-card__photo,
    body .quick-link {
        transition: none;
    }
}


/* ==========================================================
   MAJUSCULES : uniquement « BONGOUANOU » sur la page d'accueil
   Tous les autres titres s'affichent comme ils sont écrits
   (première lettre en majuscule, le reste en minuscules).
   ========================================================== */
body *:not(#wpadminbar):not(#wpadminbar *) {
    text-transform: none !important;
    letter-spacing: normal;
}

body .home-hero h1:not(#wpadminbar):not(#wpadminbar *) {
    text-transform: uppercase !important;
}

/* Le logo du header / footer : « Mairie de » + « Bongouanou » */
body .site-brand__text strong {
    letter-spacing: 0;
}

/* ==========================================================
   TÉLÉPHONE / TABLETTE TACTILE
   Pas de survol au doigt : au toucher, l'orange remplit
   tout le bouton immédiatement (sinon l'animation est
   coupée par le changement de page et s'arrête au milieu).
   ========================================================== */
@media (hover: none) {
    body .quick-link,
    body .news-card__body,
    body .featured-news-card__body {
        transition: none;
    }

    body .quick-link:active,
    body .quick-link:focus-visible {
        background-size: 100% 100%;
    }

    body .quick-link:active > span,
    body .quick-link:active .quick-link__icon,
    body .quick-link:active .quick-link__icon--orange {
        color: #fff;
    }

    body .news-card:active .news-card__body,
    body .featured-news-card:active .featured-news-card__body {
        background-size: 100% 100%;
    }

    body .news-card:active :is(.news-date, h2 a, h3 a, p, .text-link),
    body .featured-news-card:active :is(.news-date, h3 a, p, .text-link) {
        color: #fff;
    }
}