/**
 * ============================================================
 *  GROUPE MOHA COM — Base Styles
 *  Fichier : base.css
 *  Version : 1.0.0
 *  Date    : 2026-03-19
 *
 *  Reset CSS, typographie, utilitaires globaux.
 *  Dépend de : design-tokens.css (chargé en premier)
 * ============================================================
 */


/* ============================================================
   1. MODERN CSS RESET
   ============================================================ */

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

html {
  font-size: 100%;          /* 16px base */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  color: var(--color-charcoal);
  background-color: var(--color-surface-page);
  line-height: var(--line-height-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Block-level elements */
blockquote,
dl,
dd,
h1, h2, h3, h4, h5, h6,
hr,
figure,
p,
pre {
  overflow-wrap: break-word;
}

hr {
  border: none;
  border-top: var(--border-width-thin) solid var(--color-silver);
  height: 0;
}

/* Lists */
ol,
ul {
  list-style: none;
}

/* Media */
img,
video,
svg,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  vertical-align: middle;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Forms */
button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Remove built-in fieldset styles */
fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

/* Accessible hidden */
[hidden] {
  display: none !important;
}


/* ============================================================
   2. TYPOGRAPHIE — Titres h1-h6
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-heading);
  line-height: var(--line-height-heading);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-h1);        /* 2.5rem / 40px */
  font-weight: var(--font-weight-extrabold);
}

h2 {
  font-size: var(--font-size-h2);        /* 2rem / 32px */
  font-weight: var(--font-weight-bold);
}

h3 {
  font-size: var(--font-size-h3);        /* 1.5625rem / 25px */
}

h4 {
  font-size: var(--font-size-h4);        /* 1.25rem / 20px */
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: var(--font-size-h5);        /* 1.0625rem / 17px */
  font-weight: var(--font-weight-semibold);
}

h6 {
  font-size: var(--font-size-h6);        /* 0.9375rem / 15px */
  font-weight: var(--font-weight-semibold);
}


/* ============================================================
   3. LIENS
   ============================================================ */

a {
  color: var(--color-text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--duration-base) var(--ease-in-out);
}

a:hover {
  color: var(--color-text-link-hover);
}

a:not([class]) {
  text-decoration-skip-ink: auto;
}


/* ============================================================
   4. FOCUS VISIBLE (Accessibilité clavier)
   ============================================================ */

:focus-visible {
  outline: 3px solid var(--color-royal-blue);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================
   5. CONTENEUR PRINCIPAL
   ============================================================ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.container-sm {
  max-width: 768px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-md {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 1.5rem;
}


/* ============================================================
   6. SECTIONS — Espacement vertical
   ============================================================ */

.section {
  padding: 5rem 0;
}

.section-sm {
  padding: 3rem 0;
}

.section-lg {
  padding: 7rem 0;
}

/* Fond alterné */
.section-alt {
  background-color: var(--color-surface-section);
}

.section-dark {
  background-color: var(--color-navy);
  color: var(--color-white);
}


/* ============================================================
   7. EN-TÊTES DE SECTION (.section-heading)
   ============================================================ */

.section-heading {
  text-align: center;
  margin-bottom: 3rem;
}

.section-heading h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 0.75rem;
  line-height: var(--line-height-heading);
}

.section-heading .subtitle {
  font-family: var(--font-body);
  font-size: var(--font-size-body-lg);
  color: var(--color-tower-gray);
  line-height: var(--line-height-relaxed);
  max-width: 600px;
  margin: 0 auto;
}

/* Barre rouge décorative sous le titre */
.section-heading::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--color-signal-red);
  border-radius: var(--radius-full);
  margin: 1rem auto 0;
}

/* Variante alignée à gauche */
.section-heading.text-left {
  text-align: left;
}

.section-heading.text-left::after {
  margin-left: 0;
}

/* Variante sur fond sombre */
.section-dark .section-heading h2 {
  color: var(--color-white);
}

.section-dark .section-heading .subtitle {
  color: rgba(255, 255, 255, 0.75);
}


/* ============================================================
   8. TEXTE UTILITAIRES
   ============================================================ */

.text-center  { text-align: center !important; }
.text-left    { text-align: left !important; }
.text-right   { text-align: right !important; }

.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }

.text-small  { font-size: var(--font-size-small) !important; }
.text-xsmall { font-size: var(--font-size-xsmall) !important; }

.font-bold     { font-weight: var(--font-weight-bold) !important; }
.font-semibold { font-weight: var(--font-weight-semibold) !important; }
.font-medium   { font-weight: var(--font-weight-medium) !important; }

/* Lead / Chapeau */
.lead {
  font-family: var(--font-body);
  font-size: var(--font-size-lead);  /* 1.25rem */
  color: var(--color-charcoal);
  line-height: 1.7;
  font-weight: var(--font-weight-regular);
}


/* ============================================================
   9. PROSE — Contenu éditorial long
   ============================================================ */

.prose {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  color: var(--color-charcoal);
  line-height: var(--line-height-relaxed);
  max-width: 70ch;
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose p {
  margin-bottom: 1.25rem;
}

.prose ul,
.prose ol {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose ol {
  list-style: decimal;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose blockquote {
  border-left: 4px solid var(--color-royal-blue);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-royal-blue-10);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-charcoal);
}

.prose strong {
  font-weight: var(--font-weight-bold);
  color: var(--color-navy);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-light-gray);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
}

.prose a {
  color: var(--color-royal-blue);
  font-weight: var(--font-weight-medium);
}


/* ============================================================
   10. ACCESSIBILITÉ — .sr-only
   ============================================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.sr-only-focusable:focus,
.sr-only-focusable:active {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}


/* ============================================================
   11. BADGES
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-family: var(--font-accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
  white-space: nowrap;
}

.badge-primary {
  background: var(--color-royal-blue-10);
  color: var(--color-royal-blue);
}

.badge-danger {
  background: var(--color-signal-red-10);
  color: var(--color-signal-red);
}

.badge-success {
  background: var(--color-safety-green-20);
  color: var(--color-safety-green);
}

.badge-warning {
  background: var(--color-solar-gold-20);
  color: #b7770d;
}

.badge-navy {
  background: var(--color-navy-10);
  color: var(--color-navy);
}

.badge-solid-red {
  background: var(--color-signal-red);
  color: var(--color-white);
}


/* ============================================================
   12. GRILLES UTILITAIRES
   ============================================================ */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* Responsive grilles */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
}


/* ============================================================
   13. FLEX UTILITAIRES
   ============================================================ */

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }


/* ============================================================
   14. ESPACEMENTS UTILITAIRES
   ============================================================ */

.mt-0  { margin-top: 0 !important; }
.mt-1  { margin-top: 0.5rem !important; }
.mt-2  { margin-top: 1rem !important; }
.mt-3  { margin-top: 1.5rem !important; }
.mt-4  { margin-top: 2rem !important; }
.mb-0  { margin-bottom: 0 !important; }
.mb-1  { margin-bottom: 0.5rem !important; }
.mb-2  { margin-bottom: 1rem !important; }
.mb-3  { margin-bottom: 1.5rem !important; }
.mb-4  { margin-bottom: 2rem !important; }

.pt-0  { padding-top: 0 !important; }
.pb-0  { padding-bottom: 0 !important; }


/* ============================================================
   15. DIVERS
   ============================================================ */

/* Divider décoratif */
.divider {
  width: 60px;
  height: 4px;
  background: var(--color-signal-red);
  border-radius: var(--radius-full);
  margin: 1rem 0;
}

.divider-center {
  margin: 1rem auto;
}

/* Texte atténué */
.text-muted {
  color: var(--color-tower-gray) !important;
}

/* No-wrap */
.nowrap {
  white-space: nowrap;
}

/* Visibilité */
.invisible {
  visibility: hidden;
}

.visible {
  visibility: visible;
}

/* Overflow hidden */
.overflow-hidden {
  overflow: hidden;
}

/* Ratio d'image */
.aspect-16-9 {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.aspect-4-3 {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.aspect-square {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}


/* ============================================================
   16. NOUVELLES CLASSES UTILITAIRES — Refonte Visuelle
   ============================================================ */

/* Texte gradient (navy → blue) */
.gradient-text {
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-royal-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-red {
  background: linear-gradient(135deg, var(--color-signal-red) 0%, #9B1B21 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glass morphism utilitaire */
.glass {
  background: var(--glass-bg-strong, rgba(255,255,255,0.15));
  backdrop-filter: blur(var(--glass-blur, 20px));
  -webkit-backdrop-filter: blur(var(--glass-blur, 20px));
  border: 1px solid var(--glass-border, rgba(255,255,255,0.18));
}

.glass-dark {
  background: rgba(27, 42, 74, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Text balance pour les titres */
.text-balance {
  text-wrap: balance;
}

/* Overflow hidden */
.clip-hidden {
  overflow: hidden;
}

/* Fluid typography */
.fluid-display { font-size: var(--fluid-display, clamp(2.5rem, 5vw, 4rem)); }
.fluid-h1      { font-size: var(--fluid-h1, clamp(2rem, 4.5vw, 3.25rem)); }
.fluid-h2      { font-size: var(--fluid-h2, clamp(1.625rem, 3vw, 2.25rem)); }
.fluid-h3      { font-size: var(--fluid-h3, clamp(1.25rem, 2.5vw, 1.75rem)); }
.fluid-body    { font-size: var(--fluid-body, clamp(0.9375rem, 1.5vw, 1.0625rem)); }

/* Section heading améliorée avec barre animée */
.section-heading .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-accent);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-signal-red);
  margin-bottom: 0.875rem;
}

.section-heading .section-kicker::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--color-signal-red);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* ::selection branding */
::selection {
  background: rgba(36, 86, 164, 0.18);
  color: var(--color-navy);
}

/* Body overflow-x protection (pour animations clip-path) */
body {
  overflow-x: hidden;
}

/* Gutter responsive pour containers */
@media (max-width: 768px) {
  .container,
  .container-sm,
  .container-md {
    padding: 0 1rem;
  }
}

/* Grid gap responsive */
@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    gap: 1rem;
  }
}

/* Focus visible amélioré (plus visible) */
:focus-visible {
  outline: 3px solid var(--color-royal-blue);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
  box-shadow: 0 0 0 6px rgba(36, 86, 164, 0.15);
}

/* ============================================================
   UTILITAIRES — text-gradient, text-clip, backdrop-blur (VAGUE 1.2)
   ============================================================ */

/* Texte en dégradé (pour headings accrocheurs) */
.text-gradient {
  background: linear-gradient(135deg, var(--color-royal-blue) 0%, var(--color-navy) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-red {
  background: linear-gradient(135deg, var(--color-signal-red) 0%, #8b0000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Masque de texte (pour animations clip reveal) */
.text-clip {
  overflow: hidden;
  display: block;
}

/* Utilitaire glass backdrop */
.backdrop-blur {
  backdrop-filter: blur(var(--glass-blur, 20px));
  -webkit-backdrop-filter: blur(var(--glass-blur, 20px));
}

/* Barre accent animée au scroll */
.section-heading.is-visible::after,
.section-header.is-visible::after {
  animation: expandBar 0.7s var(--ease-smooth) forwards;
}

@keyframes expandBar {
  from { width: 0; opacity: 0; }
  to   { width: 60px; opacity: 1; }
}

/* Skip nav button amélioré */
.skip-nav:focus {
  top: 0;
  z-index: 10000;
  background: var(--color-signal-red);
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
}
