/* ============================================================
   yoga-sutras.css — Patanjali Yoga Sutras study companion
   vedanta.study

   SELF-CONTAINED. Tokens and shared components below are copied
   verbatim from common/css/styles.css so this page renders
   correctly on its own, at any folder depth. Values match the
   main stylesheet exactly — linking styles.css as well is safe
   but not required.
============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Devanagari:wght@400;500&display=swap');

/* ── Tokens (from common/css/styles.css) ───────────────── */
:root{
  --bg:           #FAF8F5;
  --bg-surface:   #F0EDE7;
  --bg-card:      #FFFFFF;
  --border:       #E0D9D0;
  --border-light: #EDE8E2;
  --text:         #362C24;
  --text-muted:   #6B6560;
  --text-light:   #9B9590;
  --accent:       #B5621D;
  --accent-dark:  #8F4A10;
  --accent-light: #FDF0E3;
  --accent-mid:   #E8923A;
  --white:        #FFFFFF;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow:    0 4px 16px rgba(0,0,0,0.08);

  --transition: 0.25s ease;
  --container:  1160px;

  /* Page-specific: the six aspect colours of each sutra.
     Two new hues only, tuned to the warm palette. */
  --ys-sanskrit:   var(--accent);
  --ys-translit:   var(--accent-dark);
  --ys-word:       #4E7A52;
  --ys-concept:    #7C5A86;
  --ys-concept-bg: #F4EFF6;
  --ys-devanagari: 'Noto Serif Devanagari', 'Playfair Display', serif;
}

/* ── Reset & base (from main stylesheet) ───────────────── */
*, *::before, *::after{ box-sizing: border-box; margin: 0; padding: 0; }
html{ scroll-behavior: smooth; font-size: 16px; scroll-padding-top: 150px; }
body{
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a{ text-decoration: none; color: inherit; }
ul{ list-style: none; }
button{ cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, select{ font-family: var(--font-body); font-size: 1rem; outline: none; }

h1,h2,h3,h4,h5{ font-family: var(--font-heading); font-weight: 500; line-height: 1.25; }
h1{ font-size: clamp(2rem, 5vw, 3.25rem); }
h2{ font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3{ font-size: clamp(1.1rem, 2.5vw, 1.5rem); }
h4{ font-size: 1.15rem; }
p{ line-height: 1.7; }

.container{
  width: 100%; max-width: var(--container);
  margin: 0 auto; padding: 0 24px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn{
  display: inline-flex; align-items: center; gap: 6px;
  padding: 11px 24px; border-radius: 100px;
  font-size: 0.875rem; font-weight: 500; letter-spacing: 0.01em;
  transition: var(--transition); cursor: pointer;
}
.btn-outline{
  background: transparent; color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-outline:hover{ border-color: var(--text); }

/* ── Header & nav ──────────────────────────────────────── */
.header{
  position: sticky; top: 0; z-index: 900;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.header.scrolled{ box-shadow: var(--shadow); }
.header .container{
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.logo{ display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-text{
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 600;
  color: var(--text); letter-spacing: -0.01em;
}
.logo-accent{ color: var(--accent); }

.nav{ display: flex; align-items: center; gap: 4px; }
.nav-link{
  padding: 7px 14px; font-size: 0.875rem; font-weight: 400;
  color: var(--text-muted); border-radius: 100px;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active{ color: var(--text); background: var(--bg-surface); }
.nav-cta{
  background: var(--text); color: var(--white) !important;
  font-weight: 500; margin-left: 8px;
}
.nav-cta:hover{ background: var(--accent) !important; }

.menu-toggle{ display: none; flex-direction: column; gap: 5px; padding: 8px; border-radius: var(--radius); }
.menu-toggle span{
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px; transition: var(--transition);
}

.header-spacer{ height: 28px; }

/* ── Section headings ──────────────────────────────────── */
.section-label{
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--accent);
  display: block; margin-bottom: 6px;
}
.section-title{ font-size: clamp(1.5rem, 3vw, 2rem); }

/* ── Page hero ─────────────────────────────────────────── */
.page-hero{
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.page-hero-inner{ max-width: 760px; }
.page-hero .section-label{ margin-bottom: 10px; }
.page-hero h1{ margin-bottom: 14px; }
.page-hero p{ color: var(--text-muted); font-size: 1.05rem; }

/* ── Tag chip ──────────────────────────────────────────── */
.tag{
  background: var(--bg-surface); color: var(--text-muted);
  padding: 5px 14px; border-radius: 100px;
  font-size: 0.78rem; font-weight: 500;
  border: 1px solid var(--border);
}

/* ── Footer ────────────────────────────────────────────── */
.footer{
  background: var(--text); color: var(--white);
  padding: 40px 0 32px; margin-top: 64px;
}
.footer-bottom{
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-bottom p{ font-size: 0.8rem; color: rgba(255,255,255,0.35); }
.footer-bottom a{
  color: rgba(255,255,255,0.5); font-size: 0.8rem;
  transition: var(--transition);
}
.footer-bottom a:hover{ color: var(--white); }

/* ============================================================
   PAGE-SPECIFIC STYLES
============================================================ */
/* ── Page hero additions ───────────────────────────────── */
.ys-hero-dev{
  font-family: var(--ys-devanagari);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--accent);
  line-height: 1.4;
  margin-bottom: 8px;
}
.ys-hero-source{
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 14px;
}
.ys-hero-source em{ color: var(--text-muted); font-style: normal; font-weight: 500; }
.ys-stats{ display: flex; gap: 40px; flex-wrap: wrap; margin-top: 28px; }
.ys-stats .num{
  font-family: var(--font-heading); font-size: 1.75rem; font-weight: 600; color: var(--text);
}
.ys-stats .lbl{
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}

/* ── Sticky toolbar ────────────────────────────────────── */
.ys-toolbar{
  position: sticky; top: 68px; z-index: 800;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.ys-toolbar-inner{ display: flex; flex-direction: column; gap: 12px; }
.ys-search-row{ display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.ys-search{
  flex: 1; min-width: 240px;
  display: flex; align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  padding: 0 18px;
  transition: border-color var(--transition);
}
.ys-search:focus-within{ border-color: var(--accent); }
.ys-search i{ color: var(--text-light); font-size: 0.85rem; }
#searchBox{
  flex: 1; border: none; background: none;
  padding: 11px 12px; font-size: 0.95rem; color: var(--text);
}
#searchBox::placeholder{ color: var(--text-light); }

.ys-filter-row{ display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ys-filter-lbl{
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-light);
}
select#tagFilter{
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 100px; padding: 8px 14px;
  font-size: 0.85rem; color: var(--text); max-width: 260px;
  transition: border-color var(--transition);
}
select#tagFilter:focus{ border-color: var(--accent); }

#activeFilter{
  display: none; align-items: center; gap: 8px;
  background: var(--ys-concept-bg); color: var(--ys-concept);
  border: 1px solid var(--ys-concept);
  border-radius: 100px; padding: 4px 6px 4px 14px;
  font-size: 0.8rem; font-weight: 500;
}
#activeFilter button{ color: var(--ys-concept); font-size: 0.9rem; line-height: 1; padding: 2px 6px; }
#resultCount{ font-size: 0.82rem; color: var(--text-light); }

/* ── Aspect legend ─────────────────────────────────────── */
.ys-legend{
  display: flex; gap: 18px; flex-wrap: wrap;
  padding: 18px 0 0; font-size: 0.78rem; color: var(--text-muted);
}
.ys-legend span{ display: inline-flex; align-items: center; gap: 7px; }
.ys-dot{ width: 9px; height: 9px; border-radius: 50%; }

/* ── Block sections ───────────────────────────────────── */
.ys-block{ padding: 44px 0 0; }
.ys-block > .section-label{ margin-bottom: 6px; }
.ys-block > h2{ margin-bottom: 20px; }

/* ── Thought flow ─────────────────────────────────────── */
details.ys-flow{
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
details.ys-flow > summary{
  cursor: pointer; list-style: none;
  padding: 20px 24px;
  font-family: var(--font-heading); font-size: 1.2rem; font-weight: 500; color: var(--text);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
details.ys-flow > summary::-webkit-details-marker{ display: none; }
details.ys-flow > summary::after{
  content: "+"; color: var(--accent); font-size: 1.5rem; font-weight: 300;
  transition: transform var(--transition);
}
details.ys-flow[open] > summary::after{ transform: rotate(45deg); }
.ys-flow-body{ padding: 0 24px 28px; }
.ys-flow-body p{ color: var(--text-muted); margin-bottom: 14px; }
.ys-flow-body p b{ color: var(--text); }

.ys-flow-steps{ margin: 20px 0; }
.ys-flow-step{
  position: relative; padding: 10px 0 10px 26px;
  border-left: 2px solid var(--border);
  color: var(--text-muted); font-size: 0.95rem;
}
.ys-flow-step::before{
  content: ""; position: absolute; left: -6px; top: 17px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 4px var(--accent-light);
}
.ys-flow-step b{ color: var(--text); font-weight: 600; }
.ys-ref{ color: var(--text-light); font-size: 0.8rem; margin-left: 6px; white-space: nowrap; }

/* ── Pada accordion ───────────────────────────────────── */
details.ys-pada{
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}
details.ys-pada > summary{
  cursor: pointer; list-style: none;
  padding: 24px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-left: 3px solid var(--accent);
  transition: background var(--transition);
}
details.ys-pada > summary::-webkit-details-marker{ display: none; }
details.ys-pada > summary:hover{ background: var(--bg-surface); }
.ys-pada-head h3{ font-size: 1.35rem; font-weight: 600; margin-bottom: 4px; }
.ys-pada-head p{ font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }
.ys-pada-count{
  flex-shrink: 0; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-light);
  border-radius: 100px; padding: 6px 14px; white-space: nowrap;
}
.ys-pada-body{ padding: 8px 20px 24px; }

/* ── Theme grouping ───────────────────────────────────── */
.ys-theme-head{
  display: flex; align-items: center; gap: 14px;
  margin: 28px 4px 14px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
}
.ys-theme-head::after{ content: ""; flex: 1; height: 1px; background: var(--border-light); }

/* ── Sutra card ───────────────────────────────────────── */
.ys-sutra{
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.ys-sutra:hover{ border-color: var(--border); box-shadow: var(--shadow-sm); }
.ys-sutra.hidden{ display: none; }
.ys-sutra:target{ border-color: var(--accent); box-shadow: var(--shadow); }

.ys-sutra-top{ padding: 20px 22px 18px; }
.ys-sutra-meta{
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.ys-num{
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--accent);
}
.ys-sutra-theme{ font-size: 0.72rem; color: var(--text-light); text-align: right; }

.ys-dev{
  font-family: var(--ys-devanagari);
  font-size: 1.3rem; line-height: 1.85;
  color: var(--ys-sanskrit);
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
}
.ys-iast{
  font-style: italic; font-size: 0.95rem; color: var(--ys-translit);
  letter-spacing: 0.01em; padding: 0 2px;
}
.ys-trans{
  font-family: var(--font-heading); font-size: 1.15rem; font-weight: 500;
  line-height: 1.5; color: var(--text);
  margin-top: 14px; padding-left: 14px;
  border-left: 3px solid var(--border);
}

/* ── Inner collapsibles ───────────────────────────────── */
details.ys-sub{ border-top: 1px solid var(--border-light); }
details.ys-sub > summary{
  cursor: pointer; list-style: none;
  padding: 11px 22px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
  transition: background var(--transition);
}
details.ys-sub > summary::-webkit-details-marker{ display: none; }
details.ys-sub > summary::before{
  content: "\203A"; font-size: 1rem; line-height: 1;
  transition: transform var(--transition);
}
details.ys-sub[open] > summary::before{ transform: rotate(90deg); }
details.ys-sub > summary:hover{ background: var(--bg-surface); }
.ys-sub-body{ padding: 4px 22px 20px; }

details.ys-sub.words > summary{ color: var(--ys-word); }
details.ys-sub.expl  > summary{ color: var(--text-muted); }
details.ys-sub.tags  > summary{ color: var(--ys-concept); }

/* Word-by-word */
.ys-words{ display: grid; grid-template-columns: auto 1fr; gap: 7px 20px; }
.ys-words dt{ font-style: italic; font-weight: 500; color: var(--ys-word); white-space: nowrap; }
.ys-words dd{ color: var(--text-muted); font-size: 0.93rem; }

.ys-expl{ color: var(--text-muted); font-size: 0.95rem; }

/* Concept chips — reuse site .tag, made interactive */
.ys-tag-wrap{ display: flex; gap: 8px; flex-wrap: wrap; }
button.tag{
  background: var(--ys-concept-bg);
  color: var(--ys-concept);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
button.tag:hover{ border-color: var(--ys-concept); }

mark{ background: var(--accent-light); color: var(--accent-dark); border-radius: 2px; padding: 0 2px; }

/* ── Key points ───────────────────────────────────────── */
.ys-keypoints{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px;
}
.ys-kp{
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--accent-mid);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.ys-kp b{
  display: block; font-family: var(--font-heading); font-size: 1.1rem;
  font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.ys-kp span{ color: var(--text-muted); font-size: 0.92rem; }

/* ── Concept index ────────────────────────────────────── */
.ys-index-note{ color: var(--text-muted); margin-bottom: 20px; max-width: 640px; }
#idxSearch{
  width: 100%; max-width: 380px;
  background: var(--white); border: 1.5px solid var(--border); border-radius: 100px;
  padding: 10px 18px; font-size: 0.9rem; color: var(--text); margin-bottom: 24px;
  transition: border-color var(--transition);
}
#idxSearch:focus{ border-color: var(--accent); }

.ys-idx-entry{ border-bottom: 1px solid var(--border-light); padding: 16px 2px; }
.ys-idx-entry h4{
  font-family: var(--font-body); font-style: italic; font-weight: 600;
  font-size: 1rem; color: var(--ys-word); margin-bottom: 4px;
}
.ys-idx-def{ color: var(--text-muted); font-size: 0.92rem; margin-bottom: 8px; }
.ys-idx-refs{ display: flex; gap: 6px; flex-wrap: wrap; }
.ys-idx-ref{
  font-size: 0.78rem; font-weight: 500; color: var(--accent);
  background: var(--accent-light); border-radius: var(--radius-sm);
  padding: 2px 8px; transition: var(--transition);
}
.ys-idx-ref:hover{ background: var(--accent); color: var(--white); }

/* ── Back to top ──────────────────────────────────────── */
.ys-top{
  position: fixed; bottom: 24px; right: 24px; z-index: 850;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--accent);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.ys-top:hover{ border-color: var(--accent); background: var(--accent); color: var(--white); }

/* ── Responsive (nav rules from main stylesheet) ───────── */
@media (max-width: 768px){
  .container{ padding: 0 18px; }
  .nav{
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch;
    padding: 12px; gap: 4px; z-index: 888;
  }
  .nav.open{ display: flex; }
  .nav-link{ padding: 12px 16px; border-radius: var(--radius); }
  .nav-cta{ margin-left: 0; text-align: center; justify-content: center; }
  .menu-toggle{ display: flex; }
}
@media (max-width: 860px){
  .header-spacer{ height: 16px; }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 860px){
  .ys-toolbar{ top: 0; }
  .ys-stats{ gap: 26px; }
}
@media (max-width: 600px){
  .ys-dev{ font-size: 1.12rem; line-height: 1.75; padding: 10px 12px; }
  .ys-trans{ font-size: 1.05rem; }
  .ys-words{ grid-template-columns: 1fr; gap: 2px; }
  .ys-words dt{ margin-top: 8px; }
  details.ys-pada > summary{ padding: 20px; flex-direction: column; align-items: flex-start; gap: 12px; }
  .ys-sutra-meta{ flex-direction: column; gap: 4px; }
  .ys-sutra-theme{ text-align: left; }
}
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ transition: none !important; }
}
