/* =========================================================
   Cogiterra — site corporate
   Feuille de styles
   ========================================================= */

:root {
  /* Couleurs de marque (relevées sur les vrais logos)
     - Orange Actu-Environnement   : #ef9b08  (couleur du globe sur le logo)
     - Vert Emploi-Environnement   : #669920  (vert moyen du globe stylisé)
     - Sapin Actu-Environnement    : #1f5945  (vert profond et chaleureux,
                                              repris des media-kits, devient
                                              la couleur signature Cogiterra) */
  --c-actu:        #ef9b08;
  --c-actu-soft:   #fdf1d8;
  --c-emploi:      #669920;
  --c-emploi-soft: #eef6e1;
  --c-brand:       #1f5945;
  --c-brand-soft:  #e6efea;
  --c-accent:      #ef9b08;  /* on aligne l'accent sur l'orange Actu */

  --text:        #1f231b;
  --text-soft:   #565b50;
  --text-mute:   #8a8e82;
  --bg:          #ffffff;
  --bg-soft:     #f6f6f1;
  --border:      #e4e4db;

  --maxw: 1080px;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .05);
  --font: "Helvetica Neue", Arial, "Segoe UI", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: inherit; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 116px;
}
.logo-cogiterra { display: flex; align-items: center; }
.logo-cogiterra img {
  display: block;
  height: 84px;
  width: auto;
  transition: height .25s ease;
}
/* L'en-tête se compacte légèrement après défilement (classe .is-scrolled
   posée par le script) — le logo s'allège mais reste imposant. */
.site-header.is-scrolled .wrap { height: 92px; }
.site-header.is-scrolled .logo-cogiterra img { height: 66px; }

.nav { display: flex; gap: 28px; }
.nav a {
  text-decoration: none;
  font-size: 14px;
  color: var(--text-soft);
  transition: color .2s;
}
.nav a:hover { color: var(--c-brand); }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 96px 0 80px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.hero .eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-emploi);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.25;
  font-weight: 600;
  max-width: 760px;
  margin: 0 auto 20px;
  letter-spacing: -.01em;
}
.hero p {
  font-size: 19px;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
/* Les sections au fond coloré font leur propre séparation visuelle :
   on garde un filet entre deux sections blanches uniquement. */
.section + .section { border-top: 1px solid var(--border); }
.section + .kpi-section,
.section + .ecosystem-section,
.section + .independance,
.kpi-section + .section,
.ecosystem-section + .section,
.independance + .section { border-top: none; }
.section h2 {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 16px;
  max-width: 780px;
  line-height: 1.3;
}
.section p.lead {
  font-size: 17px;
  color: var(--text-soft);
  max-width: 720px;
}
.section-eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--c-emploi);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ---------- Logos intégrés en ligne dans le texte ---------- */
.inline-logo {
  display: inline-block;
  height: 1.5em;
  width: auto;
  vertical-align: -0.45em;
  margin: 0 0.15em;
}
/* Léger ajustement dans le hero où la typo est plus grande */
.hero .inline-logo { height: 1.4em; vertical-align: -0.42em; }

/* ---------- Indépendance ---------- */
.independance {
  background: var(--c-brand);
  color: #fff;
  position: relative;
  overflow: hidden;
}
/* Rotonde filigrane qui habille le texte sur la droite du bloc.
   Son bord droit s'aligne sur le bord droit du contenu du wrap
   (= bord droit du mot "Contact" dans la barre de menu) */
.independance::after {
  content: "";
  position: absolute;
  top: 50%;
  right: max(24px, calc((100vw - 1080px) / 2 + 24px));
  transform: translateY(-50%);
  width: 520px;
  height: 520px;
  background-image: url("../img/rotonde.svg");
  background-size: contain;
  background-repeat: no-repeat;
  /* Le SVG rotonde utilise currentColor : filtre qui force le blanc */
  filter: brightness(0) invert(1);
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
}
.independance .wrap { position: relative; z-index: 1; }
.independance h2 { color: #fff; }
.independance p.lead { color: rgba(255, 255, 255, .82); }
.independance .accent {
  width: 52px;
  height: 4px;
  background: var(--c-emploi);
  border-radius: 2px;
  margin-bottom: 26px;
}

/* ---------- Chiffres clés ---------- */
.kpi-section { background: var(--c-brand-soft); }
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}
.kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--c-brand);
}
.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.kpi .num {
  font-size: 42px;
  font-weight: 700;
  color: var(--c-brand);
  letter-spacing: -.025em;
  line-height: 1;
  margin-bottom: 8px;
}
.kpi .label {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
  font-weight: 500;
}
.kpi .label .sub {
  display: block;
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 400;
  margin-top: 2px;
}
.kpi-foot {
  font-size: 15px;
  color: var(--text-soft);
  margin-top: 22px;
  font-style: italic;
}

/* ---------- Parcours de carrière ---------- */
.parcours-timeline {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 20px;
  align-items: stretch;
  margin-top: 38px;
}
.parcours-step {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--c-brand);
  border-radius: var(--radius);
  padding: 26px 22px;
  position: relative;
}
.parcours-step-num {
  position: absolute;
  top: -18px;
  left: 22px;
  width: 36px; height: 36px;
  background: var(--c-accent);
  color: #fff;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.parcours-step h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-brand);
  margin: 12px 0 8px;
}
.parcours-step p {
  font-size: 14.5px;
  color: var(--text-soft);
  line-height: 1.55;
}
.parcours-arrow {
  color: var(--c-emploi);
  font-size: 26px;
  align-self: center;
  font-weight: 300;
  user-select: none;
}

/* ---------- Écosystème ---------- */
.ecosystem-section { background: var(--bg-soft); }
.ecosystem-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 48px;
  margin-top: 32px;
  align-items: center;
}
.ecosystem-text p { margin-bottom: 14px; color: var(--text-soft); font-size: 16px; }
.ecosystem-text p:last-child { margin-bottom: 0; }
.ecosystem-venn { display: flex; justify-content: center; }
.ecosystem-venn svg { max-width: 100%; height: auto; }
/* Wrapper qui contient le SVG + les logos posés en absolu par-dessus.
   Cette technique évite l'utilisation de <image> dans le SVG qui pose des
   problèmes de chargement sur Safari (CORS strict sur les SVG externes). */
.venn-stage {
  position: relative;
  display: block;
  width: 100%;
  max-width: 460px;
}
.venn-stage > svg {
  display: block;
  width: 100%;
  height: auto;
}
.venn-logo {
  position: absolute;
  top: 8.5%;        /* y=22 sur 260 */
  width: 22.2%;     /* w=80 sur 360 */
  height: auto;
  pointer-events: none;
}
.venn-logo-actu   { left: 15.3%; }   /* x=55 sur 360 */
.venn-logo-emploi { left: 62.5%; }   /* x=225 sur 360 */

/* ---------- Focus médias ---------- */
.media-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  background: #fff;
  position: relative;
}

/* ---------- Bande des secteurs ---------- */
.sectors {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 22px 0 24px;
  padding: 28px 18px;
  border-radius: 12px;
  /* Variante Actu (par défaut) : dégradé sapin reproduisant le fond du media-kit Pro Intégral */
  background:
    radial-gradient(ellipse at 50% 50%,
      #58b890 0%,
      #3a9774 35%,
      #226e51 75%,
      #1d5a43 100%);
}
/* Variante Emploi-Environnement : dégradé reprenant les verts foncés
   de la charte du site (du vert moyen au vert olive sombre) */
.sectors-emploi {
  grid-template-columns: repeat(9, 1fr);
  background:
    radial-gradient(ellipse at 50% 50%,
      #6e9b22 0%,
      #5a8418 35%,
      #3f5e10 75%,
      #2d4309 100%);
}
.sector {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  color: #fff;
}
.sector img {
  width: 42px;
  height: 42px;
  display: block;
  /* SVG en blanc sur le fond vert */
  filter: brightness(0) invert(1);
}
.sector span {
  font-size: 12px;
  line-height: 1.3;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}
/* Pictos un peu plus petits côté Emploi (9 colonnes) */
.sectors-emploi .sector img { width: 36px; height: 36px; }
.sectors-emploi .sector span { font-size: 11px; }
.media-card + .media-card { margin-top: 28px; }
.media-card .media-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.media-logo { height: 46px; width: auto; display: block; }
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
}
.badge.actu   { background: var(--c-actu-soft);   color: var(--c-actu); }
.badge.emploi { background: var(--c-emploi-soft); color: var(--c-emploi); }
.media-card .since { font-size: 13px; color: var(--text-mute); }
.media-card h3 {
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 14px;
}
.media-card p { color: var(--text-soft); margin-bottom: 14px; }
.media-card .visit {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  margin-top: 6px;
  transition: transform .15s, box-shadow .2s;
}
.media-card .visit.actu   { background: var(--c-actu);   color: #fff; }
.media-card .visit.emploi { background: #8bbf2e; color: #fff; }  /* vert pomme de la charte EE, plus clair que le vert moyen */
.media-card .visit:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.clients-label {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin: 28px 0 14px;
}

/* ---------- Carrousel de logos ---------- */
.logos-carousel {
  position: relative;
  overflow: hidden;
  margin: 0 -40px -10px;       /* déborde un peu de la carte pour effet bandeau */
  padding: 8px 0;
  /* dégradés latéraux pour fondre les bords */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.logos-track {
  display: flex;
  width: max-content;
  gap: 56px;
  align-items: center;
  animation: logos-scroll 60s linear infinite;
}
.logos-track img {
  height: 56px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: grayscale(100%);
  opacity: .72;
  transition: filter .25s ease, opacity .25s ease, transform .25s ease;
}
.logos-track img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.06);
}
/* Pause au survol pour pouvoir lire un logo */
.logos-carousel:hover .logos-track { animation-play-state: paused; }

@keyframes logos-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .logos-track { animation: none; flex-wrap: wrap; justify-content: center; }
}

/* ---------- Pied de page ---------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 44px 0;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.site-footer .f-brand { display: flex; align-items: center; gap: 14px; }
.site-footer .f-brand img { height: 40px; width: auto; }
.site-footer p, .site-footer a {
  font-size: 13px;
  color: var(--text-mute);
  text-decoration: none;
}
.site-footer a:hover { color: var(--c-brand); }
.site-footer .f-links { display: flex; gap: 20px; }

/* ---------- Animations au scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .hero { padding: 64px 0 56px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 17px; }
  .section { padding: 60px 0; }
  .section h2 { font-size: 24px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi .num { font-size: 32px; }
  .media-card { padding: 28px 22px; }
  /* Rotonde indépendance : plus petite et alignée sur le bord droit du wrap mobile */
  .independance::after {
    width: 380px;
    height: 380px;
    right: -130px;
    opacity: 0.10;
  }
  /* Secteurs Actu : 3 colonnes sur mobile */
  .sectors {
    grid-template-columns: repeat(3, 1fr);
    padding: 20px 12px;
    gap: 14px;
  }
  /* Secteurs Emploi : 3 colonnes sur mobile aussi (3x3) */
  .sectors-emploi {
    grid-template-columns: repeat(3, 1fr);
  }
  .sector img { width: 36px; height: 36px; }
  .sector span { font-size: 11px; }
  .sectors-emploi .sector img { width: 32px; height: 32px; }
  .sectors-emploi .sector span { font-size: 10.5px; }
  .nav { display: none; }
  .site-header .wrap { height: 88px; }
  .logo-cogiterra img { height: 62px; }
  .site-header.is-scrolled .wrap { height: 72px; }
  .site-header.is-scrolled .logo-cogiterra img { height: 50px; }
  .logos-carousel { margin: 0 -22px -10px; }
  .logos-track { gap: 38px; }
  .logos-track img { height: 44px; }
  /* Parcours en colonne sur mobile */
  .parcours-timeline {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .parcours-arrow {
    transform: rotate(90deg);
    text-align: center;
  }
  /* Écosystème en colonne sur mobile */
  .ecosystem-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .ecosystem-venn { order: -1; }
}
@media (max-width: 460px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
