/* =========================================================================
 * Thème Fabre - Page d'accueil
 * ========================================================================= */

/* Fond bois de toute la home (#content.page-home du site d'origine) */
.page-content--home {
  display: block; /* hummingbird : grille avec 40px d'écart entre les blocs */
  container-type: inline-size; /* sert au calcul de la hauteur arrondie du héros */
  background-image: url('../img/texture-background-full.jpg');
  background-repeat: round;
  background-attachment: fixed;
  background-size: contain;
}

/* =========================================================================
 * Bloc héros (module linovhero)
 * Le site d'origine dessine le héros sur un canevas de 1920 x 750 px, mis à
 * l'échelle selon la largeur. --u = 1px du canevas, en unités du conteneur.
 * ========================================================================= */
.fabre-hero {
  position: relative;
  overflow: hidden;
  width: 100%; /* sinon la largeur se déduit de la hauteur arrondie et déborde d'une fraction de pixel */
  aspect-ratio: 1920 / 750;
  height: round(calc(100cqw * 750 / 1920), 1px); /* hauteur arrondie au pixel, comme le diaporama d'origine */
  container-type: inline-size;
}

.fabre-hero__bg,
.fabre-hero__bg .fabre-slider,
.fabre-hero__bg .carousel-inner,
.fabre-hero__bg .carousel-item,
.fabre-hero__bg .fabre-slider__link {
  position: absolute;
  inset: 0;
  height: 100%;
}
.fabre-hero__bg .carousel-item {
  display: block;
}
.fabre-slider__img {
  display: block;
  width: 100%;
  height: auto; /* ratio d'origine conservé (1920 x 750) */
  filter: brightness(0.5);
}

.fabre-hero__canvas {
  --u: calc(100cqw / 1920);
  position: absolute;
  inset: 0;
  z-index: 2; /* au-dessus des slides (z-index 1 en mode fondu Bootstrap) */
  pointer-events: none;
}
.fabre-hero__canvas > * {
  pointer-events: auto;
}

/* Titre + messages : calque positionné en x=235, y=275 (+30 de marge interne) */
.fabre-hero__caption {
  position: absolute;
  top: calc(305 * var(--u));
  left: calc(265 * var(--u));
  width: calc(1860 * var(--u));
}

.fabre-hero__title {
  margin: 0 0 calc(8 * var(--u));
  font-size: calc(70 * var(--u));
  font-weight: 700;
  line-height: calc(77 * var(--u));
  color: var(--fabre-green-light);
}

.fabre-hero__messages {
  position: relative;
  width: calc(790 * var(--u));
}

.fabre-hero__message {
  display: none;
}
.fabre-hero__message.is-active {
  display: block;
  animation: fabre-fade-in 0.4s ease;
}
@keyframes fabre-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fabre-hero__subtitle {
  margin: 0 0 calc(8 * var(--u));
  font-size: calc(35 * var(--u));
  font-weight: 300;
  line-height: calc(38.5 * var(--u));
  color: #fff;
}

.fabre-hero__text,
.fabre-hero__text p {
  max-width: calc(790 * var(--u));
  margin: 0;
  font-size: calc(20 * var(--u));
  font-weight: 300;
  line-height: calc(30 * var(--u));
  color: #fff;
}

.fabre-hero__action {
  margin: calc(30 * var(--u)) 0 0;
  line-height: 0;
}
.fabre-hero__btn {
  display: inline-block;
  min-width: calc(230 * var(--u));
  /* 18px 9px + bordure transparente de 1px du site d'origine, en padding pour éviter l'arrondi des bordures < 1px */
  padding: calc(19 * var(--u)) calc(10 * var(--u));
  font-size: calc(26 * var(--u));
  font-weight: 300;
  line-height: calc(28 * var(--u));
  letter-spacing: calc(1 * var(--u));
  color: #fff;
  text-align: center;
  text-decoration: none;
  background-color: var(--fabre-orange);
  border: 0;
  transition: all 0.3s ease-out;
}
.fabre-hero__btn:hover,
.fabre-hero__btn:focus {
  color: #fff;
  background-color: #d86800;
}

/* Flèches de navigation des messages (icônes Material, 60px) */
.fabre-hero__arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: calc(60 * var(--u));
  height: calc(30 * var(--u));
  padding: 0;
  color: #fff;
  background: none;
  border: 0;
  transform: translateY(-50%);
  cursor: pointer;
}
.fabre-hero__arrow .material-icons {
  display: block;
  font-size: calc(60 * var(--u));
  line-height: calc(30 * var(--u));
}
.fabre-hero__arrow--prev {
  left: calc(-90 * var(--u));
}
.fabre-hero__arrow--next {
  right: calc(-60 * var(--u));
}

/* Vidéo : calque positionné en x=1150, y=210, 600 x 400 */
.fabre-hero__video {
  position: absolute;
  top: calc(210 * var(--u));
  left: calc(1150 * var(--u));
  width: calc(600 * var(--u));
  height: calc(400 * var(--u));
}
.fabre-hero__video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: calc(2 * var(--u)) inset #666;
}
/* Avec JS : lecteur rendu en 600 x 400 puis réduit (comme le site d'origine), pour une interface YouTube identique */
.fabre-hero__video.is-scaled iframe {
  width: 600px;
  height: 400px;
  border-width: 2px;
  transform: scale(var(--fabre-hero-scale, 1));
  transform-origin: 0 0;
}

/* ----- Héros : tablettes et mobiles (règles du site d'origine) ----- */
@media (max-width: 769px) {
  /* Textes agrandis (custom.css d'origine). La légende y était remontée de 120px et passait
     sous le header : on la garde visible, à 120 unités du haut. */
  .fabre-hero__caption {
    top: calc(120 * var(--u));
  }

  .fabre-hero__title {
    font-size: calc(100 * var(--u));
    line-height: calc(110 * var(--u));
  }

  .fabre-hero__messages {
    width: calc(860 * var(--u));
  }

  .fabre-hero__subtitle {
    font-size: calc(55 * var(--u));
    line-height: calc(60.5 * var(--u));
  }

  .fabre-hero__text,
  .fabre-hero__text p {
    max-width: none;
    font-size: calc(40 * var(--u));
    line-height: calc(40 * var(--u));
  }

  .fabre-hero__btn {
    padding: calc(29 * var(--u)) calc(20 * var(--u));
    font-size: calc(46 * var(--u));
  }
}

@media (max-width: 425px) {
  .fabre-hero {
    aspect-ratio: auto;
    height: 250px;
  }

  /* Diaporama d'origine : image 1920 x 750 réduite à 768px de large, calée à gauche, recadrée de 24px en haut */
  .fabre-slider__img {
    width: 768px;
    max-width: none;
    height: 300px;
    margin-top: -24px;
  }

  .fabre-hero__caption {
    top: 74px;
    left: 12px;
    width: calc(100% - 34px);
  }

  .fabre-hero__title {
    margin: 0 0 3px;
    font-size: 36px;
    line-height: 39.6px;
  }

  .fabre-hero__messages {
    width: 100%;
  }

  .fabre-hero__subtitle {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    line-height: 17.6px;
  }

  .fabre-hero__text,
  .fabre-hero__text p {
    font-size: 14px;
    line-height: 14px;
  }

  .fabre-hero__action {
    margin-top: 12px;
  }

  .fabre-hero__btn {
    min-width: 0;
    padding: 11.6px 8px;
    font-size: 18.4px;
    line-height: 11.2px;
    letter-spacing: 0;
  }

  .fabre-hero__arrow--prev,
  .fabre-hero__video {
    display: none;
  }

  .fabre-hero__arrow {
    width: 24px;
    height: 12px;
  }

  .fabre-hero__arrow .material-icons {
    font-size: 24px;
    line-height: 12px;
  }

  .fabre-hero__arrow--next {
    right: -24px;
  }
}

/* =========================================================================
 * Cadre crème (grille de catégories, texte de présentation...)
 * .container.bloc-categories / .text-intro du site d'origine
 * ========================================================================= */
.fabre-cream-box {
  width: 70%;
  max-width: 1200px; /* .container du site d'origine plafonné à 70 % */
  margin: 60px auto 90px;
  padding: 2% 3%; /* % de la largeur du conteneur (pleine page), comme sur le site d'origine */
  background-color: var(--fabre-cream);
  border-radius: 25px;
  box-shadow: 2px 2px 8px 2px rgba(52, 52, 52, 0.35);
}
@media (max-width: 769px) {
  .fabre-cream-box {
    width: 90%;
  }
}

/* =========================================================================
 * Grille de catégories (module linovhomecategories)
 * ========================================================================= */
.fabre-catgrid__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 70px 30px;
  margin: 0 0 70px;
  padding: 0;
  list-style: none;
}

.fabre-catgrid__item {
  position: relative;
}

.fabre-catgrid__link {
  display: block;
  color: #000;
  text-decoration: none;
}

.fabre-catgrid__img {
  display: block;
  padding-top: 66%;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* Nom sous l'image, en débord (position absolue comme sur le site d'origine) */
.fabre-catgrid__name {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  padding-top: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
  color: #000;
  text-align: center;
  text-transform: uppercase;
}
.fabre-catgrid__link:hover .fabre-catgrid__name,
.fabre-catgrid__link:focus .fabre-catgrid__name {
  color: #000;
}

/* =========================================================================
 * Présentation + plan d'accès + horaires (module linovhomeintro + ps_customtext)
 * ========================================================================= */
.fabre-intro__title {
  margin: 0 0 10px;
  padding-right: 60px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--fabre-green-light);
  text-align: center;
  text-transform: capitalize;
}
.fabre-intro__title span {
  font-weight: 400;
  color: var(--fabre-dark);
}

.fabre-customtext p {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.7;
  color: #000;
}

.fabre-intro__infos {
  display: flex;
  margin: 0 -15px;
}
.fabre-intro__map {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
  padding: 0 15px;
}
.fabre-intro__hours {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
  padding: 0 15px;
}
.fabre-intro__map iframe {
  border: 0; /* reste inline comme sur le site d'origine (espace de ligne sous la carte) */
}

.fabre-intro__subtitle {
  margin: 30px 0 16px;
  font-size: 22px;
  line-height: 1.7;
  color: #000;
}

.fabre-intro__table {
  border-collapse: collapse;
  font-size: 14px;
  line-height: 25px;
  color: #333;
}
.fabre-intro__table th,
.fabre-intro__table td {
  padding: 1px;
  vertical-align: middle;
}
.fabre-intro__table th {
  font-weight: 700;
  text-align: left;
}

/* =========================================================================
 * Bloc "Meilleures ventes" (ps_featuredproducts, catégorie "Populaires")
 * ========================================================================= */
.fabre-featured {
  width: 1380px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 15px 70px;
}
.fabre-featured__box {
  margin: 0 -15px;
  padding: 3% 10%;
  background: var(--fabre-green-light) url('../img/texture2.png');
  background-size: contain;
  border-radius: 50px;
  box-shadow: 2px 2px 8px 2px rgba(52, 52, 52, 0.35);
}
.fabre-featured__title {
  margin: 0 0 10px;
  padding-right: 60px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--fabre-green-light);
  text-align: center;
  text-transform: capitalize;
}
.fabre-featured__title span {
  font-weight: 400;
  color: #000;
}
.fabre-featured__title strong {
  font-weight: 700;
  color: #fff;
}
.fabre-featured__list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 30px; /* pas d'écart vertical : la carte porte sa marge basse de 30px */
  margin: 0 0 46px; /* 16px + 30px de marge du bloc produits d'origine */
  padding: 0 15px; /* colonne interne du site d'origine */
}

/* =========================================================================
 * Derniers articles du blog (module linovcmsblog)
 * ========================================================================= */
.fabre-blog {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 15px 70px;
}
.fabre-blog__title {
  margin: 0 0 70px;
  padding-right: 60px;
  font-size: 30px;
  font-weight: 700;
  line-height: 23px;
  color: var(--fabre-green-light);
  text-align: center;
  text-transform: capitalize;
}
.fabre-blog__title span {
  font-weight: 400;
  color: var(--fabre-dark);
}
.fabre-blog__title strong {
  font-weight: 700;
  color: #fff;
}
.fabre-blog__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 30px;
  padding-bottom: 26px; /* hauteur des puces du carrousel d'origine */
}
.fabre-blog__item {
  overflow: hidden;
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 2px 2px 8px 2px rgba(176, 176, 176, 0.47);
}
.fabre-blog__image {
  display: block;
  line-height: 0;
}
.fabre-blog__image img {
  width: 100%;
  height: auto;
}
.fabre-blog__meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  padding: 0 20px;
  font-weight: 300;
  color: var(--fabre-dark);
}
.fabre-blog__name {
  margin: 20px 0 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 32px;
}
.fabre-blog__name a {
  color: var(--fabre-dark);
  text-decoration: none;
}
.fabre-blog__name a:hover {
  color: var(--fabre-green);
}
.fabre-blog__date {
  display: block;
  padding: 0 10px 10px 0;
  font-size: 14px;
  line-height: 17.5px;
}
.fabre-blog__date .ti {
  font-size: 14px;
  line-height: 28px;
}

/* =========================================================================
 * Home : tablettes et mobiles (colonnes du site d'origine)
 *   catégories : 4 colonnes, 1 sous 481px
 *   meilleures ventes : 4 / 3 (<992) / 2 (<768) / 1 (<481)
 *   blog (carrousel) : 3 / 2 (<992) / 1 (<576), défilement horizontal
 * ========================================================================= */
@media (max-width: 991px) {
  .fabre-featured__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fabre-blog__list {
    grid-template-columns: none;
    grid-auto-columns: calc((100% - 30px) / 2);
    grid-auto-flow: column;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .fabre-blog__list::-webkit-scrollbar {
    display: none;
  }

  .fabre-blog__item {
    align-self: start; /* carrousel d'origine : chaque carte garde sa hauteur */
    scroll-snap-align: start;
  }

  .fabre-blog__meta {
    padding: 10px;
  }
}

@media (max-width: 769px) {
  .fabre-intro__title,
  .fabre-featured__title,
  .fabre-blog__title {
    padding-right: 0;
  }
}

@media (max-width: 767px) {
  .fabre-featured__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .fabre-blog__list {
    grid-auto-columns: 100%;
  }
}

@media (max-width: 480px) {
  .fabre-catgrid__list {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 60px;
    margin-bottom: 60px;
    padding: 24px 30px 0;
  }

  .fabre-intro__infos {
    flex-direction: column;
  }

  .fabre-intro__map,
  .fabre-intro__hours {
    max-width: 100%;
  }

  .fabre-intro__map iframe {
    width: 100%;
  }

  /* Colonnes empilées : la marge du titre fusionne avec celle du dernier paragraphe (30px au lieu de 16 + 30) */
  .fabre-intro__map .fabre-intro__subtitle {
    margin-top: 14px;
  }

  .fabre-featured__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 425px) {
  .fabre-intro__title,
  .fabre-featured__title,
  .fabre-blog__title {
    font-size: 22px;
  }

  .fabre-customtext p {
    font-size: 13px;
  }
}

/* Hummingbird ajoute 2rem sous le contenu : la réassurance de l'accueil touche le footer */
body#index .center-column.page {
  padding-bottom: 0;
}

/* ----- Réassurance (linovhtmlblocks, bloc "Réassurance accueil") ----- */
.fabre-reassurance {
  background: #f9f9f9;
}

.fabre-reassurance__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 50px 15px;
  text-align: center;
}

.fabre-reassurance__item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fabre-reassurance__item img {
  box-sizing: content-box;
  width: 80px;
  height: 80px;
  padding: 40px 0;
}

.fabre-reassurance__item h5 {
  margin: 0 0 2px;
  font-size: 24px;
  font-weight: 700;
  line-height: 26.4px;
  color: var(--fabre-dark);
}

.fabre-reassurance__item p {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 17.5px;
  color: var(--fabre-orange);
}

/* Réassurance : colonnes du site d'origine (col-md-4 / col-sm-6 / col-sp-12) */
@media (max-width: 991px) {
  .fabre-reassurance__item {
    margin-bottom: 40px;
  }
}

@media (max-width: 767px) {
  .fabre-reassurance__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fabre-reassurance__item:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .fabre-reassurance__list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 425px) {
  .fabre-reassurance__list {
    padding-top: 0;
    padding-bottom: 30px; /* marge basse du bloc d'origine, dans le fond gris */
  }
}
