/* ==========================================================================
   SVAAHI — READING PAGES
   Blog index, articles, privacy. Loaded after site.css, which supplies the
   tokens, the chrome bar, the index overlay and the footer.

   The article bodies keep their original `sv-*` class names and markup, so
   this file re-skins them into the system rather than rewriting five pages of
   hand-authored prose.
   ========================================================================== */

/* Reading pages are paper from top to bottom. */
body.page {
  --fg:     var(--on-paper, #14130F);
  --fg-60:  rgba(20, 19, 15, 0.68);
  --fg-38:  rgba(20, 19, 15, 0.46);
  --fg-16:  rgba(20, 19, 15, 0.16);
  --signal: var(--signal-deep);
  background: var(--paper);
  color: var(--fg);
}

.body-inner { position: relative; z-index: 1; }

/* Clear the chrome bar, which is pinned from the first pixel on these pages. */
.page-main {
  padding-top: calc(var(--chrome-h) + clamp(3rem, 9vh, 6rem));
  padding-bottom: clamp(4rem, 12vh, 8rem);
}

/* Full-bleed with a gutter, matching the home page. Reading measure is capped
   on the prose itself, not on the container. */
.sv-container {
  width: 100%;
  padding-inline: var(--gutter);
}


/* ==========================================================================
   BLOG INDEX
   ========================================================================== */

.sv-blog-landing { padding: 0; background: transparent; }
.sv-blog-landing__header { margin-bottom: clamp(2.5rem, 7vh, 4.5rem); }

.sv-blog-landing__title,
.sv-article__title {
  font-family: var(--grot);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.9;
  color: var(--fg);
  margin: 0;
}

.sv-blog-landing__title { font-size: clamp(2.6rem, 8.5vw, 7rem); }

.sv-blog-landing__list {
  display: block;
  background: transparent;
  border-top: 1px solid var(--fg-16);
}

/* Each post is a row in a system table, not a card. */
.sv-blog-card {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: 0 clamp(1rem, 2.5vw, 2.5rem);
  align-items: baseline;
  padding: clamp(1.4rem, 3.5vh, 2.25rem) 0;
  border-bottom: 1px solid var(--fg-16);
  background: transparent;
  transition: padding-left 0.45s var(--ease), background-color 0.45s var(--ease);
}
.sv-blog-card::before {
  content: counter(post, decimal-leading-zero);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.6875rem;
  letter-spacing: 0.11em;
  color: var(--signal);
}
.sv-blog-landing__list { counter-reset: post; }
.sv-blog-card { counter-increment: post; }

.sv-blog-card:hover { padding-left: 1rem; }

.sv-blog-card__title {
  font-family: var(--grot);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  font-size: clamp(1.15rem, 2.4vw, 2rem);
  line-height: 1.06;
  color: var(--fg);
  margin: 0;
  transition: color 0.35s var(--ease);
}
.sv-blog-card:hover .sv-blog-card__title { color: var(--signal); }

.sv-blog-card__meta {
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.6875rem;
  color: var(--fg-38);
  white-space: nowrap;
}


/* ==========================================================================
   ARTICLE
   ========================================================================== */

.sv-article-page { padding: 0; background: transparent; }
.sv-article { display: block; }

.sv-article__header {
  margin-bottom: clamp(2rem, 6vh, 3.5rem);
  padding-bottom: clamp(1.5rem, 4vh, 2.25rem);
  border-bottom: 1px solid var(--fg-16);
}

.sv-article__title { font-size: clamp(2.1rem, 6vw, 4.75rem); }

.sv-article__subtitle {
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--fg-60);
  margin: 1.25rem 0 0;
  max-width: 62ch;
}

.sv-article__meta {
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.6875rem;
  color: var(--fg-38);
  margin: 1.25rem 0 0;
}
.sv-article__meta strong { color: var(--fg); font-weight: 500; }

/* Prose. Mono at a comfortable measure - it is the site's reading face. */
.sv-article__body {
  max-width: 74ch;
  font-family: var(--mono);
  font-size: 0.9375rem;
  line-height: 1.85;
  color: var(--fg-60);
}

.sv-article__body p { margin: 0 0 1.5em; }

.sv-article__body h2,
.sv-article__body h3,
.sv-article__body h4 {
  font-family: var(--grot);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  line-height: 1.06;
  color: var(--fg);
  margin: 2.75em 0 0.9em;
}
.sv-article__body h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.sv-article__body h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
.sv-article__body h4 { font-size: 1.05rem; }
.sv-article__body > :first-child { margin-top: 0; }

.sv-article__body strong { color: var(--fg); font-weight: 500; }
.sv-article__body em { font-style: italic; }

.sv-article__body a {
  color: var(--fg);
  box-shadow: inset 0 -2px 0 var(--signal);
  transition: color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.sv-article__body a:hover { color: var(--signal); box-shadow: inset 0 -0.9em 0 rgba(var(--signal-rgb), 0.14); }

.sv-article__body ul,
.sv-article__body ol { margin: 0 0 1.5em; padding-left: 1.5em; }
.sv-article__body ul { list-style: none; padding-left: 1.35em; }
.sv-article__body ul li { position: relative; margin-bottom: 0.6em; }
.sv-article__body ul li::before {
  content: '';
  position: absolute;
  left: -1.35em; top: 0.72em;
  width: 0.5em; height: 1px;
  background: var(--signal);
}
.sv-article__body ol { list-style: decimal; }
.sv-article__body ol li { margin-bottom: 0.6em; padding-left: 0.35em; }
.sv-article__body ol li::marker { color: var(--signal); font-weight: 500; }

.sv-article__body hr {
  border: 0;
  border-top: 1px solid var(--fg-16);
  margin: 2.75em 0;
}

.sv-article__body blockquote {
  margin: 2em 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--signal);
  color: var(--fg);
}

.sv-article__body code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: rgba(20, 19, 15, 0.07);
  padding: 0.15em 0.4em;
}
.sv-article__body pre {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  background: var(--ink);
  color: var(--paper);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.5em;
}
.sv-article__body pre code { background: none; padding: 0; }

.sv-article__body img { margin: 2em 0; }

.sv-article__sign-off {
  margin-top: clamp(2.5rem, 7vh, 4rem);
  padding-top: clamp(1.5rem, 4vh, 2.25rem);
  border-top: 1px solid var(--fg-16);
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.6875rem;
  color: var(--fg-38);
}

/* Telugu needs its own face and a looser line - it does not fit the mono. */
.sv-article__body.telugu,
.sv-lang-content .telugu {
  font-family: 'Noto Sans Telugu', var(--mono);
  font-size: 1.0625rem;
  line-height: 2;
}
.sv-article__body.telugu h2,
.sv-article__body.telugu h3,
.sv-article__body.telugu h4 {
  font-family: 'Noto Sans Telugu', var(--grot);
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.4;
}


/* ==========================================================================
   TABS + LANGUAGE TOGGLE
   ========================================================================== */

.sv-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: clamp(2rem, 5vh, 3rem);
  border-bottom: 1px solid var(--fg-16);
}

.sv-tabs__btn {
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.6875rem;
  color: var(--fg-38);
  background: none;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0.9rem 1.1rem;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.sv-tabs__btn:first-child { padding-left: 0; }
.sv-tabs__btn:hover { color: var(--fg); }
.sv-tabs__btn.active { color: var(--signal); border-bottom-color: var(--signal); }

.sv-tab-panel { display: none; }
.sv-tab-panel.active { display: block; }

.sv-lang-toggle {
  display: inline-flex;
  border: 1px solid var(--fg-16);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: clamp(1.75rem, 4vh, 2.5rem);
}

.sv-lang-toggle__btn {
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.625rem;
  color: var(--fg-38);
  background: none;
  border: 0;
  border-radius: 999px;
  padding: 0.55em 1.15em;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
.sv-lang-toggle__btn.active { background: var(--ink); color: var(--paper); }

.sv-lang-content,
.sv-tools-lang { display: none; }
.sv-lang-content.active,
.sv-tools-lang.active { display: block; }


/* ==========================================================================
   TOOLS / VIDEOS / TABLES
   ========================================================================== */

.sv-tools__title,
.sv-videos__title {
  font-family: var(--grot);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.025em;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  line-height: 1.06;
  color: var(--fg);
  margin: 0 0 1.5rem;
}

.sv-tools-table,
.sv-tier-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--fg-60);
  margin-bottom: clamp(2rem, 5vh, 3rem);
}

.sv-tools-table th,
.sv-tier-table th {
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.6875rem;
  color: var(--fg-38);
  text-align: left;
  padding: 0.85rem 1rem 0.85rem 0;
  border-bottom: 1px solid var(--fg-16);
  white-space: nowrap;
}

.sv-tools-table td,
.sv-tier-table td {
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--fg-16);
  vertical-align: top;
}
.sv-tools-table tr:last-child td,
.sv-tier-table tr:last-child td { border-bottom: 0; }

.sv-tools-table strong,
.sv-tier-table strong {
  font-family: var(--grot);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.015em;
  font-size: 1rem;
  color: var(--fg);
}

.sv-tools-table a,
.sv-tier-table a,
.sv-videos a {
  color: var(--fg);
  box-shadow: inset 0 -1px 0 var(--signal);
  transition: color 0.3s var(--ease);
}
.sv-tools-table a:hover,
.sv-tier-table a:hover,
.sv-videos a:hover { color: var(--signal); }

.sv-videos__list { display: grid; gap: 0; }
.sv-videos__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--fg-16);
  font-family: var(--mono);
  font-size: 0.8125rem;
}

.sv-ccpa-notice,
.sv-qr-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.7;
  color: var(--fg-38);
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--fg-16);
  margin: 1.5em 0;
}

/* Labels carried over from the old theme. */
.sv-label {
  display: block;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.6875rem;
  color: var(--signal);
  margin-bottom: 1rem;
}
.sv-label--ruled { display: flex; align-items: center; gap: 0.9rem; }
.sv-label--ruled::after {
  content: '';
  flex: 1;
  max-width: 160px;
  height: 1px;
  background: var(--fg-16);
}


/* ==========================================================================
   BACK LINK
   ========================================================================== */

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.6875rem;
  color: var(--fg-38);
  margin-bottom: clamp(1.75rem, 4vh, 2.5rem);
  transition: color 0.3s var(--ease);
}
.page-back i {
  display: block;
  width: 18px; height: 1px;
  background: currentColor;
  position: relative;
  transition: width 0.35s var(--ease);
}
.page-back i::after {
  content: '';
  position: absolute;
  left: 0; top: -3px;
  width: 7px; height: 7px;
  border-bottom: 1px solid currentColor;
  border-left: 1px solid currentColor;
  transform: rotate(45deg);
}
.page-back:hover { color: var(--signal); }
.page-back:hover i { width: 28px; }


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 760px) {
  .sv-blog-card {
    grid-template-columns: 2.5rem minmax(0, 1fr);
    row-gap: 0.5rem;
  }
  .sv-blog-card__meta { grid-column: 2; white-space: normal; }

  .sv-tools-table,
  .sv-tier-table { font-size: 0.75rem; }
  .sv-videos__list li { grid-template-columns: 1fr; }
}
