@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

* {
  box-sizing: border-box;
}

.video-placeholder-box,
.video-launch-card {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: linear-gradient(145deg, #eef5fb, #fff);
  color: #26394d;
  box-shadow: 0 12px 26px rgba(15, 42, 68, 0.08);
}

.video-placeholder-box strong,
.video-launch-card strong {
  color: #0d4a75;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:root {
  --reader-primary: #0d4a75;
  --reader-primary-dark: #062d47;
  --reader-accent: #1f6f8b;
  --reader-bg: #eef4f9;
  --reader-page: rgba(255, 255, 255, 0.84);
  --reader-text: #112235;
  --reader-muted: #65758a;
  --reader-border: #d9e3ef;
  --reader-shadow: 0 18px 42px rgba(15, 42, 68, 0.12);
}

body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
  color: var(--reader-text);
  background:
    radial-gradient(circle at 12% 8%, rgba(31, 111, 139, 0.14), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(13, 74, 117, 0.10), transparent 32%),
    linear-gradient(145deg, #f7fbff 0%, #eaf2f8 48%, #f9fbfd 100%);
}

.page-body {
  min-height: 100vh;
  padding: 34px 22px 60px;
}

.content-page {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid rgba(13, 74, 117, 0.13);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(13, 74, 117, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(13, 74, 117, 0.035) 1px, transparent 1px),
    rgba(255, 255, 255, 0.82);
  background-size: 34px 34px;
  box-shadow: var(--reader-shadow);
}

.content-page h1 {
  max-width: 760px;
  margin: 28px 0 14px;
  color: var(--reader-primary-dark);
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  line-height: 1.02;
}

.page-lead {
  max-width: 760px;
  margin: 0 0 24px;
  color: #334e68;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  line-height: 1.65;
}

.video-launch-card {
  max-width: 620px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 16px;
  padding: 22px 24px;
  color: var(--reader-primary-dark);
  text-decoration: none;
}

.video-launch-card:hover {
  color: var(--reader-primary);
  text-decoration: none;
  border-color: rgba(13, 74, 117, 0.28);
  transform: translateY(-1px);
}

.video-launch-icon {
  grid-row: span 2;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: #0d4a75;
  box-shadow: 0 10px 20px rgba(13, 74, 117, 0.22);
}

.video-launch-icon svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.video-launch-card strong {
  font-size: 1.15rem;
  letter-spacing: 0;
  text-transform: none;
}

.video-launch-card span {
  color: #526575;
}

img,
iframe,
video {
  max-width: 100%;
}

a {
  color: var(--reader-primary);
}

.reader-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.reader-sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  overflow-y: auto;
  padding: 24px 18px;
  color: var(--reader-text);
  border: 1px solid rgba(13, 74, 117, 0.13);
  border-radius: 28px;
  background: rgba(232, 243, 250, 0.84);
  box-shadow: 0 18px 42px rgba(15, 42, 68, 0.12);
  backdrop-filter: blur(14px);
}

.reader-brand {
  display: block;
  margin-bottom: 22px;
  color: var(--reader-primary);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.reader-sidebar h1 {
  margin: 0 0 8px;
  color: var(--reader-primary-dark);
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.reader-sidebar p {
  margin: 0 0 20px;
  color: var(--reader-muted);
}

.toc-toggle {
  display: none;
}

.chapter-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.chapter-link {
  display: block;
  padding: 9px 11px;
  border: 1px solid rgba(13, 74, 117, 0.12);
  border-radius: 12px;
  color: #2d4b64;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.58);
  font-size: 0.9rem;
  line-height: 1.35;
}

.chapter-link:hover,
.chapter-link.active {
  color: var(--reader-primary-dark);
  text-decoration: none;
  background: #dcecf7;
  border-color: rgba(13, 74, 117, 0.30);
}

.reader-main {
  min-width: 0;
  padding: 0;
}

.reader-book {
  max-width: 980px;
  margin: 0 auto;
}

.reader-toolbar,
.reader-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.reader-pagination {
  margin-top: 24px;
  margin-bottom: 0;
}

.reader-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--reader-border);
  border-radius: 16px;
  color: var(--reader-primary-dark);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 8px 18px rgba(15, 42, 68, 0.08);
  font-weight: 800;
  text-decoration: none;
}

.reader-button-icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.reader-button:hover {
  color: var(--reader-primary);
  text-decoration: none;
  border-color: rgba(13, 74, 117, 0.28);
}

.reader-button.disabled {
  color: #94a3b8;
  pointer-events: none;
  box-shadow: none;
}

.reader-page {
  min-height: 70vh;
  padding: clamp(28px, 5vw, 60px);
  border: 1px solid rgba(13, 74, 117, 0.13);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(13, 74, 117, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(13, 74, 117, 0.035) 1px, transparent 1px),
    var(--reader-page);
  background-size: 34px 34px;
  box-shadow: var(--reader-shadow);
}

.reader-page h1 {
  margin-top: 0;
  color: var(--reader-primary-dark);
  font-size: clamp(2.2rem, 4.8vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.reader-page h2 {
  margin-top: 1.6em;
  color: var(--reader-primary);
}

.reader-kicker {
  margin: 0 0 10px;
  color: var(--reader-accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-page p,
.reader-page li {
  font-size: 1.07rem;
}

.reader-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: #fff;
}

.reader-page th,
.reader-page td {
  border: 1px solid var(--reader-border);
  padding: 8px;
  vertical-align: top;
}

.reader-page code,
.reader-page pre {
  background: #f4f6f8;
}

.unit-cover {
  display: grid;
  gap: 16px;
}

.unit-cover-card {
  display: block;
  padding: 18px;
  border: 1px solid rgba(13, 74, 117, 0.13);
  border-left: 4px solid rgba(31, 111, 139, 0.52);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--reader-primary-dark);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(15, 42, 68, 0.07);
}

.unit-cover-card:hover {
  color: var(--reader-primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.book-toc {
  gap: 14px;
}

.toc-unit {
  border-top: 1px solid rgba(13, 74, 117, 0.12);
  padding-top: 12px;
}

.toc-unit:first-child {
  border-top: none;
  padding-top: 0;
}

.toc-unit-title {
  display: block;
  margin-bottom: 8px;
  color: var(--reader-primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.toc-unit-title:hover,
.active-unit .toc-unit-title {
  color: var(--reader-primary);
  text-decoration: none;
}

.toc-chapters {
  display: grid;
  gap: 6px;
}

.library-body {
  background:
    radial-gradient(circle at 12% 8%, rgba(31, 111, 139, 0.14), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(13, 74, 117, 0.10), transparent 32%),
    linear-gradient(145deg, #f7fbff 0%, #eaf2f8 48%, #f9fbfd 100%);
}

.library-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 22px 60px;
}

.library-hero,
.library-note {
  margin: 22px 0;
  padding: 28px;
  border: 1px solid rgba(13, 74, 117, 0.13);
  border-radius: 28px;
  background:
    linear-gradient(90deg, rgba(13, 74, 117, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(13, 74, 117, 0.035) 1px, transparent 1px),
    rgba(255, 255, 255, 0.78);
  background-size: 34px 34px;
  box-shadow: 0 14px 36px rgba(15, 42, 68, 0.10);
}

.library-hero h1 {
  margin: 0 0 8px;
  color: var(--reader-primary-dark);
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.book-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
  margin: 28px 0;
}

.book-thumb {
  position: relative;
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px 20px;
  overflow: hidden;
  border-radius: 10px 16px 16px 10px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(145deg, #0d4a75, #062d47);
  box-shadow:
    inset 12px 0 0 rgba(255, 255, 255, 0.12),
    inset 16px 0 0 rgba(0, 0, 0, 0.16),
    0 16px 28px rgba(15, 23, 42, 0.18);
}

.book-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.12), transparent 18%, rgba(255,255,255,0.06) 54%, transparent);
  pointer-events: none;
}

.book-thumb:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-4px);
  box-shadow:
    inset 12px 0 0 rgba(255, 255, 255, 0.14),
    inset 16px 0 0 rgba(0, 0, 0, 0.18),
    0 22px 40px rgba(15, 23, 42, 0.24);
}

.book-thumb strong {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  line-height: 1.15;
}

.book-thumb small,
.book-label {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.82);
}

.book-thumb small {
  margin-top: 12px;
}

.book-label {
  margin-bottom: auto;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.book-mark {
  position: absolute;
  top: 0;
  right: 24px;
  width: 22px;
  height: 74px;
  background: rgba(255, 255, 255, 0.84);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
}

.federal-book {
  background: linear-gradient(145deg, #16324f, #0d4a75);
}

.law-book {
  background: linear-gradient(145deg, #123c45, #1f6f8b);
}

.language-book {
  background: linear-gradient(145deg, #49326b, #7251a3);
}

.math-book {
  background: linear-gradient(145deg, #5b3b16, #a3631f);
}

.resource-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 860px) {
  .reader-shell {
    display: block;
    padding: 8px;
  }

  .reader-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    max-height: 100vh;
    overflow-y: visible;
    padding: 14px 16px;
    border-radius: 18px;
    box-shadow: 0 10px 26px rgba(15, 42, 68, 0.16);
  }

  .reader-brand {
    margin-bottom: 8px;
    font-size: 0.75rem;
  }

  .reader-sidebar h1 {
    margin-bottom: 10px;
    font-size: 1.05rem;
  }

  .reader-sidebar p {
    display: none;
  }

  .toc-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid rgba(13, 74, 117, 0.18);
    border-radius: 12px;
    color: #062d47;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
    font: inherit;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
  }

  .toc-toggle::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 1.25rem;
    line-height: 1;
  }

  .reader-sidebar.is-open .toc-toggle::after {
    content: "-";
  }

  .reader-sidebar .book-toc {
    display: none;
    max-height: 62vh;
    margin-top: 12px;
    padding: 12px 4px 4px 0;
    overflow-y: auto;
  }

  .reader-sidebar.is-open .book-toc {
    display: grid;
  }

  .reader-main {
    padding: 12px 0 24px;
  }

  .reader-toolbar,
  .reader-pagination {
    flex-wrap: wrap;
  }

  .reader-page {
    min-height: auto;
    padding: 22px 18px;
  }

  .page-body {
    padding: 12px;
  }

  .content-page {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .video-launch-card {
    grid-template-columns: 1fr;
  }

  .video-launch-icon {
    grid-row: auto;
  }
}
