/* ===========================================================================
   Page d'accueil — mise en page "précaire" (éléments de travers)
   (feuille chargée uniquement sur la page d'accueil)
   =========================================================================== */

/* On colle le contenu tout en haut pour que l'image N&B passe sous le menu */
.post--home { margin-top: 0; }

.wrapper-homepage {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
    max-width: 95%;
    margin: 0 auto;
    padding: 0 var(--page-margin);
    background-color: transparent !important;
    box-shadow: none;
}

/* ===========================================================================
   HAUT DE PAGE — grille à zones nommées (mobile -> desktop)
   =========================================================================== */
.home-hero {
    position: relative;
    display: grid;
    gap: 1.4rem;
    /* dégage le header (.top en position absolute) sans pousser le fond */
    padding: calc(var(--navbar-height) + 1.4rem) clamp(1rem, 3vw, 2.2rem) 2rem;
    margin-bottom: 2.5rem;
    overflow: hidden;

    /* --- Mobile : 1 colonne, ordre demandé : CTA, affiche, prix libre, infos, compteurs --- */
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "cta"
        "affiche"
        "stamp"
        "info"
        "stats";
    justify-items: center;
}

@media (min-width: 768px) {
    .home-hero {
        /* gauche (affiche, plus large) · droite (image N&B + infos en désordre) */
        grid-template-columns: 1.3fr minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: auto 1fr auto auto;
        grid-template-areas:
            "affiche .     stamp"
            "affiche info  info"
            "affiche stats stats"
            "affiche cta   cta";
        align-content: stretch;
        justify-items: stretch;
        gap: 1rem 1.4rem;
    }
}

/* ---- Image N&B en fond, partant du haut (sous le menu), bord gauche diagonal ---- */
.home-hero__bg {
    display: none;
}

@media (min-width: 768px) {
    .home-hero__bg {
        display: block;
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        width: 70%;
        z-index: 0;
        pointer-events: none;
        background:
            /* voile léger seulement (image plus claire) */
            linear-gradient(to bottom, rgba(0, 0, 0, 0.26) 0%, rgba(0, 0, 0, 0.12) 100%),
            url('/media/spectacles/8-en-attendant-la-mer-home-1360w.webp');
        background-repeat: no-repeat, no-repeat;
        background-position: center, center;
        background-size: cover, cover;
        background-blend-mode: multiply, normal;
        /* image éclaircie */
        -webkit-filter: grayscale(100%) contrast(0.3) brightness(1.28);
        filter: grayscale(100%) contrast(0.3) brightness(1.28);
        /* bord gauche diagonal inversé : coin haut-gauche plus à gauche que le bas-gauche */
        -webkit-clip-path: polygon(5% 0, 100% 0, 100% 100%, 17% 100%);
        clip-path: polygon(5% 0, 100% 0, 100% 100%, 17% 100%);
    }
}

/* Les éléments de contenu passent au-dessus du fond */
.home-affiche,
.home-hero__stamp,
.home-hero__cta,
.home-hero__info,
.home-hero__stats { position: relative; z-index: 1; }

/* ===========================================================================
   Diaporama d'affiches (gauche, agrandie, rotations alternées, fondu)
   =========================================================================== */
.home-affiche {
    grid-area: affiche;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

@media (min-width: 768px) {
    .home-affiche { align-self: stretch; }
}

/* Conteneur du diaporama */
.home-affiche__slideshow {
    position: relative;
    width: 100%;
    max-width: 300px;
    height: 100%;
    min-height: 400px;
}

@media (min-width: 768px) {
    .home-affiche__slideshow { max-width: 500px; min-height: 600px; }
}

/* Chaque affiche en position absolue pour s'empiler */
.home-affiche__frame {
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0;
    width: 100%;
    max-width: 300px;
    padding: 8px;
    background: #fbf7ee;
    border-radius: 3px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.34);
    transition: opacity 0.8s ease, transform 0.8s ease;
    opacity: 0;
    pointer-events: none;
    transform-origin: center center;
}

@media (min-width: 768px) {
    .home-affiche__frame { max-width: 500px; }
}

/* Affiche active (visible) */
.home-affiche__frame.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 10;
}

/* Affiches précédentes (restent en dessous avec opacité réduite) */
.home-affiche__frame.is-below {
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

/* Rotations alternées : -5, +3, -3, +5 */
.home-affiche__frame--1 {
    transform: translate(-50%, -50%) rotate(-5deg);
}

.home-affiche__frame--2 {
    transform: translate(-50%, -50%) rotate(3deg);
}

.home-affiche__frame--3 {
    transform: translate(-50%, -50%) rotate(-3deg);
}

.home-affiche__frame--4 {
    transform: translate(-50%, -50%) rotate(5deg);
}

/* Transition fluide pour la rotation */
.home-affiche__frame.is-active {
    transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
}

/* Définir les rotations pour chaque frame active */
.home-affiche__frame--1.is-active { --rotation: -5deg; }
.home-affiche__frame--2.is-active { --rotation: 3deg; }
.home-affiche__frame--3.is-active { --rotation: -3deg; }
.home-affiche__frame--4.is-active { --rotation: 5deg; }

/* Suppression de l'animation hover */
.home-affiche__frame:hover {
    transform: translate(-50%, -50%) rotate(var(--rotation, 0deg));
}

.home-affiche__frame img {
    display: block;
    width: 100%;
    height: auto;
}

/* ===========================================================================
   Tampon "PRIX LIBRE" — haut droite, sous le menu (grande marge au-dessus)
   =========================================================================== */
.home-hero__stamp {
    grid-area: stamp;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

@media (min-width: 768px) {
    .home-hero__stamp { justify-content: flex-end; margin-top: 1.8rem; }
}

@media (max-width: 767px) {
    .prix-libre-stamp {
        /* hors image -> tampon rouge classique sur le kraft */
        color: #c1121f;
        border-color: #c1121f;
        background: rgba(255, 255, 255, 0.15);
        box-shadow: inset 0 0 0 2px rgba(193, 18, 31, 0.35);
        mix-blend-mode: multiply;
    }
}

/* ===========================================================================
   Bouton "Voir la programmation" — en bas, centré sur l'image
   =========================================================================== */
.home-hero__cta {
    grid-area: cta;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.cta-button {
    display: inline-block;
    background-color: #e63946;
    color: #fff !important;
    padding: 0.85rem 1.8rem;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1.25rem;
    text-align: center;
    transform: rotate(2deg);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: #c1121f;
    transform: rotate(2deg) scale(1.04);
    box-shadow: 0 0 12px rgba(230, 57, 70, 0.9),
                0 0 28px rgba(230, 57, 70, 0.65),
                0 0 50px rgba(230, 57, 70, 0.4);
}

/* ===========================================================================
   Infos festival (sur l'image) : dates rouge + villes plus grosses, en désordre
   =========================================================================== */
.home-hero__info {
    grid-area: info;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
}

.hero-info-dates {
    margin: 0;
    font-weight: bold;
}

.hero-info-dates--big {
    font-size: 2.9rem;
    line-height: 1.05;
    color: #ff414e;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.7);
}

.hero-info-location { margin: 0; }

.hero-info-location .location-region {
    font-weight: bold;
    font-size: 1.6rem;
    color: #fff;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.7);
}

.hero-info-location .location-villes {
    font-size: 1.45rem;            /* villes plus grosses */
    color: #fff;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.7);
}

/* Badge/tampon flottant, détaché du texte (même langage visuel que PRIX LIBRE) */
.hero-info-horaire {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
    margin: 0;
}

/* Clignotement (accueil uniquement) : remplace le pulse discret du composant partagé */
.hero-info-horaire__badge {
    animation: horaire-badge-in 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28) both,
               horaire-badge-blink 1s steps(1, end) infinite;
}

@keyframes horaire-badge-blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-info-horaire__badge { animation: none; }
}

/* --- Désordre "à la main" : chaque ligne légèrement décalée / penchée (desktop) --- */
@media (min-width: 768px) {
    .home-hero__info { text-align: center; }
    .home-hero__info .hero-info-dates--big { transform: rotate(-3deg) translateX(-26px); }
    .hero-info-location > div:nth-child(1) { transform: rotate(2.5deg)  translateX(34px); }
    .hero-info-location > div:nth-child(2) { transform: rotate(-2deg)   translateX(-18px); }
    .hero-info-location > div:nth-child(3) { transform: rotate(2deg)    translateX(40px); }
    .hero-info-location > div:nth-child(4) { transform: rotate(-1.5deg) translateX(-6px); }
    /* Détaché à gauche du bloc de texte, à l'opposé du tampon PRIX LIBRE (haut droite) */
    .hero-info-horaire {
        position: absolute;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        justify-content: flex-start;
        margin: 0;
    }
    .hero-info-horaire__badge { font-size: 1.7rem; }
}

/* Hors image (mobile) : texte lisible sur le kraft, sans décalage */
@media (max-width: 767px) {
    .hero-info-dates--big { color: #e63946; text-shadow: none; }
    .hero-info-location .location-region,
    .hero-info-location .location-villes { color: #1a130b; text-shadow: none; }
    .hero-info-horaire__badge {
        color: #c1121f;
        background: rgba(255, 255, 255, 0.15);
        border-color: #c1121f;
        box-shadow: inset 0 0 0 2px rgba(193, 18, 31, 0.35);
        mix-blend-mode: multiply;
    }
}

@media (max-width: 600px) {
    .hero-info-dates--big { font-size: 2rem; }
    .hero-info-location .location-region { font-size: 1.3rem; }
    .hero-info-location .location-villes { font-size: 1.2rem; }
}

/* ===========================================================================
   Compteurs (Depuis 2020 / ...) — plus bas et plus penché
   =========================================================================== */
.home-hero__stats {
    grid-area: stats;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 768px) {
    .home-hero__stats { justify-content: flex-end; align-self: end; }
}

.stats-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    background: rgba(255, 252, 245, 0.2);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
    transform: rotate(6deg);
}

.stats-year {
    font-size: 1.6rem !important;
    font-weight: bold;
    margin-bottom: 0.5rem;
    text-align: center;
    font-family: var(--heading-font);
}

.stats-counter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.6rem;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
}

.counter-value {
    font-size: 2.1rem;
    font-weight: bold;
    color: #e63946;
    margin-bottom: 0.3rem;
    font-family: var(--heading-font);
}

.counter-label {
    font-size: 0.95rem;
    text-align: center;
}

/* ===========================================================================
   EN DESSOUS — carte (gauche) + texte (droite), 50/50, kraft normal partout
   =========================================================================== */
.home-below {
    display: grid;
    gap: 2rem;
    margin-bottom: 2.5rem;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "text"
        "map";
}

@media (min-width: 768px) {
    .home-below {
        grid-template-columns: 1fr 1fr;
        grid-template-areas: "map text";
        align-items: center;
        gap: 2.5rem;
    }
}

.home-map-section {
    grid-area: map;
    padding: 0.5rem 0.5rem 1rem;
}

.map-title {
    text-align: center;
    margin: 0 0 1rem;
}

.limousin-map-wrapper {
    max-width: 100%;
    margin: 1rem auto 0;
    position: relative;
}

/* ===========================================================================
   Texte de présentation — police uniforme, gras sur l'important, rouge conservé
   =========================================================================== */
.home-text-section {
    grid-area: text;
    align-self: center;
}

.text-content {
    margin: 0;
    font-family: var(--mono-font);
}

.text-editorial p {
    font-family: var(--mono-font);      /* texte de présentation en monospace */
    font-weight: 400;
    text-align: left;
    font-size: 1.12rem;                 /* le monospace "rend" plus gros : on réduit un peu */
    line-height: 1.6;
    color: #1a130b;
    margin: 0 0 1.2rem 0;
    text-shadow: 0 1px 0 rgba(255, 250, 242, 0.4);
}

.text-editorial strong {
    font-weight: 800;
    color: #120c06;
}

.text-editorial .text-lead {
    font-size: 1.24rem;
    line-height: 1.55;
    margin-bottom: 1.3rem;
}

/* texte en rouge : seule exception à la police uniforme */
.text-highlight,
.text-red {
    color: #c1121f;
    font-weight: bold;
}

.text-editorial .text-highlight {
    font-family: var(--heading-font);
    font-size: 1.5rem;
    line-height: 1.35;
    text-shadow: none;
}

.text-editorial .text-quote {
    margin: 1.8rem 0 0;
    text-align: center;
    font-size: 1.7rem;
    color: #c1121f;
}

.text-editorial .text-quote em {
    font-style: normal;
}

@media (max-width: 600px) {
    .text-editorial .text-lead { font-size: 1.15rem; }
    .text-editorial .text-quote { font-size: 1.4rem; }
}
