/* ==========================================================================
   Ma'orif — Sayyid Burhoniddin Muhaqqiq Termiziy
   "Ink & Gilding" dizayn tizimi — manuskript ruhidagi, o'ziga xos vizual uslub.

   Tuzilma:
   1. Tokens          6.  Ma'orif reader (manuskript)
   2. Reset            7.  Timeline / Stats / Filters
   3. Typography       8.  Media gallery / Test / Profile
   4. Buttons/Forms     9.  Footer / Auth / Admin
   5. Header / Hero     10. Responsive
   ========================================================================== */

/* ==========================================================================
   1. Tokens — "Deep Midnight × Ancient Gold" premium editorial tizimi
   Izoh: ranglar semantik ravishda ajratilgan — "sirt" (background) va "matn"
   tokenlari hech qachon bitta o'zgaruvchida aralashtirilmaydi (bu qoida avvalgi
   dark-mode inversiya xatosidan keyin qat'iy saqlanadi — sayt bitta, ataylab
   tuzilgan temada ishlaydi, avtomatik dark-mode yo'q).

   Matn-kontrast qoidasi: --gold yorqin va och fonlarda (--bg/--surface) O'QISH
   uchun YETARLI KONTRASTGA EGA EMAS (WCAG AA) — shuning uchun kichik/matnli
   elementlarda (eyebrow, yorliq) --gold-ink ishlatiladi, --gold esa faqat
   dekorativ (chiziq, ramka, ikon, katta "ruh" raqamlar) yoki to'q fonlar
   ustida (navy) matn uchun qo'llaniladi.
   ========================================================================== */
:root {
  /* --- Sirtlar --- */
  --bg:                #F8F5EE;   /* Warm Ivory — asosiy fon */
  --surface:            #FFFFFF;
  --surface-raised:     #FFFCF6;
  --surface-inverse:    #101B36;  /* Deep Midnight Navy — hero, footer, tugmalar, sidebar */
  --surface-inverse-2:  #1B2C52;
  --parchment:          #F1E7D2; /* Ma'orif reader, hikmat kartalari, qadimiy qog'oz his-tuyg'usi */
  --parchment-dark:     #E4D4B2;

  /* --- Matn --- */
  --text-heading:       #101B36;
  --text-body:          #2A2724;
  --text-muted:         #6E6656;
  --on-inverse:         #FFFFFF;
  --on-inverse-muted:   rgba(255,255,255,.72);

  /* --- Aksentlar --- */
  --gold:               #C79A42;  /* Ancient Gold — dekorativ/to'q fon ustida matn */
  --gold-light:         #E0BC72;
  --gold-ink:           #8C6A2E;  /* Gold'ning AA-xavfsiz to'q varianti — och fonda MATN uchun */
  --gold-wash:          rgba(199,154,66,.12);
  --glow-gold:          0 0 0 1px rgba(199,154,66,.28), 0 10px 32px -8px rgba(199,154,66,.5);
  --copper:             #A66138;  /* Copper — ikkilamchi aksent */

  /* --- Chegara / soya --- */
  --border:             #E6DCC8;
  --border-strong:      #D2C2A0;
  --shadow-sm: 0 1px 2px rgba(16,27,54,.06);
  --shadow-md: 0 10px 34px -10px rgba(16,27,54,.22);
  --shadow-lg: 0 24px 70px -18px rgba(16,27,54,.34);

  /* --- Holat ranglari --- */
  --success:    #3E7A4D;
  --success-bg: #E7F3EA;
  --error:      #B23A34;
  --error-bg:   #FBEAE9;

  /* --- Tipografika --- */
  --font-display: 'Cormorant Garamond', 'Lora', Georgia, serif;
  --font-serif:   'Lora', Georgia, 'Times New Roman', serif;
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* --- Radius / o'lcham / harakat --- */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-xl: 28px;
  --container-w: 1160px;
  --container-w-wide: 1400px;
  --ease-editorial: cubic-bezier(.16,1,.3,1);
}

/* ==========================================================================
   2. Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--text-body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
table { border-collapse: collapse; }
.container { max-width: var(--container-w); margin: 0 auto; padding: 0 1.25rem; }

::selection { background: var(--gold-wash); color: var(--text-heading); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Scroll-reveal utility — motion.js [data-reveal] elementlarga .is-visible
   qo'shadi (IntersectionObserver). JS ishlamasa ("html.js" klassi yo'q bo'lsa)
   yoki reduced-motion bo'lsa — kontent darhol, to'liq ko'rinadi (progressive
   enhancement: animatsiya faqat JS tasdiqlangandan keyin yoqiladi). */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s var(--ease-editorial), transform .7s var(--ease-editorial);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal="fade"] { transform: none; }
html[data-motion="off"] [data-reveal] { opacity: 1; transform: none; }

/* ==========================================================================
   3. Typography
   Asosiy matn — serif (kitobiy xarakter). Interfeys elementlari (tugma, forma,
   navigatsiya, jadval, yorliq) — sans, aniq belgilangan holda.
   ========================================================================== */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; color: var(--text-heading); }
h1, .h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); letter-spacing: -.01em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.eyebrow, .brand__subtitle,
.btn, .nav-toggle, .main-nav, .main-nav__auth, .admin-nav, .admin-sidebar, .admin-topbar,
.form label, .form input, .form select, .form textarea, .field-error, .field-hint,
.search-form input, .badge, .pill, .filter-list, .filter-sidebar h3, .pagination,
table, th, td, .card__tag, .card__meta, .article-meta, .test-intro__facts,
.stat-tile__label, .stat-card__label, .bar-chart__label, .site-footer__col h3,
.admin-table code, .reader-nav__link, .reader-toggle label, .reader-block__label,
.admin-topbar__user, .results-table th {
  font-family: var(--font-sans);
}

.eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 .6rem;
}
.hl { color: var(--copper); font-style: italic; }
.muted { color: var(--text-muted); }
.link-more { font-family: var(--font-sans); color: var(--copper); font-weight: 600; font-size: .9rem; }
.link-more:hover { text-decoration: underline; }
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.empty-state { color: var(--text-muted); font-style: italic; padding: 1rem 0; }

/* Eski statik ajratkich — endi partials/ornament-divider.php (animatsiyalanadigan
   inline SVG) bilan almashtirilmoqda. Hali migratsiya qilinmagan joylar uchun saqlanadi. */
.ornament-divider {
  height: 28px; margin: 2.5rem auto; max-width: 220px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='28' viewBox='0 0 220 28'%3E%3Cpath d='M0 14h85M135 14h85' stroke='%23D2C2A0' stroke-width='1'/%3E%3Cpath d='M110 4l10 10-10 10-10-10z' fill='none' stroke='%23C79A42' stroke-width='1.2'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* Animatsiyalanadigan geometrik ajratkich (partials/ornament-divider.php) */
.geo-divider { display: flex; align-items: center; justify-content: center; margin: 3rem auto; max-width: 260px; }
.geo-divider svg { width: 100%; height: auto; overflow: visible; }
html.js .geo-divider path, html.js .geo-divider line { stroke-dasharray: 300; stroke-dashoffset: 300; transition: stroke-dashoffset 1.4s var(--ease-editorial); }
.geo-divider.is-drawn path, .geo-divider.is-drawn line { stroke-dashoffset: 0; }

/* ==========================================================================
   4. Buttons / Forms / Alerts / Badges
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border-radius: var(--r-sm);
  padding: .65rem 1.3rem;
  font-weight: 600;
  font-size: .92rem;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.btn-primary { background: var(--surface-inverse); color: #fff; }
.btn-primary:hover { background: var(--surface-inverse-2); }
.btn-outline { background: transparent; border-color: var(--surface-inverse); color: var(--surface-inverse); }
.btn-outline:hover { background: var(--surface-inverse); color: #fff; }
.btn-ghost { background: transparent; color: var(--surface-inverse); }
.btn-ghost:hover { background: var(--border); }
.btn-danger { background: transparent; border-color: var(--error); color: var(--error); }
.btn-danger:hover { background: var(--error); color: #fff; }
.btn-sm { padding: .4rem .85rem; font-size: .8rem; }
.btn-lg { padding: .85rem 1.75rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

.alert {
  font-family: var(--font-sans);
  padding: .85rem 1.1rem;
  border-radius: var(--r-sm);
  margin: 1rem 0;
  font-size: .92rem;
  transition: opacity .4s ease;
}
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid currentColor; }
.alert-error { background: var(--error-bg); color: var(--error); border: 1px solid currentColor; }

.form-group { margin-bottom: 1.1rem; }
.form-group--sm { max-width: 180px; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }
.form label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: .35rem; color: var(--text-heading); }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=number], .form input[type=url], .form input[type=tel],
.form input[type=file], .form select, .form textarea {
  width: 100%;
  padding: .65rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: .92rem;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.form input:disabled { background: var(--bg); color: var(--text-muted); }
.form textarea { resize: vertical; font-family: var(--font-sans); }
.form-check label { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.field-error { display: block; color: var(--error); font-size: .8rem; margin-top: .3rem; }
.field-hint { display: block; color: var(--text-muted); font-size: .78rem; margin-top: .3rem; }
.inline-form { display: inline; }
.inline-form-grid { display: flex; gap: .5rem; align-items: center; }
.inline-form-grid select { padding: .4rem .5rem; }
.search-form { display: flex; gap: .5rem; }
.search-form input { padding: .55rem .8rem; border: 1px solid var(--border); border-radius: var(--r-sm); font-family: var(--font-sans); }
.current-file { margin-bottom: .5rem; }
.thumb-preview { width: 120px; height: 80px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border); }

.badge { display: inline-block; padding: .25rem .65rem; border-radius: 999px; font-size: .74rem; font-weight: 600; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--muted { background: var(--border); color: var(--text-muted); }

/* ==========================================================================
   5. Header / Nav / Hero
   ========================================================================== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-bottom-color: transparent;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background .4s var(--ease-editorial), box-shadow .4s var(--ease-editorial), border-color .4s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
  padding: .9rem 1.25rem;
  transition: padding .4s var(--ease-editorial);
}
.site-header.is-scrolled .site-header__inner { padding-block: .6rem; }

/* Bosh sahifada (hero bilan) header hero ustiga suzuvchi, shaffof holatda
   boshlanadi — pastga tushilganda ivory fonga "morflanadi" */
body.has-hero .site-header {
  position: fixed; top: 0; left: 0; right: 0;
  background: transparent;
}
body.has-hero .site-header.is-scrolled {
  background: rgba(248,245,238,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body.has-hero .site-header:not(.is-scrolled) .brand__title,
body.has-hero .site-header:not(.is-scrolled) .brand__subtitle,
body.has-hero .site-header:not(.is-scrolled) .main-nav a { color: var(--on-inverse); }
body.has-hero .site-header:not(.is-scrolled) .main-nav a:hover,
body.has-hero .site-header:not(.is-scrolled) .main-nav a.active { color: var(--gold-light); border-color: var(--gold-light); }
body.has-hero .site-header:not(.is-scrolled) .nav-toggle span { background: var(--on-inverse); }
body.has-hero .site-header:not(.is-scrolled) .btn-outline { border-color: rgba(255,255,255,.55); color: var(--on-inverse); }
body.has-hero .site-header:not(.is-scrolled) .btn-outline:hover { background: rgba(255,255,255,.12); }
body.has-hero .site-header:not(.is-scrolled) .btn-ghost { color: var(--on-inverse); }
body.has-hero .site-header:not(.is-scrolled) .btn-ghost:hover { background: rgba(255,255,255,.12); }

.brand { display: flex; align-items: center; gap: .65rem; }
.brand__mark { width: 44px; height: 44px; color: var(--gold); flex-shrink: 0; }
.brand__mark svg { width: 100%; height: 100%; }
.brand--footer .brand__mark, .brand--auth .brand__mark, .brand--admin .brand__mark { color: var(--gold-light); }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text-heading); }
.brand__subtitle { font-size: .66rem; color: var(--text-muted); letter-spacing: .03em; }
.brand--auth, .brand--admin { margin-bottom: 1.5rem; }
.brand--footer .brand__title, .brand--footer .brand__subtitle { color: inherit; }

/* Ish stolida .nav-panel "shaffof" konteyner — ichidagi ikkita element
   (.main-nav, .main-nav__auth) to'g'ridan-to'g'ri grid'ning 2- va 3-ustuniga
   tushadi. Mobilda pastda alohida flex-column panelga aylanadi. */
.nav-panel { display: contents; }
.main-nav { display: flex; align-items: center; gap: 1.4rem; justify-content: center; flex-wrap: wrap; }
.main-nav a { font-size: .88rem; font-weight: 500; color: var(--text-body); padding: .3rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--text-heading); border-color: var(--gold); }
.main-nav__auth { display: flex; align-items: center; gap: .6rem; }

.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: .4rem; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text-heading); border-radius: 2px; }

/* ==========================================================================
   Hero — sinematik, asimmetrik kompozitsiya. Kanvasda konstellyatsiya,
   fonda gigant iqtibos, kontent chapga tortilgan (klassik markazlashgan
   yoki "matn-chapda/rasm-o'ngda" naqsh emas).
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1100px 620px at 82% -10%, rgba(199,154,66,.16), transparent 60%),
    radial-gradient(800px 500px at -5% 110%, rgba(166,97,56,.14), transparent 55%),
    var(--surface-inverse);
  color: var(--on-inverse);
  padding: clamp(9rem, 16vw, 12.5rem) 0 clamp(3rem, 6vw, 4.5rem);
  min-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero__canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .9; }
.hero__bgquote {
  position: absolute; z-index: 1; inset: auto -2% 6% auto;
  margin: 0; text-align: right; max-width: 62%;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: clamp(3rem, 9vw, 7.5rem); line-height: .92;
  color: rgba(224,188,114,.09);
  pointer-events: none; user-select: none;
}
@media (forced-colors: active) { .hero__bgquote, .hero__canvas { display: none; } }

.hero__layout { position: relative; z-index: 2; }
.hero__col { max-width: 640px; }
.hero .eyebrow { color: var(--gold-light); }
.hero__title { color: var(--on-inverse); font-size: clamp(2.5rem, 6vw, 4.6rem); line-height: 1.04; margin-bottom: 1.1rem; }
.hero__title .hl { color: var(--gold-light); font-style: italic; }
.hero__lead { font-family: var(--font-serif); color: rgba(255,255,255,.78); font-size: 1.15rem; max-width: 46ch; }
/* Umumiy "lead" paragraf — och fon uchun xavfsiz (hero__lead faqat to'q hero ichida) */
.lead { font-family: var(--font-serif); color: var(--text-muted); font-size: 1.1rem; max-width: 60ch; }

.hero__actions { display: flex; align-items: center; gap: 1.75rem; margin-top: 2.25rem; flex-wrap: wrap; }
.hero__link { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-sans); font-weight: 600; font-size: .92rem; color: var(--on-inverse); padding-bottom: .2rem; border-bottom: 1px solid rgba(255,255,255,.35); transition: border-color .25s ease, color .25s ease, gap .25s ease; }
.hero__link:hover { color: var(--gold-light); border-color: var(--gold-light); gap: .75rem; }
.hero__link-arrow { transition: transform .25s var(--ease-editorial); }
.hero__link:hover .hero__link-arrow { transform: translateX(3px); }

/* "Muhr" (seal) CTA — kompozitsiyaning bir qismi, oddiy tugma emas */
.seal-btn {
  position: relative;
  width: clamp(126px, 13vw, 158px); height: clamp(126px, 13vw, 158px);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-align: center; flex-shrink: 0;
  background: radial-gradient(circle at 34% 28%, var(--surface-inverse-2), var(--surface-inverse) 72%);
  border: 1.5px solid var(--gold);
  color: var(--on-inverse);
  font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; line-height: 1.22;
  box-shadow: var(--glow-gold);
  transition: transform .5s var(--ease-editorial), box-shadow .4s ease;
}
.seal-btn::before {
  content: ''; position: absolute; inset: 9px; border-radius: 50%;
  border: 1px solid rgba(224,188,114,.4);
}
.seal-btn:hover { transform: scale(1.05) rotate(-3deg); box-shadow: 0 0 0 1px rgba(199,154,66,.45), 0 20px 54px -12px rgba(199,154,66,.6); }
.seal-btn span { position: relative; }

.hero__stats {
  position: relative; z-index: 2;
  display: flex; gap: clamp(1.75rem, 5vw, 3.5rem); flex-wrap: wrap;
  margin-top: clamp(3rem, 7vw, 5.5rem); padding-top: 1.85rem;
  border-top: 1px solid rgba(255,255,255,.14);
}
.stat-card { display: block; }
.stat-card__num { display: block; font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; line-height: 1; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.stat-card__label { display: block; margin-top: .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--on-inverse-muted); }

/* ==========================================================================
   Sections / Cards
   ========================================================================== */
.section { padding: 3.5rem 0; }
.section--muted { background: var(--parchment); }
.section--wisdom { padding: 2.75rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.75rem; gap: 1rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; position: relative; padding-bottom: .55rem; }
.section-head h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 46px; height: 2px; background: var(--gold); }
.section-head--center { flex-direction: column; justify-content: center; text-align: center; }
.section-head--center h2::after { left: 50%; transform: translateX(-50%); }

.page-header { padding-bottom: 1.5rem; }
.page-header--reader { padding-bottom: .5rem; }
.page-header h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); margin-bottom: .3rem; }
.reader-original-title { font-family: var(--font-serif); font-style: italic; color: var(--text-muted); }
.article-meta { color: var(--text-muted); font-size: .85rem; display: flex; gap: .5rem; }

.page-content { max-width: 74ch; font-size: 1.06rem; }
.page-content h2, .page-content h3 { margin-top: 1.5em; }
.article-content { max-width: 74ch; font-size: 1.08rem; margin-bottom: 1.5rem; }
.article-content blockquote, .page-content blockquote {
  position: relative;
  margin: 2.25rem 0; padding: .25rem 0 .25rem 2rem;
  border-left: 2px solid var(--gold);
  font-family: var(--font-display); font-style: italic;
  font-size: 1.35rem; line-height: 1.5; color: var(--text-heading);
}
.article-content blockquote p:last-child, .page-content blockquote p:last-child { margin-bottom: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card-grid--feature .card:first-child { grid-column: span 2; }
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: transform .2s cubic-bezier(.2,.7,.3,1), box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.card::after {
  content: ''; position: absolute; top: 0; left: 0; height: 2px; width: 0;
  background: var(--gold); transition: width .3s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.card:hover::after { width: 100%; }
.card__body { padding: 1.5rem; }
.card__tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--copper); margin-bottom: .55rem; }
.card__title { font-size: 1.2rem; margin-bottom: .5rem; }
.card__title a:hover { color: var(--copper); }
.card__excerpt { color: var(--text-muted); font-size: .94rem; margin-bottom: .8rem; }
.card__meta { display: flex; gap: .8rem; color: var(--text-muted); font-size: .76rem; margin-bottom: .6rem; }

.chapter-card { padding: 1.5rem; display: flex; flex-direction: column; gap: .4rem; }
.chapter-card__num { font-family: var(--font-sans); font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-ink); }


.icon { width: 1.5rem; height: 1.5rem; }

/* Wisdom */
.wisdom-banner {
  background: var(--parchment);
  border-left: 4px solid var(--gold);
  border-radius: var(--r-md);
  padding: 2rem 2.25rem;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}
.wisdom-banner__mark { font-family: var(--font-display); font-size: 2.6rem; color: var(--gold); line-height: 0; display: block; margin-bottom: .5rem; }
.wisdom-banner__text { font-family: var(--font-serif); font-size: 1.32rem; font-style: italic; color: var(--text-heading); margin-bottom: .5rem; }
.wisdom-banner__source { font-family: var(--font-sans); color: var(--text-muted); font-size: .82rem; margin: 0; }

/* Wisdom Cards — "yirtilgan qog'oz" chekkasi (clip-path, 3 variant) +
   burchak ag'darilishi (corner-peel) hover effekti bilan */
.wisdom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.wisdom-card {
  position: relative;
  background: var(--surface-raised);
  padding: 2rem 1.85rem 1.6rem;
  margin: 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s ease, transform .3s ease;
}
.wisdom-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.wisdom-card--v0 { clip-path: polygon(0% 1%, 3% 0%, 97% 0%, 100% 2%, 99% 8%, 100% 15%, 99% 22%, 100% 30%, 100% 98%, 97% 100%, 4% 100%, 0% 98%, 1% 60%, 0% 40%); }
.wisdom-card--v1 { clip-path: polygon(1% 0%, 99% 1%, 100% 10%, 99% 20%, 100% 35%, 99% 55%, 100% 75%, 99% 92%, 98% 100%, 2% 99%, 0% 88%, 1% 65%, 0% 45%, 1% 25%); }
.wisdom-card--v2 { clip-path: polygon(2% 0%, 98% 1%, 100% 12%, 99% 28%, 100% 50%, 99% 70%, 100% 90%, 96% 100%, 3% 100%, 0% 90%, 1% 70%, 0% 48%, 1% 24%, 0% 8%); }
.wisdom-card__glyph {
  position: absolute; top: -.5rem; left: .75rem;
  font-family: var(--font-display); font-size: 4.5rem; color: var(--gold);
  opacity: .16; line-height: 1; pointer-events: none;
}
.wisdom-card p { position: relative; font-family: var(--font-serif); font-style: italic; font-size: 1.08rem; color: var(--text-heading); }
.wisdom-card footer { position: relative; font-family: var(--font-sans); color: var(--text-muted); font-size: .8rem; }
.wisdom-card__fold {
  position: absolute; right: 0; bottom: 0; width: 26px; height: 26px;
  background: linear-gradient(135deg, transparent 50%, var(--parchment-dark) 50%);
  box-shadow: -2px -2px 6px rgba(16,27,54,.08);
  transform-origin: bottom right; transform: scale(.001);
  transition: transform .35s var(--ease-editorial);
}
.wisdom-card:hover .wisdom-card__fold { transform: scale(1); }

/* ==========================================================================
   6. Ma'orif reader (manuscript)
   ========================================================================== */
.reader { position: relative; max-width: 820px; margin: 0 auto; }
.reader-toggle {
  position: sticky; top: 72px; z-index: 10;
  display: flex; gap: .4rem; flex-wrap: wrap;
  background: var(--parchment-dark);
  padding: .35rem;
  border-radius: 999px;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
}
.reader-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.reader-toggle label {
  padding: .5rem 1.1rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s ease;
}
.reader-toggle input:checked + label { background: var(--surface-inverse); color: #fff; }

.manuscript-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.85rem 2.1rem;
  margin-bottom: 1.25rem;
}
.manuscript-card--main { background: var(--parchment); border-color: var(--parchment-dark); box-shadow: var(--shadow-sm); }
.reader-block__label { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-ink); margin-bottom: .8rem; }
.manuscript-text { font-family: var(--font-serif); font-size: 1.14rem; line-height: 1.9; color: var(--text-heading); }
.manuscript-text--dropcap::first-letter {
  font-family: var(--font-display);
  font-size: 4.4rem;
  font-weight: 700;
  color: var(--copper);
  float: left;
  line-height: .85;
  padding-right: .1em;
  margin-top: .06em;
}

/* Bob raqami — dekorativ katta fon raqami */
.page-header--reader .container { position: relative; }
.page-header--reader .container::after {
  content: attr(data-chapter-number);
  position: absolute; top: -1.2rem; right: 1.25rem;
  font-family: var(--font-display); font-size: 6rem; font-weight: 700;
  color: var(--gold); opacity: .12; line-height: 1; pointer-events: none;
}

/* Toggle visibility logic (CSS-only tabs). MUHIM: .reader-toggle va
   .reader-content bir xil ota ostida sibling bo'lishi shart — bu umumiy
   sibling-selector shu holatga tayanadi. */
#mode-translation:checked ~ .reader-content .reader-block--original,
#mode-translation:checked ~ .reader-content .reader-block--commentary,
#mode-original:checked ~ .reader-content .reader-block--commentary {
  display: none;
}

/* Panel almashinuvida faqat YANGI ko'rinayotgan panel yumshoq fade qiladi —
   display:none dan chiqqanda animatsiya "spec" bo'yicha avtomatik qayta
   ishga tushadi (JS shart emas). */
@keyframes manuscriptFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.reader-block { animation: manuscriptFade .55s var(--ease-editorial) both; }

/* Interactive Manuscript Viewer — "kitob yoyilmasi": Asl matn + tarjima
   (va sharh rejimida ham) keng ekranlarda ikki ustunli, o'rtada nozik soya. */
.reader-content { position: relative; }
@media (min-width: 860px) {
  #mode-original:checked ~ .reader-content,
  #mode-commentary:checked ~ .reader-content {
    display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 0;
  }
  #mode-original:checked ~ .reader-content .reader-block--original,
  #mode-commentary:checked ~ .reader-content .reader-block--original {
    grid-column: 1; border-radius: var(--r-lg) 0 0 var(--r-lg); margin-bottom: 0;
  }
  #mode-original:checked ~ .reader-content .reader-block--translation,
  #mode-commentary:checked ~ .reader-content .reader-block--translation {
    grid-column: 2; border-radius: 0 var(--r-lg) var(--r-lg) 0; margin-bottom: 0;
  }
  #mode-commentary:checked ~ .reader-content .reader-block--commentary {
    grid-column: 1 / -1; margin-top: 1.5rem;
  }
  #mode-original:checked ~ .reader-content::after,
  #mode-commentary:checked ~ .reader-content::after {
    content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 18px; margin-left: -9px;
    background: linear-gradient(to right, rgba(16,27,54,.08), transparent 45%, transparent 55%, rgba(16,27,54,.08));
    pointer-events: none;
  }
}

.reader-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.reader-nav__link { display: flex; flex-direction: column; gap: .2rem; font-size: .82rem; }
.reader-nav__link--prev { text-align: left; }
.reader-nav__link--next { text-align: right; margin-left: auto; }
.reader-nav__link span { color: var(--gold-ink); font-weight: 600; }
.reader-nav__link strong { font-family: var(--font-serif); color: var(--text-heading); font-size: .95rem; }
.reader-nav__link--all { text-align: center; color: var(--text-muted); }

.chapter-list { display: flex; flex-direction: column; gap: .6rem; max-width: 680px; }
.chapter-list a { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: .95rem 1.2rem; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.chapter-list a:hover { border-color: var(--gold); transform: translateX(4px); box-shadow: var(--shadow-sm); }
.chapter-list__num { font-family: var(--font-display); color: var(--gold-ink); font-weight: 700; width: 1.6rem; }
.chapter-list__title { flex: 1; }
.chapter-list__arrow { color: var(--gold); opacity: 0; transform: translateX(-6px); transition: opacity .2s ease, transform .2s ease; }
.chapter-list a:hover .chapter-list__arrow { opacity: 1; transform: translateX(0); }

/* ==========================================================================
   7. Biography timeline / Stats / Filters
   ========================================================================== */
/* Golden Timeline — har bir band o'z ulanish segmentiga ega, IntersectionObserver
   orqali navbat bilan "chiziladi" (bitta yaxlit chiziq emas). */
.timeline { position: relative; max-width: 720px; margin: 0 auto; padding-left: 2.4rem; }
.timeline__item { position: relative; padding-bottom: 2.75rem; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:not(:last-child)::before {
  content: ''; position: absolute; left: -1.7rem; top: .5rem; bottom: -.75rem; width: 2px;
  background: linear-gradient(var(--gold), var(--gold-light));
}
.timeline__marker {
  position: absolute; left: -2.05rem; top: .3rem; width: 15px; height: 15px;
  background: var(--gold); border: 3px solid var(--bg);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.timeline__content h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.timeline__content p { color: var(--text-muted); margin: 0; }

/* JS tasdiqlangandagina animatsiya bilan "chiziladi" — aks holda darhol to'liq ko'rinadi */
html.js .timeline__item:not(:last-child)::before { transform: scaleY(0); transform-origin: top; transition: transform 1.1s var(--ease-editorial); }
html.js .timeline__item.is-drawn::before { transform: scaleY(1); }
html.js .timeline__marker { transform: scale(0); transition: transform .5s var(--ease-editorial) .3s; }
html.js .timeline__item.is-drawn .timeline__marker { transform: scale(1); }
html.js .timeline__content { opacity: 0; transform: translateY(10px); transition: opacity .6s ease .2s, transform .6s ease .2s; }
html.js .timeline__item.is-drawn .timeline__content { opacity: 1; transform: translateY(0); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--gold);
  border-radius: var(--r-md);
  padding: 1.3rem 1.1rem;
  text-align: center;
}
.stat-tile__num { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--text-heading); font-variant-numeric: tabular-nums; }
.stat-tile__label { display: block; color: var(--text-muted); font-size: .78rem; margin-top: .3rem; }

.bar-chart { display: flex; align-items: flex-end; gap: .5rem; height: 160px; padding-top: 1rem; }
.bar-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: .4rem; }
.bar-chart__bar { width: 100%; max-width: 22px; height: var(--h, 4%); min-height: 3px; background: linear-gradient(180deg, var(--gold-light), var(--gold)); border-radius: 3px 3px 0 0; }
.bar-chart__label { font-size: .66rem; color: var(--text-muted); }

.top-list { display: flex; flex-direction: column; gap: .6rem; }
.top-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--border); font-size: .9rem; font-family: var(--font-sans); }
.top-list li:last-child { border-bottom: none; }
.top-list li span:last-child { color: var(--text-muted); font-variant-numeric: tabular-nums; }

.articles-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; }
.filter-sidebar h3 { font-size: .9rem; }
.filter-list { display: flex; flex-direction: column; gap: .35rem; }
.filter-list a { padding: .4rem .6rem; border-radius: var(--r-sm); font-size: .88rem; color: var(--text-muted); }
.filter-list a:hover, .filter-list a.active { background: var(--parchment); color: var(--text-heading); font-weight: 600; }

.filter-pills { display: flex; gap: .6rem; margin-bottom: 1.75rem; flex-wrap: wrap; font-family: var(--font-sans); }
.pill { padding: .4rem 1rem; border-radius: 999px; border: 1px solid var(--border); font-size: .82rem; color: var(--text-muted); }
.pill:hover, .pill.active { background: var(--surface-inverse); border-color: var(--surface-inverse); color: #fff; }

.pagination { display: flex; gap: .4rem; margin-top: 2rem; justify-content: center; }
.pagination a { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); border: 1px solid var(--border); font-size: .85rem; }
.pagination a.active { background: var(--surface-inverse); color: #fff; border-color: var(--surface-inverse); }

/* ==========================================================================
   8. Media gallery / Test taking / Profile
   ========================================================================== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.media-card img { width: 100%; height: 160px; object-fit: cover; }
.media-card__icon { width: 100%; height: 160px; display: flex; align-items: center; justify-content: center; background: var(--parchment); }
.media-card__icon .icon { width: 2.4rem; height: 2.4rem; color: var(--gold); }
.media-card__body { padding: 1.1rem 1.2rem; }
.media-card__body h3 { font-size: 1rem; margin-bottom: .3rem; }
.media-card__body p { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }

.test-intro { max-width: 640px; }
.test-intro__facts { display: flex; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.test-intro__facts li { font-size: .9rem; color: var(--text-muted); }
.test-intro__facts strong { font-family: var(--font-display); color: var(--text-heading); font-size: 1.2rem; display: block; }

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.question-card legend { font-family: var(--font-sans); font-weight: 600; padding: 0; font-size: 1rem; display: flex; gap: .6rem; }
.question-card__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--gold); color: #fff; font-size: .8rem; flex-shrink: 0;
}
.answer-list { margin-top: 1rem; display: flex; flex-direction: column; gap: .55rem; }
.answer-option { font-family: var(--font-sans); display: flex; align-items: center; gap: .65rem; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; }
.answer-option:hover { border-color: var(--gold); }

.result-summary { text-align: center; padding: 2.5rem; margin-bottom: 2rem; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.result-summary__score { display: block; font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--text-heading); margin-bottom: .5rem; }
.result-summary--pass { border-top: 4px solid var(--success); }
.result-summary--fail { border-top: 4px solid var(--error); }
.result-summary p { margin-top: 1rem; color: var(--text-muted); font-family: var(--font-sans); font-size: .92rem; }

.review-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.question-review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem 1.5rem; }
.question-review--correct { border-left: 4px solid var(--success); }
.question-review--wrong { border-left: 4px solid var(--error); }
.question-review__text { font-family: var(--font-sans); font-weight: 600; display: flex; gap: .6rem; align-items: flex-start; }
.answer-review-list { margin-top: .75rem; display: flex; flex-direction: column; gap: .35rem; padding-left: 2.2rem; font-family: var(--font-sans); }
.answer-review-list li { font-size: .9rem; color: var(--text-muted); }
.answer-review-list li.is-correct { color: var(--success); font-weight: 600; }
.answer-review-list li.is-wrong-selected { color: var(--error); font-weight: 600; }

.results-table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); }
.results-table th, .results-table td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--border); font-size: .88rem; }
.results-table th { color: var(--text-muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; }

.profile-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.profile-col { display: flex; flex-direction: column; gap: 1.5rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.75rem; margin-bottom: 1.5rem; }
.panel:last-child { margin-bottom: 0; }
.panel h2 { font-size: 1.15rem; margin-bottom: 1.1rem; }
.avatar-row { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem; }
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--parchment); display: flex; align-items: center; justify-content: center; font-family: var(--font-serif); font-size: 1.5rem; color: var(--gold-ink); flex-shrink: 0; border: 2px solid var(--gold-light); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   9. Footer / Auth / Admin
   ========================================================================== */
.site-footer { position: relative; overflow: hidden; background: var(--surface-inverse); color: rgba(255,255,255,.8); margin-top: 3rem; border-top: 1px solid rgba(217,174,95,.3); }
.site-footer::before {
  content: '';
  position: absolute; right: -60px; bottom: -60px; width: 260px; height: 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Crect x='35' y='35' width='130' height='130' fill='none' stroke='%23D9AE5F' stroke-width='1'/%3E%3Crect x='35' y='35' width='130' height='130' fill='none' stroke='%23D9AE5F' stroke-width='1' transform='rotate(45 100 100)'/%3E%3C/svg%3E");
  opacity: .05; pointer-events: none;
}
.site-footer__inner { position: relative; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; max-width: var(--container-w-wide); margin: 0 auto; padding: 4rem 1.25rem 2.5rem; }
.site-footer .brand__title { font-size: 1.55rem; }
.site-footer__col h3 { color: var(--gold-light); font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 1.1rem; }
.site-footer__col a { display: block; margin-bottom: .7rem; font-size: .9rem; color: rgba(255,255,255,.75); transition: color .15s ease, padding-left .2s ease; }
.site-footer__col a:hover { color: var(--gold-light); padding-left: .25rem; }
.site-footer__desc { font-family: var(--font-serif); font-size: .95rem; margin-top: 1.1rem; max-width: 40ch; color: rgba(255,255,255,.68); line-height: 1.7; }
.site-footer__divider { position: relative; display: flex; justify-content: center; padding: 0 1.25rem; }
.site-footer__divider svg { width: 200px; height: 24px; }
.site-footer__bottom { position: relative; border-top: 1px solid rgba(255,255,255,.1); margin-top: 1.75rem; padding: 1.5rem; text-align: center; font-family: var(--font-sans); font-size: .78rem; letter-spacing: .02em; color: rgba(255,255,255,.45); }

.auth-body { background: var(--surface-inverse); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-shell { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; }
.auth-card { background: var(--surface); border-radius: var(--r-lg); padding: 2.25rem; width: 100%; box-shadow: var(--shadow-lg); }
.auth-title { text-align: center; margin-bottom: .3rem; }
.auth-subtitle { font-family: var(--font-sans); text-align: center; color: var(--text-muted); font-size: .88rem; margin-bottom: 1.5rem; }
.auth-switch { font-family: var(--font-sans); text-align: center; margin-top: 1.25rem; font-size: .88rem; color: var(--text-muted); }
.auth-switch a { color: var(--gold-light); font-weight: 600; }
.auth-back { font-family: var(--font-sans); color: rgba(255,255,255,.7); font-size: .84rem; margin-top: 1.5rem; }

.admin-body { background: var(--bg); font-family: var(--font-sans); }
.admin-body h1, .admin-body h2, .admin-body h3, .admin-body h4 { font-family: var(--font-serif); }
.admin-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--surface-inverse); color: rgba(255,255,255,.85); padding: 1.5rem 1.1rem; display: flex; flex-direction: column; }
.admin-nav { display: flex; flex-direction: column; gap: .15rem; flex: 1; }
.admin-nav a { padding: .65rem .75rem; border-radius: var(--r-sm); font-size: .88rem; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.admin-sidebar__foot { display: flex; flex-direction: column; gap: .25rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.admin-sidebar__link { font-family: var(--font-sans); color: rgba(255,255,255,.7); font-size: .84rem; padding: .5rem .75rem; text-align: left; background: none; border: none; width: 100%; }
.admin-sidebar__link:hover { color: #fff; }

.admin-content { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 2rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-topbar h1 { margin: 0; font-size: 1.28rem; }
.admin-topbar__user { color: var(--text-muted); font-size: .86rem; }
.admin-main { padding: 2rem; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; gap: 1rem; flex-wrap: wrap; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.stat-grid--admin { margin-bottom: 1.5rem; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: middle; }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; }
.admin-table__actions { display: flex; gap: .5rem; }
.admin-table code { background: var(--parchment); padding: .15rem .4rem; border-radius: 4px; font-size: .8rem; }

.question-block { border: 1px solid var(--border); border-radius: var(--r-md); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; background: var(--bg); }
.question-block__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.question-block__num { font-weight: 600; color: var(--text-heading); }
.answer-builder { margin-top: .5rem; }
.answer-rows { display: flex; flex-direction: column; gap: .5rem; margin: .5rem 0; }
.answer-row { display: flex; align-items: center; gap: .6rem; }
.answer-row__correct input { width: 18px; height: 18px; accent-color: var(--success); }
.answer-row__text { flex: 1; }

/* ==========================================================================
   11. Premium komponentlar — Knowledge Compass / Quote Carousel /
       Reading Progress Orb / Editorial grid / Sealed CTA
   ========================================================================== */

/* --- Chapter Navigator — muharrirlik indeksi, oddiy kartalar o'rniga --- */
.chapter-nav { display: flex; flex-direction: column; }
.chapter-nav__row { border-bottom: 1px solid var(--border); }
.chapter-nav__row:first-child { border-top: 1px solid var(--border); }
.chapter-nav__row:nth-child(even) .chapter-nav__link { padding-block: 2.5rem; }
.chapter-nav__row:nth-child(odd) .chapter-nav__link { padding-block: 1.9rem; }
.chapter-nav__link { display: flex; align-items: center; gap: clamp(1rem, 4vw, 2.5rem); position: relative; transition: padding-left .35s var(--ease-editorial); }
.chapter-nav__link:hover, .chapter-nav__link:focus-visible { padding-left: 1rem; }
.chapter-nav__ghost {
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(3rem, 7vw, 6rem); color: var(--gold); opacity: .14;
  width: clamp(70px, 11vw, 150px); flex-shrink: 0; text-align: center;
  transition: opacity .3s ease;
  font-variant-numeric: tabular-nums;
}
.chapter-nav__link:hover .chapter-nav__ghost, .chapter-nav__link:focus-visible .chapter-nav__ghost { opacity: .3; }
.chapter-nav__body { flex: 1; min-width: 0; }
.chapter-nav__eyebrow { font-family: var(--font-sans); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.chapter-nav__title { font-size: clamp(1.25rem, 2.4vw, 1.7rem); margin: .2rem 0 0; transition: color .2s ease; }
.chapter-nav__link:hover .chapter-nav__title, .chapter-nav__link:focus-visible .chapter-nav__title { color: var(--copper); }
.chapter-nav__summary {
  color: var(--text-muted); font-size: .92rem; margin: 0; max-width: 62ch;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .45s var(--ease-editorial), opacity .35s ease, margin-top .45s ease;
}
.chapter-nav__link:hover .chapter-nav__summary, .chapter-nav__link:focus-visible .chapter-nav__summary { max-height: 4.5rem; opacity: 1; margin-top: .6rem; }
.chapter-nav__arrow {
  font-family: var(--font-serif); font-size: 1.5rem; color: var(--gold); flex-shrink: 0;
  opacity: 0; transform: translateX(-8px);
  transition: opacity .3s ease, transform .3s ease;
}
.chapter-nav__link:hover .chapter-nav__arrow, .chapter-nav__link:focus-visible .chapter-nav__arrow { opacity: 1; transform: translateX(0); }

/* --- Knowledge Compass --- */
.compass-section { position: relative; }
.compass { position: relative; width: min(100%, 560px); aspect-ratio: 1; margin: 0 auto; display: flex; align-items: center; justify-content: center; }
.compass__rose { width: 62%; height: 62%; color: var(--gold); transition: transform 1.2s var(--ease-editorial); }
.compass:hover .compass__rose { transform: rotate(18deg); }
.compass__center { position: absolute; width: 30%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); text-align: center; padding: 1rem; }
.compass__center-label { font-family: var(--font-display); font-size: 1rem; color: var(--text-heading); line-height: 1.15; }
.compass__point { position: absolute; display: flex; flex-direction: column; align-items: center; gap: .5rem; text-align: center; width: 128px; }
.compass__point--n { top: -4%; left: 50%; transform: translateX(-50%); }
.compass__point--e { top: 50%; right: -6%; transform: translateY(-50%); }
.compass__point--s { bottom: -4%; left: 50%; transform: translateX(-50%); }
.compass__point--w { top: 50%; left: -6%; transform: translateY(-50%); }
.compass__point-icon { width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--gold-ink); transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease; }
.compass__point-icon .icon { width: 1.3rem; height: 1.3rem; }
.compass__point:hover .compass__point-icon { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.compass__point-label { font-family: var(--font-sans); font-size: .85rem; font-weight: 600; color: var(--text-heading); }
.compass__point-desc { font-family: var(--font-sans); font-size: .74rem; color: var(--text-muted); }

/* --- Quote Carousel --- */
.quote-carousel { position: relative; max-width: 820px; margin: 0 auto; text-align: center; }
.quote-carousel__track { position: relative; min-height: 11rem; }
.quote-slide { position: absolute; inset: 0; opacity: 0; transform: translateY(10px); transition: opacity .6s var(--ease-editorial), transform .6s var(--ease-editorial); pointer-events: none; }
.quote-slide.is-active { position: relative; opacity: 1; transform: translateY(0); pointer-events: auto; }
.quote-slide__mark { font-family: var(--font-display); font-size: 2.8rem; color: var(--gold); line-height: 0; display: block; margin-bottom: .75rem; }
.quote-slide__text { font-family: var(--font-display); font-style: italic; font-size: clamp(1.35rem, 3vw, 1.9rem); color: var(--text-heading); line-height: 1.35; margin-bottom: .85rem; }
.quote-slide__source { font-family: var(--font-sans); color: var(--text-muted); font-size: .85rem; }
.quote-carousel__controls { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 2rem; }
.quote-carousel__prev, .quote-carousel__next { width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: var(--text-heading); transition: border-color .2s ease, background .2s ease; }
.quote-carousel__prev:hover, .quote-carousel__next:hover { border-color: var(--gold); background: var(--gold-wash); }
.quote-carousel__dots { display: flex; gap: .5rem; }
.quote-carousel__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); border: none; padding: 0; transition: background .2s ease, transform .2s ease; }
.quote-carousel__dot.is-active { background: var(--gold); transform: scale(1.3); }

/* --- Editorial / jurnal uslubidagi maqola grid --- */
.editorial-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.75rem; }
.editorial-card { grid-column: span 2; position: relative; }
/* Tor ustunda (masalan filtr yon paneli bilan) — oddiy moslashuvchan grid */
.editorial-grid--listing { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.editorial-grid--listing .editorial-card { grid-column: auto; }
.editorial-card--feature { grid-column: span 4; }
.editorial-card__media { aspect-ratio: 16/10; border-radius: var(--r-md); overflow: hidden; background: var(--parchment); margin-bottom: 1.1rem; position: relative; }
.editorial-card--feature .editorial-card__media { aspect-ratio: 21/10; }
.editorial-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-editorial); }
.editorial-card:hover .editorial-card__media img { transform: scale(1.045); }
.editorial-card__media-fallback { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gold); background: linear-gradient(155deg, var(--parchment), var(--parchment-dark)); }
.editorial-card__media-fallback .icon { width: 2.6rem; height: 2.6rem; opacity: .7; }
.editorial-card__tag { font-family: var(--font-sans); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--copper); margin-bottom: .5rem; display: block; }
.editorial-card__title { font-size: 1.25rem; margin-bottom: .5rem; }
.editorial-card--feature .editorial-card__title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.editorial-card__title a { background-image: linear-gradient(var(--gold), var(--gold)); background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1px; transition: background-size .35s var(--ease-editorial); }
.editorial-card__title a:hover { background-size: 100% 1px; }
.editorial-card__excerpt { color: var(--text-muted); font-size: .94rem; }

/* --- Reading Progress Orb --- */
.reading-orb {
  position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 40;
  width: 3.4rem; height: 3.4rem; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
  border: 1px solid var(--border);
}
.reading-orb.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.reading-orb svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.reading-orb__track { fill: none; stroke: var(--border); stroke-width: 3; }
.reading-orb__progress { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.reading-orb__icon { position: absolute; width: 1.1rem; height: 1.1rem; color: var(--gold-ink); }
@media (max-width: 760px) { .reading-orb { right: 1rem; bottom: 1rem; width: 2.9rem; height: 2.9rem; } }

/* --- Sealed CTA (yakuniy chaqiruv) --- */
.final-cta {
  position: relative; overflow: hidden;
  background: var(--surface-inverse);
  color: var(--on-inverse);
  padding: clamp(4rem, 9vw, 7rem) 0;
  text-align: center;
}
.final-cta::before {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Ccircle cx='40' cy='40' r='34' fill='none' stroke='%23D9AE5F' stroke-width='.5'/%3E%3C/svg%3E");
  opacity: .05; pointer-events: none;
}
.final-cta__inner { position: relative; max-width: 640px; margin: 0 auto; }
.final-cta h2 { color: var(--on-inverse); }
.final-cta p { font-family: var(--font-serif); color: rgba(255,255,255,.78); font-size: 1.08rem; margin-bottom: 2.25rem; }
.final-cta__actions { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; }
.final-cta .btn-primary { background: var(--gold); color: var(--surface-inverse); }
.final-cta .btn-primary:hover { background: var(--gold-light); box-shadow: var(--glow-gold); }
.final-cta .btn-outline { border-color: rgba(255,255,255,.5); color: #fff; }
.final-cta .btn-outline:hover { background: rgba(255,255,255,.12); }

/* ==========================================================================
   10. Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero__ornament { display: none; }
  .hero__inner { grid-template-columns: 1fr; }
  .articles-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .card-grid--feature .card:first-child { grid-column: span 1; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-panel {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem 1.5rem;
    gap: 1rem;
  }
  .nav-panel.is-open { display: flex; }
  .main-nav { flex-direction: column; align-items: flex-start; gap: .85rem; }
  .main-nav__auth { flex-wrap: wrap; }
  .reader-toggle { position: static; }
  .reader-nav { grid-template-columns: 1fr; text-align: left !important; gap: .75rem; }
  .reader-nav__link--next { text-align: left; margin-left: 0; }
}
