.home-main {
    background: var(--color-bg);
}

/* Hero */

.hero {
    min-height: 620px;
    padding: 70px 80px 90px;
    box-sizing: border-box;
    background: var(--color-bg);
}

.hero > .wp-block-group__inner-container {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr);
    align-items: center;
    gap: 70px;
}

.hero__content {
    position: relative;
    z-index: 2;
    justify-self: center;
    width: max-content;
    max-width: 100%;
    text-align: center;
}

.hero__content::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 46px;
    width: 88%;
    height: 12px;
    transform: translateX(-50%);
    background: var(--color-light);
    opacity: 1;
    z-index: -1;
    pointer-events: none;

    filter: blur(10px);
    box-shadow:
        0 8px 18px rgba(230, 218, 160, .45),
        0 18px 34px rgba(230, 218, 160, .28),
        0 28px 46px rgba(230, 218, 160, .16);
}

.hero__content h1 {
    position: relative;
    z-index: 2;
    display: inline-block;
    margin: 0;
    padding: 0 22px; /* élargit le noir derrière le titre */
    background: var(--color-bg);
    font-size: clamp(38px, 4vw, 58px);
    line-height: 1;
    text-align: center;
}

.hero__content p {
    position: relative;
    z-index: 3;
    display: block;
    width: max-content;
    margin: 14px auto 0;
    font-size: clamp(22px, 2.2vw, 32px);
    color: var(--color-accent);
    font-weight: 300;
    line-height: 1.2;
    text-align: center;
}

.hero__image {
    justify-self: center;
    width: 100%;
    max-width: 580px;
}

.hero__image figure {
    margin: 0;
}

.hero__image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .5s ease, filter .5s ease;
}

/* Animation d'arrivee du titre hero */
.hero__content::after {
    animation: heroGlowRise .9s ease .08s both;
}

.hero__content h1 {
    will-change: transform, opacity;
    animation: heroRiseIn .9s cubic-bezier(.2, .8, .2, 1) .12s both;
}

.hero__content p {
    will-change: transform, opacity;
    animation: heroRiseIn .85s cubic-bezier(.2, .8, .2, 1) .28s both;
}

.hero__image {
    will-change: transform, opacity;
    animation: heroRiseIn .95s cubic-bezier(.2, .8, .2, 1) .42s both;
}

/* Hover sur les images d'accueil (hors section evenements) */
.hero__image:hover img,
.hero__image:focus-within img {
    transform: scale(1.02);
    filter: brightness(1.05);
}

.atelier-gallery figure img {
    transition: transform .45s ease, filter .45s ease;
}

.atelier-gallery figure:hover img,
.atelier-gallery figure:focus-within img {
    transform: scale(1.05);
    filter: brightness(1.07);
}

/* ==========================================================
   Atelier
   ========================================================== */

.home-atelier {
    position: relative;
    padding: 80px 80px 35px;
    background: var(--color-bg);
}

.home-atelier > .wp-block-group__inner-container {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 40px;
    align-items: end;
}

.home-atelier h2 {
    grid-column: 1 / -1;
    margin: 0 0 10px;
    font-size: 22px;
    will-change: transform, opacity;
    animation: heroRiseIn .85s cubic-bezier(.2, .8, .2, 1) .1s both;
}

/* Galerie en quinconce, sans transform : placement explicite en grid-column/grid-row */

.atelier-gallery > .wp-block-group__inner-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 90px;
    gap: 16px;
}

.atelier-gallery figure {
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
    background: var(--color-header);
}

.atelier-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Placement des 8 images */

.atelier-gallery figure:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 4; }
.atelier-gallery figure:nth-child(2) { grid-column: 3 / 5; grid-row: 1 / 3; }
.atelier-gallery figure:nth-child(3) { grid-column: 5 / 7; grid-row: 1 / 2; }
.atelier-gallery figure:nth-child(4) { grid-column: 3 / 5; grid-row: 3 / 5; }
.atelier-gallery figure:nth-child(5) { grid-column: 5 / 7; grid-row: 2 / 4; }
.atelier-gallery figure:nth-child(6) { grid-column: 1 / 3; grid-row: 4 / 6; }
.atelier-gallery figure:nth-child(7) { grid-column: 3 / 6; grid-row: 5 / 7; }
.atelier-gallery figure:nth-child(8) { grid-column: 6 / 7; grid-row: 4 / 6; }

.atelier-content {
    align-self: end;
    padding-bottom: 12px;
}

.atelier-content p {
    margin: 0 0 16px;
    font-size: 14px;
}

/* ==========================================================
   Événements accueil
   ========================================================== */

.home-evenements-list {
    max-width: 1180px;
    margin: 40px auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 34px;
}

.evenement-card {
    display: block;
}

.evenement-card__image-link {
    display: block;
    text-decoration: none;
}

.evenement-card__image-link img {
    transition: transform .35s ease, filter .35s ease, opacity .35s ease;
    will-change: transform, filter;
}

.evenement-card__image-link:hover img,
.evenement-card__image-link:focus-visible img {
    transform: scale(1.03);
    filter: brightness(1.06);
    opacity: .98;
}

.evenement-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    background: #ddd;
}

.evenement-card__content {
    margin-top: 14px;
}

.evenement-card h3 {
    margin: 0;
    font-size: 18px;
}

.evenement-card p {
    margin: 6px 0 0;
    font-size: 13px;
}

.evenements-cta {
    text-align: center;
    margin-top: 32px;
}

@keyframes heroRiseIn {
    from {
        opacity: 0;
        transform: translate3d(0, 36px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes heroGlowRise {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(18px);
        filter: blur(14px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        filter: blur(10px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero__content::after,
    .hero__content h1,
    .hero__content p,
    .hero__image {
        animation: none;
    }
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 992px) {

    .home-atelier {
        padding: 60px 40px 80px;
    }

    /* le contenu texte passe sous la galerie au lieu d'être à côté */
    .home-atelier > .wp-block-group__inner-container {
        grid-template-columns: 1fr;
    }

    .atelier-content {
        align-self: start;
        text-align: center;
    }

    /* galerie simplifiée en 4 colonnes, quinconce plus légère */
    .atelier-gallery > .wp-block-group__inner-container {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 100px;
    }

    .atelier-gallery figure:nth-child(1) { grid-column: 1 / 3; grid-row: 1 / 3; }
    .atelier-gallery figure:nth-child(2) { grid-column: 3 / 5; grid-row: 1 / 2; }
    .atelier-gallery figure:nth-child(3) { grid-column: 3 / 4; grid-row: 2 / 3; }
    .atelier-gallery figure:nth-child(4) { grid-column: 4 / 5; grid-row: 2 / 4; }
    .atelier-gallery figure:nth-child(5) { grid-column: 1 / 3; grid-row: 3 / 5; }
    .atelier-gallery figure:nth-child(6) { grid-column: 3 / 4; grid-row: 4 / 6; }
    .atelier-gallery figure:nth-child(7) { grid-column: 4 / 5; grid-row: 4 / 6; }
    .atelier-gallery figure:nth-child(8) { grid-column: 1 / 3; grid-row: 5 / 6; }

    .home-evenements-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 600px) {

    .home-atelier {
        padding: 50px 20px 60px;
    }

    /* mobile : galerie en une seule colonne, empilée, hauteur uniforme */
    .atelier-gallery > .wp-block-group__inner-container {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
        gap: 14px;
    }

    .atelier-gallery figure:nth-child(1),
    .atelier-gallery figure:nth-child(2),
    .atelier-gallery figure:nth-child(3),
    .atelier-gallery figure:nth-child(4),
    .atelier-gallery figure:nth-child(5),
    .atelier-gallery figure:nth-child(6),
    .atelier-gallery figure:nth-child(7),
    .atelier-gallery figure:nth-child(8) {
        grid-column: 1 / 2;
        grid-row: auto;
    }

    .home-evenements-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1120px) and (min-width: 993px) {
    .hero {
        padding: 60px 45px 75px;
    }

    .hero > .wp-block-group__inner-container {
        grid-template-columns: minmax(300px, .9fr) minmax(390px, 1.1fr);
        gap: 35px;
    }

    .hero__content h1 {
        font-size: clamp(42px, 4.5vw, 52px);
        white-space: nowrap;
    }

    .hero__content::after {
        left: 50%;
        right: auto;
        top: 40px;
        width: 90%;
        transform: translateX(-50%);
    }

    .hero__image {
        max-width: 500px;
    }
}

@media (max-width: 992px) {
    .hero {
        min-height: auto;
        padding: 60px 40px 75px;
    }

    .hero > .wp-block-group__inner-container {
        grid-template-columns: 1fr;
        gap: 45px;
        text-align: center;
    }

    .hero__content {
        justify-self: center;
        order: 1;
    }

    .hero__image {
        order: 2;
        max-width: 480px;
    }

    .hero__content::after {
        left: 50%;
        right: auto;
        top: 25px;
        width: 85%;
        transform: translateX(-50%);
    }

    .hero__content h1 {
        white-space: nowrap;
    }

    .hero__content p {
        margin: 12px auto 0;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 45px 20px 60px;
    }

    .hero > .wp-block-group__inner-container {
        gap: 34px;
    }

    .hero__content h1 {
        padding: 0 16px;
    }

    .hero__content {
        width: max-content;
        max-width: 100%;
    }

    .hero__content::after {
        left: 50%;
        right: auto;
        top: 39px;
        width: 98%;
        height: 9px;
        transform: translateX(-50%);
        filter: blur(8px);
    }

    .hero__content p {
        margin: 12px auto 0;
    }

    .hero__image {
        max-width: 390px;
    }
}

@media (max-width: 380px) {
    .hero {
        padding: 36px 16px 50px;
    }

    .hero__content h1 {
        padding: 0 12px;
    }

    .hero__content p {
        font-size: 18px;
    }

    .hero__content::after {
        top: 34px;
        width: 96%;
        height: 8px;
        filter: blur(7px);
    }
}