/* ============================================================
   Fayat Énergie Services — Catalogue IoT
   Palette officielle Fayat : Bleu #0155A0 | Jaune #FFD62E
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@300;400;600;700&family=Barlow+Condensed:wght@400;600;700;800&display=swap');

:root {
  --blue-dark:   #003D7A;
  --blue:        #0155A0;
  --blue-mid:    #1A6DBB;
  --blue-light:  #E8F0F9;
  --yellow:      #FFD62E;
  --yellow-light:#FFFBE6;
  --white:       #FFFFFF;
  --grey-100:    #F4F6F9;
  --grey-200:    #E2E8F0;
  --grey-400:    #94A3B8;
  --grey-700:    #334155;
  --text:        #1A2A3A;

  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;

  --radius:    6px;
  --shadow:    0 2px 12px rgba(1,85,160,0.10);
  --shadow-lg: 0 8px 32px rgba(1,85,160,0.16);
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--grey-100);

  /* Colonne pleine hauteur : barre, contenu, pied de page. Le contenu absorbe
     l'espace restant, ce qui maintient le pied de page en bas de fenêtre sur
     les pages courtes — sinon il remontait se coller sous le dernier élément. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- NAVBAR ---- */
.navbar {
  background: #0155A0;
  border-bottom: 3px solid var(--yellow);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 90px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}
/* Logo image dans la navbar.
   Le bloc PNG (ratio ~1.28:1, fond bleu integre) doit tenir dans les
   87px utiles de la navbar (height 90px - bordure 3px, box-sizing: border-box).
   Pas de transform : scale() ne recalcule pas le flux et faisait deborder
   le logo de 37px, masquant la bordure jaune. Regler la taille via height. */
.navbar-brand img {
  height: 68px;          /* <<< SEUL CURSEUR : max 87px, au-dela ca deborde */
  width: auto;
  object-fit: contain;
  object-position: left center;
}
/* ---- NIVEAU 1 : LES PÔLES D'ACTIVITÉ ----
   Onglets larges à deux lignes : le nom du pôle, et ce qu'il contient.
   Le sous-titre évite d'avoir à cliquer pour comprendre. */
.navbar-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 2px;
  margin: 0 auto 0 18px;
}

.navbar-link {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 0 20px;
  border-radius: 5px 5px 0 0;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.navbar-link-label {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1.1;
}

.navbar-link-sub {
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.2;
  transition: color var(--transition);
}

.navbar-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.navbar-link:hover .navbar-link-sub {
  color: rgba(255, 255, 255, 0.68);
}

.navbar-link.is-active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.10);
}

.navbar-link.is-active .navbar-link-sub {
  color: var(--yellow);
}

.navbar-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 3px;
  background: var(--yellow);
  z-index: 2;
}

.navbar-link:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: -2px;
}

/* ---- NIVEAU 2 : LES SECTIONS DU PÔLE ----
   Bandeau clair sous la barre bleue : on est passé « à l'intérieur »
   d'un pôle, le changement de fond le signale sans mot supplémentaire. */
.subnav {
  position: sticky;
  top: 90px;
  z-index: 90;
  background: var(--grey-100);
  border-bottom: 1px solid var(--grey-200);
  box-shadow: 0 1px 6px rgba(1, 85, 160, 0.06);
}

.subnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 9px 1.5rem;
  display: flex;
  align-items: center;
  gap: 22px;
}

.subnav-pole {
  flex: none;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--grey-400);
  padding-right: 22px;
  border-right: 1px solid var(--grey-200);
}

.subnav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Pastilles cliquables plutôt qu'un texte souligné : la forme se voit avant
   même d'être lue, et la sélection ne repose plus sur un trait de 3 px. */
.subnav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid var(--grey-200);
  border-radius: 30px;
  background: var(--white);
  color: var(--grey-700);
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition);
}

/* Point de tête : gris au repos, jaune sur l'onglet courant */
.subnav-link::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--grey-200);
  transition: background var(--transition), transform var(--transition);
}

.subnav-link:hover {
  color: var(--blue);
  border-color: var(--blue-mid);
  box-shadow: 0 2px 8px rgba(1, 85, 160, 0.10);
}

.subnav-link:hover::before {
  background: var(--blue-mid);
}

.subnav-link.is-active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(1, 85, 160, 0.22);
}

.subnav-link.is-active::before {
  background: var(--yellow);
  transform: scale(1.15);
}

.subnav-link:focus-visible {
  outline: 2px solid var(--blue-dark);
  outline-offset: 2px;
}

/* Badge de droite : « Se connecter » ou retour au portail */
.navbar-badge {
  background: var(--yellow);
  color: var(--blue-dark);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 22px;
  border-radius: 5px;
  transition: background var(--transition), transform var(--transition);
  white-space: nowrap;
}
.navbar-badge:hover {
  background: var(--white);
  transform: translateY(-1px);
}



.navbar-badge:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
}

/* ---- PAGE WRAPPER ---- */
.page-wrapper {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* La page d'erreur n'a pas de .page-wrapper : c'est son encadré qui occupe
   l'espace disponible. */
.error-box {
  flex: 1 0 auto;
}

/* La barre et le pied de page gardent leur hauteur propre. */
.navbar,
.site-footer {
  flex: none;
}

/* ---- FOOTER ----
   Deux identités, deux niveaux de lecture : le logo du groupe Fayat à gauche,
   puis l'entité et l'outil, séparés par un filet vertical plutôt que par une
   barre typographique. */
.site-footer {
  background: #0155A0;
  border-top: 3px solid var(--yellow);
  padding: 1.15rem 2rem;
  text-align: center;
}

.site-footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  justify-content: center;
}

.site-footer-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

/* Filet en dégradé plutôt qu'un trait plein : il s'efface à ses extrémités et
   paraît posé sur le fond, pas collé. */
.site-footer-rule {
  width: 1px;
  height: 30px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .45), transparent);
}

/* Bloc centré : le nom et la mention partagent le même axe vertical. */
.site-footer-id {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  color: #fff;
}

.site-footer-name {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .02em;
}

/* « Énergie Services » passe sous « Fayat » : c'est la hiérarchie de la marque,
   le groupe puis l'entité. */
.fes-sub {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .82;
}

.site-footer-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .46);
}

/* Losange Fayat : le vrai symbole de la marque, en image de fond du
   pseudo-élément — le markup reste inchangé. */
.site-footer-text::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background: url("/catalogue/images/fayat-icon.png") center / contain no-repeat;
}

/* ---- LIGNE DE NAVIGATION ----
   Regroupe le bouton de retour et, quand elle existe, la miette de pain.
   Toujours en tête du contenu, à gauche : la position est donc identique
   d'une page à l'autre, ce qui rend le bouton immédiatement repérable. */
.page-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.page-nav .breadcrumb {
  margin-bottom: 0;
}

.back-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--grey-200);
  border-radius: 20px;
  background: var(--white);
  color: var(--grey-700);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.back-link svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--transition);
}

.back-link:hover {
  color: var(--blue);
  border-color: var(--blue-mid);
  background: var(--blue-light);
}

.back-link:hover svg {
  transform: translateX(-3px);
}

.back-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .page-nav {
    gap: 9px;
    margin-bottom: 1.2rem;
  }

  .back-link {
    padding: 5px 12px 5px 9px;
    font-size: 0.73rem;
  }
}

/* ---- BREADCRUMB ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2rem;
  font-size: 0.82rem;
  color: var(--grey-400);
}
.breadcrumb a { color: var(--blue-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--grey-200); }

/* ---- BADGE TAG ---- */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blue-light);
  color: var(--blue);
  border: 1px solid var(--blue-mid);
}
.tag.yellow {
  background: var(--yellow-light);
  color: var(--blue-dark);
  border-color: var(--yellow);
}

/* ============================================================
   RESPONSIVE — Mobile first
   ============================================================ */

/* ---- NAVBAR MOBILE ---- */
@media (max-width: 600px) {
  .navbar {
    height: auto;
    min-height: 64px;
    padding: 8px 1rem;
    gap: 8px;
  }
  .navbar-brand img {
    height: 44px;        /* navbar mobile : 64px min - 16px padding - 3px bordure = 45px utiles */
  }
  .navbar-badge {
    font-size: 0.72rem;
    padding: 7px 12px;
    letter-spacing: 0.08em;
  }

  .navbar {
    flex-wrap: wrap;
  }

  .navbar-nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 2px;
    padding-top: 2px;
    overflow-x: auto;
  }

  .navbar-link {
    padding: 6px 12px;
  }

  .navbar-link-label {
    font-size: 0.86rem;
  }

  .navbar-link-sub {
    display: none;
  }

  .subnav {
    top: auto;
    position: static;
  }

  .subnav-inner {
    padding: 8px 0.9rem;
    gap: 12px;
    overflow-x: auto;
  }

  .subnav-pole {
    display: none;
  }

  .subnav-link {
    padding: 7px 14px;
    font-size: 0.76rem;
    gap: 6px;
  }

  .subnav-link::before {
    width: 5px;
    height: 5px;
  }
}

/* ---- PAGE WRAPPER ---- */
@media (max-width: 600px) {
  .page-wrapper {
    padding: 1.2rem 0.9rem 3rem;
  }
}

/* ---- BREADCRUMB ---- */
@media (max-width: 480px) {
  .breadcrumb {
    font-size: 0.72rem;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 1.2rem;
  }
}

/* ---- FOOTER ---- */
@media (max-width: 480px) {
  .site-footer {
    padding: 1rem;
  }

  .site-footer-inner {
    gap: 0.75rem;
  }

  .site-footer-logo {
    height: 36px;
  }

  .site-footer-rule {
    height: 26px;
  }

  .site-footer-name {
    font-size: 0.88rem;
  }

  .site-footer-text {
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    gap: 6px;
  }
}
