/* One readings page at a time. English unless html[data-lang="ne"]. */
html:not([data-lang="ne"]) .lang-ne { display: none; }
html[data-lang="ne"] .lang-en { display: none; }

/* figures.css makes figcaption .deva a block, which would beat the rule above
   and would also split a parenthesis onto its own line. */
html:not([data-lang="ne"]) figure.plate figcaption .lang-ne { display: none; }
html[data-lang="ne"] figure.plate figcaption .lang-en { display: none; }
figure.plate figcaption .lang-en .deva {
  display: inline;
  margin-top: 0;
}

/* Noto Sans Devanagari draws taller than the English font at the same size.
   The parenthesis is a gloss, so it sits a little under the surrounding text.
   Nepali mode is not inside .lang-en, and stays full size. */
.lang-en .deva { font-size: 0.92em; display: inline; }
/* The index blurb rule is `li span { display: block }`. A name inside a link,
   and a gloss inside a sentence, stay on the line. */
li a > span { display: inline; font-weight: 600; }
/* The name is the link. The IAST and Devanagari beside it are ordinary text. */
.name-gloss {
  font-weight: 400;
  color: inherit;
  display: inline;
}

.bar:has(.lang-switch) .bar-book { flex: 0 1 auto; }
.lang-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0 auto;
  flex: 0 0 auto;
}
.bar .lang-switch-label { display: none; }
.lang-switch-label {
  font-size: 0.92rem;
  font-weight: 650;
  color: #8a3414;
}
.lang-switch-buttons {
  display: flex;
  gap: 0.4rem;
}
.lang-switch button {
  font: inherit;
  font-size: 0.95rem;
  color: #5c4636;
  background: transparent;
  border: 1px solid #c4b09a;
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  color: #8a3414;
  background: #ead9bf;
  border-color: #ead9bf;
  font-weight: 650;
}
.lang-switch button:focus-visible {
  outline: 2px solid #b5451d;
  outline-offset: 2px;
}

html[data-theme="dark"] .lang-switch-label { color: #e7c3a8; }
html[data-theme="dark"] .lang-switch button {
  background: #2a221c;
  color: #f3e6d4;
  border-color: rgba(243, 230, 212, 0.18);
}
html[data-theme="dark"] .lang-switch button[aria-pressed="true"] {
  background: #ead9bf;
  color: #2c221a;
  border-color: #ead9bf;
}

/* Shelf index era sections and period leads */
section.era-section {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(44, 34, 26, 0.12);
}
section.era-section:first-of-type {
  border-top: none;
  margin-top: 1rem;
  padding-top: 0;
}
section.era-section h2 {
  margin-top: 0;
  margin-bottom: 0.35rem;
  font-size: 1.35rem;
  color: #2c221a;
  scroll-margin-top: 4.5rem;
}
.period-lead {
  font-style: italic;
  color: #5c4636;
  margin: 0.2rem 0 1rem;
  line-height: 1.55;
  font-size: 0.98rem;
}
.era-page-link {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 650;
}
.era-page-link a {
  color: #8a3414;
  text-decoration: none;
}
.era-page-link a:hover,
.era-page-link a:focus-visible {
  text-decoration: underline;
}
html[data-theme="dark"] .era-page-link a {
  color: #f0a070;
}
html[data-theme="dark"] section.era-section {
  border-top-color: rgba(243, 230, 212, 0.14);
}
html[data-theme="dark"] section.era-section h2 {
  color: #f6ead4;
}
html[data-theme="dark"] .period-lead {
  color: #c9b7a4;
}

/* Starter Guide & Pathway Grid Styles */
.start-guide {
  background: rgba(181, 69, 29, 0.05);
  border: 1px solid rgba(181, 69, 29, 0.18);
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0 2rem;
}
html[data-theme="dark"] .start-guide {
  background: rgba(231, 161, 90, 0.07);
  border-color: rgba(231, 161, 90, 0.22);
}
.start-guide h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: #8a3414;
}
html[data-theme="dark"] .start-guide h2 {
  color: #e7a15a;
}
.start-guide p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #4a382c;
  line-height: 1.5;
}
html[data-theme="dark"] .start-guide p {
  color: #d8c8b6;
}

/* Top 10 Reading Journey */
.top10-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.top10-card {
  background: #ffffff;
  border: 1px solid rgba(44, 34, 26, 0.12);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
html[data-theme="dark"] .top10-card {
  background: #241d17;
  border-color: rgba(243, 230, 212, 0.14);
}
.top10-rank {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8a3414;
}
html[data-theme="dark"] .top10-rank {
  color: #e7a15a;
}
.top10-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c221a;
  text-decoration: none;
}
html[data-theme="dark"] .top10-title {
  color: #f6ead4;
}
.top10-title:hover {
  text-decoration: underline;
}
.top10-author {
  font-size: 0.85rem;
  color: #6c5443;
}
html[data-theme="dark"] .top10-author {
  color: #b5a494;
}
.top10-hook {
  font-size: 0.82rem;
  font-style: italic;
  color: #5c4636;
  margin-top: 0.15rem;
  line-height: 1.35;
}
html[data-theme="dark"] .top10-hook {
  color: #c9b7a4;
}

/* Pathways */
.pathway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
.pathway-card {
  border: 1px solid rgba(44, 34, 26, 0.14);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
}
html[data-theme="dark"] .pathway-card {
  background: rgba(36, 29, 23, 0.6);
  border-color: rgba(243, 230, 212, 0.12);
}
.pathway-card h3 {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
  color: #2c221a;
}
html[data-theme="dark"] .pathway-card h3 {
  color: #f6ead4;
}
.pathway-card p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #5c4636;
}
html[data-theme="dark"] .pathway-card p {
  color: #b5a494;
}

/* Actionable Must-Read Badges */
.must-read {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
  padding: 0.15rem 0.55rem;
  background: rgba(181, 69, 29, 0.08);
  border: 1px solid rgba(181, 69, 29, 0.2);
  border-radius: 4px;
  color: #8a3414;
  font-weight: 500;
}
html[data-theme="dark"] .must-read {
  background: rgba(231, 161, 90, 0.1);
  border-color: rgba(231, 161, 90, 0.25);
  color: #e7a15a;
}
.must-read strong {
  font-weight: 650;
}


/* ==========================================================================
   Immersive Contemporary Feature Guides
   ========================================================================== */

.feature-guide-section {
  margin: 2rem 0;
}

.feature-guide-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.25rem 0;
}

.feature-guide-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(44, 34, 26, 0.15);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(44, 34, 26, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-guide-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(44, 34, 26, 0.09);
}

html[data-theme="dark"] .feature-guide-card {
  background: rgba(36, 29, 23, 0.65);
  border-color: rgba(243, 230, 212, 0.14);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.feature-guide-plate {
  position: relative;
  background: #1c140e;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-guide-plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feature-guide-body {
  padding: 1.15rem 1.25rem 1.15rem 0.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  align-items: center;
}

.feature-badge-award {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  background: #b5451d;
  color: #fff;
  border-radius: 3px;
}

.feature-badge-year {
  display: inline-block;
  font-size: 0.78rem;
  color: #7b624f;
  background: rgba(44, 34, 26, 0.07);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

html[data-theme="dark"] .feature-badge-year {
  color: #c4b3a2;
  background: rgba(243, 230, 212, 0.1);
}

.feature-guide-title {
  font-size: 1.35rem;
  margin: 0.1rem 0 0.3rem;
  line-height: 1.25;
}

.feature-guide-title a {
  color: #2c221a;
  text-decoration: none;
}

.feature-guide-title a:hover {
  color: #b5451d;
  text-decoration: underline;
}

html[data-theme="dark"] .feature-guide-title a {
  color: #f6ead4;
}

html[data-theme="dark"] .feature-guide-title a:hover {
  color: #e7a15a;
}

.feature-author-byline {
  font-size: 0.92rem;
  color: #8a3414;
  font-weight: 600;
  margin-bottom: 0.65rem;
}

html[data-theme="dark"] .feature-author-byline {
  color: #e7a15a;
}

.feature-guide-synopsis {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #3f3126;
  margin: 0 0 0.85rem;
}

html[data-theme="dark"] .feature-guide-synopsis {
  color: #d8c8b8;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.feature-tag {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  background: rgba(181, 69, 29, 0.08);
  border: 1px solid rgba(181, 69, 29, 0.18);
  border-radius: 3px;
  color: #8a3414;
}

html[data-theme="dark"] .feature-tag {
  background: rgba(231, 161, 90, 0.08);
  border-color: rgba(231, 161, 90, 0.22);
  color: #e7a15a;
}

.feature-guide-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(44, 34, 26, 0.1);
  margin-top: auto;
}

html[data-theme="dark"] .feature-guide-footer {
  border-top-color: rgba(243, 230, 212, 0.1);
}

.feature-guide-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: #b5451d;
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  background: rgba(181, 69, 29, 0.08);
  transition: background 0.15s ease, color 0.15s ease;
}

.feature-guide-cta:hover {
  background: #b5451d;
  color: #fff;
}

html[data-theme="dark"] .feature-guide-cta {
  color: #e7a15a;
  background: rgba(231, 161, 90, 0.12);
}

html[data-theme="dark"] .feature-guide-cta:hover {
  background: #e7a15a;
  color: #1e1711;
}

@media (max-width: 768px) {
  .feature-guide-card {
    grid-template-columns: 1fr;
  }
  .feature-guide-plate {
    height: 140px;
  }
  .feature-guide-body {
    padding: 1rem;
  }
}

/* ==========================================================================
   Tidy Author Portraits on Shelf Index
   ========================================================================== */
ol.authors {
  margin: 1.2rem 0 2.2rem;
  padding-left: 1.8rem;
}

ol.authors > li {
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.author-item {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
}

.author-thumb-link {
  flex-shrink: 0;
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 7px rgba(44, 34, 26, 0.14);
  border: 1px solid rgba(44, 34, 26, 0.18);
  background: #201712;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.author-thumb-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(181, 69, 29, 0.28);
  border-color: #b5451d;
}

.author-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.author-info {
  flex: 1;
  min-width: 0;
}

html[data-theme="dark"] .author-thumb-link {
  border-color: rgba(243, 230, 212, 0.18);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .author-thumb-link:hover {
  border-color: #e7a15a;
  box-shadow: 0 4px 14px rgba(231, 161, 90, 0.28);
}

@media (max-width: 640px) {
  .author-item {
    gap: 0.75rem;
  }
  .author-thumb-link {
    width: 52px;
    height: 52px;
  }
}

/* Photo credits and archival attributions */
figcaption .photo-credit {
  display: inline-block;
  opacity: 0.85;
  font-size: 0.85em;
  font-style: normal;
  margin-left: 0.35rem;
}
.credits-table-wrap {
  overflow-x: auto;
  margin-top: 1.25rem;
}
.credits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.5;
}
.credits-table th, .credits-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e2ddd3;
  vertical-align: top;
}
.credits-table th {
  background: rgba(184, 67, 25, 0.06);
  font-weight: 700;
  border-bottom: 2px solid #b84319;
}
.credits-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}
.credits-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: #eee;
  color: #444;
}
.badge-pd {
  background: #e6f4ea;
  color: #137333;
}
.badge-cc {
  background: #e8f0fe;
  color: #1557b0;
}
.badge-press {
  background: #fef7e0;
  color: #8a4b00;
}
html[data-theme="dark"] .badge-pd { background: #193224; color: #8be0a8; }
html[data-theme="dark"] .badge-cc { background: #1a2d44; color: #9ecbff; }
html[data-theme="dark"] .badge-press { background: #362916; color: #f6ca78; }


/* --- Wikisource Open-Access Boxes --- */
.wikisource-box {
  background: var(--bg-alt, #faf7f2);
  border: 1px solid var(--border, #e5dec9);
  border-left: 4px solid #3b6e8c;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.wikisource-box-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  color: var(--fg, #2a2521);
}
.wikisource-box-header strong {
  color: #1a445d;
}
.wikisource-box-header a {
  font-size: 0.88rem;
  font-weight: 600;
  color: #3b6e8c;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wikisource-box ul {
  margin: 0.5rem 0 0.25rem 1.25rem;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}
.wikisource-box li {
  margin-bottom: 0.35rem;
}
.wikisource-box a {
  color: var(--link, #8b3a1a);
}


/* ==========================================================================
   COMPACT DIRECTORY & RESPONSIVE GRID REDESIGN
   ========================================================================== */

/* Index: jump bar and open/close buttons */
.readings-index-sticky {
  margin: 0.75rem 0 1.25rem;
}
.readings-index-sticky nav.readings-jump-nav {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.85rem 0.75rem;
  background: var(--bg-alt, #faf7f2);
  border: 1px solid var(--border, #e5dec9);
  border-radius: 10px;
}
.readings-index-sticky nav.readings-jump-nav .toc-label {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6c5443;
}
.readings-jump-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.readings-jump-table th {
  width: 50%;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6c5443;
  padding: 0 0.35rem 0.45rem;
  border-bottom: 1px solid rgba(44, 34, 26, 0.12);
  vertical-align: bottom;
}
.readings-jump-table td {
  padding: 0.5rem 0.35rem 0;
  vertical-align: top;
}
.readings-jump-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.readings-jump-list a {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(44, 34, 26, 0.14);
  background: #fff;
  color: #2c221a;
}
.readings-jump-list a:hover,
.readings-jump-list a:focus-visible {
  border-color: #8b3a1a;
  color: #8b3a1a;
}
html[data-theme="dark"] .readings-jump-list a {
  background: #25201a;
  border-color: #3d332a;
  color: #ede2d3;
}
html[data-theme="dark"] .readings-jump-list a:hover,
html[data-theme="dark"] .readings-jump-list a:focus-visible {
  border-color: #e7a15a;
  color: #e7a15a;
}
html[data-theme="dark"] .readings-jump-table th {
  color: #c9b7a4;
  border-bottom-color: rgba(243, 230, 212, 0.14);
}
@media (max-width: 640px) {
  .readings-jump-table,
  .readings-jump-table tbody,
  .readings-jump-table tr,
  .readings-jump-table td,
  .readings-jump-table th {
    display: block;
    width: 100%;
  }
  .readings-jump-table th {
    padding-top: 0.65rem;
  }
  .readings-jump-table th:first-child {
    padding-top: 0;
  }
}
.readings-index-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.toggle-all-btn {
  background: #fff;
  border: 1px solid var(--border, #d8ceb8);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--fg, #2a2521);
  transition: all 0.15s ease;
}
.toggle-all-btn:hover {
  background: var(--bg-hover, #ede5d5);
  border-color: #8b3a1a;
  color: #8b3a1a;
}

/* Era Accordion Details & Summary */
details.era-accordion {
  border: 1px solid var(--border, #e5dec9);
  border-radius: 10px;
  background: var(--bg-card, #fff);
  margin-bottom: 1.75rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
details.era-accordion[open] {
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
  border-color: #c9bea6;
}
summary.era-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.4rem;
  background: var(--bg-alt, #faf7f2);
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--fg, #2a2521);
  list-style: none;
  transition: background 0.15s ease;
}
summary.era-summary::-webkit-details-marker {
  display: none;
}
summary.era-summary:hover {
  background: #f2ebd9;
}
.era-summary-title {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.era-summary-badge {
  font-size: 0.78rem;
  font-weight: normal;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  background: #e2d9c5;
  color: #4a4035;
}
.era-chevron {
  font-size: 0.9rem;
  color: #8b3a1a;
  transition: transform 0.2s ease;
}
details.era-accordion[open] .era-chevron {
  transform: rotate(180deg);
}
.era-content {
  padding: 1.25rem 1.4rem 1.75rem;
}

/* Responsive 2-Column Author Grid */
.authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.author-card {
  border: 1px solid var(--border, #e5dec9);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  background: var(--card-inner, #fcfbf9);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.author-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(44, 34, 26, 0.08);
  border-color: #b5451d;
}
.author-card-header {
  display: flex;
  gap: 0.95rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.author-card-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(44, 34, 26, 0.15);
  background: #201712;
}
.author-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.author-card-heading {
  flex: 1;
  min-width: 0;
}
.author-card-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--fg, #2a2521);
  text-decoration: none;
  line-height: 1.3;
}
.author-card-name:hover {
  color: #b5451d;
  text-decoration: underline;
}
.author-card-meta {
  font-size: 0.82rem;
  color: var(--fg-muted, #73675a);
  margin-top: 0.15rem;
}
.author-card-body {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--fg, #332d28);
  flex-grow: 1;
  margin-bottom: 0.75rem;
}
.author-card-footer {
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border, #e5dec9);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.84rem;
}
.author-card-works {
  flex: 1 1 100%;
  font-size: 0.82rem;
  color: var(--fg-muted, #665b50);
}
.author-card-works strong {
  color: #8b3a1a;
}
.author-card-works a {
  font-weight: 600;
}
.author-card-mustread {
  font-size: 0.82rem;
  color: var(--fg-muted, #665b50);
}
.author-card-mustread strong {
  color: #8b3a1a;
}
.author-card-link {
  font-weight: 600;
  color: #8b3a1a;
  text-decoration: none;
  white-space: nowrap;
}
.author-card-link:hover {
  text-decoration: underline;
}

/* Index depth: pillars table and one-year curriculum (light + dark) */
.pillars-section,
.curriculum-section {
  padding-left: 1.25rem;
  margin-bottom: 3.5rem;
  border-radius: 4px;
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}
.pillars-section {
  border-left: 4px solid #b84319;
  background: rgba(184, 67, 25, 0.03);
}
.curriculum-section {
  border-left: 4px solid #1a5fb4;
  background: rgba(26, 95, 180, 0.03);
}
html[data-theme="dark"] .pillars-section {
  background: rgba(231, 161, 90, 0.06);
  border-left-color: #e7a15a;
}
html[data-theme="dark"] .curriculum-section {
  background: rgba(120, 180, 255, 0.08);
  border-left-color: #7ab4ff;
}
.section-kicker-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.kicker {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
}
.kicker-pillars { background: #b84319; }
.kicker-curriculum { background: #1a5fb4; }
.kicker-note {
  font-size: 0.85rem;
  color: #666;
}
html[data-theme="dark"] .kicker-note { color: #c9b7a4; }
.section-subtitle {
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}
.pillars-table-wrap { overflow-x: auto; margin-top: 1.25rem; }
.pillars-table {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.5;
  table-layout: fixed;
}
.pillars-table thead tr {
  border-bottom: 2px solid #b84319;
  text-align: left;
  background: rgba(184, 67, 25, 0.06);
}
html[data-theme="dark"] .pillars-table thead tr {
  border-bottom-color: #e7a15a;
  background: rgba(231, 161, 90, 0.1);
}
.pillars-table th,
.pillars-table td {
  padding: 0.6rem 0.75rem;
}
.pillars-table th:nth-child(1),
.pillars-table td:nth-child(1) {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  padding-left: 0.35rem;
  padding-right: 0.45rem;
  text-align: right;
  white-space: nowrap;
  vertical-align: top;
}
.pillars-table th:nth-child(2),
.pillars-table td:nth-child(2) {
  width: 30%;
  min-width: 13.5rem;
  overflow-wrap: normal;
  word-break: normal;
}
.pillars-table th:nth-child(3),
.pillars-table td:nth-child(3) {
  width: 27%;
  min-width: 11rem;
}
.pillars-table th:nth-child(4),
.pillars-table td:nth-child(4) {
  width: auto;
  min-width: 14rem;
}
.pillars-table tbody tr {
  border-bottom: 1px solid #e2dcd2;
}
.pillars-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}
html[data-theme="dark"] .pillars-table tbody tr {
  border-bottom-color: rgba(243, 230, 212, 0.12);
}
html[data-theme="dark"] .pillars-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}
.pillars-table tbody tr:last-child {
  border-bottom: 2px solid #b84319;
}
.pillar-author {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}
.pillar-author > div:last-child {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}
.pillar-thumb-link { flex-shrink: 0; }
.pillar-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(44, 34, 26, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
.pillar-name-link {
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}
.pillar-years {
  color: #666;
  display: block;
  line-height: 1.4;
  margin-top: 0.15rem;
}
html[data-theme="dark"] .pillar-years { color: #b5a494; }
.pillars-table tbody td:first-child {
  font-weight: 700;
  color: #b84319;
}
html[data-theme="dark"] .pillars-table tbody td:first-child { color: #e7a15a; }

.curriculum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.curriculum-card {
  background: #fff;
  border: 1px solid #d3dbe3;
  border-radius: 4px;
  padding: 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.curriculum-q1 { border-top: 3px solid #1a5fb4; }
.curriculum-q2 { border-top: 3px solid #2e7d32; }
.curriculum-q3 { border-top: 3px solid #8e24aa; }
.curriculum-q4 { border-top: 3px solid #d81b60; }
html[data-theme="dark"] .curriculum-card {
  background: #241d17;
  border-color: rgba(243, 230, 212, 0.14);
  box-shadow: none;
}
.curriculum-card .quarter-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.curriculum-q1 .quarter-label { color: #1a5fb4; }
.curriculum-q2 .quarter-label { color: #2e7d32; }
.curriculum-q3 .quarter-label { color: #8e24aa; }
.curriculum-q4 .quarter-label { color: #d81b60; }
.curriculum-card h3 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 0.65rem;
}
.curriculum-card .quarter-lead {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}
html[data-theme="dark"] .curriculum-card .quarter-lead { color: #c9b7a4; }
.curriculum-card ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.curriculum-card li {
  margin-bottom: 0.4rem;
  padding-left: 1.2rem;
  text-indent: -1.2rem;
}
.curriculum-card li:last-child { margin-bottom: 0.2rem; }

/* Credits Accordion */
details.credits-accordion {
  border: 1px solid var(--border, #e5dec9);
  border-radius: 8px;
  background: var(--bg-alt, #faf7f2);
  margin-top: 1.25rem;
  overflow: hidden;
}
summary.credits-summary {
  padding: 0.95rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.96rem;
  color: #3b6e8c;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
summary.credits-summary:hover {
  background: #f0e9d8;
}

/* Dark Mode Overrides */
html[data-theme="dark"] details.era-accordion,
html[data-theme="dark"] .author-card,
html[data-theme="dark"] details.credits-accordion {
  background: #1e1915;
  border-color: #3d332a;
}
html[data-theme="dark"] summary.era-summary {
  background: #25201a;
  color: #ede2d3;
}
html[data-theme="dark"] summary.era-summary:hover {
  background: #2c251f;
}
html[data-theme="dark"] .era-summary-badge {
  background: #3d332a;
  color: #c9bea6;
}
html[data-theme="dark"] .toggle-all-btn {
  background: #25201a;
  border-color: #3d332a;
  color: #ede2d3;
}
html[data-theme="dark"] .toggle-all-btn:hover {
  background: #332b24;
  color: #e7a15a;
}

@media (max-width: 768px) {
  .authors-grid {
    grid-template-columns: 1fr;
  }
}

/* Katha blockquote styling for hallmark quotes */
.katha-quote {
  margin: 1.8rem 0;
  padding: 1.2rem 1.5rem;
  background: var(--surface-2, rgba(212, 175, 55, 0.05));
  border-left: 4px solid var(--gold, #d4af37);
  border-radius: 4px;
}
.katha-quote p.quote-deva {
  font-family: var(--font-deva, 'Noto Serif Devanagari', serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text, #222);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.katha-quote p.quote-trans {
  font-size: 0.95rem;
  color: var(--text-muted, #666);
  margin-bottom: 0.5rem;
}
.katha-quote cite {
  display: block;
  font-size: 0.85rem;
  color: var(--gold, #b8860b);
  font-style: normal;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.katha-quote p.quote-eng {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text, #333);
  margin: 0;
}

/* Era Filter Bar & Pills */
.literature-filter-bar {
  margin: 1.2rem 0;
  padding: 0.8rem 1rem;
  background: #faf8f5;
  border: 1px solid #e4ded7;
  border-radius: 8px;
}
.literature-filter-bar .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.literature-filter-bar .filter-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  color: #2c221a;
}
.literature-filter-bar .filter-pill {
  cursor: pointer;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  border: 1px solid #c9bfb3;
  background: #ffffff;
  color: #2c221a;
  font-size: 0.82rem;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.literature-filter-bar .filter-pill:hover {
  border-color: #735135;
  background: #f5efe6;
}
.literature-filter-bar .filter-pill.active {
  background: #735135;
  color: #ffffff;
  border-color: #735135;
}

/* Complete Dark Mode Support for Author Cards, Filters, Wikisource & Quotes */
html[data-theme="dark"] .author-card-name { color: #f6ead4; }
html[data-theme="dark"] .author-card-name:hover { color: #f0a070; }
html[data-theme="dark"] .author-card-meta { color: #c9b7a4; }
html[data-theme="dark"] .author-card-body { color: #e8dac6; }
html[data-theme="dark"] .author-card-works,
html[data-theme="dark"] .author-card-mustread { color: #d8c6b2; }
html[data-theme="dark"] .author-card-works strong,
html[data-theme="dark"] .author-card-mustread strong { color: #f6ead4; }
html[data-theme="dark"] .author-card-footer { border-top-color: #3d332a; }
html[data-theme="dark"] .era-chevron { color: #f0a070; }
html[data-theme="dark"] summary.credits-summary { color: #9bc4dc; }
html[data-theme="dark"] summary.credits-summary:hover { background: #2c251f; }
html[data-theme="dark"] .wikisource-box {
  background: #241d17;
  border-color: #3d332a;
  color: #e8dac6;
}
html[data-theme="dark"] .wikisource-box-header {
  background: #2d241c;
  border-bottom-color: #3d332a;
  color: #f6ead4;
}
html[data-theme="dark"] .wikisource-box a { color: #f0a070; }
html[data-theme="dark"] .literature-filter-bar {
  background: #241d17;
  border-color: #3d332a;
}
html[data-theme="dark"] .literature-filter-bar .filter-label { color: #f3e6d4; }
html[data-theme="dark"] .literature-filter-bar .filter-pill {
  background: #2e251e;
  border-color: #544538;
  color: #f3e6d4;
}
html[data-theme="dark"] .literature-filter-bar .filter-pill:hover {
  background: #3b3026;
  border-color: #f0a070;
}
html[data-theme="dark"] .literature-filter-bar .filter-pill.active {
  background: #b5451d;
  border-color: #b5451d;
  color: #ffffff;
}
html[data-theme="dark"] .katha-quote {
  background: rgba(212, 175, 55, 0.08);
  border-left-color: #e2b84a;
}
html[data-theme="dark"] .katha-quote p.quote-deva { color: #f6ead4; }
html[data-theme="dark"] .katha-quote p.quote-trans { color: #c9b7a4; }
html[data-theme="dark"] .katha-quote cite { color: #e2b84a; }
html[data-theme="dark"] .katha-quote p.quote-eng { color: #e8dac6; }
html[data-theme="dark"] .curriculum-q1 .quarter-label { color: #8ec2ff; }
html[data-theme="dark"] .curriculum-q2 .quarter-label { color: #86d88a; }
html[data-theme="dark"] .curriculum-q3 .quarter-label { color: #d996f0; }
html[data-theme="dark"] .curriculum-q4 .quarter-label { color: #f48fb1; }
html[data-theme="dark"] details.credits-accordion p,
html[data-theme="dark"] details.credits-accordion li,
html[data-theme="dark"] details.credits-accordion span,
html[data-theme="dark"] details.credits-accordion [style*="color: #666"],
html[data-theme="dark"] details.credits-accordion [style*="color:#666"] { color: #d8c6b2 !important; }
html[data-theme="dark"] table.katha-table thead tr,
html[data-theme="dark"] table.katha-table th {
  background: #2c231b !important;
  color: #f6ead4 !important;
  border-color: #4a3e33 !important;
}
html[data-theme="dark"] table.katha-table td {
  border-color: #3d332a !important;
  color: #e8dac6;
}
