/* =====================================================
   Dictionary + Learn pages (pages/dictionary.php, pages/learn.php)
   Builds on the tokens in theme-cameroon.css
   ===================================================== */

[hidden] { display: none !important; }

/* ── Hero band ────────────────────────────────────── */
.lib-hero {
  position: relative;
  background:
    radial-gradient(ellipse 60% 80% at 85% 0%, rgba(201,154,30,.22), transparent 60%),
    radial-gradient(ellipse 50% 70% at 0% 100%, rgba(0,122,94,.35), transparent 60%),
    var(--forest) var(--ndop-dark) repeat;
  color: #fff;
  padding: 3.2rem 0 4.2rem;
  overflow: hidden;
}
.lib-hero::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 14px;
  background: var(--toghu) repeat-x center / auto 14px;
}
.lib-kicker {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-lt);
  margin-bottom: .8rem;
}
.lib-kicker::before {
  content: ''; width: 26px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--cm-green) 0 33%, var(--cm-red) 33% 66%, var(--cm-yellow) 66%);
}
.lib-hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: .6rem;
}
.lib-hero h1 em { font-style: normal; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lib-hero .lib-sub { color: rgba(255,255,255,.75); max-width: 640px; font-size: 1.02rem; }

/* ── Big search ───────────────────────────────────── */
.lib-search {
  display: flex; align-items: stretch;
  margin-top: 1.6rem;
  max-width: 820px;
  background: #fff;
  border-radius: 16px;
  padding: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35), 0 0 0 1px rgba(242,201,53,.35);
}
.lib-search .ls-icon { display: grid; place-items: center; width: 46px; color: var(--gold-dk); font-size: 1.1rem; }
.lib-search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-size: 1.08rem; color: var(--text);
  padding: .7rem .2rem;
}
.lib-search select {
  border: 0; border-left: 1px solid var(--sand);
  background: transparent; color: var(--text-soft);
  font-size: .9rem; padding: 0 .8rem; max-width: 34%;
  outline: 0;
}
.lib-search input:focus-visible { outline: none; }
.lib-search:focus-within { box-shadow: 0 18px 50px rgba(0,0,0,.35), 0 0 0 3px rgba(242,201,53,.7); }
@media (max-width: 575px) {
  .lib-search { flex-wrap: wrap; }
  .lib-search select { max-width: none; width: 100%; border-left: 0; border-top: 1px solid var(--sand); padding: .55rem .8rem; }
}

.lib-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 1.6rem; }
.lib-stats div { display: flex; flex-direction: column; }
.lib-stats strong { font-family: var(--font-head); font-size: 1.6rem; color: var(--gold-lt); line-height: 1.1; }
.lib-stats span { font-size: .8rem; color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .06em; }

/* ── Sections ─────────────────────────────────────── */
.lib-section { padding: 2.6rem 0 1rem; }
.lib-section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.lib-section-head h2 { font-family: var(--font-head); font-weight: 700; font-size: 1.55rem; color: var(--forest-2); margin: 0; }
.lib-section-head p { margin: .2rem 0 0; color: var(--muted); font-size: .92rem; }

/* ── Chips (regions, levels, letters) ─────────────── */
.chip-row { display: flex; gap: .45rem; overflow-x: auto; padding: .2rem .1rem .6rem; scrollbar-width: thin; }
.chip-row.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--sand);
  background: #fff;
  color: var(--text-soft);
  font-size: .86rem; font-weight: 600;
  border-radius: 999px;
  padding: .42rem .95rem;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--gold); color: var(--forest-2); }
.chip.is-active, .chip[aria-pressed="true"] { background: var(--forest-2); border-color: var(--forest-2); color: var(--gold-lt); }
.chip .n { opacity: .6; font-weight: 500; margin-left: .3rem; }
.chip:focus-visible { outline: 3px solid rgba(242,201,53,.6); outline-offset: 2px; }

.letter-bar .chip { min-width: 2.3rem; padding: .35rem .6rem; text-align: center; font-family: var(--font-head); }

/* ── Language cards ───────────────────────────────── */
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.lang-card {
  position: relative;
  display: flex; flex-direction: column; gap: .2rem;
  padding: 1rem 1.05rem 1rem 1.25rem;
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 14px;
  color: var(--text);
  text-align: left;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
  overflow: hidden;
}
.lang-card::before {
  /* flag-colour edge, cycling green / red / yellow */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--edge, var(--cm-green));
}
.lang-card:nth-child(3n+2) { --edge: var(--cm-red); }
.lang-card:nth-child(3n+3) { --edge: var(--cm-yellow); }
.lang-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(17,38,29,.12); border-color: var(--gold); color: var(--text); }
.lang-card .lc-name { font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; color: var(--forest-2); }
.lang-card .lc-where { font-size: .78rem; color: var(--muted); }
.lang-card .lc-counts { display: flex; flex-wrap: wrap; gap: .2rem .7rem; margin-top: .45rem; font-size: .78rem; color: var(--text-soft); }
.lang-card .lc-counts > span { white-space: nowrap; }
.lang-card .lc-counts i { color: var(--gold); margin-right: .25rem; }
.lang-card[hidden] { display: none; }

/* ── Entry cards (search results + language dictionary) ── */
.entry-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.entry {
  display: flex; align-items: flex-start; gap: .85rem;
  background: #fff;
  border: 1px solid var(--sand);
  border-radius: 14px;
  padding: .9rem 1rem;
}
.entry-body { flex: 1; min-width: 0; }
.entry-text { font-size: 1.12rem; font-weight: 700; color: var(--forest-2); line-height: 1.3; word-break: break-word; }
.entry-meaning { color: var(--text-soft); font-size: .93rem; margin-top: .15rem; }
.entry-meaning .fr { color: var(--muted); }
.entry-example { font-size: .84rem; color: var(--muted); font-style: italic; margin-top: .25rem; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .45rem; font-size: .74rem; }
.tag {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .12rem .5rem; border-radius: 6px;
  background: var(--cream-2); color: var(--text-soft); font-weight: 600;
}
.tag-lang { background: rgba(0,122,94,.1); color: var(--cm-green); }
.tag-lang:hover { background: rgba(0,122,94,.18); color: var(--cm-green); }
.tag-phrase { background: rgba(201,154,30,.14); color: var(--gold-dk); }
.play-btn {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0;
  background: var(--gold-grad);
  color: var(--forest);
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(201,154,30,.35);
  transition: transform .15s var(--ease-bounce);
}
.play-btn:hover { transform: scale(1.08); }
.play-btn.is-playing { background: var(--cm-green); color: #fff; animation: pulse-ring 1.2s infinite; }
.play-btn:disabled { background: var(--cream-2); color: var(--muted); box-shadow: none; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(0,122,94,.45); } 100% { box-shadow: 0 0 0 14px rgba(0,122,94,0); } }

.lib-status { color: var(--muted); font-size: .9rem; margin-bottom: .8rem; min-height: 1.4em; }
.lib-empty {
  text-align: center; padding: 2.2rem 1rem;
  background: #fff; border: 1px dashed var(--sand); border-radius: 14px; color: var(--muted);
}
.skeleton { height: 82px; border-radius: 14px; background: linear-gradient(90deg, var(--cream-2), #fff, var(--cream-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Language view header ─────────────────────────── */
.lang-view-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  background: #fff; border: 1px solid var(--sand); border-radius: 18px;
  padding: 1.2rem 1.3rem; margin-bottom: 1rem;
  box-shadow: 0 6px 20px rgba(17,38,29,.05);
}
.lang-view-head h2 { font-family: var(--font-head); font-weight: 700; margin: 0; color: var(--forest-2); }
.lang-view-head .lv-where { color: var(--muted); font-size: .88rem; }
.lang-view-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.btn-soft {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--sand); background: var(--cream); color: var(--forest-2);
  border-radius: 10px; padding: .45rem .8rem; font-size: .86rem; font-weight: 600;
}
.btn-soft:hover { border-color: var(--gold); color: var(--forest-2); background: #fff; }
.btn-soft i { color: var(--gold-dk); }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--cm-green); margin-bottom: .9rem; border: 0; background: none; padding: 0; }
.filter-input { max-width: 320px; border-radius: 10px; border-color: var(--sand); }

/* ── Grow callout ─────────────────────────────────── */
.grow-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem;
  margin: 2.4rem 0 3rem;
  padding: 1.6rem 1.7rem;
  border-radius: 20px;
  background: var(--forest-2) var(--ndop-dark) repeat;
  color: #fff;
  position: relative; overflow: hidden;
}
.grow-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--toghu) repeat-y center / 14px auto; transform-origin: left; }
.grow-card h3 { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; margin: 0 0 .3rem; color: var(--gold-lt); }
.grow-card p { margin: 0; color: rgba(255,255,255,.75); max-width: 620px; }
.grow-card .btn { margin-left: auto; }

/* ── Learn: path ──────────────────────────────────── */
.path { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-top: 2rem; counter-reset: step; }
@media (max-width: 991px) { .path { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .path { grid-template-columns: 1fr; } }
.path-step {
  position: relative;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(242,201,53,.22);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  color: #fff;
  transition: background .18s, border-color .18s;
}
.path-step:hover { background: rgba(255,255,255,.1); border-color: rgba(242,201,53,.5); color: #fff; }
.path-step .ps-num {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--gold-grad); color: var(--forest);
  font-weight: 800; font-size: .9rem; margin-bottom: .5rem;
}
.path-step strong { display: block; font-family: var(--font-head); font-size: 1.08rem; }
.path-step span { font-size: .84rem; color: rgba(255,255,255,.7); }

/* ── Learn: filters + video cards ─────────────────── */
.learn-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: 1.2rem; }
.learn-filters .form-select { max-width: 260px; border-radius: 10px; border-color: var(--sand); }
.video-group { margin-bottom: 2rem; }
.video-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .6rem 1rem; margin-bottom: .8rem; padding-bottom: .5rem; border-bottom: 2px solid var(--sand); }
.video-group-head h3 { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--forest-2); margin: 0; }
.video-group-head .vg-where { color: var(--muted); font-size: .84rem; }
.video-group-head .vg-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: .8rem; font-size: .85rem; }
.video-group-head .vg-links a { color: var(--cm-green); font-weight: 600; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.video-card { background: #fff; border: 1px solid var(--sand); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.video-card[hidden] { display: none; }
.yt-lite {
  position: relative; display: block; width: 100%;
  aspect-ratio: 16 / 9;
  border: 0; padding: 0; cursor: pointer;
  background: #0b1410 center / cover no-repeat;
}
.yt-lite img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-lite .yt-play {
  position: absolute; inset: 0; margin: auto;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(11,20,16,.72); color: var(--gold-lt); font-size: 1.35rem;
  border: 2px solid rgba(242,201,53,.8);
  transition: transform .18s var(--ease-bounce), background .18s;
}
.yt-lite:hover .yt-play, .yt-lite:focus-visible .yt-play { transform: scale(1.1); background: var(--cm-red); color: #fff; border-color: #fff; }
.yt-lite iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-info { padding: .8rem .95rem .95rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.video-title { font-weight: 700; font-size: .95rem; line-height: 1.35; color: var(--text); }
.video-channel { font-size: .8rem; color: var(--muted); }
.video-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: auto; padding-top: .3rem; font-size: .72rem; }
.tag-level-start   { background: rgba(0,122,94,.12);  color: var(--cm-green); }
.tag-level-build   { background: rgba(201,154,30,.16); color: var(--gold-dk); }
.tag-level-culture { background: rgba(206,17,38,.1);   color: var(--cm-red); }
.yt-note { font-size: .82rem; color: var(--muted); }


/* ── Phrase & language pages (/say/…, /words/…) ───── */
.say-crumbs { font-size: .84rem; color: rgba(255,255,255,.6); margin-bottom: 1rem; }
.say-crumbs a { color: var(--gold-lt); text-decoration: none; }
.say-crumbs a:hover { text-decoration: underline; }
.say-hero h1.say-meaning { font-size: clamp(1.5rem, 3.4vw, 2.3rem); color: rgba(255,255,255,.92); }
.say-card {
  display: inline-flex; align-items: center; gap: 1.1rem;
  margin: .6rem 0 1rem;
  padding: 1.1rem 1.3rem 1.1rem 1.5rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(242,201,53,.35);
  border-radius: 20px;
  backdrop-filter: blur(4px);
  max-width: 100%;
}
.say-text {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.1;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: break-word;
}
.play-btn-lg { width: 64px; height: 64px; font-size: 1.4rem; }
.say-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.say-actions .btn { border-radius: 999px; padding: .55rem 1.15rem; font-weight: 600; }
.say-actions .is-saved { border-color: var(--cm-green); color: #9ee6c8; }
.say-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 1rem 0 3rem; padding-top: 1.2rem; border-top: 2px solid var(--sand);
  font-weight: 600; font-size: .92rem;
}
.say-pager a { color: var(--cm-green); text-decoration: none; }
.say-pager a:hover { color: var(--gold-dk); }
.entry-link { display: block; text-decoration: none; }
.entry-link:hover { color: var(--cm-green); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tag-tee { background: rgba(11,20,16,.06); color: var(--forest-2); text-decoration: none; }
.tag-tee:hover { background: var(--gold-lt); color: var(--forest); }
.az-row .chip { min-width: 2.3rem; text-align: center; text-decoration: none; font-family: var(--font-head); }

/* ── Recorder (suggest a word) ────────────────────── */
.rec-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rec-btn.is-recording { background: var(--cm-red); border-color: var(--cm-red); color: #fff; animation: pulse-ring 1.2s infinite; }
.rec-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }

/* ── Services ─────────────────────────────────────── */
.svc-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.svc-card { display: flex; flex-direction: column; gap: .4rem; text-decoration: none; }
.svc-icon { font-size: 1.5rem; color: var(--gold-dk); margin-bottom: .2rem; }
.svc-aside { padding: 1.6rem; border-radius: 20px; background: var(--forest-2) var(--ndop-dark) repeat; color: rgba(255,255,255,.8); position: relative; overflow: hidden; }
.svc-aside::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--toghu) repeat-x center / auto 8px; }
.svc-aside h3 { font-family: var(--font-head); color: var(--gold-lt); margin-top: .4rem; }
.svc-aside hr { border-color: rgba(255,255,255,.2); }
