/* =============================================
   Deconstructing Dawah — Design System
   ============================================= */

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Tokens === */
:root {
  --bg:            #09090e;
  --surface:       #0f0f17;
  --surface-2:     #161621;
  --surface-3:     #1c1c2a;
  --border:        #1e1e2c;
  --border-subtle: #141420;

  --gold:          #c8a84a;
  --gold-light:    #dfc06a;
  --gold-dim:      rgba(200,168,74,0.14);
  --gold-glow:     rgba(200,168,74,0.06);

  --text:          #eeeef5;
  --text-muted:    #8888a0;
  --text-dim:      #52526a;

  --green:         #6bbd87;
  --blue:          #5b8dee;
  --red:           #e05252;
  --purple:        #b868e0;
  --orange:        #e08c52;

  --font-serif: 'Crimson Pro', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 18px;

  --shadow:    0 4px 24px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 56px rgba(0,0,0,.65);

  --header-h: 62px;
}

/* === Base === */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }
img { max-width: 100%; display: block; }
button { font-family: var(--font-sans); }

h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

/* === Layout === */
.container        { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.container--mid   { max-width: 900px;  margin: 0 auto; padding: 0 1.5rem; }
.container--narrow{ max-width: 720px;  margin: 0 auto; padding: 0 1.5rem; }

/* === HEADER === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(9,9,14,.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  max-width: 1180px; margin: 0 auto; padding: 0 1.5rem;
}

/* Logo */
.logo {
  display: flex; flex-direction: column; gap: 0;
  text-decoration: none; flex-shrink: 0;
}
.logo__wordmark {
  font-family: var(--font-serif);
  font-size: 1.1rem; font-weight: 700;
  color: var(--text); letter-spacing: -.01em; line-height: 1;
}
.logo__wordmark em { font-style: normal; color: var(--gold); }
.logo__tagline {
  font-size: .6rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--text-dim); line-height: 1; margin-top: 3px;
}

/* Nav */
.site-nav { display: flex; align-items: center; gap: .125rem; }
.site-nav a {
  font-size: .875rem; font-weight: 500;
  color: var(--text-muted);
  padding: .375rem .75rem; border-radius: var(--radius-sm);
  text-decoration: none; transition: color .15s, background .15s;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--text); background: var(--surface-2);
}

/* Header actions */
.header-actions { display: flex; align-items: center; gap: .375rem; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: transparent; border: none;
  color: var(--text-muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

/* Search shortcut pill */
.search-kbd {
  display: flex; align-items: center; gap: .375rem;
  font-size: .75rem; color: var(--text-dim);
  padding: .25rem .625rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  cursor: pointer; transition: border-color .15s, color .15s;
}
.search-kbd:hover { color: var(--text-muted); border-color: var(--surface-3); }
.search-kbd kbd {
  font-family: var(--font-sans); font-size: .7rem;
  background: var(--surface-2); padding: .1rem .35rem;
  border-radius: 3px; border: 1px solid var(--border);
}

/* === SEARCH OVERLAY === */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(9,9,14,.82);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 72px;
  opacity: 0; visibility: hidden;
  transition: opacity .18s, visibility .18s;
}
.search-overlay.open { opacity: 1; visibility: visible; }

.search-box {
  width: 100%; max-width: 660px; margin: 0 1.25rem;
  background: var(--surface);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-xl);
  overflow: hidden; box-shadow: var(--shadow-lg);
  transform: translateY(-10px) scale(.98);
  transition: transform .18s;
}
.search-overlay.open .search-box { transform: translateY(0) scale(1); }

.search-box__bar {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--border);
}
.search-box__bar svg { width: 18px; height: 18px; color: var(--text-dim); flex-shrink: 0; }

.search-box__input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: 1rem; font-family: var(--font-sans); color: var(--text);
}
.search-box__input::placeholder { color: var(--text-dim); }

.search-box__close {
  background: transparent; border: none; color: var(--text-dim);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
  padding: .25rem .375rem; border-radius: var(--radius-sm);
  transition: color .15s;
}
.search-box__close:hover { color: var(--text); }

.search-results {
  max-height: 400px; overflow-y: auto; padding: .375rem;
}
.search-empty {
  padding: 2rem; text-align: center;
  color: var(--text-dim); font-size: .875rem;
}
.search-empty strong { color: var(--text-muted); }

.search-hint {
  padding: 1.25rem 1rem .75rem;
  font-size: .75rem; color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  display: flex; gap: 1.25rem;
}
.search-hint span { display: flex; align-items: center; gap: .35rem; }
.search-hint kbd {
  font-family: var(--font-sans); font-size: .7rem;
  background: var(--surface-2); padding: .1rem .35rem;
  border-radius: 3px; border: 1px solid var(--border);
  color: var(--text-muted);
}

.s-result {
  display: flex; flex-direction: column; gap: .25rem;
  padding: .75rem .875rem; border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: background .12s;
}
.s-result:hover { background: var(--surface-2); }
.s-result__top { display: flex; align-items: center; gap: .5rem; }
.s-result__title {
  font-size: .9375rem; font-weight: 700;
  color: var(--text); font-family: var(--font-serif);
}
.s-result__excerpt {
  font-size: .8125rem; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* === BADGE === */
.badge {
  display: inline-flex; align-items: center;
  font-size: .6875rem; font-weight: 600;
  letter-spacing: .055em; text-transform: uppercase;
  padding: .175rem .475rem; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); white-space: nowrap;
}
.badge--Trinity  { background:rgba(91,141,238,.12); color:#7ba3f0; border-color:rgba(91,141,238,.25); }
.badge--Quran    { background:rgba(200,168,74,.12);  color:#c8a84a; border-color:rgba(200,168,74,.25); }
.badge--Jesus    { background:rgba(107,189,135,.12); color:#6bbd87; border-color:rgba(107,189,135,.25); }
.badge--Prophecy { background:rgba(184,104,224,.12); color:#b868e0; border-color:rgba(184,104,224,.25); }
.badge--History  { background:rgba(224,140,82,.12);  color:#e08c52; border-color:rgba(224,140,82,.25); }
.badge--Hadith   { background:rgba(224,82,82,.12);   color:#e05252; border-color:rgba(224,82,82,.25); }

/* === DIFFICULTY DOT === */
.diff {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .75rem; color: var(--text-dim);
}
.diff::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
}
.diff--beginner::before     { background: var(--green); }
.diff--intermediate::before { background: var(--gold); }
.diff--advanced::before     { background: var(--red); }

/* === HERO === */
.hero {
  position: relative; padding: 7rem 0 5.5rem;
  text-align: center; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(200,168,74,.07) 0%, transparent 65%),
    radial-gradient(ellipse 55% 45% at 85% 55%, rgba(91,141,238,.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 35% at 15% 65%, rgba(107,189,135,.03) 0%, transparent 55%);
}

.hero__eyebrow {
  font-size: .7rem; font-weight: 600;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1.125rem;
}

.hero__title {
  font-size: clamp(2.75rem, 6.5vw, 4.25rem);
  font-weight: 700; letter-spacing: -.025em;
  line-height: 1.1; margin-bottom: 1.375rem;
}
.hero__title em { font-style: italic; color: var(--gold); }

.hero__sub {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 500px; margin: 0 auto 2.75rem;
  line-height: 1.75;
}

/* Hero search bar */
.hero-search {
  display: flex; align-items: center; gap: .5rem;
  max-width: 520px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: .375rem .375rem .375rem .9rem;
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within {
  border-color: rgba(200,168,74,.35);
  box-shadow: 0 0 0 3px rgba(200,168,74,.07);
}
.hero-search svg {
  width: 17px; height: 17px; color: var(--text-dim); flex-shrink: 0;
}
.hero-search input {
  flex: 1; background: transparent; border: none; outline: none;
  font-size: .9375rem; font-family: var(--font-sans); color: var(--text);
}
.hero-search input::placeholder { color: var(--text-dim); }
.hero-search__btn {
  background: var(--gold); color: #09090e;
  border: none; border-radius: var(--radius);
  padding: .5rem 1.125rem; font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.hero-search__btn:hover { background: var(--gold-light); }

/* === SECTION === */
.section { padding: 4rem 0; }
.section + .section { padding-top: 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.75rem;
}
.section-head h2 {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em;
}
.section-head a {
  font-size: .875rem; color: var(--gold);
}
.section-head a:hover { color: var(--gold-light); }

.section-divider {
  height: 1px; background: var(--border); margin: 0;
}

/* === ARTICLE CARD === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.125rem;
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.375rem 1.5rem;
  display: flex; flex-direction: column; gap: .7rem;
  text-decoration: none; color: inherit;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.card:hover {
  border-color: rgba(200,168,74,.28);
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(0,0,0,.3);
}

.card__meta { display: flex; align-items: center; gap: .5rem; }
.card__title {
  font-size: 1.0625rem; font-weight: 700; line-height: 1.35;
  color: var(--text); font-family: var(--font-serif);
  transition: color .15s;
}
.card:hover .card__title { color: var(--gold-light); }
.card__excerpt {
  font-size: .875rem; color: var(--text-muted);
  line-height: 1.65; flex: 1;
}
.card__foot {
  display: flex; align-items: center; gap: .875rem;
  padding-top: .75rem; border-top: 1px solid var(--border-subtle);
  font-size: .8rem; color: var(--text-dim);
}
.card__foot-spacer { flex: 1; }

/* === CATEGORY CARD === */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}

.cat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.375rem 1.25rem;
  display: flex; flex-direction: column; gap: .4rem;
  text-decoration: none; color: inherit;
  transition: background .15s, border-color .15s, transform .2s;
}
.cat-card:hover {
  background: var(--surface-2); border-color: var(--surface-3);
  transform: translateY(-2px);
}
.cat-card__icon { font-size: 1.5rem; margin-bottom: .25rem; }
.cat-card__name {
  font-size: .9375rem; font-weight: 700;
  color: var(--text); font-family: var(--font-serif);
}
.cat-card__count { font-size: .8rem; color: var(--text-dim); }

/* === PAGE HEADERS === */
.page-header { padding: 3rem 0 2rem; }
.page-header h1 {
  font-size: 2.125rem; font-weight: 700;
  letter-spacing: -.02em; margin-bottom: .5rem;
}
.page-header p { color: var(--text-muted); font-size: 1rem; }

/* === FILTER BAR === */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 2rem;
}
.filter-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: .35rem .875rem;
  font-size: .8125rem; font-weight: 500; color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.filter-btn:hover { color: var(--text); background: var(--surface-2); }
.filter-btn.active {
  background: var(--gold); border-color: var(--gold);
  color: #09090e; font-weight: 600;
}

/* === ARTICLE PAGE === */
.article-page { padding: 3rem 0 6rem; }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 228px;
  align-items: start; gap: 3rem;
  max-width: 1080px; margin: 0 auto; padding: 0 1.5rem;
}

/* Sidebar / TOC */
.article-sidebar { position: sticky; top: calc(var(--header-h) + 1.25rem); }

.toc-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.125rem 1rem;
}
.toc-box__label {
  font-size: .65rem; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--text-dim);
  margin-bottom: .75rem;
}
.toc-box__nav { display: flex; flex-direction: column; gap: .0625rem; }

.toc-link {
  display: block; font-size: .8125rem; color: var(--text-muted);
  text-decoration: none; padding: .3rem .5rem; border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color .12s, border-color .12s, background .12s;
  line-height: 1.45;
}
.toc-link:hover { color: var(--text); background: var(--surface-2); }
.toc-link.active {
  color: var(--gold); border-left-color: var(--gold);
  background: rgba(200,168,74,.06);
}
.toc-link--h3 { padding-left: 1.25rem; }

/* Article header */
.article-header { margin-bottom: 2rem; }
.article-header__meta {
  display: flex; align-items: center; gap: .625rem;
  flex-wrap: wrap; margin-bottom: 1rem;
}
.article-title {
  font-size: clamp(1.875rem, 4vw, 2.625rem);
  font-weight: 700; letter-spacing: -.02em;
  line-height: 1.15; margin-bottom: 1rem;
}
.article-submeta {
  display: flex; align-items: center; gap: 1rem;
  font-size: .875rem; color: var(--text-dim); flex-wrap: wrap;
}
.article-submeta__sep::before { content: '·'; margin-right: 1rem; }

/* Quick Reference card */
.quick-ref {
  background: linear-gradient(135deg,
    rgba(200,168,74,.07) 0%, rgba(200,168,74,.02) 100%);
  border: 1px solid rgba(200,168,74,.22);
  border-radius: var(--radius-xl); padding: 1.5rem 1.5rem 1.375rem;
  margin-bottom: 2.5rem;
}
.quick-ref__eyebrow {
  display: flex; align-items: center; gap: .5rem;
  font-size: .65rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 1.125rem;
}
.quick-ref__eyebrow::before {
  content: ''; display: block; width: 14px; height: 2px;
  background: var(--gold); border-radius: 1px;
}

.quick-ref__claim {
  font-size: .9375rem; color: var(--text-muted);
  padding: .875rem 1rem; border-radius: var(--radius);
  background: rgba(255,255,255,.025);
  border-left: 3px solid var(--text-dim);
  margin-bottom: .75rem; line-height: 1.65;
}
.quick-ref__claim strong { color: var(--text); }

.quick-ref__answer {
  font-size: .9375rem; color: var(--text-muted);
  padding: .875rem 1rem; border-radius: var(--radius);
  background: rgba(107,189,135,.05);
  border-left: 3px solid rgba(107,189,135,.5);
  margin-bottom: 1rem; line-height: 1.65;
}
.quick-ref__answer strong { color: var(--green); }

.quick-ref__points {
  list-style: none; display: flex; flex-direction: column; gap: .5rem;
}
.quick-ref__points li {
  font-size: .875rem; color: var(--text-muted);
  padding-left: 1.375rem; position: relative; line-height: 1.6;
}
.quick-ref__points li::before {
  content: '→'; position: absolute; left: 0;
  color: var(--gold); font-size: .8rem; top: .05rem;
}

/* Article body */
.article-body {
  font-size: 1.0625rem; line-height: 1.82; color: #d4d4e4;
}
.article-body h2 {
  font-size: 1.625rem; letter-spacing: -.01em;
  margin: 2.5rem 0 .875rem; padding-top: .25rem; color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
  border-bottom: 1px solid var(--border-subtle); padding-bottom: .5rem;
}
.article-body h3 {
  font-size: 1.25rem; margin: 1.75rem 0 .625rem; color: var(--text);
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}
.article-body p { margin-bottom: 1.25rem; }
.article-body ul,
.article-body ol {
  margin: .875rem 0 1.25rem 1.5rem;
  display: flex; flex-direction: column; gap: .5rem;
}
.article-body li { color: #d4d4e4; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { color: #d4d4e4; }
.article-body a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--gold-light); }

.article-body blockquote {
  margin: 1.5rem 0; padding: .875rem 1.125rem;
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
  border-left: 3px solid var(--gold);
  color: var(--text-muted); font-style: italic;
}
.article-body blockquote cite {
  display: block; margin-top: .5rem;
  font-size: .875rem; font-style: normal; color: var(--text-dim);
}

/* Source/reference callout */
.source-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem 1rem;
  margin: 1rem 0; font-size: .875rem; color: var(--text-muted);
}
.source-box__label {
  font-size: .65rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: .325rem;
}

/* === FOOTER === */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}
.site-footer__inner {
  max-width: 1180px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.footer-brand {
  font-family: var(--font-serif); font-size: .9375rem;
  font-weight: 700; color: var(--text-muted);
}
.footer-brand em { font-style: normal; color: var(--gold); }
.footer-links {
  display: flex; gap: 1.5rem;
}
.footer-links a {
  font-size: .8125rem; color: var(--text-dim);
  text-decoration: none; transition: color .15s;
}
.footer-links a:hover { color: var(--text-muted); }
.footer-copy { font-size: .8125rem; color: var(--text-dim); }

/* === UTILS === */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--surface-3); }

/* === SELECTION === */
::selection { background: rgba(200,168,74,.22); color: var(--text); }

/* === RESPONSIVE === */
@media (max-width: 860px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
}

@media (max-width: 640px) {
  .hero { padding: 4.5rem 0 3.5rem; }
  .hero__title { font-size: 2.25rem; }
  .card-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer__inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .section-head { flex-direction: column; gap: .5rem; align-items: flex-start; }
  .search-kbd { display: none; }
}

@media (max-width: 480px) {
  .site-nav { display: none; }
}
