/* /forum/ — premium community hub. Scoped to .fh (the page <main>); keeps the class hooks
   rendered by assets/js/forum-home.js (.forum-category-card, .forum-topic-row, ...). Same
   palette and motion language as the account modal and /mon-compte/. */

.fh {
  --fh-brand: var(--site-brand-electric, #286153);
  --fh-brand-deep: var(--site-brand-electric-deep, #1d4c41);
  --fh-gold: var(--site-category-pink, #c6ae78);
  --fh-gold-deep: var(--site-category-pink-deep, #725b2f);
  --fh-mint: var(--site-category-indigo, #6c9b82);
  --fh-bg: var(--site-background-primary, #f7f8f4);
  --fh-bg-2: var(--site-background-secondary, #eef3eb);
  --fh-surface: #fff;
  --fh-border: var(--site-surface-border, #dce6dd);
  --fh-text: var(--site-text-primary, #1c302a);
  --fh-text-2: var(--site-text-secondary, #42584e);
  --fh-muted: var(--site-text-muted, #5b7065);
  --fh-spring: cubic-bezier(.2, .95, .25, 1.15);
  --fh-ease: cubic-bezier(.65, 0, .25, 1);
  --fh-heading: "Lexend", "Source Sans 3", system-ui, sans-serif;
  --fh-radius: 24px;
  color: var(--fh-text);
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.fh *, .fh *::before, .fh *::after { box-sizing: border-box; }
.fh .forum-shell { position: relative; }
.fh .forum-shell::before {
  content: "";
  position: absolute;
  inset: -40px 0 auto;
  z-index: -1;
  height: 620px;
  pointer-events: none;
  background:
    radial-gradient(700px 360px at 85% 10%, rgba(198, 174, 120, .2), transparent 70%),
    radial-gradient(600px 400px at 5% 20%, rgba(40, 97, 83, .1), transparent 70%);
}
.fh :focus-visible { outline: 2px solid var(--fh-gold); outline-offset: 3px; }

/* ---------- Hero ---------- */
.fh-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 40px;
  margin-top: 22px;
  padding: 56px 56px 48px;
  border-radius: 32px;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 120% at 95% 0%, rgba(198, 174, 120, .4) 0%, transparent 52%),
    linear-gradient(140deg, #2f7262 0%, var(--fh-brand) 42%, var(--fh-brand-deep) 100%);
  box-shadow: 0 40px 80px -46px rgba(16, 45, 37, .9);
}
.fh-blob { position: absolute; z-index: -1; border-radius: 50%; filter: blur(48px); opacity: .55; pointer-events: none; will-change: transform; }
.fh-blob--1 { width: 420px; height: 420px; top: -200px; left: 18%; background: #3f8a74; animation: fh-drift-a 18s ease-in-out infinite alternate; }
.fh-blob--2 { width: 340px; height: 340px; bottom: -190px; right: 10%; background: rgba(198, 174, 120, .8); animation: fh-drift-b 22s ease-in-out infinite alternate; }
.fh-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .9) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(100deg, transparent 10%, #000 70%);
  -webkit-mask-image: linear-gradient(100deg, transparent 10%, #000 70%);
}
.fh-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.fh-kicker i {
  position: relative;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  border-radius: 50%;
  background: #7fd1a8;
  animation: fh-pulse 2.4s ease-out infinite;
}
.fh .fh-hero h1 {
  margin: 0;
  color: #fff;
  font-family: var(--fh-heading);
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.03em;
}
.fh-hero h1 em { font-style: normal; color: #f0dfb4; }
.fh-intro { max-width: 52ch; margin: 18px 0 26px; color: rgba(255, 255, 255, .88); font-size: 1.08rem; line-height: 1.6; }
.fh-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.fh-stats { display: flex; flex-wrap: wrap; gap: 12px 30px; margin: 30px 0 0; padding: 22px 0 0; border-top: 1px solid rgba(255, 255, 255, .18); list-style: none; }
.fh-stats li { display: grid; gap: 2px; }
.fh-stats strong { font-family: var(--fh-heading); font-size: 1.9rem; line-height: 1; font-variant-numeric: tabular-nums; }
.fh-stats span { color: rgba(255, 255, 255, .78); font-size: .9rem; font-weight: 600; }

/* Animated conversation illustration */
.fh-chat { position: relative; height: 340px; }
.fh-bubble {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(340px, 92%);
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .95);
  color: var(--fh-text);
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, .55);
  animation: fh-bubble-in 800ms var(--fh-spring) both, fh-float 7s ease-in-out infinite;
}
.fh-bubble:nth-child(1) { top: 0; left: 0; animation-delay: 200ms, 1s; }
.fh-bubble:nth-child(2) { top: 112px; right: 0; animation-delay: 650ms, 1.6s; border-bottom-right-radius: 6px; }
.fh-bubble:nth-child(3) { top: 238px; left: 8%; width: auto; animation-delay: 1100ms, 2.2s; }
.fh-bubble--gold { background: linear-gradient(135deg, #f6ecd2, #ead9ad); }
.fh-av {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: var(--fh-brand);
  color: #fff;
  font-family: var(--fh-heading);
  font-size: .9rem;
  font-weight: 700;
}
.fh-av--gold { background: var(--fh-gold-deep); }
.fh-bubble b { display: block; font-size: .82rem; color: var(--fh-muted); font-weight: 700; }
.fh-bubble p { margin: 2px 0 0; font-size: .95rem; font-weight: 600; line-height: 1.4; }
.fh-typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.fh-typing span { width: 8px; height: 8px; border-radius: 50%; background: var(--fh-brand); animation: fh-typing 1.2s ease-in-out infinite; }
.fh-typing span:nth-child(2) { animation-delay: .15s; }
.fh-typing span:nth-child(3) { animation-delay: .3s; }
.fh-chip {
  position: absolute;
  right: 6%;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3);
  font-size: .85rem;
  font-weight: 800;
  animation: fh-bubble-in 800ms var(--fh-spring) 1500ms both;
}

/* ---------- Buttons ---------- */
.fh-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 24px;
  border: 0;
  border-radius: 15px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  transition: transform 220ms var(--fh-spring), box-shadow 220ms ease, background-color 200ms ease;
}
.fh-btn svg { width: 18px; height: 18px; transition: transform 260ms var(--fh-spring); }
.fh-btn:hover { transform: translateY(-2px); }
.fh-btn:hover svg { transform: translateX(3px); }
.fh-btn:active { transform: translateY(0) scale(.98); }
.fh-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 700ms var(--fh-ease);
}
.fh-btn:hover::before { transform: translateX(120%); }
.fh .fh-btn--light { background: #fff; color: var(--fh-brand-deep); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .6); }
.fh .fh-btn--glass { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55); }
.fh .fh-btn--glass:hover { background: rgba(255, 255, 255, .22); }
.fh .fh-btn--primary,
.fh .forum-btn--primary { background: linear-gradient(135deg, var(--fh-brand), var(--fh-brand-deep)); color: #fff; box-shadow: 0 14px 28px -16px rgba(29, 76, 65, .85); }
.fh .forum-btn--secondary { background: var(--fh-surface); color: var(--fh-brand-deep); box-shadow: inset 0 0 0 1.5px var(--fh-border); }
.fh .forum-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 220ms var(--fh-spring), box-shadow 220ms ease;
}
.fh .forum-btn:hover { transform: translateY(-2px); }
.fh .forum-btn svg { width: 18px; height: 18px; }

/* ---------- Sections ---------- */
.fh .forum-section { margin-top: 64px; }
.fh .forum-section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.fh-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--fh-brand); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.fh-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--fh-gold), var(--fh-brand)); }
.fh .forum-section__title { margin: 0; font-family: var(--fh-heading); font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -.02em; }
.fh-section-lead { margin: 6px 0 0; color: var(--fh-text-2); max-width: 60ch; }

/* ---------- Category cards ---------- */
.fh .forum-categories-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.fh .forum-category-card {
  --accent: var(--fh-brand);
  --accent-soft: rgba(40, 97, 83, .1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 210px;
  padding: 26px 26px 22px;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius);
  background: var(--fh-surface);
  color: var(--fh-text);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 20px 40px -38px rgba(16, 45, 37, .6);
  transition: transform 340ms var(--fh-spring), box-shadow 340ms ease, border-color 240ms ease;
}
.fh .forum-category-card:nth-child(6n+2) { --accent: #8a6d2f; --accent-soft: rgba(198, 174, 120, .2); }
.fh .forum-category-card:nth-child(6n+3) { --accent: #2f6f8a; --accent-soft: rgba(47, 111, 138, .11); }
.fh .forum-category-card:nth-child(6n+4) { --accent: #4f7a3a; --accent-soft: rgba(108, 155, 130, .18); }
.fh .forum-category-card:nth-child(6n+5) { --accent: #9a4a3c; --accent-soft: rgba(154, 74, 60, .1); }
.fh .forum-category-card:nth-child(6n+6) { --accent: #285f4e; --accent-soft: rgba(40, 95, 78, .12); }
.fh .forum-category-card::before {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  z-index: -1;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  transition: transform 700ms var(--fh-ease);
}
.fh .forum-category-card::after {
  content: "→";
  position: absolute;
  right: 22px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fh-bg-2);
  color: var(--accent);
  font-weight: 800;
  transition: transform 340ms var(--fh-spring), background-color 240ms ease, color 240ms ease;
}
.fh .forum-category-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 35%, var(--fh-border)); box-shadow: 0 34px 50px -36px rgba(16, 45, 37, .7); }
.fh .forum-category-card:hover::before { transform: scale(1.9); }
.fh .forum-category-card:hover::after { transform: translateX(4px) rotate(-12deg); background: var(--accent); color: #fff; }
.fh .forum-category-card__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  transition: transform 420ms var(--fh-spring);
}
.fh .forum-category-card__icon svg { width: 28px; height: 28px; }
.fh .forum-category-card:hover .forum-category-card__icon { transform: rotate(-8deg) scale(1.08); }
.fh .forum-category-card__title { margin: 6px 0 0; font-family: var(--fh-heading); font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; color: var(--fh-text); }
.fh .forum-category-card__desc { margin: 0; padding-right: 40px; color: var(--fh-text-2); font-size: .96rem; line-height: 1.5; }
.fh .forum-category-card__meta { display: flex; gap: 14px; margin-top: auto; padding-top: 8px; color: var(--fh-muted); font-size: .86rem; font-weight: 700; }
.fh .forum-category-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.fh .forum-category-card__meta svg { width: 15px; height: 15px; }

/* ---------- Recent discussions ---------- */
.fh-recent-wrap {
  padding: 10px;
  border: 1px solid var(--fh-border);
  border-radius: 28px;
  background: var(--fh-surface);
  box-shadow: 0 24px 50px -44px rgba(16, 45, 37, .6);
}
.fh .forum-topic-list { display: grid; gap: 6px; }
.fh .forum-topic-row {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "av top" "av title" "av meta";
  column-gap: 16px;
  row-gap: 4px;
  padding: 18px 20px;
  border-radius: 20px;
  color: var(--fh-text);
  text-decoration: none;
  transition: background-color 220ms ease, transform 300ms var(--fh-spring);
}
.fh .forum-topic-row::before {
  content: attr(data-initial);
  grid-area: av;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--fh-brand), var(--fh-brand-deep));
  color: #fff;
  font-family: var(--fh-heading);
  font-weight: 700;
}
.fh .forum-topic-row:nth-child(even)::before { background: linear-gradient(135deg, #b89a5a, var(--fh-gold-deep)); }
.fh .forum-topic-row:hover { background: var(--fh-bg); transform: translateX(4px); }
.fh .forum-topic-row + .forum-topic-row { box-shadow: 0 -1px 0 var(--fh-bg-2); }
.fh .forum-topic-row__top { grid-area: top; display: flex; flex-wrap: wrap; gap: 8px; }
.fh .forum-topic-row__category {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--fh-bg-2);
  color: var(--fh-brand-deep);
  font-size: .78rem;
  font-weight: 800;
}
.fh .forum-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: rgba(198, 174, 120, .22); color: var(--fh-gold-deep); font-size: .78rem; font-weight: 800; }
.fh .forum-pill svg { width: 13px; height: 13px; }
.fh .forum-topic-row__title { grid-area: title; margin: 0; font-family: var(--fh-heading); font-size: 1.08rem; font-weight: 700; line-height: 1.35; }
.fh .forum-topic-row__meta { grid-area: meta; display: flex; flex-wrap: wrap; gap: 16px; color: var(--fh-muted); font-size: .88rem; font-weight: 600; }
.fh .forum-topic-row__meta span { display: inline-flex; align-items: center; gap: 5px; }
.fh .forum-topic-row__meta svg { width: 15px; height: 15px; }

.fh .forum-loading { display: grid; gap: 8px; padding: 8px; }
.fh .forum-skeleton-row {
  height: 84px;
  border-radius: 18px;
  background: linear-gradient(100deg, var(--fh-bg-2) 30%, #f8faf6 50%, var(--fh-bg-2) 70%) 0 0 / 300% 100%;
  animation: fh-shimmer 1.4s linear infinite;
}

.fh .forum-empty,
.fh .forum-error,
.fh .forum-auth-gate {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 24px;
  text-align: center;
}
.fh .forum-auth-gate[hidden],
.fh .forum-empty[hidden],
.fh .forum-error[hidden],
.fh .forum-loading[hidden],
.fh .forum-topic-list[hidden] { display: none; }
.fh-lock {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin-bottom: 6px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--fh-brand), var(--fh-brand-deep));
  color: #fff;
  box-shadow: 0 20px 34px -20px rgba(29, 76, 65, .9);
  animation: fh-float 5s ease-in-out infinite;
}
.fh-lock svg { width: 34px; height: 34px; }
.fh .forum-auth-gate__title,
.fh .forum-empty__title { margin: 0; font-family: var(--fh-heading); font-size: 1.35rem; font-weight: 700; color: var(--fh-text); }
.fh .forum-auth-gate__text,
.fh .forum-empty__text,
.fh .forum-error__text { max-width: 54ch; margin: 0; color: var(--fh-text-2); }
.fh .forum-auth-gate__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }

/* ---------- How it works ---------- */
.fh-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0; padding: 0; list-style: none; counter-reset: fh-step; }
.fh-step {
  position: relative;
  padding: 26px;
  border: 1px solid var(--fh-border);
  border-radius: var(--fh-radius);
  background: linear-gradient(180deg, #fff, #fbfcf9);
  counter-increment: fh-step;
}
.fh-step::before {
  content: counter(fh-step, decimal-leading-zero);
  display: block;
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--fh-brand), var(--fh-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--fh-heading);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
}
.fh-step h3 { margin: 0 0 6px; font-family: var(--fh-heading); font-size: 1.12rem; font-weight: 700; }
.fh-step p { margin: 0; color: var(--fh-text-2); line-height: 1.5; }
.fh-step a { color: var(--fh-brand); font-weight: 700; }

/* ---------- Final CTA band ---------- */
.fh .forum-cta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 64px 0 56px;
  padding: 40px 44px;
  border-radius: 30px;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(90% 140% at 100% 100%, rgba(198, 174, 120, .45), transparent 55%),
    linear-gradient(120deg, var(--fh-brand-deep), var(--fh-brand));
  box-shadow: 0 34px 60px -40px rgba(16, 45, 37, .9);
}
.fh .forum-cta__title { margin: 0; color: #fff; font-family: var(--fh-heading); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.02em; }
.fh .forum-cta__subtitle { margin: 6px 0 0; color: rgba(255, 255, 255, .86); }
.fh .forum-cta #forum-cta-root { display: grid; gap: 8px; justify-items: end; }
.fh .forum-cta .forum-btn--primary { background: #fff; color: var(--fh-brand-deep); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .6); }

/* ---------- Scroll reveal (only when JS runs: content stays visible otherwise) ---------- */
.fh-js .fh-reveal { transform: translateY(26px); transition: transform 800ms var(--fh-spring); transition-delay: calc(var(--i, 0) * 70ms); }
.fh-js .fh-reveal.is-in { transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .fh-hero { grid-template-columns: 1fr; padding: 44px 36px; }
  .fh-chat { height: 300px; max-width: 520px; }
  .fh .forum-categories-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .fh-hero { margin-top: 14px; padding: 32px 22px 28px; border-radius: 26px; gap: 22px; }
  .fh-chat { display: none; }
  .fh-actions .fh-btn { flex: 1 1 100%; }
  .fh-stats { gap: 12px 22px; }
  .fh-stats strong { font-size: 1.6rem; }
  .fh .forum-section { margin-top: 44px; }
  .fh .forum-categories-grid,
  .fh-steps { grid-template-columns: 1fr; }
  .fh .forum-category-card { min-height: 0; }
  .fh .forum-topic-row { padding: 14px; column-gap: 12px; }
  .fh .forum-topic-row::before { width: 40px; height: 40px; border-radius: 13px; }
  .fh .forum-cta { padding: 30px 22px; border-radius: 26px; }
  .fh .forum-cta #forum-cta-root { justify-items: stretch; width: 100%; }
  .fh .forum-cta .forum-btn { justify-content: center; }
}

/* ---------- Keyframes ---------- */
@keyframes fh-drift-a { to { transform: translate(80px, 50px) scale(1.15); } }
@keyframes fh-drift-b { to { transform: translate(-90px, -30px) scale(.9); } }
@keyframes fh-pulse { 0% { box-shadow: 0 0 0 0 rgba(127, 209, 168, .7); } 70%, 100% { box-shadow: 0 0 0 10px rgba(127, 209, 168, 0); } }
@keyframes fh-bubble-in { from { opacity: 0; transform: translateY(24px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes fh-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes fh-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes fh-shimmer { to { background-position: -300% 0; } }

@media (prefers-reduced-motion: reduce) {
  .fh *, .fh *::before, .fh *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .fh-js .fh-reveal { opacity: 1; transform: none; }
  .fh-blob { display: none; }
}
