/*
Theme Name: TQ Notes (Hello Elementor Child)
Template: hello-elementor
Description: Child theme for the Tarjuma-tul-Quran notes site. Holds fonts, skin variables, and small front-end widgets on top of Hello Elementor + Elementor Pro.
Version: 1.1.0
Text Domain: tq-notes
*/

/* BUILD MARKER: font-size-pass-1 — if you can see this comment when
   viewing this file via Appearance > Theme File Editor, the correct
   updated file is on the server and any remaining stale look is a
   browser/CDN/host cache issue, not a missed upload. */

/* ==========================================================
   SKIN SYSTEM — CSS custom properties, switched via a body
   class set by the Customizer control (see functions.php).
   Elementor's own Global Colors can point at these same vars
   (Site Settings > Global Colors > use the "Custom" hex field
   with e.g. var(--gold-1)) so Elementor-built sections skin
   automatically too.
   ========================================================== */

:root,
body.tq-skin-gold {
  --bg: #06090B;
  --bg-gradient: radial-gradient(ellipse at top, #12100c 0%, #06090B 55%, #030405 100%);
  --panel: rgba(20,26,30,.62);
  --panel-border: rgba(212,175,55,.14);
  --gold-1: #F4C669;
  --gold-2: #C9922E;
  --emerald: #22A37D;
  --coral: #E2574C;
  --text-1: #F2ECDD;
  --text-2: #A69C8C;
  --dot: rgba(212,175,55,.35);
}

/* Typography scale — defaults here; overridden inline by Customizer
   settings (Appearance > Customize > TQ Typography) when changed from
   default, so one slider genuinely controls each category sitewide
   without editing CSS or hunting through Elementor templates. */
:root {
  --tq-body-size: 18px;
  --tq-heading-size: 42px;
  --tq-card-title-size: 27px;
  --tq-meta-size: 16px;
  --tq-verse-arabic-size: 22px;
  --tq-verse-urdu-size: 16px;
  --tq-subheading-size: 17px;
  --tq-brand-size: 22px;
  --tq-class-selector-size: 16px;
  --tq-header-nav-size: 16px;
  --tq-footer-nav-size: 16px;
  /* Reading-comfort scale — adjusted by the sm/md/lg font-size toggle
     on the Single Surah page (see assets/tq-widgets.js). Multiplies
     content-relevant sizes only; branding/hero sizes stay fixed. */
  --tq-fontsize-scale: 1;
}
html[data-tq-fontsize="sm"] { --tq-fontsize-scale: 0.88; }
html[data-tq-fontsize="lg"] { --tq-fontsize-scale: 1.18; }

body.tq-skin-emerald {
  --bg: #050B09;
  --bg-gradient: radial-gradient(ellipse at top, #0b1712 0%, #050B09 55%, #030605 100%);
  --panel: rgba(15,30,25,.62);
  --panel-border: rgba(16,185,129,.16);
  --gold-1: #FDE68A;
  --gold-2: #10B981;
  --emerald: #10B981;
  --coral: #E2574C;
  --text-1: #EAF3EE;
  --text-2: #9BAFA6;
  --dot: rgba(16,185,129,.35);
}

/* Note: an earlier invented "Charcoal Gold" skin was removed here —
   comparing it against the 4 source-derived skins below showed it
   shared identical --bg, --gold-1, --gold-2 and --emerald values with
   "Platinum Charcoal," making it a functional duplicate. */

/* ==========================================================
   EXTENDED PALETTE SKINS — four additional color identities,
   each carefully tuned for contrast and mood (font families stay
   the same across every skin — Amiri Quran / Jameel Noori
   Nastaleeq — only color/background identity changes per skin).
   ========================================================== */

body.tq-skin-amber-emerald {
  --bg: #05080A;
  --bg-gradient: radial-gradient(ellipse at top, #0d1210 0%, #05080A 55%, #030405 100%);
  --panel: rgba(15,23,42,.7);
  --panel-border: rgba(16,185,129,.10);
  --gold-1: #FDE68A;
  --gold-2: #F59E0B;
  --emerald: #10B981;
  --coral: #E2574C;
  --text-1: #E2E8F0;
  --text-2: #94A3B8;
  --dot: rgba(16,185,129,.3);
}

body.tq-skin-citrine-gold {
  --bg: #0A0A0B;
  --bg-gradient: radial-gradient(ellipse at top, #14140f 0%, #0A0A0B 55%, #050505 100%);
  --panel: rgba(26,26,28,.7);
  --panel-border: rgba(253,224,71,.15);
  --gold-1: #FEF08A;
  --gold-2: #FDE047;
  --emerald: #22A37D;
  --coral: #E2574C;
  --text-1: #E5E7EB;
  --text-2: #9CA3AF;
  --dot: rgba(253,224,71,.3);
}

body.tq-skin-ivory-emerald {
  --bg: #050706;
  --bg-gradient: radial-gradient(ellipse at top, #0c1310 0%, #050706 55%, #030403 100%);
  --panel: rgba(6,78,59,.18);
  --panel-border: rgba(212,175,55,.15);
  --gold-1: #E8CD7A;
  --gold-2: #D4AF37;
  --emerald: #0F6B4A;
  --coral: #EF4444;
  --text-1: #F8FAFC;
  --text-2: #94A3B8;
  --dot: rgba(212,175,55,.3);
}

body.tq-skin-platinum-charcoal {
  --bg: #0A0A0B;
  --bg-gradient: radial-gradient(ellipse at top, #1A1A1E 0%, #0A0A0B 55%, #050506 100%);
  --panel: rgba(26,26,30,.75);
  --panel-border: rgba(212,175,55,.18);
  --gold-1: #E8C15E;
  --gold-2: #D4AF37;
  --emerald: #3FA383;
  --coral: #EF4444;
  --text-1: #E0E0E0;
  --text-2: #8E8E93;
  --dot: rgba(212,175,55,.25);
}

/* ==========================================================
   FONTS — self-hosted. Drop the actual .woff2 files in
   /assets/fonts/ and update these paths. (Jameel Noori
   Nastaleeq is not a licensed Google Fonts entry, so it must
   be self-hosted; Amiri Quran can be self-hosted the same way
   for performance/reliability instead of depending on the
   Google Fonts CDN.)
   ========================================================== */

@font-face {
  font-family: "Amiri Quran";
  src: url("assets/fonts/AmiriQuran-Regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Jameel Noori Nastaleeq";
  src: url("assets/fonts/JameelNooriNastaleeq.woff2") format("woff2");
  font-display: swap;
}

.tq-arabic { font-family: "Amiri Quran", "Traditional Arabic", serif !important; line-height: 1.8; }
.tq-urdu   { font-family: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", serif !important; line-height: 1.7; }

/* ==========================================================
   BASE LAYOUT — logical properties throughout, so the whole
   site mirrors correctly the moment dir="ltr" is set on a
   wrapper (see mu-plugin-tq-direction.php). Never add a
   left/right physical-property override anywhere else in the
   child theme or in Elementor Custom CSS — it will silently
   break the LTR mode for whichever element it's on.
   ========================================================== */

body {
  background-color: var(--bg) !important;
  color: var(--text-1) !important;
  /* Dot texture (top layer) sits over the skin's vignette gradient
     (base layer) — each skin now has its own distinct depth/mood,
     not just a flat color swap. */
  background-image: radial-gradient(var(--dot) .6px, transparent .6px), var(--bg-gradient) !important;
  background-size: 26px 26px, 100% 100%;
  background-attachment: fixed, fixed;
  font-family: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", serif !important;
  font-size: calc(var(--tq-body-size) * var(--tq-fontsize-scale));
  line-height: 1.9;
}
html {
  background: var(--bg-gradient), var(--bg) !important;
}

/* Focus outlines — Elementor's own default focus-ring color (a pink/red)
   was showing through on interactive elements since nothing here
   overrode it explicitly. This makes focus rings follow the active
   skin's gold accent everywhere, consistently, instead of clashing. */
a:focus-visible,
button:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--gold-2) !important;
  outline-offset: 2px;
}

/* This is fundamentally an Urdu-content site, so Nastaliq is the
   default body font (inherited naturally by our own shortcode/HTML
   output — cards, badges, footer, nav). Elementor's own native
   widgets (Heading, Text Editor, Archive Title, Post Title) generate
   their own typography CSS via the site Kit with higher specificity
   than a plain inherited font-family, so they need an explicit,
   narrowly-scoped override here. This does NOT touch icon-font
   elements (.eicon-*, dashicons, etc.), only genuine text classes,
   so icons are unaffected. .tq-arabic still overrides this correctly
   wherever real Qur'anic Arabic (Amiri Quran) is needed instead. */
.elementor-heading-title,
.elementor-text-editor,
.elementor-text-editor p {
  font-family: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", serif !important;
  line-height: 1.7 !important;
}

.tq-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  padding: 28px;
}

.tq-gradient-text {
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tq-badge {
  display: inline-block;
  font-size: var(--tq-meta-size);
  color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-inline-end: 8px;
}

.tq-mcq-option {
  text-align: start;
  border-radius: 10px;
  padding: 10px 14px;
  border: 1px solid var(--panel-border) !important;
  background: rgba(255,255,255,.03) !important;
  color: var(--text-1) !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.tq-mcq-option:hover:not([aria-disabled="true"]) {
  border-color: var(--gold-2) !important;
}
.tq-mcq-option.is-correct {
  background: rgba(34,163,125,.18) !important;
  border-color: var(--emerald) !important;
  color: var(--emerald) !important;
}
.tq-mcq-option.is-wrong {
  background: rgba(226,87,76,.18) !important;
  border-color: var(--coral) !important;
  color: var(--coral) !important;
}

/* Verse-quote blocks (intro_notes block_type = verse_quote) — visually
   distinct from regular paragraph text, used wherever a Surah's notes
   cite a specific ayah mid-explanation. */
.tq-verse-quote {
  border-inline-start: 3px solid var(--gold-2);
  background: rgba(255,255,255,.02);
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  margin: 14px 0;
}
.tq-verse-quote .tq-verse-quote-arabic {
  font-family: "Amiri Quran", serif;
  font-size: calc(var(--tq-verse-arabic-size) * var(--tq-fontsize-scale));
  line-height: 2;
  color: var(--gold-1);
  margin-bottom: 8px;
}
.tq-verse-quote .tq-verse-quote-urdu {
  font-size: calc(var(--tq-verse-urdu-size) * var(--tq-fontsize-scale));
  line-height: 1.7;
  color: var(--text-2);
}
.tq-block-subheading {
  font-weight: 600 !important;
  color: var(--gold-1) !important;
  margin: 18px 0 6px;
  font-size: calc(var(--tq-subheading-size) * var(--tq-fontsize-scale)) !important;
  line-height: 1.6 !important;
}

/* ==========================================================
   HEADER — sticky, blurred, gold-underline nav hover.
   ========================================================== */

.tq-header {
  position: sticky;
  top: 0;
  z-index: 999;
  overflow: visible;
  background: linear-gradient(var(--bg), var(--bg) 75%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--panel-border);
  transition: border-color .3s ease;
}

.tq-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  overflow: visible;
}

.tq-brand {
  font-size: var(--tq-brand-size);
  line-height: 1.6;
  font-weight: 700;
  margin: 0;
  text-decoration: none;
  transition: filter .2s ease;
}
.tq-brand:hover { filter: brightness(1.15); }

.tq-header-controls {
  display: flex !important;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  overflow: visible;
}

.tq-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}
.tq-nav-link {
  position: relative;
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--tq-meta-size);
  padding-bottom: 4px;
  transition: color .2s ease;
}
/* Independent sizing for header vs footer nav links, scoped by
   container so the two can be adjusted separately even though they
   share the same .tq-nav-link class. */
.tq-header .tq-nav-link { font-size: var(--tq-header-nav-size) !important; }
.tq-footer-links .tq-nav-link { font-size: var(--tq-footer-nav-size) !important; }
.tq-nav-link::after {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  bottom: 0;
  width: 0;
  height: 1.5px;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  transition: width .25s ease;
}
.tq-nav-link:hover { color: var(--text-1); }
.tq-nav-link:hover::after { width: 100%; }

/* Marks whichever nav link matches the page currently being browsed
   (Home, All Surahs, or a specific Class) — permanent gold state
   (not just on hover), plus a small dot so it reads clearly even for
   someone scanning quickly. */
.tq-nav-link.is-current {
  color: var(--gold-1) !important;
  font-weight: 600;
}
.tq-nav-link.is-current::after { width: 100%; }
.tq-nav-link.is-current::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-2);
  margin-inline-end: 6px;
  vertical-align: middle;
}

select.class-select {
  font-size: var(--tq-meta-size);
  color: var(--text-1);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  appearance: none;
  transition: border-color .2s ease, background .2s ease;
}
select.class-select:hover,
select.class-select:focus {
  border-color: var(--gold-2);
  background: rgba(255,255,255,.04);
  outline: none;
}

/* Custom dropdown — replaces native <select> so the open menu can
   actually be styled (browsers largely ignore CSS on native <option>
   elements, which is why the native select looked unstyled/default). */
.tq-dropdown {
  position: relative;
  display: inline-block;
}
.tq-dropdown-toggle {
  display: flex !important;
  align-items: center;
  justify-content: flex-start !important;
  gap: 16px !important;
  font-family: inherit;
  font-size: var(--tq-class-selector-size) !important;
  color: var(--text-1) !important;
  background: var(--panel) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.tq-dropdown-toggle:hover,
.tq-dropdown.is-open .tq-dropdown-toggle {
  border-color: var(--gold-2) !important;
  background: rgba(255,255,255,.04) !important;
}
.tq-dropdown-toggle:focus-visible {
  outline: none !important;
  border-color: var(--gold-2) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold-2) 30%, transparent) !important;
}
.tq-dropdown-toggle svg {
  transition: transform .2s ease;
  flex-shrink: 0;
}
.tq-dropdown.is-open .tq-dropdown-toggle svg {
  transform: rotate(180deg);
}
.tq-dropdown-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
  padding: 6px;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.tq-dropdown.is-open .tq-dropdown-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.tq-dropdown-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-2) !important;
  text-decoration: none;
  font-size: var(--tq-class-selector-size) !important;
  transition: background .15s ease, color .15s ease;
}
.tq-dropdown-item:hover {
  background: rgba(255,255,255,.05);
  color: var(--gold-1) !important;
}

@media (max-width: 640px) {
  .tq-header-inner { padding: 12px 16px; }
  .tq-nav { gap: 12px; }
  .tq-brand { font-size: calc(var(--tq-brand-size) * 0.86); }
}

/* ==========================================================
   FOOTER
   ========================================================== */

.tq-footer {
  border-top: 1px solid var(--panel-border);
  background: linear-gradient(transparent, rgba(255,255,255,.015));
  margin-top: 60px;
}

.tq-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 28px;
}

.tq-footer-top {
  display: flex !important;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.tq-footer-brand {
  font-size: var(--tq-brand-size);
  line-height: 1.6;
  font-weight: 700;
  margin: 0 0 6px;
}

.tq-footer-credit {
  font-size: var(--tq-meta-size);
  color: var(--text-2);
  margin: 0;
}

.tq-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
}

/* Small ornamental divider — a thin fading line with a centered
   diamond, a quiet nod to Islamic manuscript border motifs rather
   than a plain <hr>. */
.tq-footer-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 20px;
}
.tq-footer-divider::before,
.tq-footer-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--panel-border), transparent);
}
.tq-footer-divider .tq-diamond {
  width: 6px;
  height: 6px;
  background: var(--gold-2);
  transform: rotate(45deg);
  flex-shrink: 0;
  opacity: .7;
}

.tq-footer-bottom {
  text-align: center;
  font-size: var(--tq-meta-size);
  color: var(--text-3);
}
.tq-footer-bottom a {
  color: var(--text-2);
  text-decoration: none;
  transition: color .2s ease;
}
.tq-footer-bottom a:hover { color: var(--gold-1); }

@media (max-width: 640px) {
  .tq-footer-inner { padding: 36px 16px 22px; }
  .tq-footer-top { flex-direction: column; gap: 20px; }
}

/* ==========================================================
   SURAH CARD (Loop Item)
   ========================================================== */

.tq-surah-card {
  position: relative;
  display: block;
  text-decoration: none;
  padding: 26px 24px 22px;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tq-surah-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-2);
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}

.tq-surah-number-badge {
  position: absolute;
  top: 16px;
  inset-inline-start: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-2);
  transition: border-color .25s ease, color .25s ease;
}
.tq-surah-card:hover .tq-surah-number-badge {
  border-color: var(--gold-2);
  color: var(--gold-1);
}

.tq-surah-card-title {
  font-size: var(--tq-card-title-size);
  margin: 8px 0 16px;
  text-align: center;
  /* line-height intentionally not set here — inherits the generous
     1.8 multiplier from .tq-arabic (also applied on this element),
     which is what actually prevents diacritic clipping. Setting a
     tighter value here would just re-introduce the cutoff bug. */
}

.tq-badges-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tq-card-cta {
  display: block;
  text-align: center;
  font-size: var(--tq-meta-size);
  color: var(--gold-1);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s ease, transform .25s ease;
}
.tq-surah-card:hover .tq-card-cta {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll-reveal — subtle fade/slide-up as cards enter view.
   Class is toggled by JS (assets/tq-widgets.js); if JS is disabled
   the CSS default (opacity 1) keeps everything visible regardless. */
.tq-reveal {
  opacity: 1;
  transform: none;
}
.tq-reveal.tq-reveal-init {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease;
}
.tq-reveal.tq-reveal-init.tq-reveal-visible {
  opacity: 1;
  transform: none;
}

/* ==========================================================
   ARCHIVE (Class / Surah listing)
   ========================================================== */

.tq-archive-hero {
  text-align: center;
  padding: 56px 24px 40px;
  max-width: 700px;
  margin: 0 auto;
}
.tq-archive-title,
.tq-archive-title .elementor-heading-title {
  font-size: var(--tq-heading-size) !important;
  line-height: 1.7 !important;
  margin: 0 0 14px !important;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent !important;
}
.tq-archive-subtitle {
  display: block;
  font-size: var(--tq-meta-size);
  color: var(--text-2);
}

.tq-archive-grid-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

@media (max-width: 640px) {
  .tq-archive-hero { padding: 40px 16px 28px; }
  .tq-archive-title, .tq-archive-title * { font-size: calc(var(--tq-heading-size) * 0.71) !important; }
  .tq-archive-grid-wrap { padding: 0 16px 40px; }
}

/* Pagination (Loop Grid's built-in numbered pagination) */
.elementor-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}
.elementor-pagination .page-numbers {
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  font-size: var(--tq-meta-size);
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.elementor-pagination .page-numbers:hover {
  border-color: var(--gold-2);
  color: var(--gold-1);
}
.elementor-pagination .page-numbers.current {
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  color: var(--bg);
  border-color: transparent;
  font-weight: 600;
}

/* ==========================================================
   SINGLE SURAH TEMPLATE
   ========================================================== */

.tq-surah-hero {
  text-align: center;
  padding: 48px 24px 28px;
  max-width: var(--tq-content-max-width, 900px);
  margin: 0 auto;
}
.tq-surah-hero-title {
  font-size: var(--tq-heading-size) !important;
  line-height: 1.7 !important;
  margin: 0 0 18px;
}
.tq-hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.tq-fontsize-toggle {
  display: inline-flex;
  border: 1px solid var(--panel-border) !important;
  border-radius: 10px;
  overflow: hidden;
}
.tq-fontsize-toggle button {
  font-family: inherit;
  font-size: var(--tq-meta-size);
  color: var(--text-2) !important;
  background: var(--panel) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 7px 13px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.tq-fontsize-toggle button + button { border-inline-start: 1px solid var(--panel-border) !important; }
.tq-fontsize-toggle button:hover,
.tq-fontsize-toggle button:focus-visible { color: var(--text-1) !important; }
html[data-tq-fontsize="sm"] .tq-fontsize-toggle button[data-tq-fontsize-set="sm"],
html[data-tq-fontsize="md"] .tq-fontsize-toggle button[data-tq-fontsize-set="md"],
html[data-tq-fontsize="lg"] .tq-fontsize-toggle button[data-tq-fontsize-set="lg"] {
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2)) !important;
  color: var(--bg) !important;
}
.tq-bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: var(--tq-meta-size);
  color: var(--text-2) !important;
  background: var(--panel) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color .2s ease, color .2s ease;
}
.tq-bookmark-btn:hover,
.tq-bookmark-btn:focus-visible { border-color: var(--gold-2) !important; color: var(--gold-1) !important; }
.tq-bookmark-btn svg { transition: fill .2s ease; }
.tq-bookmark-btn.is-bookmarked { border-color: var(--gold-2) !important; color: var(--gold-1) !important; }
.tq-bookmark-btn.is-bookmarked svg { fill: var(--gold-1); }

/* Tabs */
.tq-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 8px;
  margin: 0 auto 4px;
  max-width: var(--tq-content-max-width, 900px);
  justify-content: var(--tq-tabs-align, flex-start);
  scrollbar-width: none;
}
.tq-tabs::-webkit-scrollbar { display: none; }
.tq-tab {
  flex: 0 0 auto;
  font-family: inherit;
  font-size: var(--tq-meta-size);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--panel-border) !important;
  background: var(--panel) !important;
  color: var(--text-2) !important;
  cursor: pointer;
  white-space: nowrap;
  outline: none !important;
  box-shadow: none !important;
  transition: all .2s ease;
}
.tq-tab:hover,
.tq-tab:focus-visible { border-color: var(--gold-2) !important; color: var(--text-1) !important; }
.tq-tab.is-active {
  color: var(--bg) !important;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2)) !important;
  border-color: transparent !important;
  font-weight: 600;
}

/* Panels */
.tq-panels-wrap {
  max-width: var(--tq-content-max-width, 900px);
  margin: 0 auto;
  padding: 0 24px 60px;
  container-type: inline-size;
  container-name: tq-content;
}
.tq-tab-panel { display: none; }
.tq-tab-panel.is-active { display: block; }
.tq-content-panel { padding: 28px; margin-bottom: 0; }
.tq-content-panel h2 {
  margin: 0 0 18px !important;
  font-size: var(--tq-card-title-size) !important;
  line-height: 1.6 !important;
  color: var(--gold-1) !important;
  font-weight: 700 !important;
}

/* Intro blocks (paragraph / subheading / verse_quote) */
.tq-intro-paragraph {
  color: var(--text-2) !important;
  font-size: calc(var(--tq-body-size) * var(--tq-fontsize-scale)) !important;
  line-height: 1.9 !important;
  margin: 0 0 14px;
}
.tq-intro-paragraph:last-child { margin-bottom: 0; }
.tq-intro-paragraph b { color: var(--text-1) !important; }

/* Topics / practical points lists */
.tq-topic-item, .tq-point-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--panel-border);
}
.tq-topic-item:last-child, .tq-point-item:last-child { border-bottom: none; padding-bottom: 0; }
.tq-topic-item:first-child, .tq-point-item:first-child { padding-top: 0; }
.tq-topic-heading, .tq-point-subheading {
  font-weight: 600 !important;
  font-size: calc(var(--tq-meta-size) * var(--tq-fontsize-scale)) !important;
  color: var(--gold-1) !important;
  margin-bottom: 6px;
}

/* Vocabulary grid */
.tq-vocab-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tq-vocab-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--panel-border);
}
.tq-vocab-word {
  font-family: "Amiri Quran", serif !important;
  color: var(--gold-1) !important;
  font-size: calc(var(--tq-verse-arabic-size) * .8 * var(--tq-fontsize-scale)) !important;
}
.tq-vocab-meaning { color: var(--text-2) !important; font-size: calc(var(--tq-meta-size) * var(--tq-fontsize-scale)) !important; }
@media (max-width: 640px) { .tq-vocab-grid { grid-template-columns: 1fr; } }

/* Verse-by-verse translation cards */
.tq-verse-card { padding: 20px 0; border-bottom: 1px solid var(--panel-border); }
.tq-verse-card:last-child { border-bottom: none; padding-bottom: 0; }
.tq-verse-card:first-child { padding-top: 0; }
.tq-verse-number {
  font-family: "Inter", sans-serif !important;
  font-size: 11px !important;
  color: var(--text-2) !important;
  opacity: .7;
  margin-bottom: 8px;
}
.tq-verse-arabic {
  font-family: "Amiri Quran", serif !important;
  font-size: calc(var(--tq-verse-arabic-size) * var(--tq-fontsize-scale)) !important;
  line-height: 2 !important;
  color: var(--text-1) !important;
  margin-bottom: 10px;
}
.tq-verse-urdu { font-size: calc(var(--tq-verse-urdu-size) * var(--tq-fontsize-scale)) !important; line-height: 1.7 !important; color: var(--text-2) !important; }

/* MCQs */
.tq-mcq { margin-bottom: 28px; }
.tq-mcq:last-child { margin-bottom: 0; }
.tq-mcq-question { font-size: calc(var(--tq-body-size) * var(--tq-fontsize-scale)) !important; line-height: 1.7 !important; margin-bottom: 14px; color: var(--text-1) !important; }
.tq-mcq-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@container tq-content (max-width: 900px) {
  .tq-mcq-options { grid-template-columns: repeat(2, 1fr); }
}
@container tq-content (max-width: 480px) {
  .tq-mcq-options { grid-template-columns: 1fr; }
}
/* Fallback for browsers without container query support — approximates
   via viewport width, close enough since content width rarely exceeds
   viewport by a large margin in practice. */
@supports not (container-type: inline-size) {
  @media (max-width: 900px) { .tq-mcq-options { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 480px) { .tq-mcq-options { grid-template-columns: 1fr; } }
}
button.tq-mcq-option {
  font-family: inherit;
  font-size: calc(var(--tq-meta-size) * var(--tq-fontsize-scale)) !important;
  color: var(--text-1) !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100%;
}
button.tq-mcq-option[aria-disabled="true"] { cursor: default; }

/* Short questions accordion */
.tq-qa { border-bottom: 1px solid var(--panel-border); padding: 16px 0; }
.tq-qa:last-child { border-bottom: none; }
.tq-qa:first-child { padding-top: 0; }
.tq-qa-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  outline: none !important;
  font-size: calc(var(--tq-body-size) * var(--tq-fontsize-scale)) !important;
  line-height: 1.7 !important;
  color: var(--text-1) !important;
}
.tq-qa-arrow { color: var(--gold-1) !important; transition: transform .2s ease; flex-shrink: 0; }
.tq-qa.is-open .tq-qa-arrow { transform: rotate(180deg); }
.tq-qa-answer {
  max-height: 0;
  overflow: hidden;
  color: var(--text-2) !important;
  font-size: calc(var(--tq-meta-size) * var(--tq-fontsize-scale)) !important;
  line-height: 1.7 !important;
  transition: max-height .25s ease, padding-top .25s ease;
}
.tq-qa.is-open .tq-qa-answer { max-height: 400px; padding-top: 12px; }

/* Duas / Hadith cards — reuse the verse-quote look */
.tq-citation-card {
  border-inline-start: 3px solid var(--gold-2);
  background: rgba(255,255,255,.02);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.tq-citation-card:last-child { margin-bottom: 0; }
.tq-citation-arabic {
  font-family: "Amiri Quran", serif !important;
  font-size: calc(var(--tq-verse-arabic-size) * var(--tq-fontsize-scale)) !important;
  line-height: 2 !important;
  color: var(--gold-1) !important;
  margin-bottom: 8px;
}
.tq-citation-urdu { font-size: calc(var(--tq-verse-urdu-size) * var(--tq-fontsize-scale)) !important; line-height: 1.7 !important; color: var(--text-2) !important; }
.tq-citation-note { font-size: 12px !important; color: var(--text-2) !important; opacity: .7; margin-top: 8px; }

@media (max-width: 640px) {
  .tq-surah-hero { padding: 36px 16px 20px; }
  .tq-panels-wrap { padding: 0 16px 40px; }
  .tq-content-panel { padding: 20px; }
}

/* ==========================================================
   SINGLE SURAH — class link line + prev/next/back navigation
   ========================================================== */

.tq-class-link {
  display: inline-block;
  font-size: calc(var(--tq-meta-size) * .9) !important;
  color: var(--text-2) !important;
  text-decoration: none;
  margin-bottom: 14px;
  padding: 5px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  transition: border-color .2s ease, color .2s ease;
}
.tq-class-link:hover { border-color: var(--gold-2) !important; color: var(--gold-1) !important; }

.tq-surah-bottom-nav {
  max-width: var(--tq-content-max-width, 900px);
  margin: 20px auto 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.tq-surah-nav-link {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 14px 18px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: var(--panel);
  min-width: 0;
  transition: border-color .2s ease, background .2s ease;
}
.tq-surah-nav-link:hover { border-color: var(--gold-2) !important; }
.tq-surah-nav-link.is-disabled { visibility: hidden; }
.tq-surah-nav-next { justify-content: flex-end; text-align: end; }
.tq-surah-nav-arrow { color: var(--gold-1) !important; font-size: 18px; flex-shrink: 0; }
.tq-surah-nav-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tq-surah-nav-label { font-size: 11px; color: var(--text-2) !important; }
.tq-surah-nav-name {
  font-size: calc(var(--tq-card-title-size) * .6) !important;
  color: var(--text-1) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tq-back-to-class-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-size: var(--tq-meta-size);
  color: var(--text-2) !important;
  background: var(--panel) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 10px;
  padding: 12px 18px;
  text-decoration: none;
  outline: none !important;
  transition: border-color .2s ease, color .2s ease;
}
.tq-back-to-class-btn:hover { border-color: var(--gold-2) !important; color: var(--gold-1) !important; }

@media (max-width: 720px) {
  .tq-surah-bottom-nav { flex-direction: column; }
  .tq-surah-nav-link.is-disabled { display: none; }
  .tq-surah-nav-link { width: 100%; }
  .tq-back-to-class-btn { order: -1; }
}

/* Dropdown reflecting the currently browsed class */
.tq-dropdown-toggle.has-selection { border-color: var(--gold-2) !important; color: var(--gold-1) !important; }
.tq-dropdown-item.is-current {
  color: var(--gold-1) !important;
  font-weight: 600;
  background: rgba(255,255,255,.04);
}
.tq-dropdown-item.is-current::after { content: ' ✓'; }

/* Home nav-link icon */
.tq-nav-link-home { display: inline-flex; align-items: center; gap: 6px; }
.tq-nav-link-home svg { flex-shrink: 0; }

/* Header search — a compact icon button that opens a centered,
   backdrop-blurred overlay (a small "command palette" style search),
   rather than an inline-expanding input. Avoids the width-transition
   fragility that comes with animating an input's own width, and
   reads as more deliberate/modern. */
.tq-search-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--panel) !important;
  border: 1px solid var(--panel-border) !important;
  color: var(--text-2) !important;
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color .2s ease, color .2s ease;
}
.tq-search-trigger:hover,
.tq-search-trigger:focus-visible {
  border-color: var(--gold-2) !important;
  color: var(--gold-1) !important;
}

.tq-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.tq-search-overlay.is-open { opacity: 1; pointer-events: auto; }
.tq-search-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
}
.tq-search-overlay-panel {
  position: relative;
  width: 90%;
  max-width: 560px;
  background: var(--panel) !important;
  border: 1px solid var(--panel-border) !important;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  padding: 4px;
  transform: translateY(-16px);
  transition: transform .25s ease;
}
.tq-search-overlay.is-open .tq-search-overlay-panel { transform: translateY(0); }
.tq-search-overlay-form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.tq-search-overlay-icon {
  position: absolute !important;
  inset-inline-start: 18px !important;
  color: var(--gold-1) !important;
  pointer-events: none;
}
.tq-search-overlay-input {
  width: 100%;
  box-sizing: border-box;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--text-1) !important;
  font-family: inherit;
  font-size: calc(var(--tq-body-size) * 1.05) !important;
  padding-block: 18px !important;
  padding-inline-start: 50px !important;
  padding-inline-end: 46px !important;
}
.tq-search-overlay-input::placeholder { color: var(--text-2); opacity: .6; }
/* Defensive: some browsers still render native form-field decorations
   (clear button, etc.) on plain text inputs in rare cases — force them
   off so nothing but our own icon/close button ever shows. */
.tq-search-overlay-input::-webkit-search-cancel-button,
.tq-search-overlay-input::-webkit-search-decoration,
.tq-search-overlay-input::-ms-clear,
.tq-search-overlay-input::-ms-reveal {
  display: none;
  -webkit-appearance: none;
  appearance: none;
}
.tq-search-overlay-close {
  position: absolute;
  inset-inline-end: 10px;
  background: none !important;
  border: none !important;
  color: var(--text-2) !important;
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  outline: none !important;
  transition: color .2s ease;
}
.tq-search-overlay-close:hover { color: var(--gold-1) !important; }
