/* =============================================
   MLRH — CSS GLOBAL
   ============================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #15803d;
  --primary-dark: #166534;
  --primary-light: #dcfce7;
  --blue: #1A56DB;
  --blue-light: #EBF2FF;
  --orange: #FF5C35;
  --text: #1a1a2e;
  --text-muted: #5a6478;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,.10);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  min-width: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* =============================================
   HEADER / NAV
   ============================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}

.site-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.site-logo:hover { text-decoration: none; }
.site-logo span { color: var(--primary); }
.site-logo-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}

.site-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: nowrap;
}

.site-nav a {
  color: var(--text-muted);
  font-size: .88rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .15s, color .15s;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
  text-decoration: none;
}

.site-nav a.nav-cta {
  background: var(--primary);
  color: var(--white);
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 99px;
  margin-left: 4px;
}

.site-nav a.nav-cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

/* =============================================
   BURGER MENU MOBILE
   ============================================= */

.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =============================================
   BOUTONS
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-orange {
  background: var(--orange);
  color: var(--white);
}

/* =============================================
   FOOTER
   ============================================= */

.site-footer {
  background: #0f1f17;
  color: #9ca3af;
  padding: 48px 24px 24px;
  margin-top: 0;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid #1f3d2b;
}

.footer-brand p {
  margin-top: 12px;
  font-size: .88rem;
  line-height: 1.6;
  max-width: 280px;
}

.footer-logo {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-logo span { color: #4ade80; }
.footer-logo-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: #22c55e;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
}

.footer-col-title {
  color: var(--white);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col ul a {
  color: #9ca3af;
  font-size: .88rem;
  text-decoration: none;
  transition: color .15s;
}
.footer-col ul a:hover { color: #4ade80; text-decoration: none; }

.footer-bottom {
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .82rem;
}

.footer-affiliation {
  font-size: .78rem;
  color: #9ca3af;
  line-height: 1.5;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #1f3d2b;
}

/* =============================================
   UTILITAIRES
   ============================================= */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 32px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.badge-blue { background: var(--blue-light); color: var(--blue); }
.badge-orange { background: #fff4f0; color: var(--orange); }
.badge-green { background: var(--primary-light); color: var(--primary); }

/* =============================================
   BREADCRUMB
   ============================================= */

.breadcrumb {
  padding: 16px 0;
  font-size: .85rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 6px; opacity: .5; }

/* =============================================
   AUTEUR
   ============================================= */

.author-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.author-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800;
  flex-shrink: 0;
  overflow: hidden;
}
.author-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.author-line a { color: var(--primary); font-weight: 600; }

/* =============================================
   TABLES RESPONSIVE
   ============================================= */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

table {
  min-width: 0;
}

/* =============================================
   ARTICLE CONTENT — MOBILE OVERFLOW FIX
   ============================================= */

.article-content,
.article-main {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-layout,
.article-outer {
  min-width: 0;
}

@media (max-width: 768px) {
  .article-layout,
  .article-outer {
    overflow-x: hidden;
    padding-left: 16px;
    padding-right: 16px;
  }

  .article-content,
  .article-main {
    overflow-x: auto;
  }

  /* Tables : forcer scroll horizontal au lieu d'écraser les colonnes */
  .compare-table-wrap,
  .comp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .compare-table,
  .comp-table {
    min-width: 600px;
  }

  /* Première colonne sticky pour garder le contexte en scrollant */
  .compare-table td:first-child,
  .compare-table th:first-child,
  .comp-table td:first-child,
  .comp-table th:first-child {
    position: sticky;
    left: 0;
    background: #fff;
    z-index: 1;
    min-width: 120px;
  }

  .compare-table thead th:first-child,
  .comp-table thead th:first-child {
    background: #f0fdf4;
  }

  .alt-detail,
  .summary-box {
    padding: 20px 16px;
  }

  .cta-box {
    padding: 24px 16px;
  }
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .nav-burger {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 16px 16px;
    gap: 4px;
    z-index: 99;
    box-shadow: 0 6px 20px rgba(0,0,0,.08);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: .92rem;
  }

  .site-nav a.nav-cta {
    margin-left: 0;
    text-align: center;
    margin-top: 4px;
  }

  .site-header-inner {
    height: 56px;
    position: relative;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .container {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: 0 16px;
  }

  .site-footer {
    padding: 32px 16px 20px;
  }

  .footer-grid {
    gap: 24px;
  }

  .btn {
    padding: 10px 18px;
    font-size: .88rem;
  }
}

/* Screenshots / Figures */
.article-screenshot {
  margin: 28px 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.article-screenshot img {
  display: block;
  width: 100%;
  height: auto;
}

.article-screenshot figcaption {
  padding: 10px 16px;
  font-size: .82rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid #e2e8f0;
  background: white;
}

/* =============================================
   BANDEAU COOKIE
   ============================================= */

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,.10);
  padding: 20px 24px;
  transform: translateY(100%);
  transition: transform .35s ease;
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  flex: 1;
  min-width: 240px;
  font-size: .88rem;
  color: var(--text);
  line-height: 1.5;
}

.cookie-banner-text a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background .15s, transform .15s;
}

.cookie-btn:hover {
  transform: translateY(-1px);
}

.cookie-btn-accept {
  background: var(--primary);
  color: var(--white);
}

.cookie-btn-accept:hover {
  background: var(--primary-dark);
}

.cookie-btn-refuse {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.cookie-btn-refuse:hover {
  background: var(--border);
}

@media (max-width: 600px) {
  .cookie-banner { padding: 16px; }
  .cookie-banner-inner { flex-direction: column; gap: 14px; }
  .cookie-banner-actions { width: 100%; }
  .cookie-btn { flex: 1; text-align: center; padding: 12px 16px; }
}
