/* ==========================================================================
   AMV Services — Feuille de style principale
   Direction : publication technique imprimée + console de supervision.
   Pas de framework, pas de build. Tokens en tête, composants ensuite.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  /* Couleur — 2 accents maximum, le reste en neutres froids */
  --paper:        #F1F3F2;
  --surface:      #FFFFFF;
  --ink:          #0E1512;
  --ink-muted:    #5C6862;
  --rule:         #D2D8D5;
  --rule-strong:  #A9B3AE;
  --signal:       #00614F;  /* liens, pastilles d'état, accents */
  --signal-wash:  #E2EDE9;
  --flag:         #A8460C;  /* réservé aux mentions « à la une » / sponsorisé */

  /* Typographie */
  --font-display: "Zilla Slab", Georgia, serif;
  --font-body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  /* Échelle typographique — ratio 1.25, base 17px */
  --t-xs:   0.735rem;
  --t-sm:   0.875rem;
  --t-base: 1rem;
  --t-md:   1.2rem;
  --t-lg:   1.5rem;
  --t-xl:   1.95rem;
  --t-2xl:  2.6rem;
  --t-3xl:  3.4rem;

  /* Espacement */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  --measure: 68ch;      /* longueur de ligne confortable en lecture */
  --wrap:    1240px;    /* largeur maximale du contenu */
  --gutter:  clamp(1.25rem, 4vw, 3rem);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: 1.65;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}

p { margin: 0 0 var(--sp-4); }

a {
  color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

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

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--t-sm);
}
.skip-link:focus { top: var(--sp-2); }

/* --- Utilitaires typographiques ---------------------------------------- */

/* Étiquette monospace — sert d'eyebrow, de méta et de référence d'article */
.mono {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* Référence d'article : silo + index (CYB-003). Encode le classement réel. */
.ref {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  color: var(--signal);
  font-weight: 500;
}

/* Pastille d'état, empruntée aux consoles de supervision */
.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: 0.08em;
  margin-right: var(--sp-2);
}

/* --- Manchette ---------------------------------------------------------- */
.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding-block: var(--sp-4);
}

.logo {
  font-family: var(--font-display);
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.logo span { color: var(--signal); font-weight: 400; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  align-items: center;
}
.nav a {
  font-size: var(--t-sm);
  color: var(--ink);
  text-decoration: none;
  padding-block: var(--sp-1);
  border-bottom: 2px solid transparent;
}
.nav a:hover,
.nav a[aria-current="page"] {
  border-bottom-color: var(--signal);
  color: var(--signal);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--sp-2) var(--sp-3);
  cursor: pointer;
}

/* --- Rail de statut (élément signature) --------------------------------- */
.statusbar {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.statusbar__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  padding-block: var(--sp-3);
}
.statusbar__inner span { white-space: nowrap; }
.statusbar .dot { background: #4ADE9B; }

/* --- Une ---------------------------------------------------------------- */
.lead {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: var(--sp-7);
  padding-block: var(--sp-8);
  border-bottom: 1px solid var(--rule);
}

.lead__title {
  font-size: var(--t-3xl);
  margin-block: var(--sp-3) var(--sp-4);
}
.lead__title a { color: inherit; text-decoration: none; }
.lead__title a:hover { color: var(--signal); }

.lead__standfirst {
  font-size: var(--t-md);
  color: var(--ink-muted);
  max-width: 54ch;
}

.lead__aside {
  border-left: 1px solid var(--rule);
  padding-left: var(--sp-5);
}
.lead__aside h2 {
  font-size: var(--t-sm);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--rule);
}

.brief {
  list-style: none;
  margin: 0;
  padding: 0;
}
.brief li {
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--rule);
}
.brief li:last-child { border-bottom: 0; }
.brief a {
  display: block;
  font-family: var(--font-display);
  font-size: var(--t-base);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  margin-top: var(--sp-2);
}
.brief a:hover { color: var(--signal); }

/* --- Rubriques ---------------------------------------------------------- */
.section { padding-block: var(--sp-7); border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-bottom: var(--sp-4);
  margin-bottom: var(--sp-6);
  border-bottom: 2px solid var(--ink);
}
.section__head h2 {
  font-size: var(--t-lg);
  margin: 0;
}
.section__head a {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--sp-6) var(--sp-5);
}

/* --- Carte article ------------------------------------------------------ */
.card {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule-strong);
  padding-top: var(--sp-3);
  transition: border-color 0.18s ease;
}
.card:hover { border-top-color: var(--signal); }

.card__meta {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  margin-bottom: var(--sp-3);
}

.card__title {
  font-size: var(--t-md);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 var(--sp-3);
}
.card__title a { color: var(--ink); text-decoration: none; }
.card:hover .card__title a { color: var(--signal); }

.card__excerpt {
  font-size: var(--t-sm);
  color: var(--ink-muted);
  margin: 0;
}

.card__img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
  margin-bottom: var(--sp-3);
  background: var(--signal-wash);
}

/* --- Bandeau d'appel ---------------------------------------------------- */
.callout {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--signal);
  padding: var(--sp-6);
  margin-block: var(--sp-7);
}
.callout h2 { font-size: var(--t-lg); }
.callout p { max-width: var(--measure); color: var(--ink-muted); margin-bottom: 0; }

.btn {
  display: inline-block;
  margin-top: var(--sp-5);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--sp-3) var(--sp-5);
  text-decoration: none;
  border: 1px solid var(--ink);
  transition: background 0.18s ease, color 0.18s ease;
}
.btn:hover { background: transparent; color: var(--ink); }

/* --- Pied de page ------------------------------------------------------- */
.footer {
  background: var(--ink);
  color: var(--paper);
  padding-block: var(--sp-8) var(--sp-6);
  margin-top: var(--sp-8);
}
.footer a { color: var(--paper); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sp-6);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}
.footer h3 {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8FA39B;
  margin-bottom: var(--sp-4);
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: var(--sp-2); font-size: var(--t-sm); }

.footer__legal {
  padding-top: var(--sp-5);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: #8FA39B;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  justify-content: space-between;
}

/* --- Adaptations petits écrans ------------------------------------------ */
@media (max-width: 900px) {
  .lead {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
    padding-block: var(--sp-6);
  }
  .lead__aside {
    border-left: 0;
    border-top: 2px solid var(--ink);
    padding-left: 0;
    padding-top: var(--sp-4);
  }
  .lead__title { font-size: var(--t-2xl); }
}

@media (max-width: 720px) {
  html { font-size: 16px; }

  .nav-toggle { display: block; }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--rule);
    margin-top: var(--sp-4);
  }
  .nav.is-open { display: flex; }
  .masthead__inner { flex-wrap: wrap; }

  .lead__title { font-size: var(--t-xl); }
  .section__head { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
}

/* --- Préférences d'accessibilité ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .masthead, .statusbar, .footer, .callout { display: none; }
  body { background: #fff; }
}
