/* ==========================================================================
   UECF.NET Telugu Webbook — Typography, Language Switcher & Mobile Layout
   ========================================================================== */
:root {
  --font-te: 'Noto Sans Telugu', 'Noto Serif Telugu', 'Gautami', 'Nirmala UI', sans-serif;
  --font-te-serif: 'Noto Serif Telugu', 'Noto Sans Telugu', Georgia, serif;
}

html[lang="te"] body {
  font-family: var(--font-te), var(--font-body);
  line-height: 1.9;
}

html[lang="te"] .page-hero h1,
html[lang="te"] .reader h2,
html[lang="te"] .reader h3,
html[lang="te"] .book-hero h2,
html[lang="te"] .card h2 {
  font-family: var(--font-te-serif);
  line-height: 1.45;
}

html[lang="te"] .reader p,
html[lang="te"] .reader li {
  font-family: var(--font-te);
  line-height: 1.98;
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
}

html[lang="te"] .toc a,
html[lang="te"] .chapter-nav .ttl,
html[lang="te"] .search-results .snippet {
  font-family: var(--font-te);
  line-height: 1.65;
}

/* Language Switcher Pills */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.lang-switcher a {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--band-fg);
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switcher a:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.lang-switcher a[aria-current="true"] {
  background: var(--gold);
  color: #1b1305;
}

.reader-tools .lang-tool {
  background: var(--cream-dim);
  border: 1px solid var(--gold);
  font-weight: 600;
}

/* Grouped TOC Sections */
.toc-section-group {
  margin-top: 24px;
}
.toc-section-group:first-of-type {
  margin-top: 12px;
}
.toc-section-group h3 {
  font-family: var(--font-te-serif);
  font-size: 1.12rem;
  color: var(--maroon);
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.chapter-grid a.pending-chapter {
  opacity: 0.76;
  border-style: dashed;
}

.badge-te {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #1b1305;
  margin-left: 6px;
  vertical-align: middle;
}

.badge-pending {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream-dim);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  margin-left: 6px;
  vertical-align: middle;
}

/* Responsive tables & figures on mobile */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
}
.reader table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}
.reader th, .reader td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
}
@media (max-width: 640px) {
  html[lang="te"] .reader {
    font-size: calc(1.02rem * var(--reader-scale));
  }
  html[lang="te"] .reader p {
    line-height: 1.92;
  }
  .lang-switcher a {
    padding: 4px 10px;
    font-size: 0.8rem;
  }
}
