/* ==========================================================================
   BIMsmarter.eu - site.css
   Identite reprise du site Zyro : navy #0E2C50, accent cyan hsl(199,89%,48%),
   typo Roboto. Mobile-first, zero dependance.
   ========================================================================== */

:root {
  --navy: #0e2c50;
  --navy-dark: #0a2039;
  --accent: hsl(199, 89%, 48%);
  --accent-dark: hsl(199, 89%, 40%);
  --accent-soft: hsl(199, 89%, 96%);
  --text: #1d1e20;
  --text-muted: #6c6a6b;
  --border: #e0e0e0;
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --radius: 12px;
  --shadow: 0 4px 12px rgba(14, 44, 80, 0.08);
  --shadow-lg: 0 12px 32px rgba(14, 44, 80, 0.14);
  --maxw: 1200px;
  --font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font);
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
}
h1 { font-size: 1.9rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.2rem; margin-top: 1.5rem; }
h4 { font-size: 1.05rem; }

p, ul, ol { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.5em; }

code, pre { font-family: var(--font-mono); font-size: 0.92em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; z-index: 100000;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px; min-height: 64px;
}
.brand { display: inline-flex; align-items: center; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand img { width: auto; height: 32px; }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; cursor: pointer; color: var(--navy);
}
.nav-toggle svg { width: 22px; height: 22px; }

.site-nav {
  display: none; order: 9; flex-basis: 100%;
  border-top: 1px solid var(--border);
}
.site-nav.open { display: block; }
.nav-list, .subnav { list-style: none; margin: 0; padding: 0; }
.nav-list { display: flex; flex-direction: column; padding: 6px 0 14px; }
.nav-list li { margin: 0; position: relative; }
.nav-list > li > a, .subnav a {
  display: block; padding: 11px 12px; border-radius: 8px;
  color: var(--navy); font-weight: 500; font-size: 0.95rem;
}
.nav-list a:hover { background: var(--accent-soft); text-decoration: none; }
.nav-list a[aria-current="page"] { color: var(--accent-dark); background: var(--accent-soft); }

.sub-toggle {
  position: absolute; top: 2px; right: 4px; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--navy); cursor: pointer;
}
.sub-toggle svg { width: 16px; height: 16px; transition: transform 0.2s; }
.has-sub.open > .sub-toggle svg { transform: rotate(180deg); }

.subnav { display: none; padding-left: 12px; }
.has-sub.open > .subnav { display: block; }
.subnav a { font-size: 0.9rem; color: var(--text-muted); }

.header-social { display: flex; gap: 12px; align-items: center; }
.header-social a { color: var(--navy); display: inline-flex; }
.header-social svg { width: 20px; height: 20px; }

@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .header-inner {
    display: grid; grid-template-columns: 1fr auto 1fr;
    align-items: center; flex-wrap: nowrap; min-height: 72px; gap: 16px;
  }
  .brand { margin-right: 0; justify-self: start; }
  .brand img { height: 38px; }
  .header-social { justify-self: end; }

  .site-nav {
    display: block !important; order: 0; flex-basis: auto;
    border-top: none; justify-self: center;
  }
  .nav-list { flex-direction: row; padding: 0; flex-wrap: nowrap; }
  .nav-list > li > a { padding: 10px 11px; font-size: 0.85rem; white-space: nowrap; }

  .sub-toggle { position: static; width: auto; height: auto; padding: 0 12px 0 0; }
  .has-sub { display: flex; align-items: center; }
  .has-sub > a { padding-right: 4px !important; }

  .subnav {
    position: absolute; top: 100%; left: 0; min-width: 220px; padding: 6px;
    background: #fff; border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-lg); z-index: 1200;
  }
  .has-sub:hover > .subnav, .has-sub:focus-within > .subnav { display: block; }
  .subnav a { white-space: nowrap; }
}
@media (min-width: 1280px) {
  .brand img { height: 42px; }
  .nav-list > li > a { padding: 10px 14px; font-size: 0.9rem; }
}

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: 24px 0; }
.section-alt { background: var(--bg-alt); }
.section-navy { background: var(--navy); color: #fff; }
.section-navy h1, .section-navy h2, .section-navy h3 { color: #fff; }
.section-navy p { color: rgba(255, 255, 255, 0.85); }

.lead { font-size: 1.1rem; color: var(--text-muted); }
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: 10px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 28px 0; background: var(--navy); color: #fff; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(14, 44, 80, 0.92), rgba(14, 44, 80, 0.62));
}
.hero > .container { position: relative; z-index: 2; }
.hero h1 { color: #fff; max-width: 44ch; }
.hero p { color: rgba(255, 255, 255, 0.88); max-width: 80ch; }
.hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 22px; border-radius: 10px; font-weight: 600;
  font-size: 0.95rem; border: 2px solid transparent; cursor: pointer; transition: 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-outline { border-color: currentColor; color: var(--navy); background: transparent; }
.section-navy .btn-outline, .hero .btn-outline, .cta .btn-outline { color: #fff; }
.btn-group { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Respiration sous les grilles de cartes quand du contenu suit */
.grid + p, .grid + h2, .grid + h3, .grid + ul, .grid + .btn-group { margin-top: 28px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card h4 { margin-top: 0; font-size: 1.05rem; }
.card-accent { border-top: 4px solid var(--accent); }

/* Alignement haut : le 1er element d'une colonne de grille ne pousse pas vers le bas */
.grid > * > :first-child { margin-top: 0; }

/* Cartes : le lien final est plaque en bas pour s'aligner d'une carte a l'autre */
.card { display: flex; flex-direction: column; }
.card > :last-child { margin-bottom: 0; }
.card-link { margin-top: auto; padding-top: 14px; }

/* Citations en grille : l'attribution est plaquee en bas de chaque bloc */
.grid blockquote { display: flex; flex-direction: column; margin: 0; }
.grid blockquote > :last-child { margin-top: auto; margin-bottom: 0; padding-top: 10px; }

.badge-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; }
.badge-list li {
  background: var(--accent-soft); color: var(--navy); border-radius: 999px;
  padding: 6px 14px; font-size: 0.85rem; font-weight: 500; margin: 0;
}

.logo-strip { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.logo-strip img { height: 48px; width: auto; object-fit: contain; }
/* Respiration entre la bande de logos et le lien qui suit */
.logo-strip + p, .logo-strip + .btn-group { margin-top: 24px; }

.profile-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }
.profile-media img { width: 100%; height: auto; }
/* Photo de profil : ne doit pas depasser la colonne de texte adjacente */
@media (min-width: 720px) { .profile-media { max-width: 340px; margin-inline: auto; } }

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(135deg, var(--navy), var(--navy-dark));
  color: #fff; border-radius: var(--radius); padding: 32px 24px; text-align: center;
}
.cta h2 { color: #fff; margin-top: 0; }
.cta p { color: rgba(255, 255, 255, 0.85); }

/* ---------- Article ---------- */
.article-body { max-width: 920px; margin: 0 auto; }
.article-meta { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.article-body img { border-radius: var(--radius); margin: 24px 0; }
.article-body figure { margin: 24px 0; }
.article-body figure img { margin: 0; max-width: 100%; height: auto; }
.article-gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin: 24px 0;
}
.article-gallery figure { margin: 0; }
.article-gallery img { margin: 0; width: 100%; height: auto; }
/* .video-embed : definition unique plus bas, section "Video" (aspect-ratio 16/9).
   L'ancien bloc padding-bottom 56.25% qui se trouvait ici faisait doublon et etait
   de toute facon ecrase par le suivant. Retire le 2026-08-07. */
blockquote {
  margin: 24px 0; padding: 16px 20px; border-left: 4px solid var(--accent);
  background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0;
}
table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.94rem; }
th, td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
th { background: var(--bg-alt); color: var(--navy); }
.table-wrap { overflow-x: auto; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--text-muted); padding: 14px 0 0; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.breadcrumb li::after { content: "/"; margin-left: 6px; color: var(--border); }
.breadcrumb li:last-child::after { content: ""; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: rgba(255, 255, 255, 0.82); padding: 24px 0 24px; margin-top: 28px; }
/* Titres de colonnes du pied de page : en h2 pour ne pas casser l ordre des titres
   (un h4 apres un h2 de contenu declenchait l audit "heading order" de Lighthouse
   sur toutes les pages). Le rendu visuel est inchange. */
.site-footer h4,
.site-footer .footer-title { color: #fff; font-size: 1rem; margin-bottom: 12px; font-weight: 700; }
.site-footer a { color: rgba(255, 255, 255, 0.82); }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 0.92rem; }
.footer-brand { margin-bottom: 14px; }
.footer-brand img { width: auto; height: 38px; }

.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.16); margin-top: 32px; padding-top: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.footer-legal a {
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; text-decoration: underline; color: #fff;
}
@media (min-width: 820px) {
  .footer-legal { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 12px 28px; }
}

.footer-bottom {
  margin-top: 24px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 0.82rem; color: rgba(255, 255, 255, 0.62);
}
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: rgba(255, 255, 255, 0.72); font: inherit; text-decoration: underline;
}
.link-btn:hover { color: #fff; }

/* ---------- Retour en haut ---------- */
.back-to-top {
  position: fixed; bottom: 9rem; right: 1.5rem; z-index: 9990;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, background 0.2s;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-dark); box-shadow: var(--shadow-lg); }
.back-to-top:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
@media (max-width: 640px) {
  .back-to-top { bottom: 8rem; right: 1rem; width: 44px; height: 44px; }
}

/* ---------- Video ---------- */
.video-embed {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius); overflow: hidden; background: #000;
  margin: 20px 0; box-shadow: var(--shadow);
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Facade video : vignette cliquable, le lecteur YouTube n'est injecte qu'au clic (site.js) */
.video-facade-btn { position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.video-facade-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-facade-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 72px; height: 50px; border-radius: 12px; background: rgba(0, 0, 0, 0.72); transition: background 0.15s ease; }
.video-facade-play::after { content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%); border-style: solid; border-width: 11px 0 11px 19px; border-color: transparent transparent transparent #fff; }
.video-facade-btn:hover .video-facade-play,
.video-facade-btn:focus-visible .video-facade-play { background: var(--accent-dark); }
.video-facade-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- Bloc outil ---------- */
.tool { padding: 20px 0; border-top: 1px solid var(--border); }
.tool:first-of-type { border-top: none; }
.tool ul { list-style: none; padding: 0; }
.tool ul li { padding-left: 26px; position: relative; }
.tool ul li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent-dark); font-weight: 700;
}
.tool-shot { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Utilitaires ---------- */
/* Pile d'images centree dans sa colonne de grille */
.stack-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stack-center img { margin-inline: auto; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

@media (min-width: 820px) {
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.85rem; }
  h3 { font-size: 1.35rem; }
  .section { padding: 32px 0; }
  .hero { padding: 44px 0; }
  .cta { padding: 48px 40px; }
}

/* Ces blocs de /guide-bim portaient des h4 directement sous un h2, ce qui declenchait
   l audit "heading order" de Lighthouse. Passes en h3 le 2026-08-07, taille conservee.
   Regle placee hors media query pour s appliquer a toutes les largeurs. */
.lifecycle h3, .cde-rules h3 { font-size: 1rem; }

/* ---------- Hero article : bandeau compact, titre en longueur ---------- */
.hero--article { padding: 16px 0; }
@media (min-width: 900px) { .hero--article { padding: 24px 0; } }

/* ---------- Cartes services : titres harmonises, corps alignes ---------- */
.service-card h2, .service-card h2 a { color: var(--accent-dark); }
@media (min-width: 720px) {
  .service-card h2 { min-height: 3.8em; }
  .service-card h3 { min-height: 2.7em; }
}
