/* ============================================================
   Club'In — Centre d'aide (statique, sans dépendance)
   Direction artistique reprise du site Espace Innovation (thème kaneva) :
   palette or + bleus, typographies Raleway (titres) + Cabin (corps).
   ============================================================ */

/* ---- Polices du thème kaneva (servies par le même serveur) ---- */
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 700; font-display: swap; src: url("/themes/custom/kaneva/assets/fonts/Raleway-Bold.ttf"); }
@font-face { font-family: "Raleway"; font-style: normal; font-weight: 800; font-display: swap; src: url("/themes/custom/kaneva/assets/fonts/Raleway-ExtraBold.ttf"); }
@font-face { font-family: "Cabin"; font-style: normal; font-weight: 400; font-display: swap; src: url("/themes/custom/kaneva/assets/fonts/Cabin-Regular.ttf"); }
@font-face { font-family: "Cabin"; font-style: normal; font-weight: 700; font-display: swap; src: url("/themes/custom/kaneva/assets/fonts/Cabin-Bold.ttf"); }

:root {
  --font-sans: "Cabin", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Raleway", "Cabin", sans-serif;

  --radius: 0.75rem;

  /* Charte Espace Innovation */
  --gold: #b49a6c;
  --gold-dark: #84704c;
  --blue-light: #d3dfea;
  --blue-default: #8d9faf;
  --blue-dark: #576c7e;
  --grey-light: #ecf3fa;
  --ink: #43484e;
  --error: #ec5248;
  --success: #8acb88;

  /* Tokens sémantiques */
  --background: #eef4f9;
  --foreground: var(--ink);
  --surface: #ffffff;
  --card: #ffffff;

  --primary: var(--blue-dark);          /* CTA / titres foncés — blanc dessus = ~5:1 */
  --primary-foreground: #ffffff;

  --brand: var(--gold);                 /* accent décoratif or */
  --brand-strong: var(--gold-dark);
  --brand-foreground: var(--ink);       /* texte foncé sur or (boutons larges) */

  --link: var(--blue-dark);             /* ~5:1 sur blanc */
  --highlight: #f4ecdc;                 /* fond « astuce » teinté or */
  --highlight-foreground: var(--gold-dark);

  --muted: #eaf0f6;
  --muted-foreground: #5d7182;          /* ~4.6:1 sur blanc */

  --border: var(--blue-light);

  --shadow-soft: 0 1px 2px rgba(67,72,78,.06), 0 8px 24px rgba(87,108,126,.08);
  --shadow-elevated: 0 4px 12px rgba(67,72,78,.10), 0 24px 48px rgba(87,108,126,.16);
}

* { box-sizing: border-box; }
/* Taille par défaut de toutes les icônes SVG inline (évite les pictos géants) */
svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; vertical-align: middle; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

h1, h2, h3, h4, .font-display { font-family: var(--font-display); font-weight: 800; color: var(--ink); }
h3, h4 { font-weight: 700; }

a { color: inherit; text-decoration: none; }

.container { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 0; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand .ei-logo { height: 26px; width: auto; display: block; }
.brand .brand-sep { width: 1px; height: 26px; background: var(--border); }
@media (max-width: 640px) { .brand .brand-sep, .brand .name + br + .sub { } .brand .ei-logo { height: 22px; } }
.brand .logo {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.25rem; width: 2.25rem; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-foreground);
  box-shadow: var(--shadow-soft);
}
.brand .logo svg { height: 1.1rem; width: 1.1rem; }
.brand .name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.brand .sub {
  font-family: var(--font-display); font-weight: 800;
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-dark);
}
.header-link { color: var(--link); font-size: 0.85rem; font-weight: 700; }
.header-link:hover { text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted-foreground); font-size: 0.85rem; }
.back-link:hover { color: var(--foreground); }

/* ---------- Hero (accueil) ---------- */
.hero { padding: 3.5rem 0 2rem; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem; border-radius: 999px;
  background: rgba(180,154,108,.15); color: var(--gold-dark);
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 1.25rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.15; margin: 0 0 1rem; letter-spacing: -0.01em; }
.hero h1 .accent { color: var(--gold-dark); }
.hero p.lead { max-width: 40rem; margin: 0 auto 2rem; font-size: 1.1rem; color: var(--muted-foreground); }
.hero-search { max-width: 34rem; margin: 0 auto; }

/* ---------- Search input ---------- */
.search { position: relative; display: flex; align-items: center; }
.search > svg { position: absolute; left: 0.85rem; height: 1.05rem; width: 1.05rem; color: var(--muted-foreground); pointer-events: none; }
.search input {
  width: 100%; font-family: inherit; font-size: 0.95rem;
  padding: 0.75rem 2.5rem 0.75rem 2.6rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--foreground);
  box-shadow: var(--shadow-soft);
}
.search input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.search .clear {
  position: absolute; right: 0.6rem; border: none; background: transparent;
  cursor: pointer; color: var(--muted-foreground); border-radius: 0.4rem; padding: 0.25rem; display: inline-flex;
}
.search .clear:hover { background: var(--muted); }

/* ---------- Category grid (accueil) ---------- */
.section-title { font-size: 1.4rem; font-weight: 800; margin: 2.5rem 0 1.25rem; }
.cat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.cat-card {
  display: block; padding: 1.25rem; border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); background: var(--surface);
  box-shadow: var(--shadow-soft); transition: transform .15s, box-shadow .15s;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); }
.cat-card .ico-box {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.5rem; width: 2.5rem; border-radius: var(--radius);
  background: rgba(180,154,108,.16); color: var(--gold-dark); margin-bottom: 0.85rem;
}
.cat-card .ico-box svg { width: 1.35rem; height: 1.35rem; }
.brand .logo svg { width: 1.15rem; height: 1.15rem; }
.cat-card h3 { margin: 0 0 0.3rem; font-size: 1rem; font-weight: 700; }
.cat-card p { margin: 0; font-size: 0.85rem; color: var(--muted-foreground); }
.cat-card .count { display: inline-block; margin-top: 0.75rem; font-size: 0.75rem; font-weight: 700; color: var(--gold-dark); }

/* ---------- Layout sommaire ---------- */
.aide-layout { display: grid; gap: 2rem; padding: 2rem 0 4rem; grid-template-columns: 280px 1fr; align-items: start; }
@media (max-width: 860px) { .aide-layout { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 5rem; }
@media (max-width: 860px) { .sidebar { position: static; } }
.sidebar .search { margin-bottom: 1rem; }
.nav-group { margin-bottom: 1.25rem; }
.nav-group h4 {
  margin: 0 0 0.5rem; font-family: var(--font-display); font-size: 0.68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--gold-dark);
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }
.nav-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.6rem; border-radius: var(--radius);
  font-size: 0.9rem; color: var(--ink); cursor: pointer;
}
.nav-item:hover { background: var(--muted); }
.nav-item.active { background: var(--primary); color: var(--primary-foreground); font-weight: 700; }
.nav-item .chap { font-family: var(--font-display); font-size: 0.68rem; font-weight: 800; color: var(--gold-dark); min-width: 1.4rem; }
.nav-item.active .chap { color: rgba(255,255,255,.8); }
.nav-item .txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .play { height: 0.8rem; width: 0.8rem; color: var(--gold-dark); }
.nav-item.active .play { color: rgba(255,255,255,.85); }
.nav-empty { font-size: 0.8rem; font-style: italic; color: var(--muted-foreground); padding: 0.3rem 0.6rem; }

/* ---------- Article cards ---------- */
.cat-block { margin-bottom: 2.5rem; scroll-margin-top: 6rem; }
.cat-block .head { margin-bottom: 1rem; }
.cat-block .head h2 { margin: 0; font-size: 1.3rem; font-weight: 800; }
.cat-block .head p { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--muted-foreground); }
.article-list { display: grid; gap: 0.75rem; }
.article-card {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1rem 1.15rem; border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px); background: var(--surface);
  box-shadow: var(--shadow-soft); cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s;
}
.article-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-elevated); border-color: var(--gold); }
.article-card .chap-badge { font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; color: var(--gold-dark); min-width: 2rem; }
.article-card .body h3 { margin: 0 0 0.2rem; font-size: 0.98rem; font-weight: 700; }
.article-card .body p { margin: 0; font-size: 0.85rem; color: var(--muted-foreground); }
.article-card .badge-video { display: inline-flex; align-items: center; gap: 0.3rem; margin-top: 0.5rem; font-size: 0.7rem; font-weight: 700; color: var(--gold-dark); }

/* ---------- Article detail ---------- */
.article { max-width: 46rem; margin: 0 auto; padding: 2rem 0 4rem; }
.article-meta {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--gold-dark);
}
.article-meta .pill { padding: 0.25rem 0.7rem; border-radius: 999px; background: rgba(180,154,108,.16); }
.article h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1.15; margin: 0 0 0.75rem; }
.article .summary { font-size: 1.05rem; color: var(--muted-foreground); margin: 0 0 2rem; }
.article-body > * { margin: 0 0 1.15rem; }
.article-body p { font-size: 1rem; }
.article-body a { color: var(--link); text-decoration: underline; }
.article-body h3 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 0.75rem; }
.article-body ul, .article-body ol { padding-left: 1.4rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body ul li::marker { color: var(--gold-dark); }

/* Callouts */
.callout { display: flex; gap: 0.85rem; padding: 1rem 1.1rem; border: 1px solid; border-radius: calc(var(--radius) + 2px); }
.callout svg { height: 1.2rem; width: 1.2rem; flex-shrink: 0; margin-top: 0.15rem; }
.callout .c-body { font-size: 0.92rem; }
.callout .c-title { font-weight: 700; margin-bottom: 0.15rem; }
.callout.info { border-color: var(--blue-light); background: #eef4f9; color: var(--ink); }
.callout.info svg { color: var(--blue-dark); }
.callout.tip { border-color: #e6d3a8; background: var(--highlight); color: var(--ink); }
.callout.tip svg { color: var(--gold-dark); }
.callout.warning { border-color: rgba(236,82,72,.35); background: rgba(236,82,72,.07); color: var(--ink); }
.callout.warning svg { color: var(--error); }

/* Steps */
.steps { display: grid; gap: 0.75rem; }
.step { display: flex; gap: 0.9rem; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: calc(var(--radius) + 2px); background: var(--surface); }
.step .num {
  display: inline-flex; align-items: center; justify-content: center;
  height: 1.7rem; width: 1.7rem; flex-shrink: 0; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground);
  font-family: var(--font-display); font-weight: 800; font-size: 0.85rem;
}
.step .s-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.15rem; }
.step .s-text { font-size: 0.88rem; color: var(--muted-foreground); }

/* Loom embed */
.loom { overflow: hidden; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--surface); box-shadow: var(--shadow-soft); }
.loom .frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--grey-light); }
.loom iframe { position: absolute; inset: 0; height: 100%; width: 100%; border: 0; }
.loom .cap { display: flex; align-items: center; gap: 0.5rem; border-top: 1px solid var(--border); background: var(--grey-light); padding: 0.5rem 0.9rem; font-size: 0.85rem; color: var(--muted-foreground); }
.loom .cap svg { height: 1rem; width: 1rem; color: var(--gold-dark); }
.loom .cap .cap-title { font-weight: 700; color: var(--foreground); }
.loom .cap .cap-tag { margin-left: auto; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }

.quote { border-left: 3px solid var(--gold); padding: 0.5rem 0 0.5rem 1.1rem; font-style: italic; color: var(--muted-foreground); }

/* Prev/next + contact */
.article-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; }
.article-nav a { flex: 1; padding: 0.9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 0.85rem; }
.article-nav a:hover { border-color: var(--gold); }
.article-nav .dir { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); font-weight: 700; }
.article-nav .t { font-weight: 700; }
.article-nav .next { text-align: right; }

.contact-card { margin-top: 3rem; padding: 1.5rem; text-align: center; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: rgba(180,154,108,.08); }
.contact-card h3 { margin: 0 0 0.4rem; }
.contact-card p { margin: 0 0 0.9rem; font-size: 0.9rem; color: var(--muted-foreground); }
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.65rem 1.15rem; border-radius: var(--radius);
  background: var(--primary); color: var(--primary-foreground);
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; cursor: pointer; border: none;
}
.btn:hover { background: #4b5f70; }
.btn svg { height: 1rem; width: 1rem; }
.btn.ghost { background: var(--surface); color: var(--foreground); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 2rem 0; font-size: 0.8rem; color: var(--muted-foreground); text-align: center; }
.site-footer a { color: var(--link); }
.site-footer .foot-sub { margin-top: 0.4rem; font-size: 0.72rem; color: var(--blue-default); }

.hidden { display: none !important; }
