/* ═══════════════════════════════════════════════════════════════
   LearnTrade — style.css
   Dark trading theme · Khmer-first · Mobile-ready
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts loaded in header.php ── */
:root {
  /* Palette */
  --bg-base:        #0A0E1A;   /* deep navy-black */
  --bg-card:        #111827;   /* card surface */
  --bg-card-hover:  #1A2234;
  --bg-sidebar:     #0D1425;
  --bg-ticker:      #060B15;

  --gold:           #F59E0B;
  --gold-light:     #FCD34D;
  --gold-muted:     #92661A;
  --green:          #10B981;
  --red:            #EF4444;
  --blue:           #3B82F6;
  --purple:         #8B5CF6;
  --cyan:           #06B6D4;
  --pink:           #EC4899;

  --border:         #1F2D45;
  --border-glow:    rgba(245,158,11,.25);

  --text-main:      #F1F5F9;
  --text-muted:     #94A3B8;
  --text-dim:       #64748B;

  /* Typography */
  --font-km:   'Noto Sans Khmer', sans-serif;
  --font-en:   'Inter', sans-serif;

  /* Sizes */
  --nav-h:     60px;
  --ticker-h:  34px;
  --sidebar-w: 240px;
  --radius:    10px;
  --radius-lg: 16px;
}
:root {
  --khmer-font-family: "Hanuman", "Noto Sans Khmer", "Battambang", "DaunPenh", "Khmer MN", sans-serif;
}

body {
  font-family: var(--khmer-font-family);
}

h1, h2, h3, .khmer-text {
  font-family: var(--khmer-font-family);
}

/* ── Reset ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--font-km);
  /* Responsive base font-size following web standards.
     Clamp: 16px on phones (matches iOS Safari's no-zoom threshold),
     scales smoothly, up to 18px on wide desktops.
     Every rem-based measurement across the site scales with this. */
  font-size: clamp(16px, 0.6vw + 14px, 18px);
  line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
ul { list-style: none; padding: 0; }

/* ── Utility ────────────────────────────── */
.km-text  { font-family: var(--font-km); }
.en-text  { font-family: var(--font-en); }
.fw-500   { font-weight: 500; }
.fw-600   { font-weight: 600; }
.fw-700   { font-weight: 700; }
.text-gold    { color: var(--gold); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-muted-light { color: var(--text-muted); }
.small        { font-size: .83rem; }
.container-xl { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 22px; border-radius: 8px; font-weight: 600;
  font-size: .9rem; border: none; cursor: pointer; transition: .2s;
  font-family: var(--font-km);
}
.btn-warning  { background: var(--gold); color: #0A0E1A; }
.btn-warning:hover { background: var(--gold-light); color: #0A0E1A; }
.btn-outline-secondary {
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-outline-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(1.15); }
.me-2 { margin-right: 8px; }
.px-4 { padding-left: 16px; padding-right: 16px; }

/* ── Ticker Bar ─────────────────────────── */
.lt-ticker-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--ticker-h);
  background: var(--bg-ticker);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  /* Fixed base font-size for the entire ticker.
     Prevents the ticker from scaling when body font-size changes.
     Inline rules in header.php use px units directly (safest). */
  font-size: 13px;
  line-height: 1;
}
.lt-ticker-bar * { font-size: inherit; } /* safety net for any missed child */
/* NOTE: Old scroll/item/color rules for .lt-ticker-wrap, .lt-ticker-track,
   .lt-ticker-item, .lt-ticker-up/down, and @keyframes ticker-scroll were
   removed. The ticker's marquee animation, item typography, and up/down/flat
   colours are now self-contained inside header.php so they always stay in
   sync with the JS-rendered content. Only .lt-ticker-bar (page-level layout
   positioning) remains here because header.php relies on it.
   Any old .lt-ticker-demo-label rule is intentionally omitted — new file
   uses .lt-live-badge instead. */

/* ── Navbar ─────────────────────────────── */
.lt-nav {
  position: fixed;
  top: var(--ticker-h);
  left: 0; right: 0;
  z-index: 150;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(10,14,26,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.lt-logo {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main) !important;
  letter-spacing: -.01em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.lt-logo span { color: var(--gold); }
.lt-logo .lt-logo-icon {
  flex-shrink: 0;
  display: block;
}
.lt-nav-links {
  display: flex; align-items: center; gap: 4px;
}
.lt-nav-links a {
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--text-muted);
  font-family: var(--font-km);
  font-size: .88rem;
  font-weight: 500;
  transition: .15s;
}
.lt-nav-links a:hover,
.lt-nav-links a.active { color: var(--gold); background: rgba(245,158,11,.09); }

.mobile-menu-btn {
  display: none;
  background: none; border: none;
  color: var(--text-main);
  font-size: 1.4rem; cursor: pointer;
  padding: 4px;
}

/* Mobile nav */
.mobile-nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav-drawer {
  position: fixed; top: 0; right: -290px;
  width: 264px; height: 100vh;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border);
  z-index: 500;
  padding: 84px 14px 24px;
  transition: right .28s ease;
  display: flex; flex-direction: column; gap: 3px;
  box-shadow: -12px 0 32px rgba(0,0,0,.45);
  overflow-y: auto;
}
.mobile-nav-drawer.open { right: 0; }
.mobile-nav-drawer a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-family: var(--font-km);
  font-weight: 500;
  font-size: .86rem;
  line-height: 1.45;
  letter-spacing: .01em;
  border-left: 2px solid transparent;
  transition: .15s;
}
.mobile-nav-drawer a:hover,
.mobile-nav-drawer a:active {
  color: var(--gold);
  background: rgba(245,158,11,.08);
  border-left-color: var(--gold);
}
.mobile-nav-drawer a:first-child {
  margin-bottom: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  color: var(--text-main);
  font-weight: 600;
}

/* ── Layout Shell ───────────────────────── */
.lt-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  padding-top: calc(var(--ticker-h) + var(--nav-h));
}
.lt-main {
  min-width: 0;
  padding: 28px 24px 60px;
}

/* ── Sidebar ────────────────────────────── */
.lt-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 24px 0 60px;
  position: sticky;
  top: calc(var(--ticker-h) + var(--nav-h));
  height: calc(100vh - var(--ticker-h) - var(--nav-h));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.lt-sidebar::-webkit-scrollbar { width: 4px; }
.lt-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-section-label {
  font-family: var(--font-km);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 18px 10px;
}
.sidebar-cat {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  color: var(--text-muted);
  font-family: var(--font-km);
  font-size: .87rem;
  font-weight: 500;
  transition: .15s;
  border-left: 3px solid transparent;
}
.sidebar-cat:hover { color: var(--text-main); background: rgba(255,255,255,.04); }
.sidebar-cat.active {
  color: var(--gold);
  background: rgba(245,158,11,.08);
  border-left-color: var(--gold);
}
.sidebar-cat i { font-size: 1rem; flex-shrink: 0; }

.sidebar-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 16px 18px 14px;
}
.sidebar-pages { padding: 0 12px; }
.sidebar-pages li { margin-bottom: 2px; }
.sidebar-pages a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-family: var(--font-km);
  font-size: .84rem;
  transition: .12s;
}
.sidebar-pages a:hover { color: var(--text-main); background: rgba(255,255,255,.05); }
.sidebar-pages a.active { color: var(--gold); background: rgba(245,158,11,.1); font-weight: 600; }

/* Sidebar mobile toggle button */
.sidebar-toggle-btn {
  display: none;
  position: fixed;
  bottom: 20px; left: 16px;
  z-index: 300;
  background: var(--gold);
  color: #0A0E1A;
  border: none; border-radius: 24px;
  padding: 10px 16px;
  font-family: var(--font-km);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245,158,11,.35);
  display: none; align-items: center; gap: 6px;
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
  z-index: 250;
}
.sidebar-overlay.open { display: block; }

/* ── Footer ─────────────────────────────── */
.lt-footer {
  background: var(--bg-ticker);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  font-family: var(--font-km);
  font-size: .85rem;
  color: var(--text-muted);
}
.lt-footer a { color: var(--text-muted); }
.lt-footer a:hover { color: var(--gold); }
.lt-footer strong { color: var(--gold); }

/* ── Ads ────────────────────────────────── */
.lt-ad {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: .8rem;
  font-family: var(--font-en);
  margin: 28px 0;
}

/* ── Hero ───────────────────────────────── */
.lt-hero {
  text-align: center;
  padding: 56px 16px 48px;
}
.lt-hero-title {
  font-family: var(--font-km);
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 16px;
}
.lt-hero-subtitle {
  font-family: var(--font-en);
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  letter-spacing: .02em;
}

/* ── Category Cards ─────────────────────── */
.lt-cat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.lt-cat-card {
  display: flex; flex-direction: column; align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  transition: .2s;
  cursor: pointer;
}
.lt-cat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-muted);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.lt-cat-card-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05);
  border-radius: 10px;
  margin-bottom: 14px;
  font-size: 1.4rem;
}
.lt-cat-card-title-km {
  font-family: var(--font-km);
  font-weight: 700;
  font-size: .9rem;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.4;
}
.lt-cat-card-title-en {
  font-family: var(--font-en);
  font-size: .75rem;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.lt-cat-card-count {
  font-family: var(--font-km);
  font-size: .78rem;
  color: var(--gold);
  font-weight: 600;
}

/* Feature boxes on homepage */
.lt-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* Feature box icon centering */
.lt-article i.bi {
  margin: 0 auto 10px;
  display: block;
  text-align: center;
}

/* ── Category Page ──────────────────────── */
.lt-cat-header {
  display: flex; align-items: center; gap: 16px;
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.lt-cat-header-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.lt-cat-header-title { font-family: var(--font-km); font-weight: 700; font-size: 1.3rem; color: var(--text-main); }
.lt-cat-header-en    { font-family: var(--font-en); font-size: .82rem; color: var(--text-muted); margin-top: 2px; }

/* Lesson list grid */
.lt-lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.lt-lesson-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: .2s;
}
.lt-lesson-card:hover {
  border-color: var(--gold-muted);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.lt-lesson-card-num {
  font-family: var(--font-en);
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.lt-lesson-card-title-km {
  font-family: var(--font-km);
  font-weight: 700;
  font-size: .95rem;
  color: var(--text-main);
  line-height: 1.4;
}
.lt-lesson-card-title-en {
  font-family: var(--font-en);
  font-size: .77rem;
  color: var(--text-dim);
}
.lt-lesson-card-desc {
  font-family: var(--font-km);
  font-size: .83rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.lt-lesson-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.lt-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-km);
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.lt-badge-beginner { background: rgba(16,185,129,.12); color: var(--green); }
.lt-badge-inter    { background: rgba(59,130,246,.12); color: var(--blue); }
.lt-badge-advanced { background: rgba(239,68,68,.12);  color: var(--red); }
.lt-lesson-card-arrow { color: var(--text-dim); font-size: 1rem; transition: .15s; }
.lt-lesson-card:hover .lt-lesson-card-arrow { color: var(--gold); transform: translateX(3px); }

/* ── Breadcrumb ─────────────────────────── */
.lt-breadcrumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-family: var(--font-km);
  font-size: .8rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.lt-breadcrumb a { color: var(--text-dim); }
.lt-breadcrumb a:hover { color: var(--gold); }
.lt-breadcrumb .sep { color: var(--border); }
.lt-breadcrumb .current { color: var(--text-muted); }

/* ── Lesson Page ────────────────────────── */
.lt-lesson-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}
.lt-lesson-content { min-width: 0; }

.lt-lesson-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.lt-lesson-num {
  font-family: var(--font-en);
  font-size: .72rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.lt-lesson-title-km {
  font-family: var(--font-km);
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 6px;
}
.lt-lesson-title-en {
  font-family: var(--font-en);
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.lt-lesson-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.lt-lesson-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-km);
  font-size: .78rem;
  color: var(--text-muted);
}
.lt-lesson-meta-item i { color: var(--gold); }

/* Content blocks */
.lt-lesson-body { display: flex; flex-direction: column; gap: 20px; }

.lt-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lt-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.025);
}
.lt-section-header i { font-size: 1rem; }
.lt-section-title-km {
  font-family: var(--font-km);
  font-weight: 700;
  font-size: .95rem;
  color: var(--text-main);
}
.lt-section-title-en {
  font-family: var(--font-en);
  font-size: .72rem;
  color: var(--text-dim);
  margin-left: auto;
}
.lt-section-body { padding: 20px; }

/* Khmer paragraph blocks */
.lt-para-km {
  font-family: var(--font-km);
  font-size: .93rem;
  color: var(--text-main);
  line-height: 1.85;
  margin-bottom: 14px;
}
.lt-para-en {
  font-family: var(--font-en);
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

/* Key points list */
.lt-key-points { display: flex; flex-direction: column; gap: 10px; }
.lt-key-point {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  background: rgba(255,255,255,.03);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.lt-key-point-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .8rem; font-weight: 700;
  font-family: var(--font-en);
}
.lt-key-point-text-km {
  font-family: var(--font-km);
  font-size: .88rem;
  color: var(--text-main);
  line-height: 1.6;
}
.lt-key-point-text-en {
  font-family: var(--font-en);
  font-size: .75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Info / Warning / Tip boxes */
.lt-box {
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex; align-items: flex-start; gap: 12px;
  margin: 6px 0;
}
.lt-box-tip     { background: rgba(16,185,129,.07);  border: 1px solid rgba(16,185,129,.2); }
.lt-box-warning { background: rgba(245,158,11,.07);  border: 1px solid rgba(245,158,11,.2); }
.lt-box-danger  { background: rgba(239,68,68,.07);   border: 1px solid rgba(239,68,68,.2); }
.lt-box-info    { background: rgba(59,130,246,.07);  border: 1px solid rgba(59,130,246,.2); }
.lt-box i { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.lt-box-tip i     { color: var(--green); }
.lt-box-warning i { color: var(--gold); }
.lt-box-danger i  { color: var(--red); }
.lt-box-info i    { color: var(--blue); }
.lt-box-label {
  font-family: var(--font-km);
  font-weight: 700;
  font-size: .8rem;
  margin-bottom: 4px;
}
.lt-box-tip .lt-box-label     { color: var(--green); }
.lt-box-warning .lt-box-label { color: var(--gold); }
.lt-box-danger .lt-box-label  { color: var(--red); }
.lt-box-info .lt-box-label    { color: var(--blue); }
.lt-box-text {
  font-family: var(--font-km);
  font-size: .86rem;
  color: var(--text-main);
  line-height: 1.7;
}

/* Steps */
.lt-steps { display: flex; flex-direction: column; gap: 0; }
.lt-step {
  display: flex; gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.lt-step:last-child { border-bottom: none; }
.lt-step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(245,158,11,.15);
  border: 1.5px solid var(--gold-muted);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-en); font-weight: 700; font-size: .8rem;
  color: var(--gold); flex-shrink: 0; margin-top: 2px;
}
.lt-step-body-km {
  font-family: var(--font-km); font-size: .9rem; color: var(--text-main); line-height: 1.7;
  margin-bottom: 4px;
}
.lt-step-body-en {
  font-family: var(--font-en); font-size: .77rem; color: var(--text-dim); line-height: 1.55;
}

/* Example / case box */
.lt-example {
  background: rgba(6,182,212,.06);
  border: 1px solid rgba(6,182,212,.2);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.lt-example-label {
  font-family: var(--font-en);
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  color: var(--cyan); text-transform: uppercase; margin-bottom: 8px;
}
.lt-example-text {
  font-family: var(--font-km); font-size: .88rem; color: var(--text-main); line-height: 1.75;
}

/* Lesson images */
.lt-lesson-figure {
  margin: 4px 0 8px;
}
.lt-lesson-figure img {
  width: 100%;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.lt-lesson-figure figcaption {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lt-lesson-figure figcaption .lt-para-km {
  font-size: .78rem;
  color: var(--text-muted);
  margin: 0;
}
.lt-lesson-figure figcaption .lt-para-en {
  font-size: .72rem;
  color: var(--text-dim);
  margin: 0;
}

/* ── Comparison table (Option B: horizontal scroll on mobile) ────────────
   Font sizes tuned for comfortable extended reading of Khmer script.
   IMPORTANT: this site's KM/EN toggle SWAPS languages (via html.lang-km /
   html.lang-en classes at the bottom of this file). Table cells contain
   both <span class="lt-cell-km"> and <span class="lt-cell-en"> — only one
   is visible at a time. So font-size on .lt-cell-km/en applies to whichever
   is currently shown, and needs to give comfortable reading either way. */
.lt-compare {
  width: 100%; border-collapse: collapse;
  font-family: var(--font-km); font-size: .93rem; /* matches .lt-para-km */
  line-height: 1.85; /* matches intro paragraph line-height for coherent flow */
}
.lt-compare th {
  background: rgba(255,255,255,.04);
  color: var(--text-muted);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: .88rem;
  letter-spacing: .02em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; /* keep header names on one line for cleanest scroll */
}
.lt-compare td {
  padding: 10px 12px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: top;
  font-size: .93rem;   /* fallback for tables without KM/EN cell spans */
  line-height: 1.7;
}
/* Cell language spans: same size as intro paragraph so reading feels
   seamless when switching between prose and tables in the same lesson. */
.lt-compare .lt-cell-km,
.lt-compare .lt-cell-en {
  font-size: .93rem;
  line-height: 1.7;
}
.lt-compare .lt-cell-km { font-family: var(--font-km); }
.lt-compare .lt-cell-en { font-family: var(--font-en); }
.lt-compare tr:hover td { background: rgba(255,255,255,.025); }

/* Wrapper: enables horizontal scroll and hosts the fading edge */
.lt-table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */
  border-radius: var(--radius, 8px);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.lt-table-wrap .lt-compare { border: 0; } /* wrapper owns the border now */

/* Swipe hint text below the table: hidden by default, only shown on mobile */
.lt-table-scroll-hint {
  display: none;
  font-family: var(--font-km);
  font-size: .92rem;
  color: var(--text-muted);
  text-align: center;
  margin: 10px 0 0;
  animation: lt-hint-pulse 2s ease-in-out infinite;
}
/* The hint has its own KM/EN spans — same swap rules apply via the site's
   global lang toggle at the bottom of this file. Both look the same size. */
.lt-table-scroll-hint .lt-cell-km,
.lt-table-scroll-hint .lt-cell-en {
  font-size: .92rem;
}
@keyframes lt-hint-pulse {
  0%, 100% { opacity: .5; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .lt-table-scroll-hint { animation: none; opacity: .8; }
}

/* Tablet (≤720px): text stays the same rem size (matches paragraphs),
   only cell padding tightens for narrower viewport */
@media (max-width: 720px) {
  .lt-compare th,
  .lt-compare td { padding: 9px 11px; }
  .lt-compare th { font-size: .88rem; }
  .lt-compare td,
  .lt-compare .lt-cell-km,
  .lt-compare .lt-cell-en { font-size: .93rem; }
}

/* Mobile (≤600px): match the mobile paragraph size (1rem, from the
   .lt-para-km rule at ≤600px lower in this file). Coherent flow between
   prose and tables. */
@media (max-width: 600px) {
  .lt-compare { min-width: 0; } /* let table size to content by default */
  .lt-compare th,
  .lt-compare td { padding: 9px 11px; }
  .lt-compare th { font-size: .9rem; }
  .lt-compare td,
  .lt-compare .lt-cell-km,
  .lt-compare .lt-cell-en { font-size: 1rem; line-height: 1.7; }

  /* Overflow affordances — only shown when table is actually scrollable */
  .lt-table-wrap.is-scrollable::before,
  .lt-table-wrap.is-scrollable::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    width: 32px;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .lt-table-wrap.is-scrollable::after {
    right: 0;
    background: linear-gradient(to right, transparent, var(--bg-base, #060B15));
    border-top-right-radius: var(--radius, 8px);
    border-bottom-right-radius: var(--radius, 8px);
    opacity: 1;
  }
  .lt-table-wrap.is-scrolled-right::after { opacity: 0; }

  .lt-table-wrap.is-scrollable::before {
    left: 0;
    background: linear-gradient(to left, transparent, var(--bg-base, #060B15));
    border-top-left-radius: var(--radius, 8px);
    border-bottom-left-radius: var(--radius, 8px);
    opacity: 0;
    z-index: 1;
  }
  .lt-table-wrap.is-scrolled::before { opacity: 1; }

  .lt-table-wrap.is-scrollable + .lt-table-scroll-hint { display: block; }
}

/* Very small phones (≤380px): matches mobile paragraph size (1rem) */
@media (max-width: 380px) {
  .lt-compare th,
  .lt-compare td { padding: 8px 10px; }
  .lt-compare th { font-size: .88rem; }
  .lt-compare td,
  .lt-compare .lt-cell-km,
  .lt-compare .lt-cell-en { font-size: 1rem; line-height: 1.65; }
  .lt-table-scroll-hint { font-size: .92rem; }
}

/* ── Mobile lesson-content font tuning ──────────────────────────────
   Standards-compliant sizes across the whole lesson: paragraphs, sections,
   boxes, steps. Everything at 1rem = 16px+ so reading feels effortless,
   matching table cells for coherent flow between prose and tables. */
@media (max-width: 600px) {
  /* Paragraphs: same 1rem as table cells so switching between them feels seamless */
  .lt-para-km { font-size: 1rem; line-height: 1.85; margin-bottom: 14px; }
  .lt-para-en { font-size: .9rem; line-height: 1.65; margin-bottom: 14px; }

  /* Section title inside cards */
  .lt-section-title-km { font-size: 1.05rem; }
  .lt-section-title-en { font-size: .82rem; }
  .lt-section-body { padding: 16px; } /* tighter side padding on phones */

  /* Boxes (tip, warning, info, danger, example) and step body */
  .lt-example-text,
  .lt-step-body-km { font-size: 1rem; line-height: 1.8; }
  .lt-step-body-en { font-size: .88rem; }
}

/* Very small phones (≤380px): keep 1rem — text stays at 16px minimum */
@media (max-width: 380px) {
  .lt-para-km { font-size: 1rem; }
  .lt-para-en { font-size: .88rem; }
  .lt-section-body { padding: 14px; }
}

/* Quiz */
.lt-quiz {
  background: rgba(139,92,246,.07);
  border: 1px solid rgba(139,92,246,.2);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.lt-quiz-q {
  font-family: var(--font-km);
  font-weight: 400; font-size: .85rem;
  color: var(--text-main); margin-bottom: 14px;
}
.quiz-options {
  display: flex; flex-direction: column; gap: 8px;
}
.quiz-options li {
  padding: 11px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-km);
  font-size: .78rem;
  color: var(--text-muted);
  transition: .15s;
}
.quiz-options li:hover {
  border-color: var(--purple);
  color: var(--text-main);
  background: rgba(139,92,246,.08);
}
/* Answered states: correct answer revealed with a blue tick, wrong pick in red */
.quiz-options.answered li,
.lt-quiz.answered .quiz-options li { cursor: default; }
.quiz-options li.opt-correct {
  position: relative;
  padding-right: 42px;
  border-color: #3B82F6;
  color: #3B82F6;
  background: rgba(59,130,246,.10);
}
.quiz-options li.opt-correct:hover {
  border-color: #3B82F6;
  color: #3B82F6;
  background: rgba(59,130,246,.10);
}
.quiz-options li.opt-wrong {
  border-color: #EF4444;
  color: #EF4444;
  background: rgba(239,68,68,.10);
}
.quiz-options li.opt-wrong:hover {
  border-color: #EF4444;
  color: #EF4444;
  background: rgba(239,68,68,.10);
}
.quiz-options li .quiz-tick {
  position: absolute;
  right: 15px; top: 50%;
  transform: translateY(-50%);
  color: #3B82F6;
  font-size: 1.05rem;
}

/* Next/Prev nav */
.lt-lesson-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}
.lt-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  transition: .2s;
}
.lt-nav-btn:hover { border-color: var(--gold-muted); background: var(--bg-card-hover); }
.lt-nav-btn.prev { flex-direction: row; }
.lt-nav-btn.next { flex-direction: row-reverse; text-align: right; }
.lt-nav-btn i { color: var(--gold); font-size: 1.1rem; }
.lt-nav-btn-label { font-family: var(--font-km); font-size: .72rem; color: var(--text-dim); }
.lt-nav-btn-title { font-family: var(--font-km); font-weight: 600; font-size: .88rem; color: var(--text-main); }

/* Right sidebar (lesson page) */
.lt-lesson-sidebar { display: flex; flex-direction: column; gap: 16px; }
.lt-toc-card, .lt-progress-card, .lt-related-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  position: sticky; top: calc(var(--ticker-h) + var(--nav-h) + 16px);
}
.lt-toc-title, .lt-prog-title, .lt-related-title {
  font-family: var(--font-km); font-weight: 700;
  font-size: .85rem; color: var(--text-main); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.lt-toc-list { display: flex; flex-direction: column; gap: 2px; }
.lt-toc-list a {
  display: block; padding: 7px 10px;
  border-radius: 6px; color: var(--text-muted);
  font-family: var(--font-km); font-size: .82rem;
  transition: .12s;
}
.lt-toc-list a:hover, .lt-toc-list a.active {
  color: var(--gold); background: rgba(245,158,11,.08);
}

.lt-progress-bar-wrap {
  background: var(--border); border-radius: 4px; height: 6px; margin-bottom: 8px;
  overflow: hidden;
}
.lt-progress-bar { height: 100%; background: var(--gold); border-radius: 4px; }
.lt-progress-text { font-family: var(--font-km); font-size: .78rem; color: var(--text-muted); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s; }
.reveal.active { opacity: 1; transform: none; }

/* ── Row / Grid utilities ────────────────── */
.row    { display: flex; flex-wrap: wrap; margin: 0 -8px; justify-content: center; }
.gy-3   { --gy: 12px; }
.gy-3 > [class*="col-"] { padding: var(--gy,0) 8px; }
.col-12  { width: 100%; }
.col-6   { width: 50%; text-align: center; }
.mb-3 { margin-bottom: 12px; }
.mb-5 { margin-bottom: 32px; }
.h-100 { height: 100%; }
.d-block { display: block; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1100px) {
  .lt-lesson-wrap { grid-template-columns: 1fr; }
  .lt-lesson-sidebar { position: static !important; }
  .lt-toc-card, .lt-progress-card, .lt-related-card { position: static; }
}

/* Tablet landscape (e.g. iPad Pro / larger Android tablets, ~1025-1180px):
   the 8 nav links + logo + toggle no longer fit on one line at full size,
   so shrink font/padding/gaps first instead of hiding anything. */
@media (max-width: 1180px) and (min-width: 1025px) {
  .lt-nav { padding: 0 14px; }
  .lt-logo { font-size: 1rem; gap: 6px; }
  .lt-nav-links { gap: 0; }
  .lt-nav-links a { padding: 6px 8px; font-size: .78rem; }
  .lt-support-link i { margin-right: 2px; }
}

/* Tablet portrait (e.g. iPad, Android tablets in portrait, ~769-1024px):
   still not enough room even at the reduced size above, so collapse the
   nav the same way it collapses on phones. */
@media (max-width: 1024px) and (min-width: 769px) {
  .lt-nav-links { display: none; }
  .mobile-menu-btn { display: block; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .lt-layout { grid-template-columns: 1fr; }

  .lt-sidebar {
    position: fixed;
    top: 0; left: -260px;
    width: 260px; height: 100vh;
    z-index: 300;
    transition: left .3s ease;
    padding-top: calc(var(--ticker-h) + var(--nav-h) + 16px);
  }
  .lt-sidebar.open { left: 0; }

  .sidebar-toggle-btn { display: flex; }

  .lt-nav-links { display: none; }
  .mobile-menu-btn { display: block; }

  .lt-main { padding: 20px 14px 80px; }

  .lt-hero { padding: 32px 0 28px; }
  .lt-hero-title { font-size: 1.6rem; }

  .lt-cat-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lt-lesson-grid { grid-template-columns: 1fr; }

  .lt-lesson-nav { grid-template-columns: 1fr; }

  .col-lg-3 { width: 100%; }
}

@media (max-width: 480px) {
  .lt-cat-cards { grid-template-columns: repeat(2, 1fr); }
  .lt-lesson-nav { grid-template-columns: 1fr; }
}


/* Space between Intro section and first content section */
#sec-intro {
    margin-bottom: 32px;  /* or whatever space you want */
}

/* OR: space between intro and the next section */
#sec-intro + .lt-section {
    margin-top: 32px;
}

/* OR: consistent spacing between all sections */
.lt-section {
    margin-bottom: 24px;
}

.lt-section + .lt-section {
    margin-top: 24px;
}

/* Target example blocks specifically */
.lt-example {
    margin-top: 24px;  /* or whatever space you want */
}

/* OR target all example blocks with more space */
.lt-example {
    margin-top: 24px;
    margin-bottom: 16px;
}
/* ── Support Us link (navbar/footer) ───────── */
.lt-support-link {
  color: var(--gold) !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lt-support-link:hover { color: var(--gold-light) !important; }
.lt-footer-support-link {
  color: var(--gold);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.lt-footer-support-link:hover { color: var(--gold-light); }

/* ── Support Us Modal ───────────────────────── */
.support-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, .75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.support-modal-overlay.active { display: flex; }
.support-modal {
  background: var(--surface, #11161f);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 380px;
  width: 100%;
  padding: 28px 24px 24px;
  position: relative;
  text-align: center;
}
.support-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.support-modal-close:hover { color: var(--text-main); }
.support-modal-title {
  color: var(--gold);
  font-family: var(--font-km);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}
.support-modal-text {
  color: var(--text-muted);
  font-family: var(--font-km);
  font-size: .92rem;
  line-height: 1.6;
  margin-bottom: 18px;
}
.support-modal-qr {
  width: 200px;
  height: 200px;
  border-radius: 10px;
  margin: 0 auto 18px;
  display: block;
  object-fit: contain;
  background: #fff;
  padding: 6px;
}
.support-modal-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.support-account-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.support-account-label {
  font-family: var(--font-km);
  font-size: .75rem;
  color: var(--text-muted);
}
.support-account-number {
  font-family: var(--font-en);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: .03em;
}
.support-copy-btn {
  background: var(--gold);
  color: #0A0E1A;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: var(--font-km);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background .15s;
}
.support-copy-btn:hover { background: var(--gold-light); }
.support-copy-btn.copied { background: #22c55e; color: #fff; }
.support-modal-thanks {
  font-family: var(--font-km);
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Share Modal ───────────────────────── */
.share-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, .75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.share-modal-overlay.active { display: flex; }
.share-modal {
  background: var(--surface, #11161f);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  padding: 28px 22px 22px;
  position: relative;
  text-align: left;
}
.share-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.share-modal-close:hover { color: var(--text-main); }
.share-modal-title {
  display: flex; align-items: center; gap: 8px;
  color: var(--gold);
  font-family: var(--font-km);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.share-tabs {
  display: flex; gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.share-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  font-family: var(--font-km);
  font-size: .82rem;
  font-weight: 500;
  padding: 9px 6px;
  cursor: pointer;
  transition: .15s;
}
.share-tab:first-child { border-right: 1px solid var(--border); }
.share-tab.active { background: var(--gold); color: #0A0E1A; font-weight: 600; }
.share-panel { display: none; }
.share-panel.active { display: block; }
.share-panel-desc {
  font-family: var(--font-km);
  font-size: .82rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.share-panel-note {
  display: flex; align-items: flex-start; gap: 6px;
  font-family: var(--font-km);
  font-size: .74rem;
  line-height: 1.5;
  color: var(--text-dim);
  margin-top: 10px;
}
.share-platforms {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.share-platform-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-km);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: .15s;
}
.share-platform-btn i { font-size: 1.05rem; }
.share-platform-btn.tg:hover { border-color: #2AABEE; color: #2AABEE; background: rgba(42,171,238,.08); }
.share-platform-btn.fb:hover { border-color: #1877F2; color: #1877F2; background: rgba(24,119,242,.08); }
.share-platform-btn.tw:hover { border-color: var(--text-main); color: var(--text-main); background: var(--bg-card-hover); }
.share-platform-btn.wa:hover { border-color: #25D366; color: #25D366; background: rgba(37,211,102,.08); }
.share-link-row {
  display: flex; align-items: center; gap: 8px;
}
.share-link-row input {
  flex: 1; min-width: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text-muted);
  font-family: var(--font-en);
  font-size: .78rem;
}
.share-content-textarea {
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-muted);
  font-family: var(--font-km);
  font-size: .8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  resize: vertical;
  margin-bottom: 14px;
}
.share-copy-btn {
  background: var(--gold);
  color: #0A0E1A;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-family: var(--font-km);
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background .15s;
}
.share-copy-btn:hover { background: var(--gold-light); }
.share-copy-btn.copied { background: #22c55e; color: #fff; }
.share-copy-btn.full-width { width: 100%; }
.share-native-btn {
  display: none;
  width: 100%;
  align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-km);
  font-size: .82rem;
  cursor: pointer;
  transition: .15s;
}
.share-native-btn:hover { border-color: var(--gold-muted); color: var(--gold); }
/* ═══════════ Language Toggle (ខ្មែរ / EN) ═══════════ */
.lt-lang-toggle {
  display: inline-flex; gap: 0; margin: 14px 0 4px;
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--bg-card);
}
.lt-lang-toggle button {
  background: none; border: none; cursor: pointer;
  padding: 7px 16px; font-family: var(--font-km); font-size: .82rem;
  color: var(--text-muted); transition: background .2s, color .2s;
  border-right: 1px solid var(--border);
}
.lt-lang-toggle button:last-child { border-right: none; }
.lt-lang-toggle button.active {
  background: var(--gold-muted, rgba(245,158,11,.15));
  color: var(--gold, #F59E0B); font-weight: 600;
}

/* Secondary English text inside boxes/examples (mirrors .lt-para-en) */
.lt-box-text-en, .lt-example-text-en {
  font-family: var(--font-en); font-size: .82rem;
  color: var(--text-muted); line-height: 1.65; margin-top: 4px;
}
.lt-box-label-en, .lt-example-label-en {
  font-family: var(--font-en); font-weight: 400;
  color: var(--text-muted); margin-left: 6px; font-size: .9em;
}

/* Table cells & quiz: show Khmer by default, swap (not stack) in EN mode */
.lt-cell-en { display: none; }

/* ── KM-only mode ── */
html.lang-km .lt-para-en,
html.lang-km .lt-section-title-en,
html.lang-km .lt-lesson-title-en,
html.lang-km .lt-step-body-en,
html.lang-km .lt-key-point-text-en,
html.lang-km .lt-box-text-en,
html.lang-km .lt-box-label-en,
html.lang-km .lt-example-text-en,
html.lang-km .lt-example-label-en { display: none !important; }

/* ── EN-only mode ── */
html.lang-en .lt-para-km,
html.lang-en .lt-section-title-km,
html.lang-en .lt-lesson-title-km,
html.lang-en .lt-step-body-km,
html.lang-en .lt-key-point-text-km,
html.lang-en .lt-box-text-km,
html.lang-en .lt-example-text-km { display: none !important; }
html.lang-en .lt-cell-km { display: none !important; }
html.lang-en .lt-cell-en { display: inline; }

/* EN-only: promote English text to primary readability */
html.lang-en .lt-para-en,
html.lang-en .lt-box-text-en,
html.lang-en .lt-example-text-en {
  font-size: .95rem; color: var(--text-main);
}

/* ── Mobile refinements ── */
@media (max-width: 768px) {
  /* Language toggle: compact on small screens */
  .lt-lang-toggle button { padding: 6px 12px; font-size: .78rem; }

  /* Lesson search: full width on mobile */
  .lt-lesson-search { max-width: 100%; }

  /* Sidebar lesson menu: slightly tighter on mobile */
  .sidebar-cat { font-size: .84rem; padding: 9px 16px; }
  .sidebar-pages a { font-size: .8rem; padding: 7px 11px; }
}

@media (max-width: 380px) {
  .mobile-nav-drawer { width: 236px; }
  .mobile-nav-drawer a { font-size: .82rem; padding: 9px 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME  —  toggled via <html data-theme="light">
   The whole site is CSS-variable driven, so re-mapping the palette
   flips every surface. Accent colours (gold/green/red/blue…) stay,
   they read fine on light too.
   ═══════════════════════════════════════════════════════════════ */
html[data-theme="light"] {
  --bg-base:        #F1F5F9;   /* page background (light grey) */
  --bg-card:        #FFFFFF;   /* card surface */
  --bg-card-hover:  #E9EEF5;
  --bg-sidebar:     #FFFFFF;
  --bg-ticker:      #EEF2F8;
  --surface:        #FFFFFF;   /* support-modal card (had a dark fallback) */

  --border:         #E2E8F0;
  --border-glow:    rgba(245,158,11,.30);

  --text-main:      #0F172A;
  --text-muted:     #475569;
  --text-dim:       #64748B;
}
/* Nav has a hardcoded translucent dark bg — override for light */
html[data-theme="light"] .lt-nav { background: rgba(255,255,255,.92); }
/* Soft shadow so white cards have depth on the light-grey page */
html[data-theme="light"] .lt-section,
html[data-theme="light"] .lt-sidebar,
html[data-theme="light"] .support-modal { box-shadow: 0 1px 3px rgba(15,23,42,.06); }
/* Darker amber links for readability on white */
html[data-theme="light"] a        { color: #B45309; }
html[data-theme="light"] a:hover  { color: #F59E0B; }

/* ── Nav right-side group + theme toggle button ── */
.lt-nav-right { display: flex; align-items: center; gap: 8px; }
.lt-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: none; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted);
  font-size: 1.05rem; cursor: pointer; transition: .15s;
}
.lt-theme-toggle:hover {
  color: var(--gold); border-color: var(--gold-muted);
  background: var(--bg-card-hover);
}
/* Smooth colour flip when toggling */
body { transition: background-color .25s ease, color .2s ease; }

/* Visually hidden — readable by screen readers, invisible on screen.
   Used by the footer visit counter, which shows icons only. */
.visually-hidden{
  position:absolute !important;
  width:1px; height:1px;
  padding:0; margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
