/*
 * Home section pages: / (Views/Home/Index), /about, /guide, /account.
 * Built on reader.css (reading column, dividers, articles, prose) and components.css; only tokens.
 *
 *  .home-deva                 Devanagari line under the display title
 *  .home-continue             "Continue reading" (filled from localStorage before first paint)
 *  .home-list > li > .home-row  contents rows: title + count, one line of text (collections,
 *                             posts, apps, sister sites); a.home-row is a link
 *  .home-words .quote         the guiding words: quotations with their source
 *  .guide-*                   /guide: shortcut table, script table, transliteration try-out
 *  .account-*                 /account
 */

/* ---------------------------------------------------------------------------------------- */
/* Masthead                                                                                  */
/* ---------------------------------------------------------------------------------------- */
/* The Trust's emblem above the title. Its width and height attributes reserve the space, so
   nothing moves while it loads. */
.home-emblem {
  display: block;
  width: 176px;
  height: auto;
  margin: 0 auto 28px;
}
@media (max-width: 767.98px) {
  .home-emblem { width: 128px; margin-bottom: 22px; }
}
/* Drawn for a light page: on the dark theme its slate-blue letters lose contrast. Lift it
   without washing out its colours. */
:root[data-theme="dark"] .home-emblem { filter: brightness(1.5) saturate(.9); }

.home-deva {
  margin-top: 10px;
  font-family: var(--font-deva);
  font-size: var(--fs-h3);
  line-height: 1.4;
  color: var(--text-caps);
  font-synthesis-weight: none;
}
.home-deva + .pill-row { margin-top: 20px; }

/* ---------------------------------------------------------------------------------------- */
/* Continue reading                                                                          */
/* ---------------------------------------------------------------------------------------- */
.home-continue {
  margin-top: 56px;
  text-align: center;
}
.home-continue-link {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: 1.25;
  color: var(--text-title);
  text-wrap: balance;
}
.home-continue-link:hover { color: var(--accent); }
.home-continue-meta {
  margin-top: 4px;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
.home-continue-meta:empty { display: none; }

/* ---------------------------------------------------------------------------------------- */
/* Contents rows                                                                             */
/* ---------------------------------------------------------------------------------------- */
.home-list {
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}
.home-list > li { border-bottom: 1px solid var(--border); }

.home-row {
  display: block;
  padding: 20px 2px 19px;
}
a.home-row { color: inherit; }
a.home-row:hover .home-row-title { color: var(--accent); }
a.home-row:focus-visible { outline-offset: -2px; }

.home-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 20px;
}
.home-row-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-title);
  text-wrap: balance;
  transition: color var(--dur-fast) var(--ease);
}
.home-row-count,
.home-row-meta {
  font-size: var(--fs-sm);
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: lining-nums tabular-nums;
}
.home-row-count { white-space: nowrap; }
.home-row-meta { display: block; margin-top: 7px; letter-spacing: .04em; text-transform: none; }
.home-row-deva {
  font-family: var(--font-deva);
  font-size: var(--fs-lg);
  color: var(--text-caps);
  font-synthesis-weight: none;
}
.home-row-text {
  display: block;
  margin-top: 6px;
  font-family: var(--font-reading);
  font-size: calc(var(--reading-size) * .88);
  line-height: 1.5;
  color: var(--text-nav);
}
.home-row-kicker { display: block; margin-bottom: 7px; line-height: 16px; }
.home-row-links { display: flex; margin-top: 12px; gap: 6px; }

.home-posts .home-row-title { font-size: calc(var(--fs-h3) * .92); }
.home-more { margin-top: 28px; }

/* ---------------------------------------------------------------------------------------- */
/* The guiding words                                                                         */
/* ---------------------------------------------------------------------------------------- */
.divider + .home-words { margin-top: 64px; }
.home-words + .home-words { margin-top: 88px; }
.home-words + .divider { margin-top: 104px; }
.home-words .article-head + .prose { margin-top: 32px; }

.quote { margin: 0; }
.prose .quote blockquote {
  margin: 0;
  padding: 0;
  border: 0;
}
.quote-commentary { margin-top: var(--para-space); }
.prose .quote-commentary-intro { margin-bottom: .3em; color: var(--text-muted); }
.prose .quote-commentary > :last-child { margin-bottom: 0; }
.prose .quote figcaption {
  margin-top: .55em;
  font-family: var(--font-display);
  font-size: .84em;
  line-height: 1.45;
  text-align: left;
  color: var(--text-muted);
}
.prose .quote figcaption a { text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.quote cite { font-style: italic; }

/* IAST words (lang="sa-Latn") stay in the reading face. The shared `.prose :lang(sa)` rule also
   matches sa-Latn and would switch them to the Devanagari face with its taller leading. */
.prose :lang(sa-Latn) {
  font-family: var(--font-reading);
  line-height: inherit;
  hyphens: manual;
}

/* The Trust's own line ("VMLT is one such humble offering …"). */
.quote-own blockquote p {
  text-align: center;
  font-style: italic;
  color: var(--text-title);
  text-wrap: balance;
  hyphens: manual;
}

.prose .asterism {
  margin: 1.5em 0;
  font-family: var(--font-display);
  line-height: 1;
  text-align: center;
  letter-spacing: .35em;
  color: var(--text-muted);
  user-select: none;
}

/* ---------------------------------------------------------------------------------------- */
/* About and Guide                                                                           */
/* ---------------------------------------------------------------------------------------- */
.home-section { margin-top: 56px; }
.divider + .home-section,
.divider + .prose { margin-top: 48px; }
.home-section + .divider,
.prose + .divider,
.home-list + .divider { margin-top: 96px; }
.home-section-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-title);
}
.home-section .prose + .home-section-title,
.home-section .guide-table + .home-section-title { margin-top: 44px; }
.home-section > .pill-row { margin-top: 20px; }

.home-site-domain {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  letter-spacing: .02em;
  color: var(--text-muted);
}

/* Tables of the guide (shortcuts, scripts): inside the measure, quiet rules. */
.guide-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: var(--fs-ui);
  line-height: 1.45;
}
.guide-table caption {
  padding: 0 0 8px;
  text-align: left;
  font-size: var(--fs-2xs);
  font-weight: var(--weight-caps);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-caps);
}
.guide-table th,
.guide-table td {
  padding: 9px 12px 9px 0;
  text-align: left;
  vertical-align: baseline;
  border-bottom: 1px solid var(--border);
}
.guide-table thead th {
  font-weight: var(--weight-ui-strong);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  border-bottom-color: var(--rule);
}
.guide-table tbody th { font-weight: 400; color: var(--text-title); white-space: nowrap; }
.guide-table td { color: var(--text); }
.guide-table kbd + kbd { margin-left: 4px; }
.guide-table .deva { font-size: var(--fs-lg); line-height: 1.4; }
.guide-table .iast { font-family: var(--font-reading); font-size: var(--fs-lg); }
.guide-table-scroll { margin-top: 28px; overflow-x: auto; }
.guide-table-scroll + .prose { margin-top: 20px; }
.guide .prose code { white-space: nowrap; }

/* Try-out: type in any script, see the others. */
.guide-try { margin-top: 32px; }
.guide-try .input { width: 100%; font-size: max(var(--fs-ui), var(--fs-input-touch)); }
.guide-try-out {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  min-height: calc(4 * 1.6em);     /* reserved: no shift when the results arrive */
  margin: 14px 0 0;
  font-size: var(--fs-ui);
  line-height: 1.6;
}
.guide-try-out dt { color: var(--text-muted); }
.guide-try-out dd { margin: 0; color: var(--text-title); overflow-wrap: anywhere; }
.guide-try-out dd.deva { font-size: var(--fs-lg); line-height: 1.4; }
.guide-try-out dd.iast { font-family: var(--font-reading); font-size: var(--fs-lg); line-height: 1.4; }

/* ---------------------------------------------------------------------------------------- */
/* Account                                                                                   */
/* ---------------------------------------------------------------------------------------- */
.account-profile {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.account-avatar {
  position: relative;
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--control-border);
}
.account-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1;
  text-transform: uppercase;
}
.account-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.account-name {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-title);
  overflow-wrap: anywhere;
}
.account-email { margin-top: 4px; font-size: var(--fs-ui); color: var(--text-muted); overflow-wrap: anywhere; }
.account-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.account-role {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  font-size: var(--fs-xs);
  letter-spacing: .04em;
  color: var(--text-nav);
  border: 1px solid var(--control-border);
  border-radius: var(--radius-pill);
}

.account-group { margin-top: 36px; }
.account-group-title {
  margin-bottom: 10px;
  font-size: var(--fs-2xs);
  font-weight: var(--weight-caps);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-caps);
}
.account-options { margin: 0; padding: 0; border: 0; min-width: 0; }
.account-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.account-option:first-of-type { border-top: 1px solid var(--border); }
.account-option input { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); cursor: inherit; }
.account-option input:disabled { cursor: default; }
.account-option-text { display: grid; gap: 2px; }
.account-option-label { font-size: var(--fs-md); color: var(--text-title); }
.account-option-help { font-size: var(--fs-sm); color: var(--text-muted); }
.account-status { min-height: 20px; margin-top: 10px; font-size: var(--fs-sm); color: var(--text-muted); }
.account-status.is-error { color: var(--danger); }
.account-links { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 767.98px) {
  .home-row-title { font-size: calc(var(--fs-h3) * .9); }
  .home-posts .home-row-title { font-size: calc(var(--fs-h3) * .85); }
  .home-row-count { white-space: normal; }
  .divider + .home-words { margin-top: 44px; }
  .home-words + .home-words { margin-top: 64px; }
  .home-words + .divider,
  .home-section + .divider,
  .prose + .divider,
  .home-list + .divider { margin-top: 72px; }
  .account-profile { gap: 16px; }
  .account-avatar { width: 60px; height: 60px; }
  .account-name { font-size: var(--fs-h3); }
}
