/* hermesagents.fr — Design tokens injectés comme custom properties */
:root {
  /* Colors */
  --page-bg: #FAF9F6;
  --surface: #FFFFFF;
  --surface-alt: #F5F3EE;
  --border: #D4D0C8;
  --text-primary: #1A1A1A;
  --text-secondary: #5C5C5C;
  --text-muted: #8A8A8A;
  --accent: #1A5C2E;
  --accent-hover: #2D7A42;
  --accent-text: #FFFFFF;
  --warning-bg: #FFF8E7;
  --warning-border: #E8A838;
  --code-bg: #F0EDE5;
  --code-text: #2C2C2C;
  --link: #1A5C2E;
  --link-hover: #2D7A42;

  /* Typography */
  --heading-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body-font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --code-font: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
  --font-h1-size: 2.25rem;
  --font-h1-weight: 700;
  --font-h2-size: 1.75rem;
  --font-h2-weight: 650;
  --font-h3-size: 1.35rem;
  --font-h3-weight: 600;
  --font-body-lg: 1.125rem;
  --font-body-md: 1rem;
  --font-body-sm: 0.875rem;
  --font-label: 0.75rem;
  --font-code: 0.9rem;
  --font-breadcrumb: 0.8rem;

  /* Layout */
  --max-width: 960px;
  --content-width: 820px;
  --reading-width: 780px;
  --sidebar-width: 240px;
  --padding-desktop: 24px;
  --padding-mobile: 16px;
  --section-gap: 80px;
  --subsection-gap: 48px;
  --header-height: 56px;
  --header-height-mobile: 48px;

  /* Shapes */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --border-width: 1px;
  --shadow-header: 0 1px 3px rgba(0,0,0,0.08);
}

/* Reset minimal */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body-font);
  font-size: var(--font-body-md);
  line-height: 1.6;
  background: var(--page-bg);
  color: var(--text-primary);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: var(--border-width) solid var(--border);
  box-shadow: var(--shadow-header);
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--padding-desktop);
}
.logo {
  font-weight: var(--font-h2-weight);
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}
.main-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.nav-link {
  font-size: var(--font-body-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--accent); }

/* Main */
.page-main { padding: var(--padding-desktop) 0 var(--section-gap); }
.content-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--padding-desktop);
}

/* Typography */
h1 { font-size: var(--font-h1-size); font-weight: var(--font-h1-weight); line-height: 1.2; letter-spacing: -0.02em; margin: 24px 0 16px; }
h2 { font-size: var(--font-h2-size); font-weight: var(--font-h2-weight); line-height: 1.25; margin: 32px 0 16px; }
h3 { font-size: var(--font-h3-size); font-weight: var(--font-h3-weight); line-height: 1.3; margin: 24px 0 12px; }
h4 { font-size: 1.1rem; font-weight: 600; line-height: 1.3; margin: 20px 0 10px; color: var(--text-primary); }
p { margin: 0 0 16px; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

/* Breadcrumb */
.breadcrumb { margin: 0 0 24px; }
.breadcrumb-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.breadcrumb-item { display: inline-flex; align-items: center; gap: 4px; }
.breadcrumb-sep { color: var(--text-muted); font-size: var(--font-breadcrumb); }
.breadcrumb-link { font-size: var(--font-breadcrumb); color: var(--text-secondary); }
.breadcrumb-current { font-size: var(--font-breadcrumb); color: var(--text-primary); font-weight: 600; }

/* Hero */
.hero { margin: 24px 0 40px; }
.hero-subtitle { font-size: var(--font-body-lg); color: var(--text-secondary); }

/* Cards */
.card-grid, .hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 24px 0;
}
.card {
  display: block;
  padding: 20px;
  background: var(--surface);
  border: var(--border-width) solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.card:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; }
.card-title { font-size: var(--font-h3-size); font-weight: var(--font-h3-weight); margin: 0 0 8px; color: var(--text-primary); }
.card-desc { font-size: var(--font-body-sm); color: var(--text-secondary); margin: 0; }

/* Related links */
.related-links { margin: 40px 0 24px; padding: 20px; background: var(--surface-alt); border-radius: var(--radius-md); }
.related-title { font-size: var(--font-h3-size); margin: 0 0 12px; }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.related-link { font-size: var(--font-body-sm); }

/* Source footer */
.source-footer {
  margin: 40px 0 24px;
  padding: 16px 20px;
  background: var(--surface-alt);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.source-text { margin: 0; font-size: var(--font-body-sm); color: var(--text-secondary); }
.source-link { color: var(--accent); font-weight: 600; }

/* Placeholder */
.content-placeholder {
  padding: 24px;
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-md);
  margin: 24px 0;
}
.placeholder-notice { font-weight: 600; margin-bottom: 12px; }
.placeholder-intent, .placeholder-keyword, .placeholder-cluster { font-size: var(--font-body-sm); color: var(--text-secondary); margin: 4px 0; }

/* Footer */
.site-footer { border-top: var(--border-width) solid var(--border); padding: 24px 0; background: var(--surface); }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--padding-desktop); }
.copyright { font-size: var(--font-body-sm); color: var(--text-muted); margin: 0; }

/* Mobile */
@media (max-width: 768px) {
  .card-grid, .hub-grid { grid-template-columns: 1fr; }
  .main-nav {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }
  .header-inner { padding: 0 var(--padding-mobile); flex-wrap: nowrap; }
  .content-wrapper { padding: 0 var(--padding-mobile); }
}
/* Publication content */
.hero-with-image { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr); gap: 32px; align-items: center; }
.hero-copy { min-width: 0; }
.hero-image { width: 100%; height: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: 0 18px 40px rgba(26, 92, 46, 0.14); object-fit: cover; }
.article-content { max-width: var(--reading-width); margin: 40px auto 0; }
.article-content h2 { margin-top: 44px; margin-bottom: 14px; font-size: var(--font-h2-size); line-height: 1.25; }
.article-content h3 { margin-top: 28px; margin-bottom: 10px; font-size: var(--font-h3-size); }
.article-content p { color: var(--text-secondary); }
.article-content ul, .article-content ol { color: var(--text-secondary); padding-left: 1.35rem; }
.article-content li { margin: 0.45rem 0; }
.article-content pre { overflow-x: auto; padding: 16px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-md); }
.article-content code { font-family: var(--code-font); font-size: var(--font-code); }
.content-missing { border: 2px solid #C44D34; padding: 16px; border-radius: var(--radius-md); }
@media (max-width: 820px) { .hero-with-image { grid-template-columns: 1fr; } .hero-image { order: -1; } }

/* QA mobile overflow guards */
.content-wrapper, .article-content, .card, .source-footer { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.article-content pre, .article-content table { max-width: 100%; overflow-x: auto; }
.article-content img, .hero-image { max-width: 100%; }

/* Header layout hotfix: prevent wrapped navigation from overlapping content */
.site-header { height: auto; min-height: var(--header-height); }
.header-inner { min-height: var(--header-height); flex-wrap: wrap; gap: 8px 20px; padding-top: 8px; padding-bottom: 8px; }
.logo { flex: 0 0 auto; }
.main-nav { flex: 1 1 560px; justify-content: flex-end; align-items: center; row-gap: 4px; }
@media (max-width: 768px) {
  .site-header { position: sticky; }
  .header-inner { align-items: flex-start; gap: 8px; }
  .main-nav { flex: 0 0 100%; max-width: 100%; justify-content: flex-start; }
}
