/* ============================================================
   Portail Formation Claude - N-Gage
   Palette : Marine profonde (cohérent avec template PPT formation v2)
   Typo    : Inter (Google Fonts) + Space Grotesk pour les titres
   ============================================================ */

/* -------- Reset léger -------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

/* -------- Variables -------- */
:root {
  --marine: #0F2447;
  --marine-2: #1E3A6F;
  --marine-light: #2C4F8A;
  --lin: #F5F3EE;
  --lin-2: #FAFAF7;
  --orange: #F28705;
  --orange-soft: #FFE7CC;
  --text: #1A1A1A;
  --text-muted: #5C6275;
  --border: #E1DED5;
  --bg: var(--lin-2);
  --shadow-sm: 0 1px 2px rgba(15, 36, 71, 0.06), 0 1px 3px rgba(15, 36, 71, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 36, 71, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 36, 71, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

/* -------- Typographie -------- */
h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--marine);
  line-height: 1.25;
  margin: 0 0 0.6em;
}
h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.6rem; letter-spacing: -0.01em; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
a { color: var(--marine); text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; }
a:hover { color: var(--orange); }

code {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 0.92em;
  background: var(--lin);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--marine);
}
pre {
  background: var(--marine);
  color: #E5E9F2;
  padding: 1rem 1.2rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.92em;
  line-height: 1.55;
}
pre code { background: transparent; color: inherit; padding: 0; }

blockquote {
  margin: 1.2em 0;
  padding: 0.8em 1.2em;
  border-left: 4px solid var(--orange);
  background: var(--orange-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--marine);
  font-style: normal;
}
blockquote p:last-child { margin-bottom: 0; }

/* -------- Accessibilité -------- */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--marine); color: var(--lin-2);
  padding: 0.6em 1em; border-radius: 0 0 var(--radius-sm) 0;
  z-index: 9999;
}
.skip-link:focus { left: 0; }

/* -------- Header -------- */
.portail-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--marine);
  color: var(--lin-2);
  border-bottom: 3px solid var(--orange);
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex; align-items: center; gap: 2rem;
}
.brand { display: flex; align-items: center; gap: 0.8rem; text-decoration: none; }
.brand-logo { height: 40px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem; font-weight: 700; color: var(--lin-2);
  letter-spacing: -0.01em;
}
.brand-tagline {
  font-size: 0.78rem; color: var(--orange);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 500;
}

/* Navigation header */
.header-nav {
  display: flex;
  gap: 0.4rem;
  margin-left: 2rem;
}
.header-nav a {
  display: inline-block;
  padding: 0.5em 0.9em;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(245, 243, 238, 0.85);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.header-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--lin-2);
}
.header-nav a.active {
  background: var(--orange);
  color: var(--marine);
  font-weight: 600;
}
.header-nav a.nav-back {
  color: rgba(245, 243, 238, 0.6);
  font-size: 0.85rem;
  margin-right: 0.6rem;
  padding-right: 0.9em;
  border-right: 1px solid rgba(245, 243, 238, 0.2);
  border-radius: 0;
}
.header-nav a.nav-back:hover {
  color: var(--orange);
  background: transparent;
}

/* Recherche */
.search-container { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
#search-input {
  width: 100%;
  padding: 0.6em 1em;
  font-size: 0.95rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--lin-2);
  border-radius: var(--radius-md);
  transition: background 0.2s, border-color 0.2s;
}
#search-input::placeholder { color: rgba(245, 243, 238, 0.6); }
#search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--orange);
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  list-style: none; margin: 0; padding: 0.5em 0;
  background: white; color: var(--text);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 70vh; overflow-y: auto;
}
.search-results li { padding: 0; }
.search-results a {
  display: block; padding: 0.7em 1em;
  text-decoration: none; color: var(--text);
}
.search-results a:hover, .search-results a:focus {
  background: var(--lin); color: var(--marine);
}
.search-results .result-title {
  font-weight: 600; color: var(--marine);
  display: block; margin-bottom: 2px;
}
.search-results .result-surface {
  font-size: 0.82em; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.search-results .no-result {
  padding: 0.8em 1em; color: var(--text-muted);
  font-style: italic;
}

/* -------- Layout -------- */
.layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
}

/* -------- Sidebar -------- */
.sidebar {
  background: transparent;
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 80px);
}
.sidebar-inner {
  position: sticky; top: 80px;
  padding: 1.8rem 1.2rem 1.2rem;
}
.sidebar-title {
  font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 1rem;
  padding-left: 0.4rem;
}
.surfaces-nav ul { list-style: none; margin: 0; padding: 0; }
.surfaces-nav li { margin-bottom: 4px; }
.surfaces-nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55em 0.8em;
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.surfaces-nav a:hover {
  background: var(--lin);
  color: var(--marine);
}
.surfaces-nav li.active a {
  background: var(--marine);
  color: var(--lin-2);
}
.surfaces-nav li.active .surface-count {
  background: rgba(255, 255, 255, 0.2);
  color: var(--lin-2);
}
.surface-count {
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  min-width: 24px;
  text-align: center;
}

.sidebar-footer {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}
.sidebar-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.sidebar-note code {
  background: var(--lin);
  font-size: 0.92em;
}

/* -------- Contenu -------- */
.content {
  padding: 2.5rem 2.5rem 4rem;
  min-width: 0;
}

/* -------- Hero (page d'accueil) -------- */
.hero {
  margin-bottom: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--orange);
  font-weight: 600;
  margin: 0 0 0.8rem;
  padding-left: 1.2rem;
  position: relative;
}
.hero-eyebrow::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  width: 0.9rem; height: 2px;
  background: var(--orange);
  transform: translateY(-50%);
}
.hero h1 {
  font-size: 2.6rem;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 0 2rem;
}
.hero-stats {
  display: flex; gap: 2.5rem;
  flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--marine);
  line-height: 1;
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* -------- Surfaces (page d'accueil) -------- */
.surface-block {
  margin-bottom: 3.5rem;
  scroll-margin-top: 90px;
  position: relative;
}
.surface-header {
  margin-bottom: 1.8rem;
  padding-left: 1rem;
  border-left: 3px solid var(--orange);
  position: relative;
}
.surface-header h2 {
  margin-bottom: 0.3rem;
  font-size: 1.7rem;
  letter-spacing: -0.015em;
}
.surface-header p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.98rem;
  max-width: 56ch;
}

/* -------- Cartes de fiches : "Editorial Marine" -------- */
.fiche-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.95rem;
}

.fiche-card {
  position: relative;
  background:
    linear-gradient(180deg, #FFFFFF 0%, #FCFBF7 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--marine);
  border-radius: var(--radius-md);
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(15, 36, 71, 0.04),
    0 2px 4px rgba(15, 36, 71, 0.04);
  transition:
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
    border-color 0.2s ease,
    border-left-color 0.2s ease;

  /* Animation d'entrée stagger */
  opacity: 0;
  transform: translateY(8px);
  animation: cardReveal 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Stagger : chaque carte arrive ~70 ms après la précédente, par bloc de 9 */
.fiche-card:nth-child(1)  { animation-delay: 0.02s; }
.fiche-card:nth-child(2)  { animation-delay: 0.09s; }
.fiche-card:nth-child(3)  { animation-delay: 0.16s; }
.fiche-card:nth-child(4)  { animation-delay: 0.23s; }
.fiche-card:nth-child(5)  { animation-delay: 0.30s; }
.fiche-card:nth-child(6)  { animation-delay: 0.37s; }
.fiche-card:nth-child(7)  { animation-delay: 0.44s; }
.fiche-card:nth-child(8)  { animation-delay: 0.51s; }
.fiche-card:nth-child(9)  { animation-delay: 0.58s; }
.fiche-card:nth-child(n+10) { animation-delay: 0.62s; }

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Décoration : trait diagonal orange dans le coin supérieur droit */
.fiche-card::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -16px;
  width: 42px;
  height: 2px;
  background: var(--orange);
  transform: rotate(-45deg);
  transform-origin: center;
  opacity: 0;
  transition: opacity 0.25s ease, top 0.32s ease, right 0.32s ease;
  z-index: 2;
}

/* Flèche d'ouverture (apparaît au hover) */
.fiche-card::after {
  content: '↗';
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--orange);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
  pointer-events: none;
}

.fiche-card a {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.35rem 1.4rem 1.2rem;
  text-decoration: none;
  color: inherit;
  height: 100%;
  min-height: 120px;
  position: relative;
  z-index: 1;
}

.fiche-card:hover,
.fiche-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(242, 135, 5, 0.45);
  border-left-color: var(--orange);
  box-shadow:
    0 12px 28px rgba(15, 36, 71, 0.12),
    0 4px 8px rgba(15, 36, 71, 0.06),
    0 0 0 1px rgba(242, 135, 5, 0.06);
}
.fiche-card:hover::before,
.fiche-card:focus-within::before {
  opacity: 1;
  top: -6px;
  right: -12px;
}
.fiche-card:hover::after,
.fiche-card:focus-within::after {
  opacity: 1;
  transform: translate(0, 0);
}
.fiche-card:hover h3,
.fiche-card:focus-within h3 {
  color: #0B1B36;
}

.fiche-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
  padding-right: 1.4rem; /* laisse de la place pour la flèche ↗ */
}
.fiche-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1.32;
  color: var(--marine);
  flex: 1;
  transition: color 0.2s ease;
}

.fiche-card-footer {
  display: flex; justify-content: flex-start; align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.6rem;
  border-top: 1px dashed rgba(15, 36, 71, 0.08);
}

/* Variantes selon le statut : la couleur du bord gauche change */
.fiche-card.statut-beta { border-left-color: #C08400; }
.fiche-card.statut-évolutif,
.fiche-card.statut-evolutif { border-left-color: var(--marine-light); }
.fiche-card.statut-deprecated { border-left-color: #B73A3A; opacity: 0.78; }

/* Si l'utilisateur préfère réduire les animations */
@media (prefers-reduced-motion: reduce) {
  .fiche-card {
    animation: none;
    opacity: 1;
    transform: none;
    transition: border-color 0.15s ease;
  }
  .fiche-card:hover { transform: none; }
}

.empty-note {
  color: var(--text-muted);
  font-style: italic;
  padding: 0.9em 1.2em;
  background:
    linear-gradient(90deg, var(--lin) 0%, transparent 100%);
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0;
}

/* -------- Badges et tags -------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25em 0.65em;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.4;
  border: 1px solid transparent;
}
.badge::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-stable      { background: #E5F4EC; color: #0E6A3A; border-color: rgba(14, 106, 58, 0.18); }
.badge-beta        { background: #FFEFD1; color: #8A5A00; border-color: rgba(138, 90, 0, 0.22); }
.badge-évolutif, .badge-evolutif { background: #E2EAF6; color: #1E3A6F; border-color: rgba(30, 58, 111, 0.18); }
.badge-deprecated  { background: #FBDDDD; color: #8A1F1F; border-color: rgba(138, 31, 31, 0.18); }

/* Point pulsant pour les statuts "vivants" (beta + évolutif) */
.badge-beta::before,
.badge-évolutif::before,
.badge-evolutif::before {
  animation: badgePulse 2.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.35); opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .badge::before { animation: none !important; }
}

/* Plan-tag : chip ferme, hiérarchie discrète mais lisible */
.plan-tag {
  display: inline-flex;
  align-items: center;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--marine);
  background: #FFFFFF;
  padding: 0.22em 0.65em;
  border-radius: 4px;
  border: 1px solid rgba(15, 36, 71, 0.16);
  text-transform: uppercase;
  line-height: 1.5;
}
.plan-tag::before {
  content: '◆';
  font-size: 0.65em;
  margin-right: 0.45em;
  color: var(--orange);
}

/* -------- Fiche (page individuelle) -------- */
.breadcrumb {
  margin-bottom: 1.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--orange); text-decoration: underline; }
.breadcrumb .separator { margin: 0 0.4em; color: var(--border); }
.breadcrumb .current { color: var(--marine); font-weight: 500; }

.fiche {
  max-width: 780px;
}
.fiche-header {
  padding-bottom: 1.8rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.fiche-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--orange);
  font-weight: 600;
  margin: 0 0 0.6rem;
}
.fiche-header h1 {
  font-size: 2.1rem;
  margin: 0 0 1rem;
}
.fiche-meta {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-bottom: 1rem;
}
.meta-item {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.fiche-source {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.fiche-source a { word-break: break-all; }

.fiche-body h2 {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.fiche-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.fiche-body h3 {
  margin-top: 1.5rem;
}
.fiche-body ul, .fiche-body ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}
.fiche-body li {
  margin-bottom: 0.4em;
}
.fiche-body strong {
  color: var(--marine);
  font-weight: 600;
}

/* -------- Sommaire (page tabulaire) -------- */
.sommaire-intro {
  margin-bottom: 2.5rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}
.sommaire-intro h1 {
  font-size: 2.2rem;
  margin: 0 0 0.8rem;
}
.sommaire-stats {
  margin-top: 1.5rem;
  font-size: 1rem;
  color: var(--text-muted);
}
.sommaire-stats strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  color: var(--marine);
}

.sommaire-surface {
  margin-bottom: 2.8rem;
  scroll-margin-top: 90px;
}
.sommaire-surface h2 {
  margin-bottom: 0.4rem;
}
.surface-description {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.sommaire-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
}
.sommaire-table thead {
  background: var(--marine);
  color: var(--lin-2);
}
.sommaire-table th {
  text-align: left;
  padding: 0.7em 1em;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sommaire-table td {
  padding: 0.8em 1em;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}
.sommaire-table tbody tr {
  transition: background 0.12s;
}
.sommaire-table tbody tr:hover {
  background: var(--lin);
}
.sommaire-table .col-num {
  width: 60px;
  color: var(--text-muted);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
}
.sommaire-table .col-nom a {
  color: var(--marine);
  text-decoration: none;
  font-weight: 500;
}
.sommaire-table .col-nom a:hover {
  color: var(--orange);
  text-decoration: underline;
}
.sommaire-table .col-statut {
  width: 100px;
  text-align: center;
}
.sommaire-table .col-plan {
  width: 100px;
  text-align: center;
}
.sommaire-table .col-duree {
  width: 110px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Sommaire responsive : tableau scrollable horizontalement sur mobile */
@media (max-width: 720px) {
  .sommaire-surface {
    margin-left: -1.2rem;
    margin-right: -1.2rem;
  }
  .sommaire-surface h2,
  .surface-description {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
  .sommaire-table {
    border-radius: 0;
    border-left: none;
    border-right: none;
    font-size: 0.88rem;
  }
  .sommaire-table .col-duree,
  .sommaire-table .col-plan {
    display: none;
  }
}

/* -------- Boutons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.65em 1.1em;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn-icon {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05em;
}

.btn-primary {
  background: var(--marine);
  color: var(--lin-2);
  border-color: var(--marine);
}
.btn-primary:hover {
  background: #0B1B36;
  color: var(--lin-2);
}

.btn-ghost {
  background: transparent;
  color: var(--marine);
  border-color: rgba(15, 36, 71, 0.2);
}
.btn-ghost:hover {
  background: var(--lin);
  border-color: var(--marine);
  color: var(--marine);
}

.btn-large {
  padding: 0.85em 1.5em;
  font-size: 0.98rem;
}

/* -------- Livrables : page index -------- */
.livrables-intro {
  margin-bottom: 2.5rem;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid var(--border);
}
.livrables-intro h1 {
  font-size: 2.3rem;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.livrable-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.2rem;
}
.livrable-card {
  position: relative;
  background:
    linear-gradient(180deg, #FFFFFF 0%, #FCFBF7 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow:
    0 1px 1px rgba(15, 36, 71, 0.04),
    0 2px 4px rgba(15, 36, 71, 0.04);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.28s ease;
}
.livrable-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 10px 26px rgba(15, 36, 71, 0.12),
    0 3px 6px rgba(15, 36, 71, 0.06);
}
.livrable-card-main {
  display: block;
  padding: 1.5rem 1.5rem 1rem;
  text-decoration: none;
  color: inherit;
  flex: 1;
}
.livrable-card-meta {
  display: flex; align-items: center; gap: 0.8rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.livrable-numero {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
  margin-right: 0.4rem;
}
.livrable-duree {
  text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 600;
}
.livrable-card-titre {
  font-size: 1.2rem;
  color: var(--marine);
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.livrable-card-sous-titre {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
.livrable-card-actions {
  display: flex;
  gap: 0.6rem;
  padding: 0 1.5rem 1.4rem;
}
.livrable-card-actions .btn { flex: 1; justify-content: center; }
.livrable-card-actions .btn-ghost { flex: 0 0 auto; }

/* -------- Livrables : page individuelle -------- */
.livrable {
  max-width: 720px;
}
.livrable-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.livrable-eyebrow {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--orange);
  font-weight: 600;
  margin: 0 0 1rem;
}
.livrable-actions-top {
  margin-top: 1.4rem;
}

.livrable-body {
  font-size: 1.04rem;
  line-height: 1.72;
}
.livrable-body h1:first-child {
  font-size: 2.2rem;
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
}
.livrable-body h1 + blockquote,
.livrable-body > blockquote:first-of-type {
  background: var(--lin);
  border-left: 3px solid var(--orange);
  font-size: 1.02rem;
  color: var(--text);
  margin: 0 0 2.5rem;
  padding: 1.1rem 1.4rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.livrable-body h2 {
  margin-top: 2.4rem;
  font-size: 1.5rem;
  letter-spacing: -0.012em;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.livrable-body h2:first-of-type {
  border-top: none;
  padding-top: 0;
}
.livrable-body h3 {
  margin-top: 1.8rem;
  font-size: 1.15rem;
}
/* Prompts : bloc lin clair, bord orange, lisible, avec bouton Copier */
.livrable-body pre {
  position: relative;
  background: var(--lin);
  color: var(--marine);
  border: 1px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.2rem 4.5rem 1.2rem 1.5rem; /* place pour le bouton Copier à droite */
  margin: 1.4rem 0;
  font-family: 'JetBrains Mono', 'SF Mono', 'Menlo', Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;       /* retour à la ligne automatique pour les prompts longs */
  word-wrap: break-word;
  overflow-x: visible;
  box-shadow: var(--shadow-sm);
}
.livrable-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
}

/* Bouton Copier (injecté par JS) */
.copy-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.35em 0.7em;
  background: var(--marine);
  color: var(--lin-2);
  border: 1px solid var(--marine);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
  z-index: 2;
}
.copy-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--marine);
}
.copy-btn:active { transform: scale(0.97); }
.copy-btn.copied {
  background: #0E6A3A;
  border-color: #0E6A3A;
  color: white;
}
.copy-btn-icon {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9em;
}

.livrable-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.livrable-body thead { background: var(--marine); color: var(--lin-2); }
.livrable-body th, .livrable-body td {
  padding: 0.65em 0.9em;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.livrable-body tbody tr:last-child td { border-bottom: none; }
.livrable-body tbody tr:nth-child(even) { background: var(--lin-2); }

.livrable-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
}
.livrable-bottom-note {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* -------- Footer -------- */
.portail-footer {
  background: var(--marine);
  color: rgba(245, 243, 238, 0.85);
  margin-top: 4rem;
  padding: 2.5rem 1.5rem;
  font-size: 0.9rem;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}
.footer-col strong {
  display: block;
  color: var(--orange);
  font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}
.portail-footer a {
  color: var(--lin-2);
  text-decoration: underline;
  text-decoration-color: var(--orange);
}
.portail-footer a:hover { color: var(--orange); }

/* -------- Responsive -------- */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    min-height: auto;
  }
  .sidebar-inner {
    position: static;
    padding: 1.2rem 1.5rem;
  }
  .surfaces-nav ul {
    display: flex; flex-wrap: wrap; gap: 6px;
  }
  .surfaces-nav li { margin-bottom: 0; }
  .surfaces-nav a {
    font-size: 0.88rem;
    padding: 0.4em 0.7em;
  }
  .content { padding: 1.8rem 1.5rem 3rem; }
  .header-inner {
    flex-wrap: wrap;
    gap: 0.8rem;
  }
  .header-nav {
    margin-left: 0;
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .header-nav a {
    padding: 0.4em 0.8em;
    font-size: 0.88rem;
  }
  .search-container {
    width: 100%;
    margin-left: 0;
    max-width: none;
    order: 2;
  }
  .hero h1 { font-size: 1.9rem; }
  .hero-stats { gap: 1.5rem; }
  .stat-value { font-size: 1.8rem; }
}

@media (max-width: 600px) {
  .brand-tagline { font-size: 0.72rem; }
  .fiche-grid { grid-template-columns: 1fr; }
  .content { padding: 1.4rem 1.2rem 2.5rem; }
}
