/* ==========================================================================
   Notes de publication · charte graphique Nomadia
   Valeurs reprises de tokens/*.css (design system Nomadia).
   Mode sombre : palette officielle non encore communiquée par le marketing,
   à brancher sur ces variables une fois confirmée.
   ========================================================================== */

@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;font-display:swap;src:url('../fonts/OpenSans-Regular.ttf') format('truetype');}
@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;font-display:swap;src:url('../fonts/OpenSans-SemiBold.ttf') format('truetype');}
@font-face{font-family:'Open Sans';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/OpenSans-Bold.ttf') format('truetype');}
@font-face{font-family:'Playfair Display';font-style:normal;font-weight:700;font-display:swap;src:url('../fonts/PlayfairDisplay-Bold.ttf') format('truetype');}

:root {
  --nomadia-navy:   #132B40;
  --nomadia-blue:   #003E75;
  --nomadia-blue-2: #005FB0;
  --nomadia-green:  #389F61;
  --nomadia-green-dark-1: #005C19;
  --blue-tint-1:  #EBF1FF;
  --green-tint-4: #ECF6F0;
  --grey-25:  #FAFBFC;
  --grey-50:  #F4F6F8;
  --grey-100: #E9EDF1;
  --grey-400: #8B98A6;
  --grey-500: #64717F;
  --white:    #FFFFFF;

  --text-primary:   var(--nomadia-navy);
  --text-secondary: var(--grey-500);
  --text-tertiary:  var(--grey-400);
  --text-brand:     var(--nomadia-green);
  --text-link:      var(--nomadia-blue-2);
  --text-link-hover:var(--nomadia-blue);
  --focus-ring:     #0083EE;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:    'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --tracking-wider: 0.14em;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(19, 43, 64, 0.08), 0 1px 2px rgba(19, 43, 64, 0.06);
  --shadow-focus: 0 0 0 3px rgba(0, 131, 238, 0.35);
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;

  --sidebar-w: 240px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--grey-50);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { color: var(--text-link-hover); }
a:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }

.overline {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--text-brand);
}

/* ---- Mise en page -------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.sidebar {
  position: sticky;
  top: 32px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar .logo { display: block; width: 200px; height: auto; margin-bottom: 40px; }

.sidebar .overline { margin-bottom: 16px; padding-left: 12px; }

#toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
#toc a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease-standard), color var(--dur-fast) var(--ease-standard);
}
#toc a span { font-weight: 400; color: var(--text-secondary); }
#toc a:hover { background: var(--grey-100); }
#toc a.is-active { background: var(--green-tint-4); color: var(--nomadia-green-dark-1); }
#toc .archive a { margin-top: 12px; color: var(--text-link); font-weight: 400; }

/* ---- En-tête de page ----------------------------------------------------- */
.page-header { margin: 8px 0 40px; }
.page-header h1 {
  margin: 12px 0 8px;
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.page-header p:not(.overline) { margin: 0; color: var(--text-secondary); font-size: 1.125rem; }

/* ---- Versions ------------------------------------------------------------ */
#detail { display: grid; gap: 24px; }

.release {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 32px;
}

.release > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 24px;
}
.release h2 { margin: 0; font-size: 1.375rem; font-weight: 700; line-height: 1.25; }
.release time { color: var(--text-secondary); font-size: 0.875rem; }

.release h3 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}
.release header + h3 { margin-top: 0; }
.release h3 .count {
  min-width: 22px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  letter-spacing: 0;
  text-align: center;
}
.release h3.evol { color: var(--nomadia-green-dark-1); }
.release h3.evol .count { background: var(--green-tint-4); }
.release h3.chg { color: var(--nomadia-blue-2); }
.release h3.chg .count { background: var(--blue-tint-1); }

.release ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.release li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 4px 16px;
  align-items: baseline;
  padding: 10px 12px;
  border-radius: var(--radius-md);
}
.release li:nth-child(odd) { background: var(--grey-25); }

.release li.is-empty {
  display: block;
  background: none;
  padding: 0 12px;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}

.ticket { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-secondary); }
.ticket span { display: block; }
.desc { min-width: 0; }
.module {
  display: inline-block;
  margin: 0 6px 4px 0;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--grey-100);
  color: var(--text-primary);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  vertical-align: 1px;
}

/* ---- Écrans étroits ------------------------------------------------------ */
@media (max-width: 860px) {
  html { scroll-padding-top: 76px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 0 64px; }

  /* Le logo et le menu deviennent des blocs de la grille : le menu reste accroché en haut. */
  .sidebar { display: contents; }
  .sidebar .logo { width: 160px; margin: 20px 16px 16px; }
  .sidebar .overline { display: none; }

  .sidebar nav {
    position: sticky;
    top: 0;
    z-index: 1100;
    background: var(--grey-50);
    box-shadow: var(--shadow-sm);
  }
  #toc {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #toc::-webkit-scrollbar { display: none; }
  #toc li { flex: none; scroll-snap-align: start; }
  #toc a {
    min-height: 40px;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
  }
  #toc a span { display: none; }
  #toc a:hover { background: var(--white); }
  #toc a.is-active { background: var(--green-tint-4); }
  #toc .archive a { margin-top: 0; }

  main { padding: 0 16px; min-width: 0; }
  .page-header { margin: 24px 0 24px; }
  .page-header h1 { font-size: 2rem; }
  .page-header p:not(.overline) { font-size: 1rem; }

  #detail { gap: 16px; }
  .release { padding: 20px 16px; border-radius: var(--radius-md); }
  .release > header { margin-bottom: 16px; }
  .release h2 { font-size: 1.25rem; }
  .release li { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .ticket span { display: inline; }
  .ticket span + span::before { content: " · "; }
  .release li.is-empty { padding: 0 10px; }
  .desc { overflow-wrap: anywhere; }
}
