.gospel-page .page-head,
.gospel-layout {
  --gospel-gutter: clamp(14px, 3vw, 40px);
  max-width: 64rem;
  padding-inline: max(var(--gospel-gutter), env(safe-area-inset-left))
                  max(var(--gospel-gutter), env(safe-area-inset-right));
}

.gospel-page .page-head {
  padding-block: clamp(2rem, 5vw, 4rem) 1.25rem;
}

.gospel-page .page-head h1 {
  font-size: clamp(2rem, 6vw, 4rem);
}

.gospel-page .page-head p {
  margin-bottom: 0;
}

.gospel-chapters ol {
  display: flex;
  flex-wrap: wrap;
  gap: .375rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.gospel-chapters a {
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  display: flex;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
}

.gospel-chapters a[aria-current],
.gospel-chapters a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.gospel-chapter {
  border-inline: 0;
  margin-bottom: 2.5rem;
  padding-inline: clamp(0px, calc(4vw - 26px), 22px);
}

@media (max-width: 640px) {
  .gospel-chapter {
    background: transparent;
  }
}

.gospel-text {
  color: var(--ink);
  font-size: clamp(1.125rem, 2.15vw, 1.3125rem);
  line-height: 1.72;
  overflow-wrap: break-word;
}

.gospel-language {
  display: grid;
  gap: .4rem;
  justify-items: end;
  margin-bottom: 1rem;
}

.gospel-language-options {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.gospel-language-options button {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: .875rem;
  min-height: 44px;
  padding-inline: .7rem;
}

.gospel-language-options button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.gospel-language-options strong {
  margin-inline-end: .15rem;
}

.gospel-language-hint {
  color: var(--muted);
  font-size: .875rem;
  margin: 0;
}

.gospel-text:not([data-mode="compare"]) .gospel-verse,
.gospel-text:not([data-mode="compare"]) .gospel-translation {
  display: contents;
}

.gospel-text:not([data-mode="compare"]) .gospel-translation > p {
  display: inline;
  margin: 0;
}

.gospel-text:not([data-mode="compare"]) .gospel-verse[data-paragraph-start]:not(:first-child)::before,
.gospel-text:not([data-mode="compare"]) .gospel-continuation::before {
  content: "";
  display: block;
  height: .9em;
}

.gospel-verse-marker {
  color: var(--muted);
  font-size: .7em;
  margin-inline-end: .25em;
  scroll-margin-top: 6rem;
  vertical-align: super;
  white-space: nowrap;
}

.gospel-verse-toggle {
  background: none;
  border: 0;
  color: var(--deep-red);
  font-weight: 700;
  line-height: 1;
  min-width: 24px;
  padding: .2em .14em;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.gospel-swapped-language {
  color: var(--deep-red);
  font-weight: 750;
  margin-inline-start: .15em;
}

.gospel-columns,
.gospel-text[data-mode="compare"] .gospel-verse {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1.6rem repeat(2, minmax(0, 1fr));
}

.gospel-columns {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .875rem;
  font-weight: 700;
  padding: .5rem 0 .65rem;
}

.gospel-columns span:first-child {
  grid-column: 2;
}

.gospel-text[data-mode="compare"] .gospel-verse {
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-block: .7rem;
}

.gospel-text[data-mode="compare"] .gospel-verse-marker {
  font-weight: 700;
  line-height: 2;
  margin-inline-end: 0;
}

.gospel-text[data-mode="compare"] .gospel-translation > p {
  margin: 0;
}

.gospel-text[data-mode="compare"] .gospel-translation > p.gospel-continuation {
  margin-top: .55em;
}

.gospel-copy-language {
  display: none;
}

@media (max-width: 700px) {
  .gospel-language {
    justify-items: start;
  }

  .gospel-columns {
    display: none;
  }

  .gospel-text[data-mode="compare"] .gospel-verse {
    column-gap: .6rem;
    grid-template-columns: 1.1rem minmax(0, 1fr);
    row-gap: .65rem;
  }

  .gospel-text[data-mode="compare"] .gospel-translation {
    grid-column: 2;
  }

  .gospel-text[data-mode="compare"] .gospel-copy-language {
    color: var(--deep-red);
    display: block;
    font-size: .7rem;
    font-weight: 750;
  }
}

.gospel-text .verse {
  color: var(--muted);
  font-size: .68em;
  margin-inline-end: .15em;
  scroll-margin-top: 6rem;
}

.gospel-note-ref {
  color: var(--deep-red);
  margin-inline: .1em;
}

button.gospel-note-ref,
.gospel-note-close {
  background: transparent;
  border: 0;
  color: var(--deep-red);
}

button.gospel-note-ref {
  line-height: inherit;
  padding: 0 .12em;
}

button.gospel-note-ref sup {
  text-decoration: underline;
  text-underline-offset: .2em;
}

button.gospel-note-ref[aria-expanded="true"] {
  background: var(--paper);
}

.gospel-inline-note {
  background: #eee8dc;
  border-inline-start: 2px solid var(--deep-red);
  font-size: 1rem;
  line-height: 1.55;
  margin-block: .65rem 0;
  padding: .75rem 1rem .45rem;
}

.gospel-inline-note p {
  margin: 0;
}

.gospel-note-close {
  font-weight: 700;
  min-height: 40px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: .22em;
}

.gospel-navigation {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: .625rem 1rem;
  padding-block: 1rem;
}

.gospel-notes,
.gospel-credit {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1.25rem;
}

.gospel-notes h2 {
  font-size: clamp(1.25rem, 4vw, 1.75rem);
}

.gospel-notes ol,
.gospel-credit ul {
  margin: 0;
  padding-inline-start: 1.25em;
}

.gospel-notes li,
.gospel-note-ref,
.gospel-chapters {
  scroll-margin-top: 6rem;
}

.gospel-notes li + li,
.gospel-credit li + li {
  margin-top: .65rem;
}

.gospel-notes li:target {
  background: var(--paper);
}

.gospel-credit p {
  margin-bottom: .5rem;
}

.gospel-credit > div + div {
  margin-top: 1.25rem;
}
