/* ==========================================================================
   Yaoundé Sept Collines — design tokens
   Palette inspired by toghu ceremonial cloth, now carrying the tricolore
   of the flag through it: forest green, camwood/flag red, sun yellow.
   ========================================================================== */

:root {
  --ink: #14110e;
  --ink-soft: #1e1a15;
  --ivory: #f6efdd;
  --ivory-soft: #efe4c8;
  --gold: #d8a83b;
  --gold-bright: #f0c968;
  --camwood: #a3242b;
  --camwood-bright: #c73b3f;
  --palm: #3c5a40;
  --palm-bright: #517a56;
  --ink-text: #241f18;

  /* Flag tricolore — used as fixed, theme-independent identity colors
     (the brand mark, the zigzag trim, the stat-stripe rhythm) so the
     national palette reads the same whether the page is light or dark. */
  --flag-green: #007a3d;
  --flag-green-bright: #16a34a;
  --flag-red: #ce1126;
  --flag-yellow: #fcd116;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Work Sans", "Segoe UI", sans-serif;

  --radius: 4px;
  --zig-size: 16px;

  --bg: var(--ink);
  --surface: var(--ink-soft);
  --text: var(--ivory);
  --text-dim: #cbbfa0;
  --accent: var(--flag-yellow);
  --accent-2: var(--flag-red);
  --accent-3: var(--flag-green-bright);
  --border-color: #3a3225;
}

[data-theme="light"] {
  --bg: var(--ivory);
  --surface: #fffaee;
  --text: var(--ink-text);
  --text-dim: #6b5f47;
  --accent: var(--flag-red);
  --accent-2: var(--flag-green);
  --accent-3: #b8860b;
  --border-color: #e3d6ae;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  transition: background .25s ease, color .25s ease;
  line-height: 1.5;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .01em;
  margin: 0 0 .4em;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Signature: toghu trim, rewoven in the tricolore ---------- */
.zigzag {
  height: var(--zig-size);
  width: 100%;
  background-image: repeating-linear-gradient(
    45deg,
    var(--flag-green) 0,
    var(--flag-green) var(--zig-size),
    var(--flag-yellow) var(--zig-size),
    var(--flag-yellow) calc(var(--zig-size) * 2),
    var(--flag-red) calc(var(--zig-size) * 2),
    var(--flag-red) calc(var(--zig-size) * 3)
  );
}

/* ---------- Header / nav ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border-color);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.brand .mark {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--flag-yellow);
  background: conic-gradient(
    var(--flag-green) 0deg 120deg,
    var(--flag-red) 120deg 240deg,
    var(--flag-yellow) 240deg 360deg
  );
  box-shadow: inset 0 0 0 4px var(--ink);
}

nav.main-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

nav.main-nav a {
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .02em;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
}
nav.main-nav a:hover, nav.main-nav a.active { color: var(--accent); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: .8rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.badge-dot {
  position: absolute; top: -5px; right: -5px;
  min-width: 16px; height: 16px; padding: 0 3px;
  border-radius: 999px; background: var(--camwood-bright); color: #fff;
  font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center;
  display: none; align-items: center; justify-content: center;
  border: 1px solid var(--bg);
}

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .92rem;
  padding: 10px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: .01em;
}
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--gold-bright); }
.btn-outline { background: transparent; border: 1.5px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--ink); }
.btn-ghost { background: none; border: none; color: var(--text-dim); text-decoration: underline; cursor: pointer; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 0 70px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 82% -12%, rgba(252,209,22,.16), transparent 50%),
    radial-gradient(ellipse at -5% 60%, rgba(0,122,61,.14), transparent 55%),
    var(--bg);
}
.hero .eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .15em;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 14ch;
  line-height: 1.05;
}
.hero p.lead {
  max-width: 46ch;
  color: var(--text-dim);
  font-size: 1.08rem;
  margin: 18px 0 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head .kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 700; }
.section-head h2 { font-size: 1.9rem; margin-top: 6px; }
.section-head p { color: var(--text-dim); max-width: 52ch; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card .thumb { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .zigzag { position: absolute; bottom: 0; left: 0; }
.fav-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(20,17,14,.55); border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 1.1rem; cursor: pointer; display: grid; place-items: center;
  line-height: 1;
}
.fav-btn.is-fav { color: var(--camwood-bright); border-color: var(--camwood-bright); }
.card .cat-tag {
  position: absolute; top: 10px; left: 10px;
  background: var(--ink); color: var(--gold-bright);
  font-size: .68rem; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 9px; border-radius: 3px; font-weight: 700;
}
.card .body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 1.15rem; margin: 0; }
.card .place { color: var(--text-dim); font-size: .82rem; }
.card p.desc { color: var(--text-dim); font-size: .9rem; flex: 1; }
.card .card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.pop { color: var(--accent); font-weight: 700; font-size: .85rem; }
.pop::before { content: "★ "; }

/* ---------- Filters ---------- */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  background: var(--surface); border: 1px solid var(--border-color);
  padding: 16px; border-radius: var(--radius); margin-bottom: 30px;
}
.filter-bar input, .filter-bar select {
  background: var(--bg); color: var(--text); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 9px 12px; font-family: var(--font-body); font-size: .9rem;
}
.filter-bar input { flex: 1; min-width: 180px; }

/* ---------- Forms ---------- */
.form-panel {
  max-width: 440px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border-color);
  border-radius: var(--radius); padding: 32px;
}
.form-panel h2 { text-align: center; }
.form-panel .sub { text-align: center; color: var(--text-dim); margin-bottom: 26px; font-size: .9rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border-color); border-radius: var(--radius); font-family: var(--font-body); font-size: .95rem;
}
.form-error { background: rgba(163,36,43,.15); border: 1px solid var(--camwood-bright); color: var(--camwood-bright); padding: 10px 14px; border-radius: var(--radius); font-size: .87rem; margin-bottom: 16px; display: none; }
.form-msg-ok { background: rgba(60,90,64,.2); border: 1px solid var(--palm-bright); color: var(--palm-bright); padding: 10px 14px; border-radius: var(--radius); font-size: .87rem; margin-bottom: 16px; display: none; }

/* ---------- Map ---------- */
#map, .map-box { height: 380px; border-radius: var(--radius); border: 1px solid var(--border-color); }

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0 30px;
  color: var(--text-dim);
  font-size: .87rem;
}
footer.site-footer .foot-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---------- Utility ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.tag { display: inline-block; background: var(--surface); border: 1px solid var(--border-color); color: var(--text-dim); padding: 3px 10px; border-radius: 20px; font-size: .78rem; margin-right: 6px; }
.badge-required { font-size: .78rem; color: var(--text-dim); }
.stars { color: var(--gold-bright); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius); max-width: 380px; width: 100%; padding: 28px; text-align: center; }

/* ---------- Chat ---------- */
.chat-box {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 560px;
  max-height: 70vh;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-msg {
  max-width: 78%;
  background: var(--bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 8px 12px;
  align-self: flex-start;
}
.chat-msg.mine {
  align-self: flex-end;
  background: rgba(216, 168, 59, .14);
  border-color: var(--accent);
}
.chat-msg-head { display: flex; justify-content: space-between; gap: 12px; font-size: .72rem; color: var(--text-dim); margin-bottom: 4px; }
.chat-msg-name { font-weight: 700; color: var(--accent); }
.chat-msg-text { font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.chat-input-row { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border-color); }
.chat-input-row input {
  flex: 1; padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border-color); border-radius: var(--radius); font-family: var(--font-body); font-size: .92rem;
}

/* ---------- Stats ---------- */

/* Thin tricolore bar — used once, at the top of the stats page, like the
   header band on a printed report. Not repeated elsewhere on the page. */
.flag-bar {
  height: 6px;
  width: 100%;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  margin-bottom: 28px;
}
.flag-bar span { flex: 1; }
.flag-bar span:nth-child(1) { background: var(--flag-green); }
.flag-bar span:nth-child(2) { background: var(--flag-yellow); }
.flag-bar span:nth-child(3) { background: var(--flag-red); }

/* Live-activity indicator */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .78rem; color: var(--text-dim); font-weight: 600;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--flag-green-bright);
  box-shadow: 0 0 0 0 rgba(22,163,74,.6);
  animation: live-pulse 2s infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}

/* Headline user count — the one bold moment on this page: a faint
   five-point star watermark (the flag's étoile unitaire) behind the
   biggest figure on the site. */
.stat-hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 30px 26px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}
.stat-hero::before {
  content: "";
  position: absolute;
  top: 50%; right: 4%;
  width: 220px; height: 220px;
  transform: translateY(-50%);
  background-color: var(--flag-yellow);
  opacity: .08;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51 48"><path d="M25.5 0 31 18h19l-15 11 6 19-15.5-11L10 48l6-19L1 18h19z"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 51 48"><path d="M25.5 0 31 18h19l-15 11 6 19-15.5-11L10 48l6-19L1 18h19z"/></svg>') center / contain no-repeat;
}
.stat-hero-figure { position: relative; z-index: 1; }
.stat-hero-figure .stat-value { font-size: 3.2rem; line-height: 1; }
.stat-hero-figure .stat-label { margin-top: 6px; }
.stat-hero-rest { position: relative; z-index: 1; display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 34px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: 20px; text-align: center;
  border-top: 3px solid var(--flag-yellow);
}
/* Cycle the tricolore across the card grid so the rhythm of the flag
   carries through the data, three cards at a time. */
.stat-grid .stat-card:nth-child(3n+1) { border-top-color: var(--flag-green); }
.stat-grid .stat-card:nth-child(3n+2) { border-top-color: var(--flag-yellow); }
.stat-grid .stat-card:nth-child(3n)   { border-top-color: var(--flag-red); }

.stat-value { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: .8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

.stat-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.stat-panel {
  background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius); padding: 22px;
}
.stat-panel h3 { font-size: 1rem; margin-bottom: 16px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 34px; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-label { font-size: .8rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--bg); border: 1px solid var(--border-color); border-radius: 20px; height: 10px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--flag-green), var(--flag-yellow), var(--flag-red)); border-radius: 20px; }
.bar-value { font-size: .78rem; color: var(--text-dim); text-align: right; }

/* ---------- Leaderboard ---------- */
.leader-list { display: flex; flex-direction: column; gap: 10px; }
.leader-row {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border-color); border-radius: var(--radius);
  padding: 14px 18px;
}
.leader-row:first-child .leader-rank { color: var(--gold-bright); }
.leader-rank { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--accent); text-align: center; }
.leader-name { font-weight: 600; }
.leader-detail { font-size: .8rem; color: var(--text-dim); margin-top: 2px; }
.leader-score { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--accent); white-space: nowrap; }

@media (max-width: 720px) {
  nav.main-nav { order: 3; width: 100%; justify-content: center; }
  .nav-row { flex-wrap: wrap; }
}

[data-i18n], [data-i18n-ph] { }
