/* =============================================================
   Lynthis — styles des nouveaux composants
   Ce fichier s'ajoute aux CSS existants, il n'en remplace aucun.
   ============================================================= */

:root {
  --brand: #06bee1;
  --brand-dark: #0b7f96;
  --accent: #ffbf00;
  --ink: #222;
  --ink-soft: #555;
  --bg: #f9f9f9;
  --bg-alt: #f1f3f5;
  --line: #e2e6ea;
  --dark: #121212;

  /* Barre de navigation flottante */
  --nav-gap-y: 14px;    /* décrochage par rapport au bord supérieur */
  --nav-gap-x: 28px;    /* retrait latéral */
  --nav-radius: 14px;
  --nav-space: 96px;    /* place à réserver sous la barre */
}

/* --- Accessibilité : lien d'évitement ------------------------ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--dark);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* =============================================================
   BARRE DE NAVIGATION FLOTTANTE
   -------------------------------------------------------------
   navbar.css colle une barre noire pleine largeur sur le bord
   supérieur. On la transforme ici en rectangle décroché, sans
   toucher à navbar.css : `#header nav` est plus spécifique que
   le `nav` nu, donc ces règles gagnent.

   Répartition des rôles :
     #header nav        -> conteneur transparent qui crée la marge
     #header .nav-container -> le rectangle visible
   ============================================================= */

#header nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: var(--nav-gap-y) var(--nav-gap-x);
  background: none;
  box-shadow: none;
  z-index: 1000;
  pointer-events: none;      /* seul le rectangle capte les clics */
}

#header .nav-container {
  position: relative;
  pointer-events: auto;
  max-width: 1320px;
  margin: 0 auto;
  padding: 9px 14px 9px 18px;
  border-radius: var(--nav-radius);
  background: rgba(18, 18, 18, .72);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background .28s ease, box-shadow .28s ease, border-color .28s ease;
}

/* Sur les pages intérieures, le fond est clair dès le départ : un rectangle
   très translucide y virerait au gris sale. On l'opacifie d'emblée et on
   réserve la transparence à l'accueil, où elle joue sur la vidéo. */
.page-inner #header .nav-container { background: rgba(18, 18, 18, .92); }

/* Repli léger dès que la page défile : le rectangle s'opacifie pour
   rester lisible au-dessus du contenu clair. */
#header.is-scrolled .nav-container {
  background: rgba(18, 18, 18, .93);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
}

/* Le logo de 60 px écrasait le rectangle : format plus compact. */
#header nav img.logo {
  height: 42px;
  width: auto;
}

#header #nav-menu { gap: 26px; }
#header #nav-menu li a { font-size: 16px; padding: 7px 12px; border-radius: 8px; }

/* Fallback : sans backdrop-filter (Firefox ancien), on opacifie. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #header .nav-container { background: rgba(18, 18, 18, .96); }
}

/* --- Navigation : logo cliquable + sélecteur de langue -------- */
.logo-link { display: inline-flex; align-items: center; }
.logo-link img { display: block; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 20px;
  border: 1px solid #444;
  border-radius: 5px;
  overflow: hidden;
  background: #222;
  flex: 0 0 auto;
}
.lang-switch .lang-current,
.lang-switch a {
  display: block;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  color: #9aa0a6;
}
.lang-switch .lang-current { background: var(--accent); color: var(--dark); }
.lang-switch a:hover, .lang-switch a:focus { background: #333; color: #fff; }

/* --- Décalage sous la barre fixe ------------------------------ */
.page-inner main { padding-top: var(--nav-space); }
[id] { scroll-margin-top: calc(var(--nav-space) + 8px); }

/* IMPORTANT : navbar.css cible le sélecteur `nav` sans classe, donc TOUTES
   les balises <nav> héritent de la barre fixe noire. On neutralise cela pour
   les <nav> secondaires (fil d'Ariane, menu d'ancres) — sans toucher
   navbar.css, qui reste la source de vérité pour la barre principale. */
nav.breadcrumb,
nav.jump-nav {
  position: static;
  display: block;
  width: auto;
  background: none;
  color: inherit;
  box-shadow: none;
  z-index: auto;
  align-items: initial;
}

/* --- Boutons -------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-dark); color: #fff; }
.btn-ghost { border-color: currentColor; color: inherit; }
.btn-ghost:hover, .btn-ghost:focus { background: rgba(6, 190, 225, .12); }

.cta-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
#home .cta-actions { justify-content: center; }
#home .btn-ghost { color: #fff; }

/* index.css donne `max-width: 600px` au paragraphe d'accroche sans marges
   automatiques : sa boîte restait collée à gauche et le texte, centré à
   l'intérieur de cette boîte, paraissait décalé d'une centaine de pixels
   par rapport au titre. Les marges auto recentrent la boîte elle-même. */
#home .home-overlay > p {
  margin-left: auto;
  margin-right: auto;
}

/* --- Fil d'Ariane --------------------------------------------- */
.breadcrumb {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 5% 0;
  font-size: .9rem;
  color: var(--ink-soft);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 8px; color: #9aa0a6; }
.breadcrumb a { color: var(--brand-dark); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb + .page-header { padding-top: 22px; }

/* --- En-tête de page ------------------------------------------ */
.page-header {
  display: block;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 5% 20px;
}
.page-header h1 {
  font-size: clamp(2rem, 4.5vw, 2.9rem);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 16px;
}
.page-header > p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 70ch;
}

/* --- Corps de texte ------------------------------------------- */
.prose {
  display: block;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 5%;
}
.prose h2, .sector-body h2 {
  font-size: 1.6rem;
  color: var(--ink);
  margin: 34px 0 12px;
}
.prose h2:first-child, .sector-body h2:first-child { margin-top: 0; }
.prose h3, .sector-body h3 { font-size: 1.2rem; color: var(--ink); margin: 22px 0 8px; }
.prose p, .sector-body p { margin-bottom: 14px; color: var(--ink-soft); max-width: 72ch; }
.prose ul, .sector-body ul { margin: 0 0 18px 1.2em; color: var(--ink-soft); }
.prose li, .sector-body li { margin-bottom: 8px; }
.prose a, .sector-body a { color: var(--brand-dark); }

.tech-list { list-style: none; margin-left: 0 !important; }
.tech-list li {
  border-left: 3px solid var(--brand);
  padding: 6px 0 6px 14px;
  margin-bottom: 12px;
}

.section-intro {
  max-width: 70ch;
  margin: 0 auto 28px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}
#services .section-intro, #industries .section-intro { text-align: center; }

/* --- Cartes services : titres devenus des liens --------------- */
.service-box { text-align: left; }
.service-box .service-info h3 a { color: inherit; text-decoration: none; }
.service-box:hover .service-info h3 a { color: #fff; }
.service-box .learn-more { align-self: flex-start; }

/* --- Cartes secteurs : lien couvrant -------------------------- */
.industry-card > a { display: block; position: relative; color: inherit; text-decoration: none; }
.industry-card .overlay { pointer-events: none; }
.industry-card .industry-name { font-size: 1.35rem; font-weight: 700; }

/* --- Encadré « faits » (page d'accueil) ----------------------- */
.about-right .facts { list-style: none; margin: 0; padding: 0; }
.about-right .facts li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(0, 0, 0, .12);
}
.about-right .facts li:last-child { border-bottom: 0; }
.about-right .facts strong { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-dark); }
.about-right .facts span { color: #333; }

/* --- Zones d'intervention ------------------------------------- */
.zones-section { background: var(--bg-alt); text-align: center; }
.zones-section h2 { font-size: 2rem; color: var(--ink); margin-bottom: 10px; }
.zones-list {
  list-style: none;
  display: grid;
  /* min() évite le débordement horizontal : `section` étant en flex colonne
     (base.css), un enfant grid ne descend pas sous sa taille min-content. */
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  /* `width: 100%` est indispensable : `section` est en flex colonne (base.css)
     et `margin: 0 auto` désactive l'étirement, la grille se dimensionnerait
     alors sur son contenu et déborderait sur mobile. */
  width: 100%;
  min-width: 0;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  text-align: left;
}
.zones-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--ink-soft);
}
.zones-note { margin-top: 24px; color: var(--ink-soft); }
.zones-note a { color: var(--brand-dark); }

/* --- FAQ ------------------------------------------------------- */
.faq-section { max-width: 900px; margin: 0 auto; padding: 50px 5%; display: block; }
.faq-section > h2 { font-size: 2rem; color: var(--ink); margin-bottom: 24px; }
.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-list summary {
  cursor: pointer;
  padding: 16px 18px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand);
  flex: 0 0 auto;
}
.faq-list details[open] summary::after { content: "–"; }
.faq-list summary h3 { font-size: 1.05rem; margin: 0; color: var(--ink); font-weight: 700; }
.faq-answer { padding: 0 18px 18px; }
.faq-answer p { margin: 0; color: var(--ink-soft); }

/* --- Menu d'ancres (page secteurs) ---------------------------- */
.jump-nav { margin-top: 22px; }
.jump-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.jump-nav a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: .95rem;
}
.jump-nav a:hover { border-color: var(--brand); background: rgba(6, 190, 225, .08); }

/* --- Secteurs : vignette + texte, séparés par un filet --------- */
.sector {
  display: block;
  padding: 0;
  border-top: 1px solid var(--line);
}
.sector-inner {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  max-width: 900px;
  margin: 0 auto;
  padding: 38px 5%;
}
.sector-thumb { margin: 0; }
.sector-thumb img {
  display: block;
  width: 100%;
  /* `height: auto` est indispensable : l'attribut height="300" de la balise
     est un indice de présentation qui, sans cela, l'emporte sur aspect-ratio
     et étire la vignette. */
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: #e9edeb;
}
.sector-body { min-width: 0; }

@media (max-width: 720px) {
  .sector-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 30px 5%;
  }
  .sector-thumb img { aspect-ratio: 16 / 7; }
}

/* --- Bandeau d'appel à l'action ------------------------------- */
.cta-band {
  display: block;
  background: var(--dark);
  color: #fff;
  text-align: center;
  padding: 56px 5%;
}
.cta-band h2 { font-size: 2rem; margin-bottom: 12px; }
.cta-band p { color: #cfd4d8; max-width: 60ch; margin: 0 auto; }
.cta-band .cta-actions { justify-content: center; }
.cta-band .btn-ghost { color: #fff; }

/* --- Page contact --------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  min-width: 0;
  gap: 30px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 5% 60px;
  align-items: start;
}
.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
}
.contact-card h2 { font-size: 1.35rem; color: var(--ink); margin-bottom: 14px; }
.contact-card h2 + * { margin-top: 0; }
.contact-card address { font-style: normal; line-height: 1.8; color: var(--ink-soft); }
.contact-card ul { margin: 0 0 0 1.1em; padding: 0; color: var(--ink-soft); }
.contact-card li { margin-bottom: 8px; }
.contact-card a { color: var(--brand-dark); }
.contact-card .muted { color: #888; font-size: .9rem; margin-top: 14px; }
.contact-card > h2:not(:first-child) { margin-top: 30px; }

.contact-form p { margin-bottom: 16px; }
.contact-form label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #ccd2d8;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(6, 190, 225, .18);
}
.contact-form .consent label {
  display: block;
  position: relative;
  padding-left: 28px;
  font-weight: 400;
  font-size: .9rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.contact-form .consent input { position: absolute; left: 0; top: 4px; margin: 0; }
.contact-form button { cursor: pointer; font-family: inherit; font-size: 1rem; }

/* Champ piège anti-spam : invisible pour l'humain, rempli par les robots */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-weight: 700;
}
.form-status.ok { background: #e6f7ed; border: 1px solid #a8dfc0; color: #1c6b41; }
.form-status.error { background: #fdecec; border: 1px solid #f3b9b9; color: #a12626; }

/* --- Pages légales -------------------------------------------- */
.legal h1 { font-size: 2.2rem; margin-bottom: 18px; color: var(--ink); }
.legal h2 { font-size: 1.25rem; }

/* --- Pied de page : colonne de liens --------------------------- */
/* Même raison que les vignettes : sans `height: auto`, l'attribut height
   de la balise écrase la largeur fixée en CSS et déforme le logo. */
.footer-logo { height: auto; }

.footer-links { flex: 1; min-width: 160px; }
.footer-links a { color: #00072d; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 8px; }

/* --- Bannière cookies ----------------------------------------- */
#cookie-consent a { color: var(--brand); }

/* --- Vidéo de fond : on la coupe sur mobile (poids/batterie) --- */
@media (max-width: 768px) {
  :root { --nav-gap-y: 10px; --nav-gap-x: 12px; --nav-space: 80px; }

  #header .nav-container { padding: 7px 10px 7px 14px; }
  #header nav img.logo { height: 36px; }
  .lang-switch { margin-left: 10px; }

  /* Le menu déroulant se cale sous le rectangle et en reprend le style.
     `max-height` doit être relevé : navbar.css la fixe à 300 px, ce qui
     tronquait le 5e lien (Contact) ajouté à la navigation. */
  #header #nav-menu.show { max-height: 440px; }
  #header #nav-menu {
    top: calc(100% + 8px);
    right: 0;
    background: rgba(18, 18, 18, .96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: var(--nav-radius);
  }

  #home-video { display: none; }
  #home {
    background: linear-gradient(rgba(0, 0, 0, .55), rgba(0, 0, 0, .55)),
                url("/assets/images/index/automation.webp") center/cover no-repeat;
    height: auto;
    min-height: 82vh;
    padding: 120px 5% 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1 !important; transform: none !important; }
  #home-video { display: none; }
}
