/* Complete documents, with the original page and its explanation kept together. */

.hero-main>.eyebrow>strong {
  display: inline;
  font-weight: 850;
  color: #123da2;
}

.hero-main>.eyebrow {
  line-height: 1.85;
}

.lesson-subject-picker {
  display: none;
}

.lesson-document-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 23px;
  background: white;
  border: 1px solid #d4dce8;
  border-radius: 10px;
  margin: 24px 0;
}

.document-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .09em;
  color: #1642aa;
}

.lesson-document-bar p {
  font-size: 14px;
  color: #4a515d;
  margin-top: 4px;
}

.document-actions {
  display: flex;
  align-items: center;
  gap: 25px;
  flex-shrink: 0;
}

.document-actions .button {
  min-height: 48px;
  padding: 12px 19px;
  font-size: 14px;
}

.download-link {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  padding: 4px 0;
}

.download-link small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #555f70;
}

.lesson-navigation {
  display: block;
  margin: 0 0 20px;
}

.lesson-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lesson-pager>div {
  display: flex;
  gap: 8px;
}

.lesson-pager button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #bdc8d8;
  border-radius: 7px;
  background: white;
  color: #1445bb;
  font-size: 16px;
  padding: 8px 13px;
  line-height: 1.4;
}

.lesson-pager button span {
  font-size: 13px;
  font-weight: 650;
}

.lesson-pager button:disabled {
  opacity: .4;
}

.lesson-pager.bottom {
  margin: 20px 0 26px;
  padding-top: 15px;
  border-top: 1px solid #dbe1ea;
}

.lesson-count {
  font-size: 13px;
  font-weight: 700;
  color: #3e4b5e;
}

.lesson-thumbnails {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 11px 4px 6px;
  scrollbar-width: thin;
}

.lesson-thumbnails button {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  min-width: 66px;
  min-height: 60px;
  padding: 5px 10px 5px 5px;
  border: 1px solid #ccd4df;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #3d4f69;
}

.lesson-thumbnails img {
  width: 36px;
  height: 48px;
  object-fit: contain;
  border: 1px solid #e6e8ed;
  border-radius: 2px;
}

.lesson-thumbnails button[aria-pressed=true] {
  border-color: #1248d8;
  background: #eaf0ff;
  color: #123ca7;
  box-shadow: 0 0 0 1px #1248d8;
}

.lesson-frame {
  grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
  align-items: start;
}

.lesson-paper {
  border: 1px solid #d1d7df;
  border-radius: 9px;
  background: var(--paper);
}

.lesson-paper .note-open {
  background: var(--paper);
}

.lesson-paper img {
  display: block;
  width: 100%;
  object-fit: contain;
  background: var(--paper);
  max-height: none;
}

.lesson-paper figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid #e4e6ea;
  background: var(--paper);
  line-height: 1.5;
  color: #42516a;
}

.lesson-paper figcaption a {
  font-size: 12px;
  font-weight: 750;
  min-height: 38px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.lesson-commentary {
  padding: 5px 0;
}

.lesson-commentary h4 {
  margin-top: 10px;
}

.lesson-commentary p+p {
  margin-top: 18px;
}

.lesson-commentary .equation {
  background: white;
  border-radius: 0 5px 5px 0;
  font-size: 18px;
}

.pdf-cover {
  display: block;
  background: #fff;
  max-height: 310px;
  overflow: hidden;
}

.pdf-cover img {
  display: block;
  width: 100%;
  height: 310px;
  object-fit: contain;
  padding: 12px;
}

.pdf-caption a {
  display: block;
  margin-top: 10px;
  min-height: 32px;
  font-weight: 650;
}

.hero-manuscript .note-open {
  background: var(--paper);
}

#doc-reader {
  margin: auto;
  width: min(1400px,calc(100vw - 40px));
  height: calc(100dvh - 40px);
  max-width: none;
  max-height: none;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  padding: 0;
  background: white;
  color: #182332;
  box-shadow: 0 30px 90px #111d4360;
}

#doc-reader[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0,1fr) auto auto;
}

#doc-reader::backdrop {
  background: #122341c9;
  backdrop-filter: blur(3px);
}

.doc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 22px 13px;
  border-bottom: 1px solid #dce2ec;
}

.doc-header .eyebrow {
  font-size: 10px;
  letter-spacing: .08em;
}

.doc-header h2 {
  font-size: 23px;
  letter-spacing: -.025em;
  line-height: 1.3;
  margin-top: 5px;
}

.doc-header button {
  min-height: 44px;
  min-width: 84px;
  flex-shrink: 0;
  border: 1px solid #bdc8d8;
  border-radius: 6px;
  background: #fff;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 700;
}

.doc-header button span {
  font-size: 20px;
  margin-left: 6px;
}

.doc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 22px;
  background: #f6f8fb;
}

.doc-toolbar>a {
  font-size: 13px;
  font-weight: 750;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.doc-zoom {
  display: flex;
  align-items: center;
  gap: 5px;
}

.doc-zoom button {
  border: 1px solid #c7d0de;
  background: white;
  border-radius: 6px;
  min-width: 44px;
  min-height: 44px;
  font-size: 22px;
  font-weight: 600;
}

.doc-zoom #doc-fit {
  font-size: 12px;
  min-width: 64px;
}

.doc-zoom button:disabled {
  opacity: .4;
}

.doc-tabs {
  display: none;
}

.doc-main {
  display: grid;
  grid-template-columns: minmax(0,1.35fr) minmax(0,1fr);
  gap: 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.doc-sheet {
  position: relative;
  overflow: auto;
  min-width: 0;
  min-height: 0;
  background: var(--paper,#fff);
  overscroll-behavior: contain;
  scrollbar-width: thin;
  touch-action: pan-x pan-y;
}

.doc-canvas {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  min-height: 100%;
}

.doc-sheet img {
  display: block;
  max-width: none;
  flex: none;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.doc-sheet.is-zoomed {
  cursor: grab;
}

.doc-sheet.is-panning {
  cursor: grabbing;
}

.doc-explanation {
  font-size: 16px;
  line-height: 1.8;
  padding: 25px 30px;
  overflow: auto;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid #dce2ec;
  overscroll-behavior: contain;
}

.doc-explanation .eyebrow {
  font-size: 10px;
}

.doc-explanation h3 {
  line-height: 1.24;
  letter-spacing: -.035em;
  margin: 12px 0 22px;
}

.doc-explanation .equation {
  font-size: 18px;
  background: #f6f8fc;
  margin-block: 20px;
}

.doc-source {
  display: flex;
  gap: 15px;
  border-top: 1px solid #dde3eb;
  padding: 8px 22px;
  font-size: 11px;
  color: #475974;
  line-height: 1.6;
}

.doc-source a {
  flex-shrink: 0;
}

.doc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 22px 13px;
  background: #f6f8fb;
  border-top: 1px solid #dce2ec;
}

.doc-pagination button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #bdc8d8;
  background: white;
  border-radius: 7px;
  font-size: 21px;
  color: #1647b8;
}

.doc-pagination button:disabled {
  opacity: .35;
}

.doc-pagination select {
  font: 600 14px/1.4 Manrope,system-ui,sans-serif;
  max-width: 470px;
  min-width: 0;
  width: 100%;
  height: 44px;
  background: #fff;
  color: #172d53;
  border: 1px solid #bdc8d8;
  border-radius: 7px;
  padding: 8px 32px 8px 12px;
  text-overflow: ellipsis;
}

.doc-sheet:focus-visible,.doc-explanation:focus-visible {
  outline: 3px solid #1248d8;
  outline-offset: -4px;
}

.doc-reader-open .mobile-contact {
  visibility: hidden;
}

#doc-image-error {
  padding: 22px;
  position: absolute;
  inset: 0;
  background: white;
  font-size: 16px;
}

.lesson-panel:focus-visible {
  outline-offset: 7px;
}

.lesson-subject-picker select:focus-visible,.doc-pagination select:focus-visible {
  outline: 3px solid #1248d8;
  outline-offset: 3px;
}

html:not(.js) .lesson-pager,html:not(.js) .lesson-thumbnails {
  display: none;
}

html:not(.js) .lesson-frame {
  margin-bottom: 35px;
}

@media (max-width:1000px) {
  .lesson-intro {
    grid-template-columns: 1fr;
    gap: 13px;
  }
  .lesson-intro h3,.lesson-intro p {
    max-width: 670px;
  }
  .lesson-commentary {
    font-size: 16px;
  }
  .lesson-commentary h4 {
    font-size: 23px;
  }
  .lesson-document-bar {
    gap: 18px;
    padding: 18px;
  }
  .document-actions {
    gap: 18px;
  }
  .doc-main {
    grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
  }
  .doc-explanation {
    padding: 20px;
  }
  .doc-explanation h3 {
    font-size: 24px;
  }
  .tabs button {
    font-size: 13px;
  }
}

@media (max-width:800px) {
  html.js .lesson-subject-picker {
    display: block;
    margin-bottom: 25px;
  }
  html.js .examples .tabs {
    display: none;
  }
  .lesson-subject-picker label {
    display: block;
    font-size: 12px;
    font-weight: 750;
    margin-bottom: 7px;
    color: #465674;
  }
  .lesson-subject-picker select {
    font: 650 16px/1.4 Manrope,system-ui,sans-serif;
    height: 54px;
    width: 100%;
    padding: 10px 40px 10px 15px;
    color: #153e96;
    background: #fff;
    border: 1px solid #aebdd4;
    border-radius: 8px;
  }
  .lesson-frame {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .lesson-paper {
    max-width: 590px;
    width: 100%;
    margin-inline: auto;
  }
  .lesson-commentary {
    max-width: 690px;
    font-size: 16px;
  }
  .lesson-commentary h4 {
    font-size: 26px;
  }
  .lesson-paper figcaption {
    font-size: 11px;
  }
  .lesson-intro h3 {
    font-size: 28px;
  }
  .lesson-intro p {
    font-size: 15px;
    margin-top: 12px;
  }
  .lesson-document-bar {
    align-items: flex-start;
  }
  .document-actions {
    gap: 15px;
  }
  .lesson-pager.bottom {
    margin-top: 22px;
  }
  .lesson-navigation button {
    min-width: 44px;
  }
  .lesson-pager button {
    padding: 8px 12px;
  }
  .lesson-thumbnails {
    gap: 7px;
  }
  .lesson-thumbnails button {
    min-width: 53px;
    flex-direction: column;
    gap: 2px;
    padding: 4px;
    min-height: 76px;
  }
  .lesson-thumbnails img {
    width: 32px;
    height: 44px;
  }
  .lesson-thumbnails span {
    font-size: 11px;
    line-height: 1.7;
  }
  .lesson-commentary .equation {
    font-size: 17px;
  }
  .lesson-commentary p+p {
    margin-top: 17px;
  }
  #doc-reader {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
  #doc-reader[open] {
    grid-template-rows: auto auto auto minmax(0,1fr) auto auto;
  }
  .doc-header {
    padding: 10px 14px;
    padding-top: max(10px,env(safe-area-inset-top));
  }
  .doc-header h2 {
    font-size: 19px;
    margin-top: 3px;
  }
  .doc-header button {
    padding: 6px 10px;
    min-width: 80px;
    font-size: 13px;
  }
  .doc-header .eyebrow {
    font-size: 9px;
  }
  .doc-toolbar {
    padding: 6px 14px;
  }
  .doc-toolbar>a {
    font-size: 13px;
  }
  .doc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0 14px;
    gap: 6px;
    background: #f6f8fb;
    border-bottom: 1px solid #d9e1ed;
  }
  .doc-tabs button {
    min-height: 44px;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 5px 5px 0 0;
    background: transparent;
    color: #435774;
    font-size: 14px;
    font-weight: 750;
  }
  .doc-tabs button[aria-selected=true] {
    color: #1248d8;
    background: #fff;
    border-bottom-color: #1248d8;
  }
  .doc-main {
    display: block;
  }
  .doc-sheet,.doc-explanation {
    height: 100%;
    width: 100%;
  }
  .doc-explanation {
    font-size: 16px;
    padding: 22px 20px;
    border-left: 0;
  }
  .doc-explanation h3 {
    font-size: 26px;
  }
  .doc-explanation .equation {
    font-size: 17px;
  }
  .doc-source {
    display: block;
    padding: 7px 14px;
    font-size: 10px;
  }
  .doc-source a {
    display: block;
    font-size: 11px;
    min-height: 26px;
    line-height: 26px;
  }
  .doc-pagination {
    padding: 9px 14px max(10px,env(safe-area-inset-bottom));
    gap: 8px;
  }
  .doc-pagination select {
    font-size: 13px;
    max-width: none;
  }
  .doc-pagination button {
    width: 44px;
  }
  .doc-sheet img {
    padding: 0;
  }
  .doc-zoom #doc-fit {
    min-width: 60px;
  }
}

@media (max-width:560px) {
  .lesson-document-bar {
    display: block;
    padding: 16px;
    margin: 20px 0 15px;
  }
  .lesson-document-bar p {
    font-size: 13px;
  }
  .document-actions {
    margin-top: 14px;
    gap: 23px;
  }
  .document-actions .button {
    flex: 1;
    max-width: 210px;
    min-height: 48px;
  }
  .download-link {
    font-size: 13px;
  }
  .document-tag {
    font-size: 9px;
  }
  .lesson-thumbnails {
    padding-top: 13px;
  }
  .lesson-intro h3 {
    font-size: 27px;
  }
  .lesson-pager button span {
    font-size: 12px;
  }
  .lesson-pager .lesson-count {
    font-size: 12px;
  }
  .lesson-paper figcaption {
    padding: 7px 11px;
    gap: 9px;
  }
  .lesson-paper figcaption a {
    font-size: 11px;
  }
  .lesson-commentary h4 {
    font-size: 25px;
  }
  .hero-main>.eyebrow>strong {
    font-size: 12px;
    letter-spacing: .11em;
  }
  .examples .section-heading>p:not(.eyebrow) {
    font-size: 16px;
  }
  .pdf-cover,.pdf-cover img {
    height: 280px;
    max-height: 280px;
  }
}

@media (max-width:360px) {
  .lesson-pager button span {
    display: none;
  }
  .lesson-pager button {
    width: 44px;
  }
  .lesson-thumbnails button {
    min-width: 44px;
  }
  .lesson-thumbnails {
    gap: 4px;
  }
  .lesson-thumbnails img {
    width: 29px;
    height: 41px;
  }
  .lesson-thumbnails span {
    font-size: 10px;
  }
  .lesson-document-bar {
    padding: 14px;
  }
  .document-actions {
    gap: 14px;
  }
  .doc-header h2 {
    font-size: 17px;
  }
  .doc-header .eyebrow {
    font-size: 8px;
  }
  .doc-toolbar>a {
    font-size: 12px;
  }
  .doc-zoom {
    gap: 3px;
  }
  .doc-zoom #doc-fit {
    min-width: 54px;
  }
  .doc-explanation {
    padding: 18px 16px;
  }
}

@media (prefers-reduced-motion:reduce) {
  .lesson-thumbnails {
    scroll-behavior: auto;
  }
}
