/* ============================================
   Lucide - Global Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800;900&display=swap');

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #dbeafe;
  --color-secondary: #7c3aed;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-bg: #f7f5f2;
  --color-white: #fffffe;
  --color-border: #e8e4df;
  --color-card-bg: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --max-width: 720px;
  --max-width-wide: 960px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --transition: 0.2s ease;
}

/* --- Dark mode --- */
/*
 * Variables on html.dark so they apply BEFORE body exists (no flash).
 * CSS custom properties cascade from html → body automatically.
 *
 * Palette — cool neutral gray (Linear/Notion style)
 * Background:  #191b22  (cool dark gray)
 * Surface 1:   #181a20  (header, footer)
 * Surface 2:   #1e2028  (cards)
 * Border:      #2a2d36  (subtle)
 * Text:        #e8eaed  (87% white)
 * Text muted:  #8b8fa3
 * Primary:     #5b8def  (desaturated blue)
 */
html.dark {
  color-scheme: dark;
  --color-primary: #5b8def;
  --color-primary-dark: #7da6ff;
  --color-primary-light: rgba(91, 141, 239, 0.12);
  --color-secondary: #a78bfa;
  --color-success: #34d399;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --color-text: #e8eaed;
  --color-text-light: #8b8fa3;
  --color-bg: #191b22;
  --color-white: #1e2028;
  --color-border: #2e3140;
  --color-card-bg: #242731;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);
}

html.dark h1,
html.dark h2,
html.dark h3,
html.dark h4 {
  color: #f1f3f5;
}

html.dark a {
  color: var(--color-primary);
}

html.dark a:hover {
  color: var(--color-primary-dark);
}

/* Dark — header */
html.dark header {
  background: var(--color-white);
  border-bottom-color: var(--color-border);
}

html.dark nav .logo {
  color: #f1f3f5;
}

html.dark .nav-contact {
  color: var(--color-text-light);
  border-left-color: var(--color-border);
}

html.dark nav .nav-links a {
  color: var(--color-text-light);
}

html.dark nav .nav-links a:hover {
  color: var(--color-primary);
}

html.dark nav .nav-links a[href="/connexion.html"] {
  background: var(--color-primary);
  color: #fff !important;
}

html.dark nav .nav-links a[href="/connexion.html"]:hover {
  background: var(--color-primary-dark);
  color: #fff !important;
}

html.dark .nav-burger span {
  background: #f1f3f5;
}

/* Dark — footer */
html.dark footer {
  background: var(--color-white);
  border-top-color: var(--color-border);
  color: var(--color-text-light);
}

html.dark footer a {
  color: var(--color-text-light);
}

/* Dark — forms */
html.dark input,
html.dark textarea,
html.dark select {
  background: var(--color-card-bg);
  color: var(--color-text);
  border-color: var(--color-border);
}

/* Dark — cards */
html.dark .test-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
}

html.dark .test-card h3 {
  color: #f1f3f5;
}

html.dark .test-card p,
html.dark .test-card .meta {
  color: var(--color-text-light);
}

/* Theme toggle button */
.theme-toggle {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.4rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  margin-left: auto;
  margin-right: 0.75rem;
}

.theme-toggle:hover {
  background: var(--color-border);
}

/* Homepage light: glass pill on hero */
body.home .theme-toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

body.home .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Dark mode toggle */
html.dark .theme-toggle {
  background: #1e2028;
  border-color: #2a2d36;
  color: #e8eaed;
}

html.dark .theme-toggle:hover {
  background: #2a2d36;
}

/* Homepage dark: same glass style */
body.home.dark .theme-toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

body.home.dark .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

main.wide {
  max-width: var(--max-width-wide);
}

main.full {
  max-width: 1200px;
  padding: 0 2rem 2rem;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: 1.875rem; margin-bottom: 0.75rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.625rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.1rem; margin-bottom: 0.375rem; }

p { margin-bottom: 1rem; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover { color: var(--color-primary-dark); }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }

/* --- Header / Nav --- */
header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Homepage: header transparent, overlapping hero */
body.home header {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  gap: 1rem;
  position: relative;
}

/* Nav left group: logo | contact */
.nav-left {
  display: flex;
  align-items: baseline;
}

nav .logo {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--color-primary);
}

.nav-contact {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-light);
  margin-left: 1.25rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--color-border);
}

.nav-contact:hover {
  color: var(--color-primary);
}

/* Homepage: white nav text */
body.home nav .logo {
  color: #fff;
}

body.home .nav-contact {
  color: rgba(255, 255, 255, 0.7);
  border-left-color: rgba(255, 255, 255, 0.25);
}

body.home .nav-contact:hover {
  color: #fff;
}

/* Burger menu button */
.nav-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}

.nav-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition);
}

body.home .nav-burger span {
  background: #fff;
}

.nav-burger.open span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.nav-burger.open span:nth-child(2) {
  opacity: 0;
}

.nav-burger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

nav .nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

nav .nav-links a {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-weight: 500;
}

nav .nav-links a:hover {
  color: var(--color-primary);
}

/* Homepage: white nav links */
body.home nav .nav-links a {
  color: rgba(255, 255, 255, 0.85);
}

body.home nav .nav-links a:hover {
  color: #fff;
}

/* Auth visibility - hidden elements use display:none, visible ones are left untouched */
[data-auth="logged-in"] { display: none !important; }
body.authenticated [data-auth="logged-in"] { display: revert !important; }
body.authenticated [data-auth="logged-out"] { display: none !important; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: var(--color-white);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary-light);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
}

.btn-danger:hover {
  background: #b91c1c;
  color: var(--color-white);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Cards --- */
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: 1rem;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition);
  font-family: var(--font-sans);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-error {
  font-size: 0.8rem;
  color: var(--color-danger);
  margin-top: 0.25rem;
}

/* --- Alerts --- */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-info {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border: 1px solid #93c5fd;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* --- Articles --- */
.article-page {
  max-width: var(--max-width);
}

.article-page .article-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

.article-page h1 {
  margin-bottom: 0.5rem;
}

.article-page h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.article-page h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.article-page p {
  line-height: 1.85;
  margin-bottom: 1.25rem;
}

.article-page p:last-child {
  margin-bottom: 0;
}

/* Article hero image */
.article-hero {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

/* Mid-article illustration */
.article-illustration {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 2rem 0;
}

.article-page blockquote {
  border-left: 3px solid var(--color-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--color-primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--color-text);
}

.article-page .article-cta {
  text-align: center;
  padding: 2rem;
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  margin: 2.5rem 0;
}

.article-page .article-cta p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

/* Compact CTA under TOC */
.article-cta-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  margin-bottom: 2.5rem;
}

.article-cta-mini p {
  font-size: 0.9rem;
  color: var(--color-text);
  margin: 0;
  line-height: 1.4;
}

.article-cta-mini .btn {
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

.article-page .article-sources {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.article-page .article-sources h3 {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-top: 0;
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.faq-item {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item[open] {
  border-color: var(--color-primary);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-text);
  transition: color var(--transition);
}

.faq-item summary:hover {
  color: var(--color-primary);
}

.faq-item summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-text-light);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.faq-item[open] summary::after {
  content: "\2212";
  color: var(--color-primary);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item p {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--color-text-light);
  margin: 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 0.78rem;
  margin-bottom: 1.5rem;
}

.breadcrumb a,
.breadcrumb > span {
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  text-decoration: none;
  transition: all var(--transition);
}

.breadcrumb a {
  color: var(--color-text-light);
  background: transparent;
}

.breadcrumb a:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.breadcrumb > span {
  color: var(--color-text);
  font-weight: 500;
  background: var(--color-bg);
}

.breadcrumb-sep {
  color: var(--color-border);
  margin: 0 0.15rem;
  font-size: 0.65rem;
}

/* Table of contents (articles) */
/* --- Table of contents (articles) --- */
.article-toc {
  display: block;
  margin-bottom: 2rem;
  padding: 0;
  background: none;
  border: none;
  border-left: 2px solid var(--color-border);
  border-radius: 0;
  padding-left: 1.25rem;
}

.article-toc-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-light);
  margin-bottom: 0.625rem;
}

.article-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  counter-reset: toc;
}

.article-toc li {
  counter-increment: toc;
}

.article-toc a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
  background: none;
  border: none;
  border-radius: 0;
  text-decoration: none;
  transition: color var(--transition);
  line-height: 1.4;
}

.article-toc a:hover {
  color: var(--color-primary);
  background: none;
}

.article-toc a::before {
  content: counter(toc) ".";
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-light);
  min-width: 1.25rem;
  flex-shrink: 0;
  background: none;
  border-radius: 0;
  width: auto;
  height: auto;
  display: inline;
}

/* Article list (index page) */
/* --- Article search & filters --- */
.article-search {
  position: relative;
  margin-bottom: 1rem;
}

.article-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.article-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.article-search::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-size: contain;
  pointer-events: none;
}

.article-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.filter-pill {
  display: inline-block;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-text-light);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.filter-pill:hover {
  border-color: var(--pill-color, var(--color-primary));
  color: var(--pill-color, var(--color-primary));
}

.filter-pill.active {
  background: var(--pill-color, var(--color-primary));
  border-color: var(--pill-color, var(--color-primary));
  color: var(--color-white);
}

/* Filter pill colors */
.filter-pill[data-filter="relations"]    { --pill-color: #7c3aed; }
.filter-pill[data-filter="finances"]     { --pill-color: #0d9488; }
.filter-pill[data-filter="communication"]{ --pill-color: #ea580c; }
.filter-pill[data-filter="travail"]      { --pill-color: #dc2626; }
.filter-pill[data-filter="productivite"] { --pill-color: #d97706; }
.filter-pill[data-filter="emotions"]     { --pill-color: #2563eb; }
.filter-pill[data-filter="general"]      { --pill-color: #64748b; }

.article-no-result {
  text-align: center;
  color: var(--color-text-light);
  padding: 3rem 1rem;
  display: none;
}

/* --- Article cards grid --- */
.article-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--cat-color, var(--color-primary));
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--cat-color, var(--color-primary));
  border-left-width: 3px;
  color: var(--color-text);
}

.article-card .article-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cat-color, var(--color-primary));
  margin-bottom: 0.5rem;
}

.article-card h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  line-height: 1.4;
}

.article-card p {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: 0;
  flex: 1;
  line-height: 1.5;
}

.article-card .article-card-meta {
  font-size: 0.78rem;
  color: var(--color-text-light);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

/* Category colors for article cards */
.article-card[data-category="relations"]    { --cat-color: #7c3aed; }
.article-card[data-category="finances"]     { --cat-color: #0d9488; }
.article-card[data-category="communication"]{ --cat-color: #ea580c; }
.article-card[data-category="travail"]      { --cat-color: #dc2626; }
.article-card[data-category="productivite"] { --cat-color: #d97706; }
.article-card[data-category="emotions"]     { --cat-color: #2563eb; }
.article-card[data-category="general"]      { --cat-color: #64748b; }

/* --- Content pages (a-propos, legal, etc.) --- */
.content-page {
  max-width: var(--max-width);
}

.content-page h1 {
  margin-bottom: 2rem;
}

.content-page > .text-muted {
  margin-bottom: 2.5rem;
}

.content-page section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border);
}

.content-page section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.content-page h2 {
  padding-left: 0.75rem;
  border-left: 3px solid var(--color-primary);
  margin-bottom: 1.25rem;
  font-size: 1.2rem;
}

.content-page p {
  line-height: 1.85;
  margin-bottom: 1rem;
}

.content-page p:last-child {
  margin-bottom: 0;
}

/* Table of contents for legal pages */
/* --- Table of contents (legal/content pages) --- */
.page-toc {
  display: block;
  margin-bottom: 2.5rem;
  padding: 0;
  background: none;
  border: none;
  border-left: 2px solid var(--color-border);
  border-radius: 0;
  padding-left: 1.25rem;
  box-shadow: none;
  max-width: none;
  justify-content: initial;
}

.page-toc p {
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-light);
  margin-bottom: 0.625rem;
  padding-bottom: 0;
  border-bottom: none;
}

.page-toc ol {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  counter-reset: pagetoc;
}

.page-toc li {
  counter-increment: pagetoc;
}

.page-toc a {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition);
  line-height: 1.4;
  border-radius: 0;
}

.page-toc a:hover {
  color: var(--color-primary);
  background: none;
}

.page-toc a::before {
  content: counter(pagetoc) ".";
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-light);
  min-width: 1.25rem;
  flex-shrink: 0;
  background: none;
  border-radius: 0;
  height: auto;
}

/* --- Footer --- */
footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 1.5rem 2rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 0;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
}

.footer-tagline {
  font-size: 0.78rem;
  color: var(--color-text-light);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.25rem;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
}

.footer-legal a {
  color: var(--color-text-light);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-legal a:hover {
  color: var(--color-primary);
}

footer a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}

footer a:hover {
  color: var(--color-primary);
}

.footer-kofi {
  display: inline-block;
  padding: 0.35rem 0.875rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff !important;
  background: #ff5e5b;
  border-radius: 99px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.footer-kofi:hover {
  background: #e8504d;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 94, 91, 0.3);
}

.donate-banner {
  margin-top: 3rem;
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, #fff5f5, #fef2f2);
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
}

.donate-banner p {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.btn-donate {
  background: #ff5e5b;
  color: var(--color-white);
  padding: 0.625rem 1.5rem;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-donate:hover {
  background: #e8504d;
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 94, 91, 0.3);
}

/* --- Test intro page --- */
.test-intro {
  text-align: center;
}

.test-intro h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.test-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

.test-description {
  text-align: left;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.test-description ul {
  list-style: none;
  padding: 0;
}

.test-description li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.test-description li:last-child {
  border-bottom: none;
}

.test-notice {
  background: #fefce8;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.875rem 1.25rem;
  max-width: 520px;
  margin: 0 auto 2rem;
  font-size: 0.9rem;
  color: #854d0e;
}

/* --- Stats container (homepage / test intro) --- */
#stats-container {
  margin-top: 2.5rem;
  text-align: left;
}

.stat-bar-group {
  margin-bottom: 0.75rem;
}

.stat-bar-label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
}

.stat-bar-track {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* --- Homepage --- */

/* Serif font for titles */
.hero h1, .test-card h3 {
  font-family: var(--font-serif);
}

/* Nav Connexion button — filled primary */
nav .nav-links a[href="/connexion.html"] {
  background: var(--color-primary);
  color: #fff !important;
  border: none;
  border-radius: 99px;
  padding: 0.45rem 1.3rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

nav .nav-links a[href="/connexion.html"]:hover {
  background: var(--color-primary-dark);
  color: #fff !important;
}

/* Homepage: glass-style connexion button */
body.home nav .nav-links a[href="/connexion.html"] {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff !important;
}

body.home nav .nav-links a[href="/connexion.html"]:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Hero — full-width, deep radial gradient, header overlaps */
.hero {
  background: linear-gradient(180deg,
    #4338ca 0%,
    #312e81 40%,
    #1e1b4b 65%
  );
  color: var(--color-white);
  text-align: center;
  padding: 140px 20px 130px;
  position: relative;
}

/* Wave separator between hero and content */
.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  line-height: 0;
  z-index: 1;
}

.hero-wave svg {
  width: 100%;
  height: 120px;
  display: block;
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

/* Hero features line */
.hero-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  flex-wrap: wrap;
}

.hero-features span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.hero-features .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1.5rem;
  color: var(--color-white);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  font-weight: 300;
  line-height: 1.7;
}

.hero-cta {
  display: inline-block;
  background: white;
  color: #312e81;
  padding: 18px 42px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
  letter-spacing: 0.01em;
}

.hero-cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.35);
  background: white;
  color: #312e81;
}

/* Test grid */
.test-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 1rem 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Test card — soft, warm, generous */
.test-card {
  display: flex;
  flex-direction: column;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 32px;
  position: relative;
  text-align: left;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.test-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 20px 20px 0 0;
  background: var(--tag-color, var(--color-primary));
}

.test-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  color: var(--color-text);
}

.test-card:hover .test-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Tag badge — pill with square-round contrast */
.test-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tag-color, var(--color-primary));
  background: var(--tag-bg, var(--color-primary-light));
  padding: 6px 12px;
  border-radius: 8px;
  align-self: flex-start;
  margin-bottom: 1.5rem;
}

/* Card header with arrow (legacy — kept for test intro pages) */
.test-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.test-arrow {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  color: var(--tag-color, var(--color-primary));
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition), transform var(--transition);
  flex-shrink: 0;
}

.test-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
  font-weight: 700;
}

.test-card p {
  font-size: 1rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
  flex-grow: 1;
  line-height: 1.7;
}

.test-card .meta {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-light);
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

/* Trust bar */
/* Trust bar — elevated stats */
.trust-bar {
  text-align: center;
  padding: 4rem 1.5rem 2rem;
}

.trust-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}

.trust-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.trust-number {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.trust-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.trust-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--color-border);
  flex-shrink: 0;
}

.trust-refs {
  font-size: 0.8rem;
  color: var(--color-text-light);
  margin-top: 2rem;
  line-height: 1;
  white-space: nowrap;
  padding: 0.75rem 1.5rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  display: inline-block;
  letter-spacing: 0.02em;
}

.trust-refs a {
  color: var(--color-text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.trust-refs a:hover {
  color: var(--color-primary);
}

/* Theme colors per test */
.test-card[data-theme="relations"]   { --tag-color: #7c3aed; --tag-bg: #ede9fe; }
.test-card[data-theme="argent"]      { --tag-color: #0d9488; --tag-bg: #ccfbf1; }
.test-card[data-theme="conflit"]     { --tag-color: #ea580c; --tag-bg: #fff7ed; }
.test-card[data-theme="burnout"]     { --tag-color: #dc2626; --tag-bg: #fee2e2; }
.test-card[data-theme="productivite"]{ --tag-color: #d97706; --tag-bg: #fef3c7; }
.test-card[data-theme="emotions"]    { --tag-color: #2563eb; --tag-bg: #dbeafe; }

/* Dark mode: desaturated tag colors + dark subtle backgrounds */
html.dark .test-card[data-theme="relations"]   { --tag-color: #a78bfa; --tag-bg: rgba(167, 139, 250, 0.12); }
html.dark .test-card[data-theme="argent"]      { --tag-color: #2dd4bf; --tag-bg: rgba(45, 212, 191, 0.12); }
html.dark .test-card[data-theme="conflit"]     { --tag-color: #fb923c; --tag-bg: rgba(251, 146, 60, 0.12); }
html.dark .test-card[data-theme="burnout"]     { --tag-color: #f87171; --tag-bg: rgba(248, 113, 113, 0.12); }
html.dark .test-card[data-theme="productivite"]{ --tag-color: #fbbf24; --tag-bg: rgba(251, 191, 36, 0.12); }
html.dark .test-card[data-theme="emotions"]    { --tag-color: #60a5fa; --tag-bg: rgba(96, 165, 250, 0.12); }

/* Dark mode: article card category colors */
/* Dark mode: desaturated article category colors */
html.dark .article-card[data-category="relations"]    { --cat-color: #a78bfa; }
html.dark .article-card[data-category="finances"]     { --cat-color: #2dd4bf; }
html.dark .article-card[data-category="communication"]{ --cat-color: #fb923c; }
html.dark .article-card[data-category="travail"]      { --cat-color: #f87171; }
html.dark .article-card[data-category="productivite"] { --cat-color: #fbbf24; }
html.dark .article-card[data-category="emotions"]     { --cat-color: #60a5fa; }
html.dark .article-card[data-category="general"]      { --cat-color: #94a3b8; }

/* Dark mode: article cards — remove left border, use top accent like test cards */
html.dark .article-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--cat-color, var(--color-primary));
}

html.dark .article-card:hover {
  border-color: var(--color-border);
  border-left-color: var(--cat-color, var(--color-primary));
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

html.dark .article-card h3 { color: var(--color-text); }
html.dark .article-card p { color: var(--color-text-light); }

/* Dark mode: CTA mini */
html.dark .article-cta-mini {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
}

/* Dark mode: article page CTA */
html.dark .article-page .article-cta {
  background: var(--color-card-bg);
  border-color: var(--color-border);
}

/* Dark mode: filter pills */
html.dark .filter-pill {
  background: var(--color-card-bg);
  border-color: var(--color-border);
  color: var(--color-text-light);
}

html.dark .filter-pill.active,
html.dark .filter-pill:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Dark mode: search input */
html.dark .article-search input {
  background: var(--color-card-bg);
  border-color: var(--color-border);
  color: var(--color-text);
}

html.dark .article-search input::placeholder {
  color: var(--color-text-light);
}

/* --- Profile result page --- */
.profil-result {
  max-width: var(--max-width);
}

.profil-header {
  text-align: center;
  margin-bottom: 2rem;
}

.profil-header .profil-name {
  font-size: 2rem;
  color: var(--color-primary);
}

.profil-header .profil-test {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.profil-section {
  margin-bottom: 2rem;
}

.profil-section h2 {
  border-bottom: 2px solid var(--color-primary-light);
  padding-bottom: 0.375rem;
  margin-bottom: 1rem;
}

.profil-scores {
  margin-bottom: 2rem;
}

.scores-grid {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.score-item {
  padding: 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
}

.score-item .score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.375rem;
}

.score-item .score-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.score-item .score-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
}

.score-item .score-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}

.score-item .score-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.6s ease;
}

.score-item.score-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-item.score-text .score-value {
  font-size: 1rem;
}

/* --- Chart container --- */
.chart-container {
  text-align: center;
  margin-bottom: 1.5rem;
}

.chart-container svg {
  max-width: 420px;
  width: 100%;
  height: auto;
}

.chart-export-btn {
  margin-top: 0.75rem;
}

.scores-section {
  margin-top: 0.5rem;
}

/* --- Share section --- */
.share-section {
  text-align: center;
  padding: 1.5rem;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  margin-top: 2rem;
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.share-buttons .btn {
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}

/* --- CTA box --- */
.cta-box {
  text-align: center;
  padding: 2rem;
  background: var(--color-white);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-lg);
  margin-top: 2rem;
}

.cta-box p {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

/* --- Disclaimer on profile pages --- */
.profil-disclaimer {
  text-align: center;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  color: var(--color-text-light);
  line-height: 1.5;
  border-top: 1px solid var(--color-border);
}

/* --- Modal --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* --- RGPD consent banner --- */
.consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  padding: 1rem 1.25rem;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.consent-banner p {
  font-size: 0.85rem;
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.consent-banner .btn {
  white-space: nowrap;
}

/* --- Loading spinner --- */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Utility --- */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* --- Scroll reveal animation --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.test-card {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.test-card:nth-child(1) { animation-delay: 0.05s; }
.test-card:nth-child(2) { animation-delay: 0.12s; }
.test-card:nth-child(3) { animation-delay: 0.19s; }
.test-card:nth-child(4) { animation-delay: 0.26s; }
.test-card:nth-child(5) { animation-delay: 0.33s; }
.test-card:nth-child(6) { animation-delay: 0.40s; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .test-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  h1 { font-size: 1.5rem; }
  .hero { padding: 100px 1.25rem 3.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1.05rem; margin-bottom: 1.5rem; }
  .hero-features { font-size: 0.85rem; gap: 0.75rem; margin-bottom: 2rem; }
  .hero-cta { padding: 0.875rem 2rem; font-size: 1rem; }
  .test-grid { grid-template-columns: 1fr; padding: 2rem 1rem; gap: 1.25rem; }
  .test-card { padding: 24px; }
  .test-card h3 { font-size: 1.25rem; }
  .test-card p { font-size: 0.95rem; margin-bottom: 1.5rem; }
  .test-card .meta { flex-wrap: wrap; gap: 0.5rem; }
  .trust-stats { gap: 1.5rem; }
  .trust-number { font-size: 1.5rem; }
  .trust-label { font-size: 0.7rem; }
  .trust-divider { display: none; }
  .trust-refs { font-size: 0.78rem; }
  .footer-top, .footer-bottom { flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
  .footer-brand { flex-direction: column; align-items: center; gap: 0.25rem; }
  .footer-links { gap: 1rem; }
  .footer-legal { flex-wrap: wrap; justify-content: center; }
  .test-intro h1 { font-size: 1.625rem; }
  main { padding: 1.25rem 1rem; }
  .btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; }
  .modal { padding: 1.5rem; }
  .consent-banner { flex-direction: column; text-align: center; }

  .test-arrow { display: none; }

  .test-intro {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .test-intro > * {
    width: 100%;
  }

  .test-intro .test-notice {
    order: 10;
    margin-top: 1.5rem;
  }

  .test-intro .btn {
    order: 5;
  }

  .test-intro #stats-container {
    order: 20;
  }

  /* Burger menu: show on mobile */
  .nav-burger {
    display: flex;
  }

  nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    padding: 0.75rem 1.25rem;
    gap: 0;
  }

  nav .nav-links.open {
    display: flex;
  }

  nav .nav-links a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
    color: var(--color-text) !important;
  }

  nav .nav-links a:last-child {
    border-bottom: none;
  }

  /* Homepage mobile: dark dropdown */
  body.home nav .nav-links {
    background: rgba(30, 27, 75, 0.97);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  }

  body.home nav .nav-links a {
    color: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  /* Dark mode mobile dropdown */
  html.dark nav .nav-links {
    background: #181a20;
    border-bottom: 1px solid #2a2d36;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }

  html.dark nav .nav-links a {
    color: #e8eaed !important;
    border-bottom-color: #2a2d36;
  }

  /* Breadcrumb: hide on mobile */
  .breadcrumb { display: none; }

  /* Article grid: single column */
  .article-list { grid-template-columns: 1fr; }

  /* Filters: smaller pills that wrap naturally */
  .filter-pill {
    font-size: 0.72rem;
    padding: 0.25rem 0.6rem;
  }

  /* TOC: mobile */
  .article-toc, .page-toc {
    padding-left: 1rem;
  }

  .page-toc ol {
    grid-template-columns: 1fr;
  }

  /* Mini CTA: stack on mobile */
  .article-cta-mini {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  /* Content pages: tighter spacing */
  .content-page h1 { margin-bottom: 1.25rem; }
  .content-page section { margin-bottom: 2rem; padding-bottom: 1.5rem; }
  .content-page h2 { font-size: 1.1rem; }
  .content-page p { font-size: 0.9rem; line-height: 1.75; }

  /* Footer mobile */
  footer {
    padding: 1.5rem 1rem;
  }

  footer a {
    display: inline-block;
    margin: 0.2rem 0.5rem;
  }
}
