/* ---------- Variables — identité visuelle RxWeb ---------- */

:root {
  /* Palette bleu léger */
  --rxw-primary:        #3b7ec7;   /* bleu principal */
  --rxw-primary-dark:   #2c5f9a;   /* bleu foncé — hover, accents */
  --rxw-primary-light:  #e8f1fa;   /* bleu très clair — fonds subtils */
  --rxw-accent:         #5fa3d9;   /* bleu accent */

  /* Neutres */
  --rxw-text:           #1f2937;   /* texte principal */
  --rxw-text-muted:     #64748b;   /* texte secondaire */
  --rxw-border:         #e2e8f0;   /* bordures */
  --rxw-bg:             #ffffff;   /* fond */
  --rxw-bg-soft:        #f8fafc;   /* fond légèrement teinté */

  /* Typographie */
  --rxw-font-body:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rxw-font-heading:   var(--rxw-font-body);
  --rxw-font-mono:      "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Géométrie */
  --rxw-max-width:      48rem;     /* largeur de lecture confortable */
  --rxw-radius:         0.375rem;
  --rxw-shadow:         0 1px 3px rgba(15, 23, 42, 0.05);
}

/* ---------- Reset léger ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

/* ---------- Base ---------- */

body {
  font-family: var(--rxw-font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--rxw-text);
  background: var(--rxw-bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: var(--rxw-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- En-tête ---------- */

.site-header {
  background: var(--rxw-bg);
  border-bottom: 1px solid var(--rxw-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--rxw-text);
}

.brand-logo { width: 2rem; height: 2rem; }
.brand-name {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Navigation ---------- */

.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-list a {
  text-decoration: none;
  color: var(--rxw-text-muted);
  font-weight: 500;
  padding: 0.375rem 0;
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}

.nav-list a:hover {
  color: var(--rxw-primary);
}

.nav-list a[aria-current="page"] {
  color: var(--rxw-primary-dark);
  border-bottom-color: var(--rxw-primary);
}

/* ---------- Contenu principal ---------- */

.page {
  padding: 3rem 1.25rem 4rem;
}

.page-title {
  font-family: var(--rxw-font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--rxw-text);
  margin: 0 0 0.5rem;
}

.page-subtitle {
  font-size: 1.125rem;
  color: var(--rxw-text-muted);
  margin: 0 0 2.5rem;
}

/* ---------- Typographie du contenu ---------- */

.content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.75rem 0 1rem;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--rxw-border);
}

.content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: var(--rxw-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.875rem;
}

.content p { margin: 0 0 1rem; }

.content a {
  color: var(--rxw-primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.content a:hover { color: var(--rxw-primary); }

.content ul, .content ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.content li { margin-bottom: 0.375rem; }

.content blockquote {
  margin: 1.25rem 0;
  padding: 0.875rem 1.25rem;
  border-left: 4px solid var(--rxw-primary);
  background: var(--rxw-primary-light);
  color: var(--rxw-text);
  border-radius: 0 var(--rxw-radius) var(--rxw-radius) 0;
}

.content blockquote p:last-child { margin-bottom: 0; }

.content code {
  font-family: var(--rxw-font-mono);
  font-size: 0.9em;
  background: var(--rxw-bg-soft);
  border: 1px solid var(--rxw-border);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
}

.content pre {
  background: var(--rxw-bg-soft);
  border: 1px solid var(--rxw-border);
  border-radius: var(--rxw-radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.9em;
}

.content pre code { background: transparent; border: 0; padding: 0; }

.content hr {
  border: 0;
  border-top: 1px solid var(--rxw-border);
  margin: 2.5rem 0;
}

/* ---------- Tableaux ---------- */

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9375rem;
  box-shadow: var(--rxw-shadow);
}

.content th, .content td {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--rxw-border);
  text-align: left;
  vertical-align: top;
}

.content thead th {
  background: var(--rxw-primary-light);
  color: var(--rxw-text);
  font-weight: 600;
  border-bottom: 2px solid var(--rxw-primary);
}

.content tbody tr:nth-child(even) { background: var(--rxw-bg-soft); }

/* ---------- Cartes & callouts ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  list-style: none;
  padding: 0;
}

.card {
  padding: 1.25rem;
  border: 1px solid var(--rxw-border);
  border-radius: var(--rxw-radius);
  background: var(--rxw-bg);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.card:hover {
  border-color: var(--rxw-primary);
  box-shadow: var(--rxw-shadow);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.card p {
  color: var(--rxw-text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

/* ---------- Métadonnées de document ---------- */

.doc-meta {
  margin-top: 3rem;
  padding: 1rem 1.25rem;
  background: var(--rxw-bg-soft);
  border: 1px solid var(--rxw-border);
  border-radius: var(--rxw-radius);
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.875rem;
  color: var(--rxw-text-muted);
}

.doc-meta strong { color: var(--rxw-text); }

/* ---------- Pied de page ---------- */

.site-footer {
  margin-top: 5rem;
  padding: 2.5rem 0 0;
  border-top: 1px solid var(--rxw-border);
  background: var(--rxw-bg-soft);
  color: var(--rxw-text-muted);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-col-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rxw-text);
  margin: 0 0 0.875rem;
}

.footer-col-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col-links li {
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.footer-col-links a {
  color: var(--rxw-text-muted);
  text-decoration: none;
  transition: color 120ms ease;
}

.footer-col-links a:hover {
  color: var(--rxw-primary-dark);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid var(--rxw-border);
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  font-size: 0.8125rem;
}

.copyright { margin: 0; }

.footer-bottom-links { margin: 0; }

.footer-bottom-label {
  font-weight: 500;
  color: var(--rxw-text);
  margin-right: 0.375rem;
}

.footer-bottom-links a {
  color: var(--rxw-text-muted);
  text-decoration: none;
}

.footer-bottom-links a:hover {
  color: var(--rxw-primary-dark);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .page-title { font-size: 1.75rem; }
  .nav-list { gap: 1rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ---------- Impression ---------- */

@media print {
  .site-header, .site-footer { display: none; }
  body { font-size: 11pt; }
  .page { padding: 0; }
  a { color: inherit; text-decoration: none; }
  .content h2, .content h3 { page-break-after: avoid; }
  .content table, .content blockquote { page-break-inside: avoid; }
}

/* ---------- Homepage hero ---------- */

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--rxw-text-muted);
  max-width: 32rem;
  margin: 0 auto 2rem;
  line-height: 1.55;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 1.5rem;
  background: var(--rxw-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--rxw-radius);
  transition: background 120ms ease;
}

.hero-cta:hover { background: var(--rxw-primary-dark); }

.hero-cta-secondary {
  margin-left: 0.75rem;
  color: var(--rxw-primary-dark);
  text-decoration: none;
  font-weight: 500;
}

.hero-cta-secondary:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.875rem; }
  .hero-cta-secondary { display: block; margin: 1rem 0 0; }
}
