/* ============================================================
   Ruach Hub — assets/css/theme.css
   Styles structurels du thème : reset léger, typographie de
   base, header/footer PHP natifs, boutons, cartes, hero, et
   composants UI repris fidèlement du design system Ruach Hub.
   ------------------------------------------------------------
   Charger APRÈS tokens.css. Ces styles habillent le HTML PHP
   (header.php, footer.php, templates) — ils n'interfèrent pas
   avec le contenu construit dans Elementor (voir
   elementor-overrides.css pour les ajustements côté éditeur).
   ============================================================ */

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Typographie sémantique ---------- */
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; color: var(--fg-1); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h1); line-height: 1.04; letter-spacing: -.025em; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h2); line-height: 1.1; letter-spacing: -.02em; }
h3 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-h3); line-height: 1.2; letter-spacing: -.01em; }
h4 { font-family: var(--font-body); font-weight: 600; font-size: var(--text-h4); line-height: 1.3; }
p  { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--font-mono); font-size: var(--text-sm); }

/* ---------- Layout ---------- */
.rh-container { max-width: var(--maxw); margin: 0 auto; padding: 0 32px; }
.rh-content { padding: 64px 0 96px; }
.rh-content-narrow { max-width: 760px; margin: 0 auto; }

/* ---------- Accessibilité ---------- */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius-md);
}
.skip-link:focus { left: 8px; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

/* ---------- Eyebrow / étiquette ---------- */
.rh-eyebrow {
  font-family: var(--font-mono); font-weight: 500; font-size: var(--text-xs);
  letter-spacing: .14em; text-transform: uppercase; color: var(--ruach-700);
  display: inline-flex; align-items: center; gap: 9px;
}
.rh-eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--ruach-500); }

/* ---------- Boutons ---------- */
.rh-btn {
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  border-radius: var(--radius-md); padding: 12px 22px; border: 1px solid transparent;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; line-height: 1;
  white-space: nowrap; transition: all .18s cubic-bezier(.2,0,0,1);
}
.rh-btn-primary { background: var(--ruach-500); color: #fff; }
.rh-btn-primary:hover { background: var(--ruach-600); }
.rh-btn-primary:active { background: var(--ruach-700); transform: scale(.98); }
.rh-btn-secondary { background: var(--surface); color: var(--fg-1); border-color: var(--line-strong); }
.rh-btn-secondary:hover { background: var(--surface-sunk); }
.rh-btn-ghost { background: transparent; color: var(--ruach-700); padding-left: 6px; padding-right: 6px; }
.rh-btn-ghost:hover { opacity: .7; }
.rh-btn-lg { padding: 15px 28px; font-size: 16px; }

/* ---------- Header (fallback PHP) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  background: rgba(251,251,250,.82); border-bottom: 1px solid var(--line);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.site-header .site-brand img { height: 30px; }
.site-header .site-brand .site-title-text {
  font-family: var(--font-display); font-weight: 600; font-size: 21px; letter-spacing: -.5px; color: var(--fg-1);
}
.main-nav { display: flex; align-items: center; gap: 30px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 30px; }
.main-nav a { font-size: 14.5px; font-weight: 500; color: var(--fg-2); transition: color .15s; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--fg-1); }
.header-cta { display: flex; align-items: center; gap: 14px; }

/* Menu burger (mobile) */
.menu-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-md); background: var(--surface); cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--fg-1); position: relative; transition: .2s;
}
.menu-toggle span::before { position: absolute; top: -6px; }
.menu-toggle span::after { position: absolute; top: 6px; }

/* ---------- Footer (fallback PHP) ---------- */
.site-footer { padding: 72px 0 40px; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.site-footer .foot-brand img { height: 30px; margin-bottom: 16px; }
.site-footer .foot-brand p { font-size: 14.5px; line-height: 1.6; color: var(--fg-2); max-width: 30ch; margin: 0; }
.site-footer .foot-col h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 16px; font-weight: 500; }
.site-footer .foot-col ul { list-style: none; margin: 0; padding: 0; }
.site-footer .foot-col a { display: block; font-size: 14.5px; color: var(--fg-2); margin-bottom: 11px; transition: color .15s; }
.site-footer .foot-col a:hover { color: var(--fg-1); }
.site-footer .foot-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-3); }

/* ---------- Cartes (articles / archives) ---------- */
.rh-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; box-shadow: var(--shadow-xs); transition: all .2s cubic-bezier(.2,0,0,1);
}
.rh-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
.rh-card .entry-title { font-size: var(--text-h3); margin: 0 0 8px; }
.rh-card .entry-meta { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); margin-bottom: 14px; }
.rh-card .entry-excerpt { font-size: 14.5px; line-height: 1.55; color: var(--fg-2); }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 8px; }

/* ---------- Article (single) ---------- */
.entry-header { max-width: 760px; margin: 0 auto 36px; }
.entry-header .entry-title { font-family: var(--font-display); font-weight: 600; font-size: var(--text-h1); line-height: 1.04; letter-spacing: -.025em; }
.entry-header .entry-meta { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); margin-top: 12px; }
.entry-content { max-width: 760px; margin: 0 auto; font-size: 17px; line-height: 1.7; color: var(--fg-1); }
.entry-content a { color: var(--ruach-700); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote {
  border-left: 3px solid var(--ruach-500); margin: 28px 0; padding: 4px 0 4px 22px;
  font-family: var(--font-display); font-size: 22px; color: var(--fg-1);
}

/* ---------- Page header ---------- */
.page-hero { padding: 80px 0 40px; }
.page-hero .rh-eyebrow { margin-bottom: 16px; }
.page-hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px,6vw,68px); line-height: 1; letter-spacing: -.03em; }

/* ---------- Sidebar / widgets ---------- */
.rh-sidebar { padding-left: 8px; }
.rh-sidebar .widget { margin-bottom: 34px; }
.rh-sidebar .widget-title { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 14px; }
.rh-sidebar ul { list-style: none; margin: 0; padding: 0; }
.rh-sidebar li { margin-bottom: 10px; font-size: 14.5px; color: var(--fg-2); }
.rh-sidebar a:hover { color: var(--ruach-700); }
.has-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 56px; }

/* ---------- Pagination ---------- */
.rh-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 48px; }
.rh-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px;
  padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--surface); color: var(--fg-1); font-size: 14px; font-weight: 500;
}
.rh-pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.rh-pagination a.page-numbers:hover { background: var(--surface-sunk); }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 120px 0; }
.error-404 .code { font-family: var(--font-mono); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ruach-700); }
.error-404 h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px,7vw,80px); line-height: 1; letter-spacing: -.03em; margin: 16px 0; }
.error-404 p { font-size: 18px; color: var(--fg-2); max-width: 46ch; margin: 0 auto 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .site-footer .foot-grid { grid-template-columns: 1fr 1fr; }
  .has-sidebar { grid-template-columns: 1fr; }
  .main-nav, .header-cta .rh-btn-ghost { display: none; }
  .menu-toggle { display: inline-flex; }
  .main-nav.is-open { display: block; position: absolute; top: 72px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 16px 32px; }
  .main-nav.is-open ul { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 600px) {
  .posts-grid { grid-template-columns: 1fr; }
  .site-footer .foot-grid { grid-template-columns: 1fr; }
  .rh-container { padding: 0 20px; }
}
