/* =====================================================
   CeT-Trans — Cameroon theme layer (loaded after style.css)
   Colours: the logo's gold + the flag's green, red and yellow.
   Motifs:  Toghu embroidery (Grassfields ceremonial cloth: bright diamond
            and zig-zag stitching on black) and Ndop (indigo-dyed resist cloth
            with geometric grids), drawn as tiny inline SVGs: no image requests.
   ===================================================== */

:root {
  /* Logo gold (sampled from logo.png) */
  --gold:        #c99a1e;
  --gold-lt:     #f2c935;
  --gold-dk:     #a07010;
  --gold-grad:   linear-gradient(135deg, #f2c935 0%, #c99a1e 55%, #a07010 100%);

  /* Flag */
  --cm-green:    #007a5e;
  --cm-green-lt: #00a67d;
  --cm-red:      #ce1126;
  --cm-yellow:   #fcd116;

  /* Surfaces: forest night + warm savannah cream */
  --forest:      #0b1410;
  --forest-2:    #11261d;
  --forest-3:    #173528;
  --cream:       #fbf8f1;
  --cream-2:     #f3eee2;
  --sand:        #e8e0cf;

  /* Remap the old brand tokens */
  --primary:     #0a5a45;
  --primary-lt:  #007a5e;
  --primary-xlt: #00a67d;
  --accent:      #c99a1e;
  --dark:        #11261d;
  --darker:      #0b1410;
  --bg-light:    #fbf8f1;
  --shadow-glow: 0 4px 30px rgba(201,154,30,.22);

  /* Toghu band: diamonds + zig-zag on black velvet */
  --toghu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='14' viewBox='0 0 48 14'%3E%3Crect width='48' height='14' fill='%230b0d0c'/%3E%3Cpath d='M0 2l4 -2 4 2 4-2 4 2 4-2 4 2 4-2 4 2 4-2 4 2 4-2 4 2' fill='none' stroke='%23fcd116' stroke-width='1.2'/%3E%3Cpath d='M0 12l4 2 4-2 4 2 4-2 4 2 4-2 4 2 4-2 4 2 4-2 4 2 4-2' fill='none' stroke='%23fcd116' stroke-width='1.2'/%3E%3Cpath d='M6 7l6-4 6 4-6 4z' fill='%23ce1126'/%3E%3Cpath d='M9.5 7l2.5-1.7 2.5 1.7-2.5 1.7z' fill='%23fcd116'/%3E%3Cpath d='M30 7l6-4 6 4-6 4z' fill='%23007a5e'/%3E%3Cpath d='M33.5 7l2.5-1.7 2.5 1.7-2.5 1.7z' fill='%23f2c935'/%3E%3Ccircle cx='24' cy='7' r='1.3' fill='%23f2c935'/%3E%3Ccircle cx='0' cy='7' r='1.3' fill='%23f2c935'/%3E%3Ccircle cx='48' cy='7' r='1.3' fill='%23f2c935'/%3E%3C/svg%3E");

  /* Ndop grid: faint gold lattice for light backgrounds */
  --ndop: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23c99a1e' stroke-opacity='.10' stroke-width='1'%3E%3Cpath d='M32 4l12 12-12 12-12-12z'/%3E%3Cpath d='M32 36l12 12-12 12-12-12z'/%3E%3Cpath d='M0 32h14M50 32h14M32 28v8'/%3E%3Ccircle cx='32' cy='16' r='2'/%3E%3Ccircle cx='32' cy='48' r='2'/%3E%3C/g%3E%3C/svg%3E");

  /* Ndop grid for dark backgrounds */
  --ndop-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23f2c935' stroke-opacity='.07' stroke-width='1'%3E%3Cpath d='M32 4l12 12-12 12-12-12z'/%3E%3Cpath d='M32 36l12 12-12 12-12-12z'/%3E%3Cpath d='M0 32h14M50 32h14M32 28v8'/%3E%3C/g%3E%3C/svg%3E");
}

body { background: var(--cream); color: var(--text); }
body.cm-page { background: var(--cream) var(--ndop) repeat; background-attachment: fixed; }
::selection { background: rgba(242,201,53,.35); color: var(--forest); }

/* Text that sits under the logo gold */
.text-gold { color: var(--gold) !important; }
.gold-text {
  background: var(--gold-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ── Cameroon flag (CSS: Windows shows the 🇨🇲 emoji as the letters "CM") ── */
.cm-flag {
  position: relative;
  display: inline-block;
  width: 1.35em; height: .9em;
  vertical-align: -.08em;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cm-green) 0 33.34%, var(--cm-red) 33.34% 66.67%, var(--cm-yellow) 66.67%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.cm-flag::after {
  content: '★';
  position: absolute; left: 0; right: 0; top: 50%;
  transform: translateY(-52%);
  text-align: center;
  font-size: .52em; line-height: 1;
  color: var(--cm-yellow);
}

/* ── Toghu band utility ───────────────────────────── */
.cm-toghu {
  height: 14px;
  background: var(--toghu) repeat-x center / auto 14px;
}

/* ── Main menu ────────────────────────────────────
   Desktop: brand · pill group of the five tools · EN|FR · account.
   Phones:  brand · EN|FR · account · menu sheet, plus a bottom tab bar (thumb reach). */
:root { --cet-nav-h: 64px; --cet-tab-h: 0px; }
.cet-nav {
  position: sticky; top: 0; z-index: 1030; height: var(--cet-nav-h);
  background: rgba(11,20,16,.96); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(242,201,53,.14);
}
.cet-nav::after { /* tricolour hairline */
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--cm-green) 0 33.33%, var(--cm-red) 33.33% 66.66%, var(--cm-yellow) 66.66% 100%);
}
.cet-nav-in { max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; gap: 1rem; }
.cet-brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; flex: none; }
.cet-brand img { width: 36px; height: 36px; filter: drop-shadow(0 2px 6px rgba(242,201,53,.3)); transition: transform .25s; }
.cet-brand:hover img { transform: rotate(-8deg) scale(1.05); }
.cet-brand span {
  font-family: var(--font-head, 'Space Grotesk', sans-serif); font-weight: 700; font-size: 1.25rem; letter-spacing: -.4px;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.cet-links {
  list-style: none; margin: 0 auto; padding: 4px; display: flex; gap: 2px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 999px;
}
.cet-links a {
  display: flex; align-items: center; gap: .5rem; height: 40px; padding: 0 1rem; border-radius: 999px;
  color: rgba(255,255,255,.78); text-decoration: none; font-weight: 600; font-size: .9rem; white-space: nowrap;
  transition: color .15s, background-color .15s;
}
.cet-links a i { font-size: .95rem; opacity: .85; }
.cet-links a:hover { color: #fff; background: rgba(255,255,255,.07); }
.cet-links a.is-on { color: #1a1405; background: var(--gold-grad); box-shadow: 0 2px 12px rgba(242,201,53,.28); }
.cet-links a.is-on i { opacity: 1; }
.cet-nav a:focus-visible, .cet-nav button:focus-visible, .cet-tabbar a:focus-visible { outline: 2px solid var(--gold-lt); outline-offset: 2px; }
.cet-nav-r { display: flex; align-items: center; gap: .5rem; flex: none; margin-left: auto; }
.cet-links + .cet-nav-r { margin-left: 0; }
.cet-lang { display: flex; padding: 3px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.cet-lang a { min-width: 38px; height: 32px; display: grid; place-items: center; border-radius: 999px; font-size: .76rem; font-weight: 800; letter-spacing: .04em; color: rgba(255,255,255,.6); text-decoration: none; }
.cet-lang a:hover { color: #fff; }
.cet-lang a.is-on { background: rgba(242,201,53,.18); color: var(--gold-lt); }
.cet-signin {
  display: flex; align-items: center; gap: .45rem; height: 40px; padding: 0 1rem; border-radius: 999px;
  border: 1px solid rgba(242,201,53,.45); color: var(--gold-lt); text-decoration: none; font-weight: 600; font-size: .88rem;
  transition: background-color .15s, color .15s;
}
.cet-signin:hover { background: var(--gold); border-color: var(--gold); color: var(--forest); }
.cet-avatar, .cet-more-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.cet-avatar { background: linear-gradient(135deg, var(--cm-green), var(--cm-green-lt)); color: #fff; box-shadow: 0 0 0 2px rgba(242,201,53,.5); }
.cet-more { display: none; }
.cet-more-btn { background: rgba(255,255,255,.08); color: #fff; font-size: 1.05rem; }
.cet-dd { border: 0; border-radius: 16px; padding: .4rem; box-shadow: 0 16px 40px rgba(0,0,0,.25); min-width: 230px; margin-top: .5rem !important; }
.cet-dd .dropdown-item { display: flex; align-items: center; gap: .7rem; border-radius: 10px; padding: .6rem .75rem; font-weight: 500; }
.cet-dd .dropdown-item i { width: 18px; text-align: center; color: var(--gold); }
.cet-dd .dropdown-item.text-danger i { color: inherit; }
.cet-dd .dropdown-item:active { background: rgba(242,201,53,.2); color: inherit; }
.cet-dd-head { padding: .5rem .75rem .35rem; font-size: .85rem; color: var(--forest-2); }
.cet-grid { grid-template-columns: repeat(3, 1fr); gap: .35rem; width: min(330px, calc(100vw - 1.5rem)); }
.cet-grid.show { display: grid; }
.cet-grid a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; min-height: 84px; padding: .5rem;
  border-radius: 14px; text-decoration: none; color: var(--forest-2); font-size: .78rem; font-weight: 600; text-align: center; background: var(--cream);
}
.cet-grid a i { font-size: 1.25rem; color: var(--gold); }
.cet-grid a.is-on { background: rgba(242,201,53,.2); box-shadow: inset 0 0 0 1px var(--gold); }

/* Bottom tab bar (phones) */
.cet-tabbar { display: none; }
@media (max-width: 1199.98px) {
  .cet-links a { padding: 0 .8rem; font-size: .85rem; }
}
@media (max-width: 1099.98px) {
  .cet-links a:not(.is-on) span { display: none; }   /* icons + the current page's label */
  .cet-links a:not(.is-on) { padding: 0 .85rem; }
}
@media (max-width: 991.98px) {
  :root { --cet-nav-h: 56px; --cet-tab-h: calc(62px + env(safe-area-inset-bottom)); }
  .cet-nav-in { padding: 0 .75rem; gap: .5rem; }
  .cet-links, .cet-signin span { display: none; }
  .cet-signin { width: 40px; padding: 0; justify-content: center; }
  .cet-more { display: block; }
  body.has-tabbar { padding-bottom: var(--cet-tab-h); }
  .cet-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
    height: var(--cet-tab-h); padding: 0 .25rem env(safe-area-inset-bottom);
    background: rgba(11,20,16,.97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(242,201,53,.16);
  }
  .cet-tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; min-width: 0;
    color: rgba(255,255,255,.62); text-decoration: none; font-size: .66rem; font-weight: 600; position: relative;
  }
  .cet-tabbar a i { font-size: 1.15rem; transition: transform .15s; }
  .cet-tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .cet-tabbar a.is-on { color: var(--gold-lt); }
  .cet-tabbar a.is-on i { transform: translateY(-1px); }
  .cet-tabbar a.is-on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold-lt); }
  body.app-mode .cet-tabbar { display: none; }
}
@media (max-width: 360px) {
  .cet-brand span { display: none; }
}

/* ── Buttons ──────────────────────────────────────── */
.btn-primary {
  --bs-btn-bg: var(--cm-green); --bs-btn-border-color: var(--cm-green);
  --bs-btn-hover-bg: #00664f; --bs-btn-hover-border-color: #00664f;
  --bs-btn-active-bg: #005440; --bs-btn-active-border-color: #005440;
  --bs-btn-disabled-bg: var(--cm-green); --bs-btn-disabled-border-color: var(--cm-green);
}
.btn-warning, .btn-gold {
  --bs-btn-color: var(--forest); --bs-btn-bg: var(--gold-lt); --bs-btn-border-color: var(--gold-lt);
  --bs-btn-hover-color: var(--forest); --bs-btn-hover-bg: var(--gold); --bs-btn-hover-border-color: var(--gold);
  --bs-btn-active-bg: var(--gold-dk); --bs-btn-active-border-color: var(--gold-dk);
  font-weight: 600;
}
.btn-outline-primary {
  --bs-btn-color: var(--cm-green); --bs-btn-border-color: var(--cm-green);
  --bs-btn-hover-bg: var(--cm-green); --bs-btn-hover-border-color: var(--cm-green);
  --bs-btn-active-bg: var(--cm-green);
}
.text-primary { color: var(--cm-green) !important; }
.bg-primary   { background-color: var(--cm-green) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 .22rem rgba(201,154,30,.22);
}
.page-link { color: var(--cm-green); }
.page-item.active .page-link { background: var(--cm-green); border-color: var(--cm-green); }

/* ── Footer ───────────────────────────────────────── */
.cet-footer {
  position: relative;
  background: var(--forest) var(--ndop-dark) repeat !important;
  color: rgba(255,255,255,.78);
  padding-top: 2.6rem !important;
}
.cet-footer::before {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 14px;
  background: var(--toghu) repeat-x center / auto 14px;
}
.cet-footer .text-muted, .cet-footer a.text-muted { color: rgba(255,255,255,.6) !important; }
.cet-footer a.text-muted:hover { color: var(--gold-lt) !important; }
.cet-footer .footer-brand { display: inline-flex; align-items: center; gap: .55rem; }
.cet-footer .footer-brand img { width: 30px; height: 30px; }
.cet-footer .footer-links a { color: rgba(255,255,255,.72); margin: 0 .55rem; font-size: .88rem; }
.cet-footer .footer-links a:hover { color: var(--gold-lt); }

/* ── Inner page headers (phrasebook / translator / vocabulary) ── */
.pb-header-icon {
  background: var(--gold-grad) !important;
  color: var(--forest) !important;
  box-shadow: 0 6px 18px rgba(201,154,30,.3) !important;
}
.page-title { color: var(--forest-2); }

/* PWA banner */
#pwaInstallBanner { background: var(--forest) !important; border-color: rgba(242,201,53,.45) !important; }

/* ── Motion: respect reduced motion everywhere ────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
