/* =============================================================================
   SANATAN UNITY — Design System
   Premium, calm, trustworthy: ancient + modern. Devanagari-first typography,
   subtle Sanskrit-inspired ornamentation, full dark/light theme support.
   ============================================================================= */

:root {
  --font-hindi: 'Tiro Devanagari Hindi', 'Noto Sans Devanagari', 'Poppins', system-ui, sans-serif;
  --font-display: 'Tiro Devanagari Hindi', 'Noto Serif Devanagari', Georgia, serif;

  --bg: #FBF7F0;
  --bg-alt: #F3EBDD;
  --surface: #FFFFFF;
  --surface-alt: #FAF4E9;
  --text: #2A211A;
  --text-muted: #6B5D4F;
  --border: #E7DBC7;
  --accent: #B5651D;
  --accent-strong: #8A3E12;
  --accent-soft: #F0DCC0;
  --saffron: #E58A1F;
  --maroon: #7A1F2B;
  --gold: #C79A3C;
  --teal: #2F6B63;
  --link: #8A3E12;
  --shadow: 0 2px 10px rgba(60, 40, 15, 0.08);
  --shadow-lg: 0 12px 32px rgba(60, 40, 15, 0.14);
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 72px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17130F;
    --bg-alt: #1F1A14;
    --surface: #221C16;
    --surface-alt: #29221A;
    --text: #F1E8D9;
    --text-muted: #B9A98D;
    --border: #3B3227;
    --accent: #E29A4D;
    --accent-strong: #F0B36B;
    --accent-soft: #3A2A18;
    --saffron: #E9A75C;
    --maroon: #D98A94;
    --gold: #D9B466;
    --teal: #6FB6AC;
    --link: #E9A75C;
    --shadow: 0 2px 10px rgba(0,0,0,0.35);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #17130F;
  --bg-alt: #1F1A14;
  --surface: #221C16;
  --surface-alt: #29221A;
  --text: #F1E8D9;
  --text-muted: #B9A98D;
  --border: #3B3227;
  --accent: #E29A4D;
  --accent-strong: #F0B36B;
  --accent-soft: #3A2A18;
  --saffron: #E9A75C;
  --maroon: #D98A94;
  --gold: #D9B466;
  --teal: #6FB6AC;
  --link: #E9A75C;
  --shadow: 0 2px 10px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-hindi);
  font-size: 16.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; color: var(--text); margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- Header -- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; color: var(--text); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, var(--gold), var(--accent-strong));
  color: #fff; font-size: 1.3rem; box-shadow: var(--shadow);
}
.brand small { display: block; font-family: var(--font-hindi); font-weight: 400; font-size: 0.62rem; color: var(--text-muted); letter-spacing: 0.03em; }

.main-nav { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1; justify-content: center; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { color: var(--text); font-size: 0.92rem; padding: 8px 10px; border-radius: var(--radius-sm); white-space: nowrap; }
.main-nav a:hover, .main-nav a.active { background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-alt);
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--text);
}
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-alt); cursor: pointer; }

.btn-join {
  background: linear-gradient(135deg, var(--saffron), var(--accent-strong));
  color: #fff !important; font-weight: 700; padding: 10px 20px; border-radius: 999px;
  box-shadow: var(--shadow); border: none; font-size: 0.92rem; letter-spacing: 0.02em; white-space: nowrap;
}
.btn-join:hover { text-decoration: none; filter: brightness(1.08); box-shadow: var(--shadow-lg); }

/* ------------------------------------------------------------------ Hero -- */
.hero {
  position: relative; padding: 72px 0 60px; text-align: center; overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--gold) 18%, transparent), transparent 45%),
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--maroon) 14%, transparent), transparent 45%),
    var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.hero .om-mark { font-size: 2.6rem; color: var(--accent); margin-bottom: 8px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 0.3em; }
.hero p.tagline { color: var(--accent-strong); font-weight: 600; letter-spacing: 0.04em; margin-bottom: 0.6em; }
.hero p.subhead { max-width: 680px; margin: 0 auto 1.8em; color: var(--text-muted); font-size: 1.08rem; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-stats { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-top: 44px; }
.hero-stat { text-align: center; }
.hero-stat .num { font-family: var(--font-display); font-size: 1.7rem; color: var(--accent-strong); font-weight: 700; }
.hero-stat .lbl { font-size: 0.82rem; color: var(--text-muted); }

/* ------------------------------------------------------------- Sections --- */
.section { padding: 56px 0; }
.section-alt { background: var(--surface-alt); }
.section-title { font-size: 1.9rem; margin-bottom: 0.2em; }
.section-subtitle { color: var(--text-muted); max-width: 680px; margin-bottom: 2em; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }

/* --------------------------------------------------------------- Buttons -- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 0.94rem; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-alt); text-decoration: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-danger { background: #A6362C; color: #fff; }

/* ----------------------------------------------------------------- Cards -- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card-link { display: block; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); text-decoration: none; }
.card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.card .meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 0; }
.card .sanskrit { font-family: var(--font-display); color: var(--accent-strong); font-size: 1.05rem; margin-bottom: 6px; }

.icon-tile {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 1.3rem; margin-bottom: 10px;
}

/* ---------------------------------------------------------------- Badges -- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); }
.badge-scripture { background: #EFE3C8; color: #6B4C10; border-color: #DFC98F; }
.badge-historical { background: #DCE9F0; color: #1F4C63; border-color: #B9D6E4; }
.badge-scientific { background: #DCEFE2; color: #1F5C36; border-color: #B7DEC3; }
.badge-philosophy { background: #E9E1F5; color: #452E75; border-color: #D3C3EE; }
.badge-tradition { background: #FBE4D4; color: #7A3B12; border-color: #F1C4A2; }
.badge-folk { background: #F3EBDD; color: #6B5D4F; border-color: var(--border); }
.badge-modern { background: #E0EFF0; color: #1E5A5C; border-color: #BFE0E2; }
.badge-unverified { background: #FBE0DD; color: #8A2A20; border-color: #F0BBB4; }
.badge-grey { background: var(--surface-alt); color: var(--text-muted); }
[data-theme="dark"] .badge, :root:not([data-theme="light"]) .badge { filter: brightness(1.15) saturate(0.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-scripture,
  :root:not([data-theme="light"]) .badge-historical,
  :root:not([data-theme="light"]) .badge-scientific,
  :root:not([data-theme="light"]) .badge-philosophy,
  :root:not([data-theme="light"]) .badge-tradition,
  :root:not([data-theme="light"]) .badge-modern,
  :root:not([data-theme="light"]) .badge-unverified { background: color-mix(in srgb, var(--surface-alt) 70%, currentColor 8%); }
}

.badge-sci-green { background: #DCEFE2; color: #1F5C36; }
.badge-sci-blue { background: #DCE9F0; color: #1F4C63; }
.badge-sci-yellow { background: #FBF0CE; color: #6B4C10; }
.badge-sci-orange { background: #FBE4D4; color: #7A3B12; }
.badge-sci-red { background: #FBDCDA; color: #8A2A20; }

.status-draft { background: #F3EBDD; color: #6B5D4F; }
.status-review { background: #FBF0CE; color: #6B4C10; }
.status-published { background: #DCEFE2; color: #1F5C36; }
.status-updated { background: #DCE9F0; color: #1F4C63; }
.status-archived { background: #E4E4E4; color: #555; }
.status-new { background: #DCE9F0; color: #1F4C63; }
.status-contacted { background: #FBF0CE; color: #6B4C10; }
.status-progress { background: #E9E1F5; color: #452E75; }
.status-completed { background: #DCEFE2; color: #1F5C36; }

.disclaimer-box {
  background: var(--accent-soft); border: 1px solid var(--gold); border-radius: var(--radius);
  padding: 16px 20px; font-size: 0.92rem; color: var(--text); margin: 18px 0;
}
.disclaimer-box.warn { background: #FBE0DD; border-color: #E8A79E; }
.disclaimer-box strong { color: var(--accent-strong); }
.disclaimer-box.medical { background: #FBE0DD; border: 2px solid #C4453A; }
.disclaimer-box.medical strong { color: #A6362C; }

/* ---------------------------------------------------------------- Source -- */
.source-block { margin-top: 32px; padding-top: 24px; border-top: 1px dashed var(--border); }
.source-block h4 { font-size: 1.05rem; margin-bottom: 10px; }
.source-item { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.source-item:last-child { border-bottom: none; }
.source-item .tier { color: var(--text-muted); font-size: 0.78rem; }

/* ------------------------------------------------------------------ Chip -- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 0.85rem; color: var(--text); }
.chip.active, .chip:hover { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); text-decoration: none; }

/* ------------------------------------------------------------------ Gita -- */
.verse-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; margin-bottom: 20px; box-shadow: var(--shadow); }
.verse-card .sanskrit-text { font-family: var(--font-display); font-size: 1.3rem; color: var(--accent-strong); line-height: 1.9; margin-bottom: 10px; }
.verse-card .translit { font-style: italic; color: var(--text-muted); font-size: 0.92rem; margin-bottom: 14px; }
.verse-block-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 14px 0 4px; }
.chapter-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.chapter-nav a { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--border); font-size: 0.85rem; }
.chapter-nav a.active { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.text-size-controls { display: flex; gap: 8px; align-items: center; }

/* ----------------------------------------------------------------- Forms -- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.form-group input[type="text"], .form-group input[type="email"], .form-group input[type="password"],
.form-group input[type="number"], .form-group input[type="date"], .form-group input[type="file"],
.form-group select, .form-group textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.95rem;
}
.form-group textarea { min-height: 110px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-help { font-size: 0.8rem; color: var(--text-muted); margin-top: -10px; margin-bottom: 16px; }
.form-check { display: flex; align-items: flex-start; gap: 10px; font-size: 0.88rem; }
.form-check input { width: auto; margin-top: 3px; }
.alert { padding: 13px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 0.92rem; }
.alert-success { background: #DCEFE2; color: #1F5C36; border: 1px solid #B7DEC3; }
.alert-danger { background: #FBDCDA; color: #8A2A20; border: 1px solid #EFB3AC; }

/* --------------------------------------------------------------- Search --- */
.search-box { display: flex; gap: 10px; max-width: 620px; margin: 0 auto; }
.search-box input { flex: 1; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--border); font-size: 1rem; background: var(--surface); color: var(--text); }
.search-result { padding: 16px 0; border-bottom: 1px solid var(--border); }
.search-result .cat { font-size: 0.76rem; color: var(--accent-strong); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------------------------------------------------------------- Footer -- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding: 48px 0 24px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { font-size: 0.95rem; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--text-muted); font-size: 0.9rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.88rem; max-width: 320px; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; color: var(--text-muted); }

/* ---------------------------------------------------------- Misc / utils -- */
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th, table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.data-table th { background: var(--surface-alt); font-weight: 700; }
.data-table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }

.sanskrit-pattern-divider {
  height: 3px; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, transparent 8px 16px); margin: 40px 0; opacity: 0.5;
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
}

.mobile-nav { display: none; position: fixed; inset: var(--header-h) 0 0 0; background: var(--bg); z-index: 99; overflow-y: auto; padding: 16px; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 13px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 1.02rem; }
.mobile-nav .btn-join { display: block; text-align: center; margin-top: 16px; }
