/* ================================================== */
/* HOMEPAGE — styles spécifiques à la page d'accueil  */
/* ================================================== */


/* ------------------------------------------------ */
/* Carte "Présentation"                              */
/* ------------------------------------------------ */

.a-propos {
  font-weight: 600;
}

.a-propos-homepage {
  padding: 1.5rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #ffffff;
  transition: background-color 0.3s ease-out, transform 0.3s ease-out;
  text-decoration: none;
  max-width: 340px;
  margin: 1.5rem auto 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.a-propos-homepage h2 {
  font-size: 1.2rem;
}

.a-propos-homepage a {
  text-decoration: none;
  font-size: 0.875rem;
}

.a-propos-homepage__content .link {
  color: #01FF01;
  font-size: 0.875rem;
}

/* Desktop large uniquement */
@media (min-width: 1200px) {
  .a-propos-homepage {
    width: 250px;
    height: 320px;
    z-index: 5;
    margin-left: -60% !important;
    margin-right: 0;
    margin-top: -40px;
  }
}

.a-propos-homepage:hover {
  box-shadow: rgba(0, 0, 0, 0.25) 0 8px 20px 0;
  background-color: #01FF01;
}


/* ------------------------------------------------ */
/* Countdown HS2040 (carte "Un cap pour demain")    */
/* ------------------------------------------------ */

.hs2040-countdown {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 2px solid rgba(0, 0, 0, 0.12);
}

.hs2040-countdown__label {
  font-size: 0.85rem;
  line-height: 1.2;
  margin-bottom: 0.65rem;
  color: #111;
}

.hs2040-countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.hs2040-countdown__cell {
  background: #fff;
  text-align: center;
  padding-top: 0.6rem;
}

.hs2040-countdown__num {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: 1px;
  color: #01FF01;
}

.hs2040-countdown__txt {
  font-size: 0.72rem;
  margin-top: 0.25rem;
  color: #111;
}

/* Mobile : 2×2 pour éviter l'écrasement */
@media (max-width: 600px) {
  .hs2040-countdown__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* ------------------------------------------------ */
/* Titre "Actualité"                                */
/* ------------------------------------------------ */

.title-agenda {
  white-space: nowrap;
  display: inline-block;
}

@media (max-width: 900px) {
  .title-agenda {
    font-size: 1.4rem;
    text-align: center;
  }
}


/* ------------------------------------------------ */
/* Décos carte Présentation                         */
/* ------------------------------------------------ */

.a-propos-homepage-block {
  position: relative;
  width: max-content;
}

.a-propos-homepage-deco {
  position: absolute;
  pointer-events: none;
  will-change: transform;
  transform: translateZ(0);
}

.a-propos-homepage-deco--top {
  top: -40px;
  right: -55px;
  width: 80px;
  height: 120px;
}

/* Formes géométriques */
.a-propos-homepage-deco__square,
.a-propos-homepage-deco__rect {
  box-sizing: border-box;
  border: 3px solid #000;
  background: transparent;
  display: block;
}

.a-propos-homepage-deco__square--green {
  width: 22px;
  height: 22px;
  background: #01FF01;
  border-color: #01FF01;
  position: absolute;
  top: 20px;
  left: -505px;
}

.a-propos-homepage-deco__rect {
  width: 32px;
  height: 110px;
  position: absolute;
  top: 40px;
  left: -485px;
}

/* Masqué en dessous de 1200px */
@media (max-width: 1200px) {
  .a-propos-homepage-deco {
    display: none !important;
  }
}


/* ------------------------------------------------ */
/* Carte "Next Event"                               */
/* ------------------------------------------------ */

.em-item.homepage {
  padding: 0 !important;
  border: 2px solid #01FF01;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #ffffff;
  box-shadow: rgba(0, 0, 0, 0.15) 0 5px 15px 0;
  transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;
  max-width: 340px;
  margin: 1.5rem auto 0;
}

/* Desktop large */
@media (min-width: 1200px) {
  .em-item.homepage {
    width: 300px;
    height: 350px;
    z-index: 5;
    margin-left: 60%;
    margin-top: 19px !important;
  }

  .title-agenda {
    margin-left: 60%;
    margin-top: 100px !important;
  }
}

.em-item.homepage:hover {
  box-shadow: rgba(0, 0, 0, 0.25) 0 8px 20px 0;
}

/* Image */
.em-item.homepage .em-item-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0 !important;
  margin: 0;
}

.em-item.homepage .em-item-image img {
  width: 110%;
  height: 100%;
  display: block;
  transition: transform 0.3s ease;
}

/* Overlay vert au survol */
.em-item.homepage .em-item-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #01FF01;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.em-item.homepage:hover .em-item-image::after {
  opacity: 0.45;
}

/* Texte */
.em-item.homepage .em-item-info {
  padding: 0.45rem 0.75rem;
  margin: 0;
  min-height: auto !important;
}

.em-item.homepage .em-item-info > * {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.em-item.homepage .em-item-info > *:last-child {
  margin-bottom: 0;
}

.em-event-date {
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
  color: #111;
  margin: 0 0 0.35rem 0 !important;
}

/* Titre event */
.em-item.homepage .em-item-info h3,
.em-item.homepage .em-item-info h3 a {
  font-family: "Inter", sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.1 !important;
  color: #01FF01 !important;
  letter-spacing: 1px !important;
  text-decoration: none !important;
}

/* Nettoyage des <p> injectés */
.em-item.homepage p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0;
}


/* ------------------------------------------------ */
/* Décos sous la carte Event                        */
/* ------------------------------------------------ */

.homepage-deco {
  position: relative;
  width: 100%;
  height: 55px;
  margin-top: 0.2rem;
  will-change: transform;
  transform: translateZ(0);
}

.homepage-deco-square--big {
  position: absolute;
  right: -103px;
  top: -20px;
  width: 53px;
  height: 53px;
  background: #01FF01;
}

.homepage-deco-square--outline {
  position: absolute;
  left: 329px;
  bottom: -15px;
  width: 32px;
  height: 32px;
  border: 3px solid #000;
  background: transparent;
}

/* Masqué en dessous de 1200px */
@media (max-width: 1200px) {
  .homepage-deco {
    display: none !important;
  }
}


/* ------------------------------------------------ */
/* Dernière production                              */
/* ------------------------------------------------ */

.homepage-last-production-wrapper {
  max-width: 340px;
  margin: 2.5rem auto 0;
  position: relative;
}

/* Desktop large */
@media (min-width: 1200px) {
  .homepage-last-production-wrapper {
    width: 300px;
    height: auto;
    z-index: 5;
    margin-top: -200px !important;
  }
}

/* Carte */
.homepage-last-production-card {
  display: block;
  padding: 0 !important;
  border-top: none;
  border-left: 2px solid #01FF01;
  border-bottom: 0.5px solid #01FF01;
  border-right: 2px solid #01FF01;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  box-shadow: rgba(0, 0, 0, 0.15) 0 5px 15px 0;
  transition: box-shadow 0.3s ease-out, transform 0.3s ease-out;
  text-decoration: none;
  max-width: 340px;
  margin: 0;
  box-sizing: border-box;
}

.homepage-last-production-card:hover {
  box-shadow: rgba(0, 0, 0, 0.25) 0 8px 20px 0;
}

/* Image */
.homepage-last-production-card__image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0 !important;
  margin: 0;
  line-height: 0;
}

.homepage-last-production-card__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Overlay vert au survol */
.homepage-last-production-card__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #01FF01;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.homepage-last-production-card:hover .homepage-last-production-card__image::after {
  opacity: 0.45;
}

/* Badge "Dernière production" */
.homepage-last-production-card__image::before {
  content: "Dernière production";
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: #01FF01;
  color: #111111;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  padding: 10px 14px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

/* Texte */
.homepage-last-production-card__info {
  padding: 1.5rem 0.75rem;
  margin: 0;
  min-height: auto !important;
}

.homepage-last-production-card__info > * {
  margin-top: 0;
  margin-bottom: 0;
}

.homepage-last-production-card__info > *:last-child {
  margin-bottom: 0;
}

.homepage-last-production-card__title {
  font-family: "Inter", sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.1 !important;
  color: #01FF01 !important;
  letter-spacing: 1px !important;
  text-decoration: none !important;
  text-transform: uppercase;
  margin: 0 !important;
}

/* Nettoyage des <p> parasites */
.homepage-last-production-wrapper p,
.homepage-last-production-card p,
.homepage-last-production-card__info p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: normal !important;
}

/* Tablette */
@media (min-width: 768px) and (max-width: 1199px) {
  .homepage-last-production-wrapper {
    width: 300px;
    max-width: 300px;
    margin: 2rem auto 0;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .homepage-last-production-wrapper {
    width: 280px;
    max-width: 280px;
    margin: 2rem auto 0;
  }

  .homepage-last-production-card__image::before {
    font-size: 0.72rem;
    padding: 8px 10px;
    top: 10px;
    left: 10px;
  }

  .homepage-last-production-card__title {
    font-size: 0.9rem !important;
  }
}

/* Très petits écrans */
@media (max-width: 360px) {
  .homepage-last-production-wrapper {
    width: 92%;
    max-width: 92%;
  }
}


/* ------------------------------------------------ */
/* Animations d'entrée                              */
/* ------------------------------------------------ */

@keyframes homepage-card-in {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes homepage-deco-pop {
  from {
    opacity: 0;
    transform: scale(0) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

.a-propos-homepage,
.em-item.homepage {
  opacity: 0;
  transform: translateY(20px);
  animation: homepage-card-in 0.8s ease-out forwards;
}

.a-propos-homepage { animation-delay: 0.15s; }
.em-item.homepage  { animation-delay: 0.35s; }

.a-propos-homepage-deco__square--green,
.a-propos-homepage-deco__rect,
.homepage-deco-square--big,
.homepage-deco-square--outline {
  opacity: 0;
  transform-origin: center;
  animation: homepage-deco-pop 0.55s ease-out forwards;
}

.a-propos-homepage-deco__square--green { animation-delay: 0.55s; }
.a-propos-homepage-deco__rect          { animation-delay: 0.7s;  }
.homepage-deco-square--big             { animation-delay: 0.85s; }
.homepage-deco-square--outline         { animation-delay: 1s;    }

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
  .a-propos-homepage,
  .em-item.homepage,
  .a-propos-homepage-deco__square--green,
  .a-propos-homepage-deco__rect,
  .homepage-deco-square--big,
  .homepage-deco-square--outline {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}


/* ------------------------------------------------ */
/* Responsive — tablette (< 1200px)                 */
/* ------------------------------------------------ */

@media (max-width: 1199px) {

  /* Les trois colonnes redeviennent verticales */
  .wp-block-columns.alignfull.wp-block-columns-is-layout-flex {
    flex-wrap: wrap !important;
  }

  .homepage-colonne1,
  .homepage-colonne2,
  .homepage-colonne3 {
    flex-basis: 100% !important;
    max-width: 700px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Ordre : Actualité → Présentation → Vidéo */
  .homepage-colonne1 { order: 3; }
  .homepage-colonne3 { order: 1; }
  .homepage-colonne2 { order: 3; }

  /* Titre Actualité */
  .title-agenda {
    text-align: center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 1rem !important;
    white-space: normal !important;
  }

  /* Vidéo centrée */
  .homepage-colonne2 .wp-block-video,
  .homepage-colonne2 figure.wp-block-video video {
    width: 100% !important;
    max-width: 700px;
    margin: 2rem auto 0 !important;
    display: block !important;
  }

  /* Décos masquées */
  .a-propos-homepage-deco,
  .homepage-deco {
    display: none !important;
  }
}


/* ------------------------------------------------ */
/* Responsive — mobile (< 768px)                    */
/* ------------------------------------------------ */

@media (max-width: 768px) {

  /* Largeur des cartes */
  .em-item.homepage,
  .a-propos-homepage {
    width: 92vw !important;
    max-width: 92vw !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Titre Actualité */
  .title-agenda {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    width: 100% !important;
  }

  /* Vidéo */
  .homepage-colonne2 .wp-block-video {
    margin: 2rem auto !important;
    max-width: 92vw !important;
  }

  /* Décos masquées */
  .a-propos-homepage-deco,
  .homepage-deco {
    display: none !important;
  }
}
