/* Books and Akhand Jyoti (themes/basic/library/*): covers, filters, the books grid, a book / issue page,
   the Akhand Jyoti archive and year pages. Header: hub-hero (section--index.css); search box, pills,
   buttons from newsroom--index.css. The reader has its own file (library--reader.css). */

.lib-hero .container, .lib .container { background: none; }
.lib-hero__title { max-width: 26ch !important; }
.lib-hero__year { color: var(--saffron-300); font-weight: var(--weight-light); }
.lib { background: linear-gradient(180deg, var(--saffron-50) 0, var(--white) 420px); padding-bottom: var(--space-8); }

/* ---- a cover (2:3), or a designed placeholder */
.lib-cover {
  position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 6px 12px 12px 6px;
  background: var(--stone-100); box-shadow: 0 1px 2px rgba(28, 25, 23, .08), 0 10px 24px rgba(28, 25, 23, .12);
}
.lib-cover::after {   /* the spine */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 7%;
  background: linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(255, 255, 255, .12) 60%, transparent);
}
.lib-cover img { width: 100%; height: 100%; object-fit: cover; }
.lib-cover--blank { display: flex; flex-direction: column; justify-content: space-between; padding: 14% 12% 12% 16%;
  background: linear-gradient(160deg, #9a3412, #7f1d1d 55%, #451a03); color: #fde68a; }
.lib-cover__title { font-size: clamp(.8rem, .7rem + .4vw, 1rem); font-weight: var(--weight-semibold); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.lib-cover__mark { align-self: center; font-size: 1.6rem; color: #fbbf24; opacity: .85; }

/* ---- the books grid */
.lib-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-6) var(--space-5); }
.lib-book { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.lib-book__link { display: flex; flex-direction: column; gap: .65rem; color: var(--ink); text-decoration: none; }
.lib-book__link .lib-cover { transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.lib-book__link:hover .lib-cover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 2px 4px rgba(28, 25, 23, .08), 0 20px 36px rgba(146, 64, 14, .22); }
.lib-book__title { font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-book__link:hover .lib-book__title { color: var(--saffron-800); }
.lib-book__meta { display: flex; flex-wrap: wrap; gap: .25rem; }
.lib-lang {
  display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: var(--radius-pill);
  background: var(--saffron-50); border: 1px solid var(--saffron-100); color: var(--saffron-800); font-size: .7rem; text-decoration: none; white-space: nowrap;
}
a.lib-lang:hover, .lib-lang.is-active { background: var(--saffron-100); border-color: var(--saffron-300); }
.lib-grid--row { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* ---- sections, lists */
.lib-section { margin-top: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.lib .lib-section__title {
  display: flex; align-items: center; gap: .6rem; margin: 0 0 var(--space-4);
  font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .1em; text-transform: uppercase; color: var(--saffron-700);
}
.lib .lib-section__title::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--stone-200); }
.lib .lib-section__title span { color: var(--stone-500); font-weight: var(--weight-regular); letter-spacing: .04em; text-transform: none; }
.lib-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem var(--space-4); }
.lib-list a { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 12px; background: var(--white); border: 1px solid var(--stone-200); color: var(--ink); font-size: var(--text-sm); text-decoration: none; }
.lib-list a:hover { border-color: var(--saffron-300); color: var(--saffron-800); }
.lib-list i { color: var(--saffron-600); }
.lib-list span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-list small { color: var(--stone-500); text-transform: capitalize; }

/* ---- a book / issue */
.lib-detail__top { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(1.5rem, 1rem + 3vw, 3.5rem); align-items: start; padding-top: var(--space-7); }
.lib-detail__cover .lib-cover { box-shadow: 0 2px 4px rgba(28, 25, 23, .1), 0 30px 60px rgba(28, 25, 23, .28); }
.lib-detail__info { padding-top: var(--space-2); }
.lib-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.lib-btn {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 48px; padding: .5rem 1.25rem; border-radius: 14px;
  border: 1px solid var(--stone-300); background: var(--white); color: var(--ink); font-weight: var(--weight-semibold); text-decoration: none;
  transition: transform var(--duration), border-color var(--duration), background var(--duration), box-shadow var(--duration);
}
.lib-btn:hover { border-color: var(--saffron-500); color: var(--saffron-800); transform: translateY(-1px); }
.lib-btn small { display: block; width: 100%; font-weight: var(--weight-regular); font-size: var(--text-xs); color: inherit; opacity: .75; }
.lib-btn--primary { flex-wrap: wrap; column-gap: .55rem; row-gap: 0; padding: .55rem 1.5rem; background: var(--saffron-500); border-color: var(--saffron-500); color: var(--ink); box-shadow: 0 10px 24px rgba(248, 182, 0, .35); }
.lib-btn--primary small { padding-left: 1.6rem; margin-top: -.15rem; }
.lib-btn--primary:hover { background: #fbbf24; color: var(--ink); }
.lib-btn__ext { font-size: .8em; opacity: .6; }
.lib-about { margin-top: var(--space-6); }
.lib-about .art-prose { font-size: var(--text-base); max-width: 68ch; }
.lib-topics { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: var(--space-5); }

.lib-editions { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-3); }
.lib-edition {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: .75rem .9rem .75rem .75rem;
  border-radius: 16px; background: var(--white); border: 1px solid var(--stone-200); color: var(--ink); text-decoration: none;
  transition: border-color var(--duration), transform var(--duration), box-shadow var(--duration);
}
.lib-edition:hover { border-color: var(--saffron-300); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(146, 64, 14, .1); }
.lib-edition .lib-cover { border-radius: 3px 7px 7px 3px; box-shadow: 0 4px 10px rgba(28, 25, 23, .16); }
.lib-edition .lib-cover--blank { padding: 10%; }
.lib-edition .lib-cover__title { font-size: .5rem; -webkit-line-clamp: 4; }
.lib-edition .lib-cover__mark { font-size: .9rem; }
.lib-edition__body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.lib-edition__lang { font-weight: var(--weight-semibold); font-size: var(--text-base); }
.lib-edition__lang small { color: var(--stone-500); font-weight: var(--weight-regular); font-size: var(--text-xs); }
.lib-edition__format { color: var(--saffron-800); font-size: var(--text-sm); }
.lib-edition__count { color: var(--stone-500); font-size: var(--text-xs); }
.lib-edition__go { color: var(--stone-400); transition: transform var(--duration), color var(--duration); }
.lib-edition:hover .lib-edition__go { transform: translateX(3px); color: var(--saffron-700); }
.lib-edition--store { background: var(--saffron-50); border-style: dashed; }

.lib-toc { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-5); }
.lib-toc.is-long:not(.is-open) li:nth-child(n+13) { display: none; }
.lib-toc a { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .6rem; align-items: baseline; padding: .6rem .2rem; border-bottom: 1px solid var(--stone-100); color: var(--ink); text-decoration: none; }
.lib-toc a:hover .lib-toc__t { color: var(--saffron-800); }
.lib-toc__n { color: var(--saffron-500); font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
.lib-toc__t { font-size: var(--text-sm); line-height: 1.45; }
.lib-toc__p { color: var(--stone-500); font-size: var(--text-xs); white-space: nowrap; }
.lib-toc__more { margin-top: var(--space-4); }

/* ---- Akhand Jyoti: issues, years */
.lib-issues { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-6) var(--space-5); margin-top: var(--space-6); }
.lib-issues--row { margin-top: 0; }
.lib-issue { display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.lib-issue__link { display: flex; flex-direction: column; gap: .6rem; color: var(--ink); text-decoration: none; }
.lib-issue__link .lib-cover { border-radius: 4px; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.lib-issue__link:hover .lib-cover { transform: translateY(-4px); box-shadow: 0 20px 36px rgba(146, 64, 14, .22); }
.lib-issue__month { font-weight: var(--weight-semibold); font-size: var(--text-base); }
.lib-issue__month small { color: var(--saffron-700); font-weight: var(--weight-regular); }
.lib-issue__eds { display: flex; flex-wrap: wrap; gap: .25rem; }
.lib-decades { display: flex; flex-direction: column; gap: var(--space-5); }
.lib-decade { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.lib .lib-decade__title { margin: .35rem 0 0; font-size: var(--text-2xl); font-weight: var(--weight-light); color: var(--saffron-700); line-height: 1; }
.lib-decade__title span { font-size: .55em; color: var(--stone-500); }
.lib-years { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: .5rem; }
.lib-year {
  display: flex; flex-direction: column; gap: .1rem; padding: .6rem .8rem; border-radius: 12px; background: var(--white); border: 1px solid var(--stone-200);
  color: var(--ink); text-decoration: none; transition: border-color var(--duration), background var(--duration), transform var(--duration);
}
.lib-year strong { font-size: var(--text-lg); font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.lib-year span { color: var(--stone-500); font-size: var(--text-xs); }
.lib-year:hover { border-color: var(--saffron-500); background: var(--saffron-50); transform: translateY(-2px); }

/* ---- sizes */
@media (max-width: 1199.98px) {
  .lib-grid, .lib-grid--row, .lib-issues { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .lib-detail__top { grid-template-columns: 180px minmax(0, 1fr); }
  .lib-toc, .lib-list { grid-template-columns: minmax(0, 1fr); }
  .lib-years { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .lib-grid, .lib-grid--row, .lib-issues { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5) var(--space-3); }
  .lib-detail__top { grid-template-columns: 1fr; padding-top: var(--space-5); }
  .lib-detail__cover { width: 52%; max-width: 220px; margin: 0 auto; }
  .lib-detail__info { padding-top: 0; }
  .lib-actions { justify-content: center; }
  .lib-btn { flex: 1 1 100%; justify-content: center; }
  .lib-btn--primary small { padding-left: 0; text-align: center; }
  .lib-decade { grid-template-columns: 1fr; gap: var(--space-2); }
  .lib-years { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lib-year { padding: .5rem .6rem; }
}
@media (max-width: 420px) {
  .lib-grid, .lib-grid--row, .lib-issues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {   /* rows of covers scroll sideways on phones */
  .lib-grid--row, .lib-issues--row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 38%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .5rem; scrollbar-width: thin; }
  .lib-grid--row > *, .lib-issues--row > * { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .lib-book__link .lib-cover, .lib-issue__link .lib-cover { transition: none; }
}

/* ======================================================= navigation v2 */

/* ---- two columns: filters / years on the left, results on the right */
.lib-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(1.25rem, .5rem + 2.5vw, 2.75rem); align-items: start; padding-top: var(--space-6); }
.lib-main { min-width: 0; }
.lib-icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; border: 1px solid var(--stone-200);
  background: var(--white); color: var(--ink); text-decoration: none; transition: border-color var(--duration), color var(--duration);
}
a.lib-icon-btn:hover, button.lib-icon-btn:hover { border-color: var(--saffron-500); color: var(--saffron-800); }
span.lib-icon-btn[aria-hidden] { visibility: hidden; }
.lib .lib-link-btn { margin-top: .4rem; padding: .35rem .2rem; border: 0; background: none; color: var(--color-link); font-size: var(--text-sm); font-weight: var(--weight-semibold); cursor: pointer; }
.lib-scrim { display: none; }

/* ---- filter panel */
.lib-side { position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; overscroll-behavior: contain;
  padding: var(--space-4); border-radius: 20px; background: var(--white); border: 1px solid var(--stone-200); box-shadow: 0 1px 2px rgba(28, 25, 23, .04); scrollbar-width: thin; }
.lib-side__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.lib .lib-side__head h2 { margin: 0; font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--ink); }
.lib-side__head h2 i { color: var(--saffron-600); margin-right: .25rem; }
.lib-side__close { display: none; }
.lib-facet + .lib-facet { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--stone-100); }
.lib .lib-facet__title { margin: 0 0 .5rem; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .1em; text-transform: uppercase; color: var(--saffron-700); }
.lib-facet__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.lib-facet__item {
  display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; border-radius: 10px; color: var(--stone-700); font-size: var(--text-sm); text-decoration: none; line-height: 1.3;
  transition: background var(--duration), color var(--duration);
}
.lib-facet__item i { color: var(--saffron-600); width: 1.1em; text-align: center; }
.lib-facet__item span { flex: 1 1 auto; min-width: 0; }
.lib-facet__item em { font-style: normal; color: var(--stone-500); font-size: .9em; }
.lib-facet__item small { color: var(--stone-500); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.lib-facet__item:hover { background: var(--saffron-50); color: var(--saffron-800); }
.lib-facet__item.is-active { background: var(--saffron-100); color: var(--saffron-900, #78350f); font-weight: var(--weight-semibold); }
.lib-facet__item.is-active small { color: var(--saffron-800); }
.lib-facet__find { position: relative; display: block; margin: 0 0 .4rem; }
.lib-facet__find i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--stone-400); font-size: .85rem; }
.lib-facet__find input { width: 100%; height: 36px; padding: 0 .7rem 0 2rem; border-radius: 10px; border: 1px solid var(--stone-200); background: var(--stone-50, #fafaf9); font-size: var(--text-sm); }
.lib-facet__find input:focus { outline: 2px solid var(--saffron-300); outline-offset: 0; background: var(--white); }

/* ---- results bar, active filters */
.lib-bar { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }
.lib .lib-bar__filters { display: none; }
.lib-bar__count { margin: 0; flex: 1 1 auto; color: var(--stone-600); font-size: var(--text-sm); }
.lib-bar__count strong { color: var(--ink); font-size: var(--text-lg); }
.lib-sort { display: flex; align-items: center; gap: .5rem; margin: 0; font-size: var(--text-sm); color: var(--stone-600); }
.lib-sort label { margin: 0; }
.lib-sort select { height: 38px; padding: 0 2rem 0 .8rem; border-radius: var(--radius-pill); border: 1px solid var(--stone-300); background-color: var(--white); font-size: var(--text-sm); color: var(--ink); }
.lib-badge { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 .3rem; border-radius: 99px; background: var(--saffron-500); color: var(--ink); font-size: .7rem; font-weight: var(--weight-semibold); }
.lib-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.lib-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: var(--radius-pill); background: var(--white); border: 1px solid var(--saffron-300); color: var(--saffron-900, #78350f); font-size: var(--text-sm); text-decoration: none; }
.lib-chip i:first-child { color: var(--saffron-600); }
.lib-chip:hover { background: var(--saffron-50); }
.lib-chip--clear { border-color: transparent; color: var(--color-link); background: none; }
.lib-shell .lib-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.lib-book__meta { align-items: center; }
.lib-book__formats { display: inline-flex; gap: .3rem; margin-left: auto; color: var(--stone-500); font-size: .8rem; }

/* ---- Akhand Jyoti: years */
.aj-years { position: sticky; top: calc(var(--header-h) + 1rem); display: flex; flex-direction: column; gap: var(--space-3); max-height: calc(100vh - var(--header-h) - 2rem); }
.aj-jump { display: flex; flex-direction: column; gap: .35rem; margin: 0; }
.aj-jump label { margin: 0; font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .1em; text-transform: uppercase; color: var(--saffron-700); }
.aj-jump select { height: 42px; padding: 0 .8rem; border-radius: 12px; border: 1px solid var(--stone-300); background: var(--white); font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.aj-decades { overflow-y: auto; overscroll-behavior: contain; padding: .35rem; border-radius: 20px; background: var(--white); border: 1px solid var(--stone-200); scrollbar-width: thin; }
.aj-decade summary { display: flex; align-items: center; justify-content: space-between; padding: .55rem .7rem; border-radius: 12px; cursor: pointer; list-style: none; font-size: var(--text-lg); font-weight: var(--weight-light); color: var(--saffron-800); }
.aj-decade summary::-webkit-details-marker { display: none; }
.aj-decade summary small { font-size: .6em; color: var(--stone-500); }
.aj-decade summary i { font-size: .8rem; color: var(--stone-400); transition: transform var(--duration); }
.aj-decade[open] summary i { transform: rotate(180deg); }
.aj-decade summary:hover { background: var(--saffron-50); }
.aj-decade__years { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: .2rem .3rem .6rem; }
.aj-year { display: flex; flex-direction: column; align-items: center; padding: .4rem .2rem; border-radius: 10px; color: var(--ink); text-decoration: none; line-height: 1.15; border: 1px solid transparent; }
.aj-year strong { font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
.aj-year small { color: var(--stone-500); font-size: .68rem; }
.aj-year:hover { background: var(--saffron-50); border-color: var(--saffron-100); }
.aj-year.is-active { background: var(--saffron-500); border-color: var(--saffron-500); }
.aj-year.is-active small { color: var(--ink); opacity: .7; }

/* ---- Akhand Jyoti: a year's months */
.aj-year-head { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
.aj-year-head__t { flex: 1 1 auto; text-align: center; }
.lib .aj-year-head h2 { margin: 0; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); font-weight: var(--weight-light); color: var(--saffron-800); line-height: 1; font-variant-numeric: tabular-nums; }
.aj-year-head p { margin: .3rem 0 0; color: var(--stone-500); font-size: var(--text-sm); }
.aj-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.aj-month { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--space-3); padding: .75rem; border-radius: 18px; background: var(--white); border: 1px solid var(--stone-200);
  transition: border-color var(--duration), box-shadow var(--duration); }
.aj-month:hover { border-color: var(--saffron-300); box-shadow: 0 12px 28px rgba(146, 64, 14, .1); }
.aj-month__cover .lib-cover { border-radius: 3px 6px 6px 3px; box-shadow: 0 4px 12px rgba(28, 25, 23, .18); }
.aj-month__cover .lib-cover--blank { padding: 12%; }
.aj-month__cover .lib-cover__title { font-size: .7rem; }
.aj-month__body { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.lib .aj-month__name { margin: .1rem 0 0; font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.2; }
.aj-month__name a { color: var(--ink); text-decoration: none; }
.aj-month__name a:hover { color: var(--saffron-800); }
.aj-month__name small { color: var(--saffron-700); font-weight: var(--weight-regular); font-size: .75em; }
.aj-month__none { margin: 0; color: var(--stone-500); font-size: var(--text-sm); }
.aj-eds { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.aj-ed { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); gap: 0 .45rem; align-items: center; padding: .38rem .55rem; border-radius: 10px;
  background: var(--saffron-50); color: var(--ink); font-size: var(--text-sm); text-decoration: none; line-height: 1.25; }
.aj-ed i { color: var(--saffron-700); }
.aj-ed span { min-width: 0; color: var(--stone-700); }
.aj-ed strong { color: var(--ink); font-weight: var(--weight-semibold); margin-right: .15rem; }
.aj-ed small { grid-column: 2; color: var(--stone-500); font-size: .7rem; white-space: nowrap; }
.aj-ed:hover { background: var(--saffron-100); }
.aj-ed--text { background: #eef6ff; }
.aj-ed--text i { color: #1d4ed8; }
.aj-ed--text:hover { background: #dbeafe; }
.aj-year-foot { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-6); }
.lib-section--first { margin-top: 0; margin-bottom: var(--space-6); }

/* ---- an issue: the month switcher under the header */
.aj-issue-nav { position: sticky; top: var(--header-h); z-index: 20; background: rgba(255, 255, 255, .95); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--stone-200); }
.aj-issue-nav__inner { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) minmax(0, 9rem); gap: var(--space-3); align-items: center; }
.aj-issue-nav__step { display: flex; align-items: center; gap: .35rem; color: var(--ink); font-size: var(--text-sm); font-weight: var(--weight-semibold); text-decoration: none; min-width: 0; }
.aj-issue-nav__step span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aj-issue-nav__step i { color: var(--saffron-700); }
.aj-issue-nav__step--next { justify-content: flex-end; }
a.aj-issue-nav__step:hover { color: var(--saffron-800); }
.aj-issue-nav__months { justify-content: center; }
.aj-issue-nav__year { font-weight: var(--weight-semibold); }

/* ---- contents tabs, downloads */
.lib-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: var(--space-4); }
.lib .lib-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem; border-radius: var(--radius-pill); border: 1px solid var(--stone-200); background: var(--white); color: var(--stone-700); font-size: var(--text-sm); cursor: pointer; }
.lib-tab small { color: var(--stone-500); }
.lib .lib-tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.lib-tab[aria-selected="true"] small { color: rgba(255, 255, 255, .7); }
.lib-tabpanel__note { margin: 0 0 var(--space-3); color: var(--stone-600); font-size: var(--text-sm); }
.lib-tabpanel__note i { color: var(--saffron-600); }
.lib-files { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.lib-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .7rem .9rem; border-radius: 14px; background: var(--white); border: 1px solid var(--stone-200); color: var(--ink); text-decoration: none; }
.lib-file:hover { border-color: var(--saffron-300); }
.lib-file > i { color: var(--saffron-700); }
.lib-file__type { padding: .35rem .5rem; border-radius: 8px; background: #b91c1c; color: #fff; font-size: .7rem; font-weight: var(--weight-semibold); letter-spacing: .04em; }
.lib-file__type--epub { background: #15803d; }
.lib-file__type--mobi { background: #1d4ed8; }
.lib-file__body { display: flex; flex-direction: column; min-width: 0; }
.lib-file__body strong { font-size: var(--text-sm); font-weight: var(--weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-file__body small { color: var(--stone-500); font-size: var(--text-xs); }

/* ---- sizes */
@media (max-width: 1199.98px) {
  .lib-shell .lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .aj-months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
  .lib-shell { grid-template-columns: minmax(0, 1fr); padding-top: var(--space-4); }
  .lib-shell .lib-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* the filters become a drawer */
  .lib-side { position: fixed; z-index: 1050; top: 0; bottom: 0; left: 0; width: min(340px, 88vw); max-height: none; border-radius: 0 20px 20px 0;
    transform: translateX(-105%); transition: transform .3s var(--ease); visibility: hidden; }
  .lib-books.side-open .lib-side { transform: none; visibility: visible; box-shadow: 0 0 60px rgba(0, 0, 0, .3); }
  .lib-side__close { display: inline-grid; }
  .lib-books .lib-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(28, 25, 23, .45); }
  .lib .lib-bar__filters { display: inline-flex; }
  /* years: a jump menu and the decades in a row */
  .aj-years { position: static; max-height: none; }
  .aj-decades { display: flex; gap: .3rem; overflow-x: auto; padding: .3rem; border-radius: 16px; }
  .aj-decade { flex: 0 0 auto; }
  .aj-decade:not([open]) summary { padding: .35rem .7rem; font-size: var(--text-base); }
  .aj-decade[open] { display: flex; align-items: center; }
  .aj-decade[open] summary { padding: .35rem .7rem; font-size: var(--text-base); background: var(--saffron-50); }
  .aj-decade[open] summary i { transform: rotate(-90deg); }
  .aj-decade__years { display: flex; gap: 3px; padding: 0 .3rem; }
  .aj-year { flex-direction: row; gap: .3rem; padding: .3rem .55rem; }
  .aj-year small { display: none; }
}
@media (max-width: 767.98px) {
  .lib-shell .lib-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5) var(--space-3); }
  .lib-bar__count { order: -1; flex-basis: 100%; }
  .lib-sort { margin-left: auto; }
  .lib-sort label { display: none; }
  .aj-months { grid-template-columns: minmax(0, 1fr); }
  .aj-issue-nav__inner { grid-template-columns: auto minmax(0, 1fr) auto; }
  .aj-issue-nav__step span { display: none; }
  .aj-issue-nav__months { justify-content: flex-start; }
  .lib-tab { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 420px) {
  .lib-shell .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aj-month { grid-template-columns: 80px minmax(0, 1fr); }
}
html.lib-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .lib-side { transition: none; } }

/* ---- an issue: contents beside the cover; buttons with a second line */
.lib-detail__toc .lib-section { margin-top: var(--space-6); }
.lib-detail__toc .lib-toc { grid-template-columns: minmax(0, 1fr); }
.lib-actions .lib-btn { flex-wrap: wrap; column-gap: .55rem; row-gap: 0; }
.lib-actions .lib-btn small { padding-left: 1.6rem; margin-top: -.15rem; }
@media (max-width: 767.98px) { .lib-actions .lib-btn small { padding-left: 0; text-align: center; } }

/* ---- Akhand Jyoti archive: the latest issue, recent issues, years */
.lib-aj > .container { padding-top: var(--space-2); }
.aj-feature__card { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(1.25rem, 1rem + 2.5vw, 3rem); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem);
  border-radius: 24px; background: var(--white); border: 1px solid var(--stone-200); box-shadow: 0 1px 2px rgba(28, 25, 23, .04), 0 20px 50px rgba(146, 64, 14, .08); }
.aj-feature__cover .lib-cover { border-radius: 4px 8px 8px 4px; box-shadow: 0 2px 4px rgba(28, 25, 23, .1), 0 24px 48px rgba(28, 25, 23, .25); transition: transform .35s var(--ease); }
.aj-feature__cover:hover .lib-cover { transform: translateY(-4px); }
.aj-feature__body { min-width: 0; display: flex; flex-direction: column; }
.aj-feature__kicker { margin: 0; color: var(--saffron-700); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .1em; text-transform: uppercase; }
.lib .aj-feature__title { margin: .2rem 0 var(--space-4); font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); font-weight: var(--weight-light); line-height: 1.15; }
.aj-feature__title a { color: var(--ink); text-decoration: none; }
.aj-feature__title span { color: var(--saffron-700); }
.aj-feature__eds { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.aj-feature__eds .lib-btn { flex-wrap: wrap; column-gap: .55rem; row-gap: 0; }
.aj-feature__eds .lib-btn small { padding-left: 1.6rem; margin-top: -.15rem; }
.lib .aj-feature__sub { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .1em; text-transform: uppercase; color: var(--stone-500); }
.aj-feature__toc { margin: 0; padding: 0; list-style: none; counter-reset: ft; columns: 2; column-gap: var(--space-5); }
.aj-feature__toc li { counter-increment: ft; break-inside: avoid; }
.aj-feature__toc a { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); padding: .4rem 0; border-bottom: 1px solid var(--stone-100); color: var(--ink); font-size: var(--text-sm); line-height: 1.4; text-decoration: none; }
.aj-feature__toc a::before { content: counter(ft); color: var(--saffron-500); font-variant-numeric: tabular-nums; }
.aj-feature__toc a:hover { color: var(--saffron-800); }
.aj-feature__more { align-self: flex-start; margin-top: var(--space-3); color: var(--color-link); font-size: var(--text-sm); font-weight: var(--weight-semibold); text-decoration: none; }
.aj-recent { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.aj-jump--inline { flex-direction: row; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.aj-jump--inline select { width: auto; min-width: 9rem; }

/* ---- a year: stats, month jump */
.aj-year-head__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; }
.aj-year-head__stats i { color: var(--saffron-600); }
.aj-month-jump { justify-content: center; margin-bottom: var(--space-5); }
.aj-month { scroll-margin-top: calc(var(--header-h) + 1rem); }
.aj-month:target { border-color: var(--saffron-500); box-shadow: 0 0 0 3px rgba(248, 182, 0, .25); }

@media (max-width: 991.98px) {
  .aj-feature__card { grid-template-columns: 170px minmax(0, 1fr); }
  .aj-feature__toc { columns: 1; }
  .aj-recent { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .aj-feature__card { grid-template-columns: minmax(0, 1fr); }
  .aj-feature__cover { width: 50%; max-width: 200px; margin: 0 auto; }
  .aj-feature__body { text-align: center; }
  .aj-feature__eds { justify-content: center; }
  .aj-feature__eds .lib-btn { flex: 1 1 100%; justify-content: center; }
  .aj-feature__eds .lib-btn small { padding-left: 0; text-align: center; }
  .aj-feature__toc { text-align: left; }
  .aj-feature__more { align-self: center; }
  .aj-recent { grid-template-columns: none; }
  .aj-jump--inline { flex-wrap: wrap; }
  .aj-jump--inline select { flex: 1 1 auto; }
  .aj-month-jump { justify-content: flex-start; }
  .aj-year-foot { flex-wrap: wrap; }
}
