/* ==========================================================================
   Bharatiya Vidya Mandir — E-Library Stylesheet
   e-library.bharatbvm.com
   ========================================================================== */

:root {
  --font-sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Cinzel", Georgia, serif;
  --font-hindi: "Rozha One", serif;

  --bg: #faf7f2;
  --bg-elevated: #ffffff;
  --bg-sunken: #f2ece1;
  --border: #e7dfd3;
  --border-strong: #d5c8b5;

  --text: #44403c;
  --text-strong: #1c1917;
  --text-muted: #78716c;

  --brand-500: #ea580c;
  --brand-600: #c2410c;
  --accent: #ea580c;
  --accent-light: #ffedd5;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.06);
  --shadow-md: 0 4px 14px rgba(28, 25, 23, 0.08);
  --shadow-lg: 0 12px 30px rgba(28, 25, 23, 0.12);
  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

html[data-theme="dark"] {
  --bg: #12100e;
  --bg-elevated: #1c1917;
  --bg-sunken: #181513;
  --border: #292524;
  --border-strong: #44403c;

  --text: #d6d3d1;
  --text-strong: #fafaf9;
  --text-muted: #a8a29e;

  --brand-500: #f97316;
  --brand-600: #ea580c;
  --accent: #f97316;
  --accent-light: rgba(249, 115, 22, 0.15);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.6);
  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: transparent; }

.elib-shell {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* --- Topbar Utility Bar --------------------------------------------------- */
.topbar {
  background: #1c1917;
  color: #d6d3d1;
  font-size: .82rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
html[data-theme="dark"] .topbar {
  background: #000000;
  border-bottom-color: rgba(255, 255, 255, .05);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: .55rem;
  flex-wrap: wrap;
}
.topbar__contact {
  display: flex;
  gap: 1.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.topbar__contact a {
  color: #d6d3d1;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .82rem;
  font-weight: 500;
  transition: color .2s ease;
}
.topbar__contact a:hover {
  color: #ea580c;
}
.topbar__tools {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.lang-switch a {
  padding: .25rem .6rem;
  border-radius: 9999px;
  color: #a8a29e;
  font-weight: 700;
  font-size: .74rem;
  letter-spacing: .06em;
  transition: all .25s ease;
}
.lang-switch a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}
.lang-switch a.is-active,
.lang-switch a[aria-current="true"] {
  background: #c2410c;
  color: #fff;
}

.icon-btn {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #d6d3d1;
  transition: background-color .25s ease, color .25s ease, transform .25s ease;
  cursor: pointer;
  background: transparent;
  border: none;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  transform: scale(1.08);
}
.icon-btn .icon-sun,
.icon-btn .icon-moon {
  display: none;
  line-height: 0;
}
html[data-theme="dark"]  .icon-btn .icon-sun  { display: inline-flex; }
html[data-theme="light"] .icon-btn .icon-moon { display: inline-flex; }
.icon-btn:active {
  transform: scale(.94) rotate(-12deg);
}

@media (max-width: 600px) {
  .topbar__inner {
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    padding-block: .4rem;
  }
  .topbar__contact {
    gap: 1rem;
    font-size: .75rem;
  }
}

/* --- Notice Bar ----------------------------------------------------------- */
.site-notice {
  background: linear-gradient(90deg, #ea580c, #c2410c);
  color: #fff;
  padding: .5rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-align: center;
}
.site-notice a { color: #fff; font-weight: 700; text-decoration: underline; margin-left: .5rem; }

/* --- Navigation ----------------------------------------------------------- */
.elib-nav {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.elib-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: .75rem;
  gap: 1rem;
}

.elib-brand {
  display: flex;
  align-items: center;
  gap: .85rem;
  transition: transform .35s var(--ease-spring);
}
.elib-brand:hover { transform: translateY(-2px); }

.elib-crest {
  position: relative;
  width: 3.2rem; height: 3.2rem;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-elevated);
  border: 2px solid var(--border-strong);
  box-shadow: 0 4px 14px rgba(28, 25, 23, .12), var(--sheen);
  transition: border-color .35s ease, box-shadow .35s ease, transform .35s var(--ease-spring);
}
.elib-crest::after {
  content: ""; position: absolute; inset: 3px;
  border-radius: 50%; border: 1px solid var(--border);
  pointer-events: none;
}
.elib-brand:hover .elib-crest {
  border-color: var(--brand-500);
  box-shadow: 0 0 24px rgba(234, 88, 12, .38), 0 6px 20px rgba(28, 25, 23, .18), var(--sheen);
  transform: scale(1.05) rotate(2deg);
}
.elib-crest img { width: 68%; height: auto; border-radius: 50%; }

.elib-brand-text { display: flex; flex-direction: column; line-height: 1; text-align: left; }
.elib-brand-acronym {
  font-weight: 900; font-size: 1.3rem; letter-spacing: .06em; line-height: .95;
  color: var(--text-strong); transition: color .25s ease;
}
.elib-brand:hover .elib-brand-acronym { color: var(--accent); }
.elib-brand-full {
  display: flex; flex-direction: column; font-family: var(--font-serif);
  font-weight: 700; font-size: .65rem; line-height: 1.15; color: var(--text-strong);
  margin-top: .15rem; white-space: nowrap;
}
.elib-brand-full span { display: block; line-height: 1.12; }
.elib-brand-sub {
  font-size: .52rem; letter-spacing: .22em; text-transform: uppercase;
  font-weight: 800; color: var(--accent); line-height: 1; margin-top: .22rem;
}

.elib-nav__actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.elib-nav__link {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .85rem; border-radius: var(--radius-full);
  font-size: .8rem; font-weight: 700; color: var(--text);
  border: 1px solid var(--border); background: var(--bg-elevated);
  transition: all .2s ease;
}
.elib-nav__link:hover {
  color: var(--accent); border-color: var(--brand-500);
  background: var(--bg-sunken); transform: translateY(-1px);
}

.elib-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: var(--radius-full);
  font-size: .82rem; font-weight: 700; transition: all .2s ease;
  white-space: nowrap;
}
.elib-btn--back {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, .25);
}
.elib-btn--back:hover {
  background: var(--brand-600); transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(234, 88, 12, .35);
}
.elib-btn--primary {
  background: var(--accent); color: #fff;
}
.elib-btn--primary:hover { background: var(--brand-600); }
.elib-btn--sm { padding: .35rem .75rem; font-size: .75rem; }

.elib-theme-toggle {
  display: grid; place-items: center;
  width: 2.3rem; height: 2.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  transition: all .2s ease;
}
.elib-theme-toggle:hover {
  color: var(--accent); border-color: var(--brand-500);
}
html[data-theme="light"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }

/* --- Hero & Search -------------------------------------------------------- */
.elib-hero {
  background: radial-gradient(circle at 50% 0%, var(--accent-light) 0%, transparent 70%), var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 1rem 3rem;
  text-align: center;
}
.elib-hero__inner { max-width: 820px; }
.elib-eyebrow {
  display: inline-block;
  font-size: .75rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .2em; color: var(--accent); margin-bottom: .75rem;
}
.elib-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  font-weight: 800; color: var(--text-strong);
  line-height: 1.2; margin-bottom: 1rem;
}
.elib-hero__subtitle {
  font-size: 1.05rem; color: var(--text-muted);
  max-width: 700px; margin-inline: auto; margin-bottom: 2rem;
}

.elib-search-box {
  position: relative;
  max-width: 620px;
  margin-inline: auto;
}
.elib-search__icon {
  position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.elib-search__input {
  width: 100%;
  padding: .9rem 2.8rem .9rem 3.2rem;
  font-size: 1rem; font-family: inherit;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-strong);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.elib-search__input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(234, 88, 12, .15);
}
.elib-search__clear {
  position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  font-size: 1.3rem; color: var(--text-muted); padding: .2rem .5rem;
}

/* --- Sections ------------------------------------------------------------- */
/* --- 2-Tab Navigation Switcher ------------------------------------------- */
.elib-tab-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.75rem;
}
.elib-tab-btn {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.25rem 1.75rem;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
  position: relative;
  transition: all .25s ease;
}
.elib-tab-btn:hover {
  border-color: var(--brand-500);
  background: var(--bg-sunken);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.elib-tab-btn.is-active {
  border-color: var(--brand-500);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 1px var(--brand-500), var(--shadow-md);
}
.elib-tab-btn.is-active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 15%;
  right: 15%;
  height: 3px;
  background: var(--brand-500);
  border-radius: var(--radius-full);
}
.elib-tab-btn__icon {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
  color: var(--text);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: all .25s ease;
}
.elib-tab-btn.is-active .elib-tab-btn__icon {
  background: var(--accent-light);
  color: var(--accent);
}
.elib-tab-btn__label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.elib-tab-btn__label strong {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.25;
  transition: color .2s ease;
}
.elib-tab-btn.is-active .elib-tab-btn__label strong {
  color: var(--accent);
}
.elib-tab-btn__count {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.elib-tab-panel {
  display: none;
  opacity: 0;
  animation: elibTabFade .35s ease forwards;
}
.elib-tab-panel.is-active {
  display: block;
}
@keyframes elibTabFade {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 768px) {
  .elib-tab-nav { grid-template-columns: 1fr; gap: .75rem; }
  .elib-tab-btn { padding: 1rem 1.25rem; }
  .elib-tab-btn__icon { width: 2.75rem; height: 2.75rem; }
  .elib-tab-btn__label strong { font-size: 1rem; }
}

.elib-content { padding-block: 3.5rem; flex: 1; }
.elib-section { margin-bottom: 4rem; }
.elib-section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem;
  padding-bottom: .75rem; border-bottom: 1px solid var(--border);
}
.elib-section__head h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.85rem);
  font-weight: 700; color: var(--text-strong);
}
.elib-badge {
  display: inline-block; font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .15em; color: var(--accent);
  margin-bottom: .25rem;
}
.elib-count-pill {
  font-size: .78rem; font-weight: 700; padding: .3rem .75rem;
  border-radius: var(--radius-full); background: var(--bg-sunken);
  color: var(--text-muted); border: 1px solid var(--border);
}
.elib-section__desc {
  font-size: 1rem; color: var(--text-muted); margin-bottom: 1.75rem;
  max-width: 800px;
}

/* --- Books Grid ----------------------------------------------------------- */
.elib-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}
.elib-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.elib-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.elib-card__cover-wrap {
  position: relative;
  background: var(--bg-sunken);
  aspect-ratio: 4 / 5.2;
  overflow: hidden;
  display: grid; place-items: center;
}
.elib-card__cover-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.elib-card:hover .elib-card__cover-wrap img { transform: scale(1.03); }

.elib-card__hover-btn {
  position: absolute; inset: auto 1rem 1rem 1rem;
  background: rgba(28, 25, 23, .85);
  color: #fff; font-size: .8rem; font-weight: 700;
  padding: .6rem; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  backdrop-filter: blur(4px);
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.elib-card:hover .elib-card__hover-btn {
  opacity: 1; transform: translateY(0);
}

.elib-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.elib-card__title {
  font-family: var(--font-serif);
  font-size: 1.05rem; font-weight: 700;
  line-height: 1.35; color: var(--text-strong); margin-bottom: .4rem;
}
.elib-card__title a:hover { color: var(--accent); }
.elib-card__sub {
  font-size: .82rem; color: var(--text-muted); line-height: 1.45;
  margin-bottom: 1.25rem; flex: 1;
}

.elib-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding-top: .85rem; border-top: 1px solid var(--border);
}
.elib-card__modes { display: flex; gap: .3rem; }
.elib-mode-pill {
  font-size: .65rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; padding: .2rem .45rem; border-radius: var(--radius-sm);
  background: var(--bg-sunken); color: var(--text-muted);
  border: 1px solid var(--border); transition: all .2s ease;
}
.elib-mode-pill:hover {
  background: var(--accent-light); color: var(--accent); border-color: var(--accent);
}

/* --- Accordions (Vaichariki) ---------------------------------------------- */
.elib-accordions { display: flex; flex-direction: column; gap: .85rem; }
.elib-accordion {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.elib-accordion__trigger {
  width: 100%; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1rem; color: var(--text-strong); text-align: left;
  transition: background .2s ease;
}
.elib-accordion__trigger:hover { background: var(--bg-sunken); }
.elib-accordion__title {
  display: flex; align-items: center; gap: .6rem;
}
.elib-pill {
  font-size: .72rem; font-weight: 700; padding: .2rem .5rem;
  border-radius: var(--radius-full); background: var(--bg-sunken);
  color: var(--text-muted); border: 1px solid var(--border);
}
.elib-accordion__chevron {
  transition: transform .25s ease; color: var(--text-muted);
}
.elib-accordion.is-open .elib-accordion__chevron {
  transform: rotate(180deg); color: var(--accent);
}

.elib-accordion__panel {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.elib-issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}
.elib-issue-card {
  display: flex; flex-direction: column;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.elib-issue-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-sm);
  border-color: var(--brand-500);
}
.elib-issue-card__media {
  aspect-ratio: 3 / 4; background: var(--bg-sunken); overflow: hidden;
}
.elib-issue-card__media img {
  width: 100%; height: 100%; object-fit: cover;
}
.elib-issue-card__label {
  padding: .6rem .75rem; font-size: .78rem; font-weight: 700;
  color: var(--text-strong); text-align: center;
}

/* --- Reader --------------------------------------------------------------- */
.reader-wrap {
  display: flex; flex-direction: column;
  min-height: calc(100vh - 70px);
  background: var(--bg-sunken);
}
.reader-toolbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  padding: .65rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.reader-toolbar__left { display: flex; align-items: center; gap: 1rem; }
.reader-back {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .8rem; font-weight: 700; color: var(--text-muted);
  padding: .35rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg);
  transition: all .2s ease;
}
.reader-back:hover { color: var(--accent); border-color: var(--accent); }
.reader-title-box { display: flex; flex-direction: column; }
.reader-title {
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 700;
  color: var(--text-strong); line-height: 1.2;
}
.reader-subtitle { font-size: .75rem; color: var(--text-muted); }

.reader-toolbar__right { display: flex; align-items: center; gap: .6rem; }
.reader-modes {
  display: flex; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 2px;
}
.reader-mode-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .75rem; font-size: .75rem; font-weight: 700;
  border-radius: 4px; color: var(--text-muted);
  transition: all .2s ease;
}
.reader-mode-btn.is-active {
  background: var(--bg-elevated); color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.reader-action-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .75rem; font-size: .8rem; font-weight: 700;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text);
  transition: all .2s ease;
}
.reader-action-btn:hover { color: var(--accent); border-color: var(--accent); }

.reader-viewport {
  position: relative; flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 1.5rem 1rem; min-height: 600px;
}
.reader-controls {
  display: flex; align-items: center; gap: .5rem;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: .35rem .85rem;
  box-shadow: var(--shadow-md); margin-bottom: 1.5rem;
  position: sticky; top: 80px; z-index: 10;
}
.reader-ctrl-btn {
  padding: .3rem .5rem; border-radius: var(--radius-sm); color: var(--text);
  transition: all .2s ease;
}
.reader-ctrl-btn:hover { color: var(--accent); background: var(--bg-sunken); }
.reader-page-info { font-size: .82rem; font-weight: 600; color: var(--text-muted); }
.reader-page-info input {
  width: 48px; padding: .15rem .3rem; text-align: center;
  font-family: inherit; font-size: .82rem; border-radius: 4px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-strong);
}
.reader-divider { width: 1px; height: 16px; background: var(--border); margin-inline: .25rem; }
.reader-zoom-val { font-size: .78rem; font-weight: 700; color: var(--text-muted); min-width: 40px; text-align: center; }

.reader-container--pdf {
  max-width: 900px; width: 100%; display: flex; justify-content: center;
}
#pdfCanvas {
  max-width: 100%; height: auto; background: #fff;
  box-shadow: var(--shadow-lg); border-radius: var(--radius-sm);
}

.reader-container--kindle {
  max-width: 760px; width: 100%; background: var(--bg-elevated);
  padding: 3rem; border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  line-height: 1.8; font-size: 1.1rem;
}
.reader-container--flip {
  display: flex; justify-content: center; width: 100%;
}

.reader-loading {
  position: absolute; inset: 0; background: rgba(var(--bg), .85);
  backdrop-filter: blur(4px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
}
.reader-spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: elibSpin .8s linear infinite;
}
@keyframes elibSpin { to { transform: rotate(360deg); } }

/* --- Footer --------------------------------------------------------------- */
.elib-footer {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding-block: 3rem; margin-top: auto;
}
.elib-footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
}
.elib-footer__brand h3 {
  font-family: var(--font-serif); font-size: 1.25rem;
  font-weight: 800; color: var(--text-strong); margin-bottom: .5rem;
}
.elib-footer__tagline { font-size: .88rem; color: var(--text-muted); margin-bottom: 1rem; }
.elib-footer__copy { font-size: .8rem; color: var(--text-muted); }

.elib-footer__links h4, .elib-footer__social h4 {
  font-size: .85rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-strong); margin-bottom: 1rem;
}
.elib-footer__links ul { list-style: none; }
.elib-footer__links li { margin-bottom: .5rem; }
.elib-footer__links a { font-size: .85rem; color: var(--text-muted); transition: color .2s; }
.elib-footer__links a:hover { color: var(--accent); }

.elib-social-list { display: flex; gap: .5rem; margin-bottom: 1rem; }
.elib-social-icon {
  display: grid; place-items: center;
  width: 2.2rem; height: 2.2rem; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--bg);
  color: var(--text); transition: all .2s ease;
}
.elib-social-icon:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
  transform: translateY(-2px);
}
.elib-footer__meta { font-size: .75rem; color: var(--text-muted); }

/* --- Media Queries -------------------------------------------------------- */
@media (max-width: 900px) {
  .elib-footer__inner { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 680px) {
  .elib-nav__actions .elib-nav__link { display: none; }
  .hide-mobile { display: none; }
  .elib-hero { padding-block: 2.5rem 2rem; }
  .reader-toolbar { flex-direction: column; align-items: flex-start; }
  .reader-toolbar__right { width: 100%; justify-content: space-between; }
}
