/* =======================================================
   TRAM-E — PAGE FABLAB
======================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =======================================================
   VARIABLES DE THÈME
======================================================= */

body.page-labo {
  font-family: "Mohave", sans-serif;
  overflow-x: hidden;
  background: white;

  --fab-bg: #f7f5f0;
  --fab-dark: #1a1a1a;
  --fab-mid: #e8e6e0;
  --fab-text: #2e2e2e;
  --fab-accent: #27ae60;
  --fab-accent2: #f39c12;
}

/* Variables de couleur par onglet */
#tab-transformations {
  --tab-color: #f2bb05;
  --tab-text: #f0f7ea;
}
#tab-formations {
  --tab-color: #29bad4;
  --tab-text: #e6f1fb;
}
#tab-ateliers {
  --tab-color: #e67e22;
  --tab-text: #794313;
}
#tab-machines {
  --tab-color: #8e44ad;
  --tab-text: #e6f1fb;
}

.fab-tab[data-tab="transformations"] {
  --tab-color: #f2bb05;
  --tab-text: #f0f7ea;
}

.fab-tab[data-tab="formations"] {
  --tab-color: #29bad4;
  --tab-text:#e6f1fb;
}

.fab-tab[data-tab="ateliers"] {
  --tab-color: #e67e22;
  --tab-text: #f7e8d8;
}

.fab-tab[data-tab="machines"] {
  --tab-color: #8e44ad;
  --tab-text: #e6f1fb;
}

/* Barre active des onglets — couleur de l'onglet actif */
.fab-tab[data-tab="transformations"].active::after {
  background: #f2bb05;
}
.fab-tab[data-tab="formations"].active::after {
  background: #00a680;
}
.fab-tab[data-tab="ateliers"].active::after {
  background: #d74e09;
}
.fab-tab[data-tab="machines"].active::after {
  background: #124e78;
}

/* =======================================================
   WRAPPER GLOBAL
======================================================= */

.fablab-wrapper {
  width: 100%;
  overflow-x: hidden;
}

/* =======================================================
   HERO
======================================================= */

.fab-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.fab-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.fab-hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fab-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 0.88) 0%,
    rgba(10, 10, 10, 0.3) 50%,
    rgba(10, 10, 10, 0.05) 100%
  );
}

.fab-hero__content {
  position: relative;
  z-index: 2;
  padding: 0 4rem 6rem;
  max-width: 960px;
}

.fab-hero__title {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(3.5rem, 8vw, 9rem);
  line-height: 0.9;
  color: #fff;
  margin-bottom: 1.5rem;
}

.fab-hero__title em {
  font-style: normal;
  color: var(--fab-accent2);
  display: block;
}

.fab-hero__intro {
  font-family: "Mohave", sans-serif;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.82);
  max-width: 520px;
  border-left: 4px solid var(--fab-accent2);
  padding-left: 1.5rem;
}

.fab-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--fab-accent);
  z-index: 4;
}

/* =======================================================
   NAVIGATION ONGLETS — sticky
======================================================= */

.fab-tabs {
  position: sticky;
  top: 0;
  z-index: 50;
  background: transparent;
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}

.fab-tabs::-webkit-scrollbar {
  display: none;
}

.fab-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 1.4rem 2.5rem;
  border: none;
  cursor: pointer;
  position: relative;
  flex: 1;
  min-width: 140px;
  white-space: nowrap;
  background: var(--tab-color);
  filter: brightness(0.9) saturate(0.9);
  transition: filter 0.3s ease;
    border-radius: 0 0 30px 30px;
}

.fab-tab:last-child {
  border-right: none;
}

.fab-tab__label {
  font-family: "MatrimoineFeutre", sans-serif;
  font-size: clamp(1rem, 1.8vw, 1.4rem);
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.25s;
}

/* Survol : légère remontée de luminosité */
.fab-tab:hover {
  filter: brightness(0.55) saturate(0.95);
}
.fab-tab:hover .fab-tab__label,
.fab-tab:hover .fab-tab__num {
  color: #fff;
}

/* Actif : pleine luminosité, couleur franche */
.fab-tab.active {
  filter: brightness(1) saturate(1);
}
.fab-tab.active .fab-tab__num {
  color: rgba(255, 255, 255, 0.85);
}
.fab-tab.active .fab-tab__label {
  color: var(--tab-text);
}

/* Barre du bas */
.fab-tab::after {
  display: none;
}

/* =======================================================
   PANNEAUX
======================================================= */

.fab-panel {
  display: none;
  background: var(--fab-bg);
}

.fab-panel.active {
  display: block;
  animation: fadePanel 0.4s ease forwards;
}

@keyframes fadePanel {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =======================================================
   INTRO — 3 colonnes
======================================================= */

.fab-intro {
  padding: 7rem 4rem;
  display: grid;
  grid-template-columns: 1fr 2.5fr;
  gap: 4rem;
  align-items: start;
  background: var(--fab-bg);
}

.fab-intro__cover {
  position: sticky;
  top: 6rem;
  overflow: hidden;
}

.fab-intro__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease;
}

.fab-intro__cover:hover img {
  transform: scale(1.04);
}


.fab-intro__title {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(3rem, 6vw, 7rem);
  line-height: 0.95;
  color: var(--fab-dark);
  margin-bottom: 2.5rem;
}

.fab-intro__title em {
  font-style: normal;
  color: var(--tab-color);
}

.fab-intro__text {
  font-family: "Mohave", sans-serif;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  line-height: 1.78;
  color: var(--fab-text);
  border-left: 4px solid var(--tab-color);
  padding-left: 1.5rem;
}

.fab-intro__text strong {
  color: var(--tab-color);
}

/* =======================================================
   SÉPARATEUR
======================================================= */

.fab-sep {
  height: 2px;
  background: var(--tab-color);
  margin: 0;
}

/* =======================================================
   BLOCS TEXTE + IMAGE — FIX direction:rtl remplacé par order
======================================================= */

.fab-bloc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
  position: relative;
}

.fab-bloc--reverse .fab-bloc__text {
  order: 2;
}
.fab-bloc--reverse .fab-bloc__media {
  order: 1;
}

/* Trait décoratif — s'adapte automatiquement */
.fab-bloc__text {
  padding: 5rem 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.fab-bloc__text::before {
  content: "";
  position: absolute;
  top: 5rem;
  left: 4rem;
  width: 36px;
  height: 4px;
  background: var(--tab-color);
}

.fab-bloc__label {
  font-family: "Mohave", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--tab-color);
  margin-bottom: 1.5rem;
}

.fab-bloc__title {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(2rem, 3.5vw, 4rem);
  line-height: 1;
  color: var(--fab-dark);
  margin-bottom: 2rem;
}

.fab-bloc__corps {
  font-family: "Mohave", sans-serif;
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.78;
  color: var(--fab-text);
  max-width: 440px;
}

/* Colonne image */
.fab-bloc__media {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background: var(--fab-mid);
}

.fab-bloc__placeholder {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, var(--fab-mid) 0px, var(--fab-mid) 10px, #ede9e1 10px, #ede9e1 20px);
  opacity: 0.5;
}

/* Slider */
.fab-bloc__slider {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.fab-bloc__track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fab-bloc__track img,
.fab-bloc__track video {
  min-width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.fab-slider-prev,
.fab-slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
  color: var(--fab-dark);
}

.fab-slider-prev {
  left: 1rem;
}
.fab-slider-next {
  right: 1rem;
}

.fab-slider-prev:hover,
.fab-slider-next:hover {
  background: var(--fab-accent);
  color: white;
  transform: translateY(-50%) scale(1.1);
}

/* =======================================================
   SPLASH
======================================================= */

.fab-splash {
  background: var(--tab-color);
  color: var(--tab-text);
  padding: 1rem 4rem;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.fab-splash__quote {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  max-width: 70%;
  position: relative;
  z-index: 2;
}

.fab-splash__quote::before {
  content: "—";
  display: block;
  font-size: 0.75em;
  font-family: "Mohave", sans-serif;
  opacity: 0.45;
  margin-bottom: 0.4em;
}

.fab-splash::after {
  content: "LABORATOIRE TEXTILE";
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Matrimoine", sans-serif;
  font-size: 3rem;
  line-height: 1;
  opacity: 0.07;
  pointer-events: none;
  color: currentColor;
  white-space: nowrap;
}

/* =======================================================
   RESPONSIVE — TABLETTE (≤ 1024px)
======================================================= */

@media (max-width: 1024px) {
  .fab-hero__content {
    padding: 0 3rem 4rem;
  }

  /* Intro : 1 colonne */
  .fab-intro {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 5rem 3rem;
  }

  .fab-intro__cover {
    position: static;
    aspect-ratio: 16/9;
    width: 100%;
  }

  .fab-intro__label {
    position: static;
  }

  /* Blocs : 1 colonne, order reset */
  .fab-bloc {
    grid-template-columns: 1fr;
    height: auto;
  }

  .fab-bloc--reverse .fab-bloc__text {
    order: 0;
  }
  .fab-bloc--reverse .fab-bloc__media {
    order: 0;
  }

  .fab-bloc__media {
    min-height: 50vw;
    height: 50vw;
  }
  .fab-bloc__text {
    padding: 3rem;
  }
  .fab-bloc__text::before {
    top: 3rem;
    left: 3rem;
  }

  .fab-tab {
    padding: 1.2rem 1.5rem;
  }
}

/* =======================================================
   RESPONSIVE — MOBILE (≤ 768px)
======================================================= */

@media (max-width: 768px) {
  .fab-hero {
    min-height: 100svh;
  }
  .fab-hero__content {
    padding: 0 1.5rem 3rem;
  }
  .fab-hero__title {
    font-size: clamp(2.6rem, 12.5vw, 5rem);
  }
  .fab-hero__intro {
    font-size: 1rem;
  }

  /* Onglets scrollables */
  .fab-tabs {
    justify-content: flex-start;
    padding: 0.5rem;
    gap: 1rem;
  }
  .fab-tab {
    flex: 0 0 auto;
    padding: 1rem 1.2rem;
    min-width: auto;
    border-radius: 30px 30px 30px 30px;
  }
  .fab-tab__label {
    font-size: 1rem;
  }

  .fab-intro {
    padding: 3rem 1.5rem;
    gap: 1.5rem;
  }

  .fab-intro__cover {
    aspect-ratio: 4/3;
  }
  .fab-intro__title {
    font-size: clamp(2.5rem, 10vw, 4rem);
  }
  .fab-intro__text {
    font-size: 1rem;
  }

  .fab-bloc__text {
    padding: 2.5rem 1.5rem;
  }
  .fab-bloc__text::before {
    left: 1.5rem;
    top: 2.5rem;
  }
  .fab-bloc__title {
    font-size: clamp(1.8rem, 7vw, 3rem);
  }
  .fab-bloc__corps {
    font-size: 1rem;
  }
  .fab-bloc__media {
    min-height: 60vw;
    height: 60vw;
  }

  .fab-splash {
    padding: 2rem 1.5rem;
  }
  .fab-splash__quote {
    max-width: 100%;
    font-size: clamp(1.6rem, 7vw, 2.5rem);
  }
  .fab-splash::after {
    display: none;
  }
}

/* =======================================================
   CORRECTIONS RESPONSIVE MOBILE — ajouts/remplacements
======================================================= */

/* --- Onglets : 2x2 sur mobile --- */
@media (max-width: 768px) {
  .fab-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 par ligne */
    overflow-x: visible;
  }

  .fab-tab {
    flex: none;
    width: 100%;
    padding: 1rem;
    min-width: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  /* Supprimer la bordure droite des 2e et 4e onglets */
  .fab-tab:nth-child(2),
  .fab-tab:nth-child(4) {
    border-right: none;
  }

  /* Supprimer la bordure basse des 3e et 4e onglets */
  .fab-tab:nth-child(3),
  .fab-tab:nth-child(4) {
    border-bottom: none;
  }

  .fab-tab__num {
    font-size: 0.65rem;
  }
  .fab-tab__label {
    font-size: 0.9rem;
  }

  /* --- Blocs : correction barre décorative et espacement --- */
  .fab-bloc {
    display: flex;
    flex-direction: column; /* colonne au lieu de grid */
    height: auto;
  }

  /* Barre décorative : toujours en haut à gauche, position fixe */
  .fab-bloc__text {
    padding: 2.5rem 1.5rem 2rem;
    position: relative; /* contexte pour ::before */
  }

  .fab-bloc__text::before {
    position: absolute;
    top: 1.5rem; /* toujours au même endroit */
    left: 1.5rem;
    width: 30px;
    height: 3px;
  }

  /* Séparation claire entre les blocs */
  .fab-bloc {
    border-bottom: 2px solid var(--fab-mid);
    margin-bottom: 0;
  }

  /* Média toujours en dessous du texte sur mobile */
  .fab-bloc--reverse .fab-bloc__text {
    order: 0;
  }
  .fab-bloc--reverse .fab-bloc__media {
    order: 1;
  }

  .fab-bloc__media {
    height: 60vw;
    min-height: 220px;
  }

  /* Label (Processus, Teinture...) — espace en bas */
  .fab-bloc__label {
    margin-bottom: 0.8rem;
  }

  /* Titre bloc — espace en bas avant le corps */
  .fab-bloc__title {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
    margin-bottom: 1rem;
  }

  .fab-bloc__corps {
    font-size: 0.95rem;
    line-height: 1.6;
  }
}


/* =======================================================
   CONTENUS 2026 — accroche, étiquette d'intro, CTA, blocs sans photo
   (ajouts : le reste de la feuille est inchangé)
======================================================= */

/* Intro à plusieurs paragraphes et intertitre d'onglet */
.fab-intro__text p + p {
  margin-top: 1em;
}

.fab-section-head {
  padding: 5rem 4rem 0;
  background: var(--fab-bg);
}
.fab-section-head__title {
  position: relative;
  padding-top: 1.6rem;
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1;
  color: var(--fab-dark);
}
.fab-section-head__title::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 4px;
  background: var(--tab-color);
}
.fab-section-head__title em {
  font-style: normal;
  color: var(--tab-color);
}
@media (max-width: 1024px) {
  .fab-section-head {
    padding: 3rem 3rem 0;
  }
}
@media (max-width: 768px) {
  .fab-section-head {
    padding: 2.5rem 1.5rem 0;
  }
}

/* Textes à plusieurs paragraphes dans les blocs */
.fab-bloc__corps + .fab-bloc__corps {
  margin-top: 1em;
}

/* Bloc dont le dossier de photos est vide : texte seul, pleine largeur */
.fab-bloc:has(.fab-bloc__placeholder) {
  grid-template-columns: 1fr;
  min-height: 0;
}
.fab-bloc:has(.fab-bloc__placeholder) .fab-bloc__media {
  display: none;
}
.fab-bloc:has(.fab-bloc__placeholder) .fab-bloc__corps {
  max-width: 720px;
}

/* ---- Bloc "Un laboratoire textile à investir" + devis ---- */
.fab-cta {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 4rem;
  align-items: center;
  padding: 6rem 4rem;
  background: var(--tab-color);
  color: var(--tab-text);
}
.fab-cta__title {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(2.2rem, 4.5vw, 4.5rem);
  line-height: 1;
  margin-bottom: 1.8rem;
}
.fab-cta p {
  font-family: "Mohave", sans-serif;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  line-height: 1.7;
  margin-bottom: 1em;
  max-width: 560px;
}
.fab-cta__box {
  padding: 2.5rem;
  border: 2px solid currentColor;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
}
.fab-cta__subtitle {
  font-family: "Matrimoine", sans-serif;
  font-size: clamp(1.6rem, 2.5vw, 2.4rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}
.fab-cta__btn {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.9rem 2rem;
  border-radius: 30px;
  background: #fff;
  color: var(--tab-color);
  font-family: "Mohave", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.fab-cta__btn:hover {
  transform: translateY(-3px);
  background: var(--fab-dark);
  color: #fff;
}

@media (max-width: 1024px) {
  .fab-cta {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 4rem 3rem;
  }
}
@media (max-width: 768px) {
  .fab-cta {
    padding: 3rem 1.5rem;
  }
  .fab-cta__box {
    padding: 1.8rem;
  }
}
