/* =========================================================
   Responsive & cohérence — refonte globale CGT Alkor
   Complète refonte.css et les CSS page-specific.
   ========================================================= */

#main-content {
  overflow-x: clip;
  padding-top: 0;
}

/*
  Menu desktop ≥1100px
  - pas de burger
  - une seule rangée flex (plus de trou 1fr entre gauche/droite)
  - toute la largeur écran
  - CTA « Plateforme mise en relation » toujours en entier
*/
@media (min-width: 1100px) {
  .menu-toggle {
    display: none !important;
  }

  .header > .container {
    max-width: none !important;
    width: 100% !important;
    margin-inline: auto;
    padding-inline: clamp(10px, 1.2vw, 36px);
  }

  .nav {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    justify-content: space-between;
    gap: clamp(2px, 0.35vw, 10px);
    width: 100%;
  }

  /* Aplatit les groupes : chaque lien participe à la répartition sur toute la largeur */
  .nav-left,
  .nav-right {
    display: contents !important;
  }

  .nav-logo {
    flex: 0 0 auto;
    margin: 0 !important;
    min-width: 0;
  }

  .nav-logo img {
    height: clamp(28px, 2.2vw, 40px);
    width: auto;
    max-width: 128px;
  }

  .nav-link {
    flex: 0 1 auto;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px clamp(3px, 0.4vw, 10px);
    font-size: clamp(10px, 0.78vw, 12px);
    letter-spacing: 0.02em;
    white-space: nowrap;
    min-width: 0;
  }

  .nav-link-muted {
    font-size: clamp(9.5px, 0.72vw, 11px);
  }

  .nav-link-cta {
    flex: 0 0 auto;
    padding-inline: clamp(6px, 0.5vw, 12px) !important;
    font-size: clamp(9.5px, 0.7vw, 11px) !important;
    max-width: none !important;
    overflow: visible !important;
    text-overflow: unset !important;
  }

  .nav-link.has-sub::after {
    margin-left: 5px;
  }

  .lang {
    flex: 0 0 auto;
  }

  .lang-btn {
    height: clamp(32px, 2.4vw, 40px);
    padding-inline: clamp(6px, 0.5vw, 12px);
    font-size: clamp(10px, 0.75vw, 12px);
  }

  .icon-btn {
    flex: 0 0 auto;
    width: clamp(32px, 2.4vw, 40px);
    height: clamp(32px, 2.4vw, 40px);
  }

  .header {
    overflow-x: clip;
  }
}

/* Très grands écrans : bandeau centré mais assez large pour tout afficher sans chevauchement */
@media (min-width: 1600px) {
  .header > .container {
    max-width: min(1760px, 96vw) !important;
    padding-inline: clamp(24px, 2vw, 48px);
  }

  .nav {
    gap: clamp(6px, 0.5vw, 14px);
  }

  .nav-link {
    padding: 10px clamp(6px, 0.45vw, 12px);
    font-size: 12px;
    letter-spacing: 0.03em;
  }

  .nav-link-muted {
    font-size: 11px;
  }

  .nav-link-cta {
    padding-inline: 12px !important;
    font-size: 11px !important;
  }

  .nav-logo img {
    height: 40px;
    max-width: 140px;
  }
}

/* Skip link : invisible hors focus clavier (a11y), pas de bandeau blanc au-dessus du header */
.skip-link {
  position: fixed;
  top: 0;
  left: 16px;
  z-index: 10000;
  margin: 0;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--text-on-accent, #041730);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  border-radius: var(--r-sm);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  transform: none;
  pointer-events: none;
}

.skip-link:focus-visible {
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
  top: 16px;
  pointer-events: auto;
  outline: 2px solid var(--accent-soft);
  outline-offset: 3px;
}

/* Typographie fluide (titres à taille fixe dans refonte.css) */
.hub-card h3 {
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.12;
}

.stat .num {
  font-size: clamp(28px, 6vw, 40px);
}

.lede {
  font-size: clamp(15px, 1.6vw, 18px);
}

.footer-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.project-content .ti {
  font-size: clamp(18px, 2.2vw, 22px);
}

.pd-feat .val {
  font-size: clamp(18px, 2.2vw, 22px);
}

/* En-têtes de section : une colonne sous desktop */
@media (max-width: 1023px) {
  .section-head {
    grid-template-columns: 1fr;
    align-items: start;
    gap: clamp(16px, 3vw, 24px);
  }
}

body.has-membrane-subtabs #catalogue {
  scroll-margin-top: calc(var(--header-h, 72px) + 88px);
}

/* ---------- Mobile (≤719px) ---------- */
@media (max-width: 719px) {
  /* Hero project (pro, training, project, product, about base) */
  .project-hero {
    min-height: min(72svh, 620px);
  }

  .project-hero-inner {
    padding-block: clamp(48px, 11vh, 80px) clamp(56px, 12vh, 88px);
  }

  .project-hero-title {
    max-width: 100%;
    font-size: clamp(30px, 9.5vw, 44px);
    line-height: 1.04;
  }

  .project-hero-lede {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Hero home */
  .hero h1 {
    max-width: 100%;
  }

  /* Heros compacts */
  .contact-hero {
    min-height: clamp(220px, 52vw, 320px);
    padding-block: clamp(24px, 8vw, 48px);
  }

  .contact-hero-title,
  .legal-hero-title {
    max-width: 100%;
    font-size: clamp(28px, 8vw, 40px);
  }

  .legal-hero {
    min-height: clamp(200px, 48vw, 280px);
  }

  /* Grilles éditoriales */
  .split {
    grid-template-columns: 1fr !important;
  }

  .duo {
    grid-template-columns: 1fr;
  }

  .project-gallery {
    padding-inline: clamp(16px, 4vw, 24px);
    max-width: var(--max);
  }

  .project-next {
    min-height: min(52vh, 420px);
  }

  .project-next-title {
    font-size: clamp(28px, 8vw, 44px);
  }

  .project-next-arrow {
    width: 48px;
    height: 48px;
  }

  /* Hub / cartes */
  .hub {
    gap: 14px;
  }

  .hub-card {
    min-height: 0;
    padding: 22px 18px;
    gap: 14px;
  }

  /* Training */
  .page-training .training-hero {
    min-height: min(68svh, 560px);
  }

  .page-training .training-country-visual {
    padding: 12px;
  }

  .page-training .training-country-visual img {
    max-height: min(62vw, 280px);
  }

  .training-date {
    font-size: 12px;
    padding: 7px 12px;
  }

  /* Autres produits */
  .product-arg {
    padding-block: 28px 40px;
  }

  .product-feature {
    padding: 12px 14px;
  }

  /* Configurateur — hauteur gérée dans configurator.css (mode mobile immersif) */

  /* Footer CTA */
  .footer-cta-inner,
  .footer-cta-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }

  .footer-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* Manifesto home */
  .manifesto {
    padding: clamp(24px, 6vw, 36px);
  }

  .manifesto p {
    font-size: clamp(18px, 5vw, 24px);
  }

  /* Formulaire contact */
  .contact-form-card {
    padding: 18px 16px;
  }
}

/* ---------- Tablette (720–1023px) ---------- */
@media (min-width: 720px) and (max-width: 1023px) {
  .about-globe-layout {
    grid-template-columns: 1fr;
  }

  .training-country .split {
    grid-template-columns: 1fr;
  }
}

/* Hero : poster = LCP ; vidéo masquée jusqu'à .hero-vid--active */
.hero-vid[hidden],
.hero-vid.hero-vid--defer:not(.hero-vid--active) {
  display: none !important;
}
.hero-poster {
  z-index: 1;
}
.hero-vid.hero-vid--active {
  z-index: 2;
}
.hero-poster.is-hidden {
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

/* ---------- Home hero : scroll plus réactif, soleil plus diffus ---------- */
.page-home .hero-media img,
.page-home .hero-media video,
.page-home .hero-poster {
  animation: none;
  transform: scale(1.04);
}

.page-home .hero-overlay {
  background:
    radial-gradient(ellipse 140% 80% at 50% 115%, rgba(97, 177, 188, 0.1), transparent 48%),
    radial-gradient(ellipse 48% 40% at 82% 18%, rgba(154, 212, 220, 0.12), transparent 62%),
    radial-gradient(ellipse 40% 36% at 12% 38%, rgba(42, 111, 122, 0.22), transparent 65%),
    radial-gradient(ellipse 70% 55% at 55% 8%, rgba(97, 177, 188, 0.05), transparent 55%),
    linear-gradient(180deg, rgba(3, 15, 30, 0.72) 0%, rgba(3, 15, 30, 0.12) 38%, rgba(3, 15, 30, 0.42) 64%, rgba(3, 15, 30, 0.96) 100%),
    radial-gradient(ellipse 160% 110% at 68% 12%, rgba(97, 177, 188, 0.14), transparent 72%);
}

.page-home .hero-overlay::after {
  inset: -35%;
  transform: none;
  animation: none;
  opacity: 0.85;
  mix-blend-mode: soft-light;
  background:
    radial-gradient(ellipse 140% 100% at 70% 6%, rgba(255, 255, 255, 0.09) 0%, rgba(97, 177, 188, 0.06) 28%, transparent 68%),
    radial-gradient(ellipse 90% 70% at 62% 18%, rgba(154, 212, 220, 0.05), transparent 75%);
}

.page-home .hero-content {
  will-change: auto;
}

/* ---------- Homepage : duo projets — même langage que les familles ---------- */
.page-home .duo:not(.grid-3) {
  max-width: 100%;
  width: 100%;
  margin-inline: 0;
  gap: clamp(16px, 2.2vw, 24px);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .page-home .duo:not(.grid-3) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.page-home .duo:not(.grid-3) .duo-card {
  aspect-ratio: 4 / 5;
}

@media (min-width: 900px) {
  .page-home .duo:not(.grid-3) .duo-card {
    aspect-ratio: 3 / 2;
  }
}

.page-home .duo:not(.grid-3) .duo-card::after {
  background: linear-gradient(
    185deg,
    rgba(4, 23, 48, 0.08) 8%,
    rgba(4, 23, 48, 0.28) 42%,
    rgba(4, 23, 48, 0.88) 78%,
    rgba(4, 23, 48, 0.96) 100%
  );
}

.page-home .duo:not(.grid-3) .duo-card-content {
  inset: auto 0 0 0;
  padding: clamp(22px, 3vw, 36px);
  gap: 10px;
}

.page-home .duo-card h3.home-proj-heading {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.08;
  max-width: none;
  letter-spacing: -0.03em;
}

.page-home .duo:not(.grid-3) .duo-card .tag {
  font-size: 11px;
  letter-spacing: 0.2em;
}

.page-home .duo:not(.grid-3) .duo-card .btn-link {
  font-size: 13px;
}

@media (max-width: 719px) {
  .page-home .duo:not(.grid-3) .duo-card {
    aspect-ratio: 16 / 11;
    max-width: min(100%, 480px);
    margin-inline: auto;
    width: 100%;
  }

  .page-home .duo-card h3.home-proj-heading {
    font-size: clamp(24px, 7vw, 32px);
  }
}

/* ---------- Homepage : 3 familles — pleine largeur, lisible ---------- */
.page-home .duo.grid-3 {
  max-width: 100%;
  width: 100%;
  margin-inline: 0;
  gap: clamp(16px, 2.2vw, 24px);
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .page-home .duo.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.page-home .duo.grid-3 .duo-card {
  aspect-ratio: 3 / 4;
  min-height: 0;
}

@media (min-width: 1100px) {
  .page-home .duo.grid-3 .duo-card {
    aspect-ratio: 4 / 5;
  }
}

.page-home .duo.grid-3 .duo-card::after {
  background: linear-gradient(
    185deg,
    rgba(4, 23, 48, 0.08) 8%,
    rgba(4, 23, 48, 0.28) 42%,
    rgba(4, 23, 48, 0.88) 78%,
    rgba(4, 23, 48, 0.96) 100%
  );
}

.page-home .duo.grid-3 .duo-card-content {
  inset: auto 0 0 0;
  padding: clamp(22px, 3vw, 36px);
  gap: 12px;
  max-height: 58%;
}

.page-home .duo.grid-3 .duo-card h3 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  overflow: visible;
  text-shadow: 0 1px 18px rgba(4, 23, 48, 0.35);
}

.page-home .duo.grid-3 .duo-card-teaser {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: clamp(13px, 1.15vw, 15px);
  line-height: 1.45;
  color: rgba(232, 242, 248, 0.88);
}

.page-home .duo.grid-3 .duo-card .btn-link {
  font-size: 13px;
  margin-top: 2px;
}

@media (max-width: 719px) {
  .page-home .duo.grid-3 .duo-card {
    aspect-ratio: 16 / 11;
    max-width: min(100%, 480px);
    margin-inline: auto;
    width: 100%;
  }

  .page-home .duo.grid-3 .duo-card-content {
    max-height: none;
    padding: 22px;
  }

  .page-home .duo.grid-3 .duo-card h3 {
    font-size: clamp(26px, 8vw, 34px);
  }
}

/* ---------- Configurateur home : mockup React ---------- */
.page-home .configurator {
  align-items: center;
  gap: clamp(28px, 5vw, 56px);
  padding-block: clamp(40px, 7vw, 80px);
  overflow: visible;
}

.configurator-copy {
  min-width: 0;
}

.configurator-mockup-visual {
  width: 100%;
  max-width: min(100%, 420px);
  margin-inline: auto;
  padding: clamp(12px, 2.4vw, 22px);
  pointer-events: auto;
  user-select: none;
  overflow: visible;
  aspect-ratio: auto;
  background: none;
  border-radius: 0;
  filter: none;
  animation: none;
  cursor: default;
}

/* Hover mockup tablette — tilt + lift (desktop only) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .page-home .configurator-mockup-visual .device-mockup--subtle .device-mockup__stage {
    transition:
      transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
      filter 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .page-home .configurator-mockup-visual:hover .device-mockup--subtle .device-mockup__stage {
    transform: rotateY(-12deg) rotateX(4deg) translateY(-10px) scale(1.03);
    filter: drop-shadow(0 36px 48px rgba(0, 0, 0, 0.48));
  }
}

@media (max-width: 719px) {
  .page-home .configurator {
    gap: 24px;
    padding-block: clamp(28px, 6vw, 48px);
  }

  .configurator-mockup-visual {
    order: 2;
    max-width: min(100%, 300px);
    padding: 12px 14px 18px;
  }

  .configurator-copy {
    order: 1;
  }
}

@media (min-width: 1024px) {
  .configurator {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 420px);
  }

  .configurator-mockup-visual {
    justify-self: center;
    align-self: center;
    max-width: 420px;
  }
}
