@font-face {
  font-family: 'Adobe Caslon Pro';
  src: url('/assets/fonts/ACaslonPro-Regular.woff2') format('woff2'), 
    url('/assets/fonts/ACaslonPro-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Adobe Caslon Pro';
  src: url('/assets/fonts/ACaslonPro-Italic.woff2') format('woff2'), 
    url('/assets/fonts/ACaslonPro-Italic.woff') format('woff');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Initials TFB';
  src: url('/assets/fonts/Initials-TFB.woff2') format('woff2'),
    url('/assets/fonts/Initials-TFB.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'FoulisGreek';
  src: url('/assets/fonts/FoulisGreek.woff2') format('woff2'), 
      url('/assets/fonts/FoulisGreek.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  color: #254A49;
  font-family: 'Adobe Caslon Pro', Georgia, serif;
  font-size: 1.4em;
  font-language-override: normal;
  font-kerning: auto;
  font-feature-settings: 'kern', 'liga', 'dlig', 'hlig', 'cswh';
  font-synthesis: weight style;
  margin: 0;

  /* Keep the footer at the bottom of the viewport on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.course-shell {
  flex: 1 0 auto;
}

blockquote, em {
  /* font-family: 'Adobe Caslon Pro Italic', Georgia, serif; */
}

article {
  max-width: 720px;
  padding: 30px 20px;
  margin: auto;
  width: 100%;
}

nav {
  margin-top: 20px;
  font-variant: small-caps;
  font-size: 0.8em;
}

footer {
  font-variant: small-caps;
  text-align: center;
  font-size: 0.7em;
  margin: 30px 0;
}

.interlinear {
  span {
    display: inline-block;
    text-align: center;
    text-indent: 0;
  }

  span::after {
    display: block;
    font-size: 0.6em;
    line-height: 0.3em;
  }

  span:not([data-translation])::after {
    content: '\200B';
  }

  span[data-translation]::after {
    content: attr(data-translation);
    text-align: center;
    opacity: 0.75;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-variant: small-caps;
}

h1,
h2 {
  text-align: center;
}

h2,
h3 {
  margin-top: 1.7em;
}

h1 {
  /* margin-bottom: 1.3em; */
  font-size: 2.6em;
}

h1 .title-1,
h1 .title-2,
h1 .title-3,
h1 .title-4,
h1 .title-7 {
  display: block;
}

h1 .title-1 {
  margin-bottom: 0.2em;
  font-size: 0.7em;
}

h1 .title-2 {
  line-height: 0.7em;
  font-size: 1.2em;
  margin-bottom: 0.4em;
  /* letter-spacing: 0.1em; */
}

h1 .title-3 {
  font-size: 0.5em;
  margin-bottom: 0.6em;
}

h1 .title-4 {
  font-size: 0.5em;
  font-variant: normal;
}

h1 .title-5 {
  font-size: 0.3em;
  font-variant: normal;
}


p, ul, ol {
  line-height: 1.5em;
}

.subtitle {
  text-align: center;
  font-style: italic;
}

article p:not(.subtitle) {
  text-indent: 2em; /* use variable, same in quote-author */
  text-align: justify;
}

.quote-author {
  display: block;
  margin-left: 2em;
}

article p:first-child {
  text-indent: 0;
}

article p:first-child::first-letter {
  margin: 0 6px;
  font-size: 6rem;
  float: left;
  line-height: 1;
  font-family: "Initials TFB", 'Georgia', serif;
}

  .breadcrumb {
    margin-bottom: -15px;
    font-size: 0.9em;
  }

  .list-inline,
  .breadcrumb,
  .navigation {
    list-style: none;
    padding: 0;
  }

  .list-inline > li,
  .breadcrumb > li,
  .navigation > li {
    display: inline;
  }

  .list-middot > li:not(:last-child)::after {
    content: "\00b7";
    margin: 0 .20em;
  }

  .breadcrumb > li:not(:last-child)::after {
    content: "›";
    margin: 0 .25em;
  }

  .navigation > li:not(:last-child)::after {
    content: "|";
    margin: 0 .25em;
  }

  hr {
    border: none;
  }

  hr::before {
    padding: 0.6em 0;
    content: '  ';
    display: block;
    text-align: center;
  }

  a {
    color: #499491;
  }

  a:hover {
    color: #a3dec9;
  }

  img {
    max-width: 100%;
  }

.study-edition {
  max-width: 860px;
  overflow-wrap: break-word;
}

.study-edition p:not(.subtitle) {
  text-indent: 0;
}

.editorial-note,
.study-unit,
.book-section {
  border-top: 1px solid rgba(37, 74, 73, 0.24);
  margin-top: 2.2em;
  padding-top: 1.2em;
}

.book-section {
  scroll-margin-top: 1.5rem;
}

/* One lesson at a time: only the active section is shown. */
.rudimenta .book-section {
  display: none;
}

.rudimenta .book-section.is-active {
  display: block;
}

/* Title page stands alone, without the section divider rule. */
.book-section.title-page {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Subtle running header naming the work; hidden on the title page itself. */
.running-title {
  color: rgba(37, 74, 73, 0.5);
  font-size: 0.78em;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  margin: 0 0 1.4em;
  text-align: center;
}

.course-shell.is-title-page .running-title {
  display: none;
}

/* Introductory prose on the title page. */
.introductio-body {
  margin: 2.6em auto 0;
  max-width: 34em;
}

.introductio-body .intro-signature {
  font-style: italic;
  margin-top: 1.8em;
  text-align: right;
  text-indent: 0;
}

/* ===== Course shell ===== */
#main-content {
  min-width: 0;
}

/* Course sidebar — mobile default (TOC sits atop the page, collapsible) */
.course-sidebar {
  margin: 0.75rem 0 0.25rem;
}

.course-nav-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.course-nav-title {
  display: none;
}

.toc-hide-btn,
.toc-show-btn {
  display: none;
}

.course-nav-toggle {
  background: none;
  border: 1px solid rgba(37, 74, 73, 0.35);
  border-radius: 4px;
  color: #254A49;
  cursor: pointer;
  font-family: 'Adobe Caslon Pro', Georgia, serif;
  font-size: 0.82em;
  padding: 0.35em 0.65em;
  text-align: left;
  width: 100%;
}

.course-nav-list {
  display: none;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
}

.course-nav-list.is-open {
  display: block;
}

.course-nav-list li + li {
  border-top: 1px solid rgba(37, 74, 73, 0.12);
}

.course-nav-list a {
  color: rgba(37, 74, 73, 0.72);
  display: block;
  font-size: 0.82em;
  padding: 0.4em 0.2em;
  text-decoration: none;
}

.course-nav-list a:hover {
  color: #254A49;
}

.course-nav-list a.is-active {
  color: #254A49;
  font-variant: small-caps;
}

/* ===== Desktop: fixed, floating flanking sidebars ===== */
@media (min-width: 900px) {
  body.has-course-shell {
    --sidebar-width: 300px;
  }

  #left-sidebar,
  #right-sidebar {
    background: #faf9f6;
    bottom: 0;
    overflow-y: auto;
    position: fixed;
    top: 0;
    width: var(--sidebar-width);
    z-index: 50;
  }

  #left-sidebar {
    border-right: 1px solid rgba(37, 74, 73, 0.2);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    left: 0;
    padding: 1.6rem 1.25rem;
    transition: transform 220ms ease;
  }

  /* Pin the downloads to the bottom-left of the Index column. */
  #left-sidebar .course-downloads {
    margin-top: auto;
  }

  #right-sidebar {
    display: none;
    right: 0;
  }

  .course-shell.is-dict-open #right-sidebar {
    display: block;
  }

  #main-content,
  body.has-course-shell > footer {
    margin-left: var(--sidebar-width);
    transition: margin 220ms ease;
  }

  .course-shell.is-dict-open #main-content,
  .course-shell.is-dict-open ~ footer {
    margin-right: var(--sidebar-width);
  }

  /* Hidden TOC: slide the panel off-screen and reclaim the space. */
  body.is-toc-hidden #left-sidebar {
    transform: translateX(-100%);
  }

  body.is-toc-hidden #main-content,
  body.is-toc-hidden.has-course-shell > footer {
    margin-left: 0;
  }

  .course-sidebar {
    margin: 0;
  }

  .course-nav-title {
    color: rgba(37, 74, 73, 0.6);
    display: block;
    font-size: 0.9em;
    font-variant: small-caps;
    letter-spacing: 0.04em;
    margin: 0;
  }

  .toc-hide-btn {
    background: none;
    border: none;
    color: rgba(37, 74, 73, 0.55);
    cursor: pointer;
    display: inline-flex;
    font-size: 1.4em;
    line-height: 1;
    padding: 0 0.2em;
  }

  .toc-hide-btn:hover {
    color: #254A49;
  }

  body.is-toc-hidden .toc-show-btn {
    align-items: center;
    background: #faf9f6;
    border: 1px solid rgba(37, 74, 73, 0.25);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    color: #254A49;
    cursor: pointer;
    display: inline-flex;
    font-family: 'Adobe Caslon Pro', Georgia, serif;
    font-size: 0.82em;
    font-variant: small-caps;
    gap: 0.4em;
    inset-block-start: 1rem;
    inset-inline-start: 1rem;
    padding: 0.4em 0.7em;
    position: fixed;
    z-index: 60;
  }

  .course-nav-toggle {
    display: none;
  }

  .course-nav-list {
    display: block;
    margin-top: 0.8rem;
  }

  .course-nav-list a {
    padding: 0.3em 0;
  }
}

.section-complete-btn {
  background: #254A49;
  border: 1px solid #254A49;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: block;
  font-family: 'Adobe Caslon Pro', Georgia, serif;
  font-size: 0.95em;
  font-variant: small-caps;
  letter-spacing: 0.03em;
  margin: 2.5rem auto 1rem;
  padding: 0.5em 1.3em;
}

.section-complete-btn:hover {
  background: #2e6f45;
  border-color: #2e6f45;
}

.section-complete-btn.is-complete {
  background: transparent;
  border-color: rgba(37, 74, 73, 0.45);
  color: rgba(37, 74, 73, 0.7);
}

.section-complete-btn.is-complete:hover {
  background: rgba(37, 74, 73, 0.07);
  border-color: rgba(37, 74, 73, 0.45);
  color: #254A49;
}

.course-nav-list li.is-complete > a::after {
  color: #2e6f45;
  content: " ✓";
  font-weight: bold;
}

.course-nav-list .nav-more {
  color: rgba(37, 74, 73, 0.4);
  font-size: 0.82em;
  font-style: italic;
  padding: 0.4em 0.2em;
}

/* Diplomatic-edition downloads at the bottom of the Index. */
.course-downloads {
  border-top: 1px solid rgba(37, 74, 73, 0.14);
  font-size: 0.82em;
  margin-top: 1.5rem;
  padding-top: 1rem;
}

.downloads-title {
  color: rgba(37, 74, 73, 0.55);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  margin: 0 0 0.4em;
}

.downloads-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.downloads-list li {
  display: inline;
}

.downloads-list li:not(:last-child)::after {
  color: rgba(37, 74, 73, 0.4);
  content: " · ";
}

.downloads-list a span {
  color: rgba(37, 74, 73, 0.5);
  font-size: 0.85em;
}

/* Dictionary panel — mobile bottom sheet */
.dict-panel {
  background: #faf9f6;
  border-top: 1px solid rgba(37, 74, 73, 0.2);
  bottom: 0;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  left: 0;
  max-height: 68vh;
  overflow-y: auto;
  position: fixed;
  right: 0;
  z-index: 200;
}

.dict-panel[hidden] {
  display: none;
}

.dict-panel-header {
  align-items: center;
  background: #faf9f6;
  border-bottom: 1px solid rgba(37, 74, 73, 0.15);
  display: flex;
  gap: 0.5em;
  justify-content: space-between;
  padding: 0.55em 0.9em;
  position: sticky;
  top: 0;
}

.dict-panel-word {
  font-size: 1.05em;
  font-style: italic;
}

.dict-panel-close {
  background: none;
  border: none;
  color: rgba(37, 74, 73, 0.6);
  cursor: pointer;
  font-size: 1.4em;
  line-height: 1;
  padding: 0.1em 0.3em;
}

.dict-panel-close:hover {
  color: #254A49;
}

.dict-panel-body {
  padding: 0.7em 0.9em 1.4em;
}

.dict-loading {
  color: rgba(37, 74, 73, 0.6);
  font-style: italic;
  margin: 0;
}

.dict-gloss {
  font-size: 1.1em;
  font-weight: bold;
  margin: 0 0 0.5em;
}

.dict-meta {
  color: rgba(37, 74, 73, 0.72);
  font-size: 0.88em;
  margin: 0 0 0.6em;
}

.dict-defs {
  font-size: 0.88em;
  margin: 0.4em 0;
  padding-left: 1.25em;
}

.dict-defs li {
  margin-bottom: 0.25em;
}

.dict-not-found {
  color: rgba(37, 74, 73, 0.6);
  font-style: italic;
  margin: 0;
}

.dict-error {
  color: #8a3d2b;
  font-style: italic;
  margin: 0;
}

.dict-sources {
  border-top: 1px solid rgba(37, 74, 73, 0.12);
  margin-top: 0.75em;
  padding-top: 0.5em;
}

.dict-source-entry {
  font-size: 0.82em;
  margin-bottom: 0.3em;
}

.dict-source-summary {
  color: rgba(37, 74, 73, 0.6);
  cursor: pointer;
  font-variant: small-caps;
  list-style: disclosure-closed;
  padding: 0.15em 0;
  user-select: none;
}

.dict-source-entry[open] .dict-source-summary {
  color: #254A49;
  list-style: disclosure-open;
}

.dict-source-text {
  color: rgba(37, 74, 73, 0.82);
  font-size: 0.92em;
  line-height: 1.45;
  margin: 0.3em 0 0.5em 0.8em;
}

.dict-links {
  border-top: 1px solid rgba(37, 74, 73, 0.12);
  font-size: 0.82em;
  margin-top: 0.85em;
  padding-top: 0.6em;
}

/* Dictionary panel — desktop: fills the right sidebar column */
@media (min-width: 900px) {
  .dict-panel {
    border-left: 1px solid rgba(37, 74, 73, 0.2);
    border-top: none;
    bottom: auto;
    box-shadow: -2px 0 16px rgba(0, 0, 0, 0.06);
    height: 100dvh;
    left: auto;
    max-height: 100dvh;
    position: static;
    right: auto;
    top: 0;
    width: 100%;
  }
}

.study-part {
  margin-top: 1.4em;
}

.study-part h3 {
  color: #499491;
  font-size: 0.82em;
  letter-spacing: 0;
  margin: 1.2em 0 0.35em;
  text-align: left;
}

.latin {
  font-size: 1.05em;
}

.book-fragment {
  font-size: 1.05em;
}

.book-fragment p {
  margin: 0.85em 0;
}

.title-fragment {
  text-align: center;
}

.exercises {
  margin-top: 1.2em;
}

.exercises h3 {
  color: #499491;
  font-size: 0.82em;
  letter-spacing: 0;
  margin: 1.2em 0 0.35em;
  text-align: left;
}

.small-caps {
  font-variant: small-caps;
}

.study-list {
  padding-left: 1.2em;
}

.ending-line,
.rule {
  background: rgba(73, 148, 145, 0.08);
  border-left: 3px solid #499491;
  padding: 0.7em 0.9em;
  overflow-wrap: anywhere;
}

.paradigm {
  margin: 1em 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terminations {
  margin: 1em 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terminations table {
  border-collapse: collapse;
  font-size: 0.78em;
  min-width: 620px;
  width: 100%;
}

.terminations h3 {
  font-style: italic;
  font-variant: normal;
  margin: 0.6em 0 0.25em;
  text-align: center;
}

.terminations th,
.terminations td {
  border-bottom: 1px solid rgba(37, 74, 73, 0.18);
  padding: 0.35em 0.42em;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.terminations thead th {
  border-bottom-color: rgba(37, 74, 73, 0.38);
  font-variant: small-caps;
}

.terminations .number-row th {
  background: rgba(73, 148, 145, 0.08);
  color: #499491;
  font-variant: small-caps;
  text-align: center;
}

.paradigm table {
  border-collapse: collapse;
  font-size: 0.9em;
  width: 100%;
}

.paradigm th,
.paradigm td {
  border-bottom: 1px solid rgba(37, 74, 73, 0.18);
  padding: 0.42em 0.55em;
  text-align: left;
  vertical-align: top;
}

.paradigm thead th {
  border-bottom-color: rgba(37, 74, 73, 0.38);
  font-variant: small-caps;
}

.paradigm td span {
  color: rgba(37, 74, 73, 0.76);
  font-style: italic;
}

.drill {
  margin-top: 0.9em;
}

.paradigm-drill {
  border-top: 1px solid rgba(37, 74, 73, 0.2);
  padding-top: 0.75em;
}

.drill-head {
  align-items: baseline;
  display: flex;
  gap: 0.8em;
  justify-content: space-between;
  margin-bottom: 0.35em;
}

.drill-title,
.drill-count {
  margin: 0;
}

.drill-title {
  font-size: 1.05em;
  font-variant: small-caps;
}

.drill-count {
  color: rgba(37, 74, 73, 0.72);
  font-size: 0.75em;
}

.drill-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.drill-table,
.key-table {
  border-collapse: collapse;
  font-size: 0.82em;
  width: 100%;
}

.drill-table th,
.drill-table td,
.key-table th,
.key-table td {
  border-bottom: 1px solid rgba(37, 74, 73, 0.16);
  padding: 0.34em 0.35em;
  text-align: left;
  vertical-align: middle;
}

.drill-table thead th {
  border-bottom-color: rgba(37, 74, 73, 0.38);
  font-variant: small-caps;
}

.form-cell {
  align-items: center;
  display: grid;
  gap: 0.25em;
  grid-template-columns: minmax(3.4em, auto) minmax(5.2em, 1fr);
}

.form-cell span {
  color: rgba(37, 74, 73, 0.72);
  font-style: italic;
  white-space: nowrap;
}

.form-cell input {
  background: #fff;
  border: 1px solid rgba(37, 74, 73, 0.35);
  border-radius: 4px;
  box-sizing: border-box;
  color: #254A49;
  font-family: 'Adobe Caslon Pro', Georgia, serif;
  font-size: 0.95em;
  min-height: 2.2em;
  padding: 0.25em 0.45em;
  width: 100%;
}

.form-cell input.is-correct {
  border-color: #2e6f45;
  background: rgba(46, 111, 69, 0.08);
}

.form-cell input.is-wrong {
  border-color: #8a3d2b;
  background: rgba(138, 61, 43, 0.08);
}

.form-cell:has(input.is-wrong)::after {
  color: #8a3d2b;
  content: attr(data-answer);
}

.drill-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  margin-top: 0.65em;
}

.drill-actions button {
  background: #254A49;
  border: 1px solid #254A49;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-family: 'Adobe Caslon Pro', Georgia, serif;
  font-size: 0.8em;
  min-height: 2.2em;
  padding: 0.25em 0.75em;
}

.drill-actions button[type="button"] {
  background: transparent;
  color: #254A49;
}

.drill-feedback {
  margin: 0.65em 0 0;
  min-height: 1.5em;
}

.drill-feedback.is-correct {
  color: #2e6f45;
}

.drill-feedback.is-wrong {
  color: #8a3d2b;
}

.answer-key {
  background: rgba(73, 148, 145, 0.08);
  margin-top: 0.7em;
  padding: 0.4em 0.55em;
}

.sequence-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35em;
  margin-bottom: 0.8em;
}

.sequence-picker button {
  background: transparent;
  border: 1px solid rgba(37, 74, 73, 0.35);
  border-radius: 4px;
  color: #254A49;
  cursor: pointer;
  font-family: 'Adobe Caslon Pro', Georgia, serif;
  font-size: 0.78em;
  padding: 0.25em 0.55em;
}

.sequence-picker button[aria-current="true"] {
  background: #254A49;
  color: #fff;
}

@media (max-width: 720px) {
  article {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1 {
    font-size: 2em;
  }

  h1 .title-2 {
    line-height: 0.9em;
  }

  .study-edition {
    max-width: 720px;
  }

  .paradigm table {
    font-size: 0.74em;
  }

  .paradigm th,
  .paradigm td {
    padding: 0.35em 0.38em;
  }

  .drill-table,
  .key-table {
    font-size: 0.72em;
  }

  .drill-table th,
  .drill-table td,
  .key-table th,
  .key-table td {
    padding: 0.28em 0.22em;
  }

  .form-cell {
    grid-template-columns: 1fr;
  }

  .form-cell input {
    min-width: 5.4em;
  }

  .drill-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15em;
  }
}

  p img {
    margin-right: 10px;
  }

  p img[src*="#left"] {
    float: left;
  }

  p img[src*="#right"] {
    float: right;
  }

  blockquote {
    margin: 2em 10px;
    text-align: justify;

  }

  /* blockquote {
    font-style: italic;
    border-left: 10px solid #e7c649;
    margin: 1.5em 10px;
    padding: 0.5em 10px;
    quotes: "\201C""\201D""\2018""\2019";
  }

  blockquote:before {
    color: #e7c649;
    content: open-quote;
    font-size: 4em;
    line-height: 0.1em;
    margin-right: 0.25em;
    vertical-align: -0.4em;
  } */

  blockquote p {
    display: inline;
  }

  .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    grid-column-gap: 1.5em;
    justify-items: center;
    margin: 0;
    padding: 0;
  }

  figure {
    font-size: 1.2rem;
    text-align: center;
  }

  figure img {
    height: auto;
    object-fit: cover;
    transition: opacity 0.25s ease-in-out;
  }

  figure img:hover {
    opacity: .7;
  }

  figcaption {
    font-size: 0.6em;
  }

  .greek {
    font-family: 'FoulisGreek', serif;
    font-style: normal;
}
