.reading {
  margin: 0 0 var(--space-7);
}

.reading__crumbs {
  margin: 0 0 var(--space-5);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.reading__crumbs a {
  color: var(--color-accent);
  text-decoration: none;
}

.reading__crumbs a:hover {
  text-decoration: underline;
}

.reading__header {
  display: grid;
  gap: var(--space-5);
  align-items: start;
  margin-bottom: var(--space-6);
}

.reading__cover {
  margin: 0;
  width: min(100%, 22rem);
}

.reading__cover img,
.reading__cover-fallback {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-2);
  background: var(--tile-read);
  object-fit: cover;
}

.reading__cover-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.reading__cover-fallback svg {
  width: 4.5rem;
  height: 4.5rem;
}

.reading__type {
  margin: 0 0 var(--space-2);
  color: var(--color-secondary);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reading h1 {
  margin: 0 0 var(--space-3);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.2;
}

.reading__lead {
  margin: 0 0 var(--space-4);
  max-width: 40rem;
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.reading__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0 0 var(--space-4);
  padding: 0;
  list-style: none;
  color: var(--color-text);
}

.reading__start {
  margin: 0;
}

.reading__sheet {
  max-width: 42.5rem;
  margin: 0;
  padding: var(--space-5) var(--space-4);
  background: #fbfaf7;
  border-radius: var(--radius-3);
}

.reading__sheet[data-measure="wide"] {
  max-width: 48.75rem;
}

.reading--poem .reading__sheet {
  max-width: 38.75rem;
}

.reading__tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.reading__tools button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}

.reading__text {
  font-size: 1.1875rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.reading__text p {
  margin: 0 0 1.15em;
}

.reading__chapter {
  margin: 0 0 var(--space-4);
  font-size: var(--text-h3);
  line-height: var(--leading-heading);
}

.reading__progress {
  margin: 0 0 var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.reading__toc {
  margin: 0 0 var(--space-5);
}

.reading__toc h2 {
  margin: 0 0 var(--space-3);
  font-size: var(--text-h3);
}

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

.reading__toc li + li {
  margin-top: var(--space-2);
}

.reading__toc button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  font: inherit;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
}

.reading__toc button[aria-current="true"] {
  color: var(--color-text);
  font-weight: 700;
  cursor: default;
}

.reading__pager {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.reading__pager button,
.reading__pager a {
  min-height: 2.75rem;
  color: var(--color-accent);
  font: inherit;
}

.reading__pager button {
  padding: 0.4rem 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.reading__pager button:disabled {
  color: var(--color-text-secondary);
  cursor: default;
}

.poem__stanza {
  margin: 0 0 1.75rem;
  text-align: left;
}

.fable-moral {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.fable-moral__label {
  margin: 0 0 var(--space-2);
  font-weight: 700;
}

.reading__more {
  margin-top: var(--space-7);
}

.reading__more h2 {
  margin: 0 0 var(--space-4);
}

.reading__status {
  margin: 0;
}

body:has(.reading) .crumbs {
  display: none;
}

@media (min-width: 48rem) {
  .reading__header {
    grid-template-columns: minmax(17.5rem, 22rem) minmax(0, 1fr);
    gap: var(--space-6);
  }

  .reading__cover {
    width: 100%;
    max-width: 22rem;
  }

  .reading__sheet {
    padding: var(--space-6) var(--space-6);
  }
}

@media (max-width: 23.5rem) {
  .reading__sheet,
  .reading__header,
  .reading__pager {
    max-width: 100%;
  }
}

.reading--illustrated,
.reading--scenes {
  --reader-width: 46.25rem;
  --reader-measure: 40.625rem;
  --reader-font: 1.15625rem;
  --reader-leading: 1.7;
  width: 100%;
  max-width: var(--reader-width);
  margin-inline: auto;
  color: var(--color-text);
}

.reading--illustrated .reading__header,
.reading--illustrated .reading__sheet {
  max-width: none;
  margin-inline: 0;
}

.reading--illustrated .reading__sheet {
  padding: 0 0 var(--space-5);
  background: transparent;
  border-radius: 0;
}

.reading--illustrated .reading__header {
  display: block;
  margin-bottom: var(--space-4);
}

.reading--scenes .reading__header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.reading--illustrated .reading__intro,
.reading--scenes .reading__intro {
  text-align: center;
}

.reading--scenes .reading__cover {
  order: 2;
  width: 100%;
  max-width: none;
  margin: var(--space-5) 0 0;
}

.reading--scenes .reading__cover img {
  width: 100%;
  height: auto;
  object-fit: contain;
  box-shadow: var(--shadow-card);
}

.reading--scenes .reading__sheet {
  max-width: none;
  margin-inline: 0;
  padding: 0 0 var(--space-5);
  background: transparent;
  border-radius: 0;
}

.reading--scenes .reading__intro {
  order: 1;
}

.reading--illustrated .reading__cover {
  width: 100%;
  max-width: none;
  margin: 0 0 var(--space-5);
}

.reading--illustrated.reading--scenes .reading__cover {
  order: 2;
  margin: var(--space-5) 0 0;
}

.reading--illustrated .reading__cover img {
  width: 100%;
  height: auto;
  object-fit: contain;
  box-shadow: var(--shadow-card);
}

.reading--illustrated .reading__type {
  margin-bottom: var(--space-2);
}

.reading--illustrated h1,
.reading--scenes h1 {
  margin-bottom: var(--space-3);
  font-size: clamp(1.75rem, 1rem + 2.4vw, 2.5rem);
  line-height: 1.2;
}

.reading--illustrated .reading__meta,
.reading--scenes .reading__meta {
  justify-content: center;
  margin-bottom: var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.reading--illustrated .reading__tools {
  justify-content: center;
  margin-bottom: var(--space-4);
}

.reading--illustrated .reading__text,
.reading--illustrated .reading__text p,
.reading--scenes .reading__text,
.reading--scenes .reading__text p {
  font-size: var(--reader-font);
  line-height: var(--reader-leading);
  text-align: left;
}

.reading--illustrated .reading__text > p {
  max-width: var(--reader-measure);
  margin-inline: auto;
  margin-bottom: 1.05em;
}

.reading--illustrated .reading__text > p:last-child {
  margin-bottom: 0;
}

.reading--illustrated .reading__figure {
  width: 100%;
  max-width: none;
  margin: 1.75rem 0;
  overflow: hidden;
  border-radius: var(--radius-2);
}

.reading--illustrated.reading--scenes .reading__figure {
  width: min(100%, var(--reader-measure));
  max-width: var(--reader-measure);
  margin: 2rem auto;
}

.reading--scenes .reading__text p {
  max-width: var(--reader-measure);
  margin-inline: auto;
}

.reading--scenes:not(.reading--immersive) .reading__figure,
.reading--scenes:not(.reading--immersive) .reading__tools {
  display: none;
}

.reading--scenes .reading__cta {
  max-width: var(--reader-measure);
  margin: 1.75rem auto 0;
}

.reading--scenes .reading__cta .button--primary {
  min-height: 3rem;
  padding-inline: 1.35rem;
  font-size: 1.0625rem;
}

.reading--scenes.reading--continuous .story-reader-nav [data-story-progress],
.reading--scenes.reading--continuous .story-reader-nav [data-story-prev],
.reading--scenes.reading--continuous .story-reader-nav [data-story-next] {
  display: none;
}

body:has(.reading--scenes.reading--immersive) .story-collections,
body:has(.reading--scenes.reading--immersive) .story-next,
body:has(.reading--scenes.reading--immersive) .portal-also {
  display: none;
}

@media (max-width: 40rem) {
  .reading--scenes .reading__cta .button--primary {
    flex: 1 1 100%;
  }
}

.reading--illustrated .reading__figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-card);
}

.reading--illustrated .kp-interaction {
  max-width: var(--reader-measure);
  margin: 1.75rem auto;
  padding: 1.125rem 1.25rem;
  background: color-mix(in srgb, var(--color-bg) 42%, var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  text-align: left;
}

.reading--illustrated .kp-interaction__label {
  margin: 0 0 0.4rem;
  color: var(--color-text);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.4;
}

.reading--illustrated .kp-interaction__question {
  margin: 0;
  font-weight: 450;
  line-height: var(--reader-leading);
}

.reading--illustrated .reading__more {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

body:has(.reading--illustrated) #discussion,
body:has(.reading--illustrated) .story-nav {
  max-width: 46.25rem;
  margin-inline: auto;
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 767px) {
  .reading--illustrated .reading__text,
  .reading--scenes .reading__text {
    font-size: 1.15625rem;
    line-height: 1.7;
  }

  .reading--illustrated .reading__sheet {
    padding-right: 0;
    padding-left: 0;
    background: transparent;
  }
}

@media (min-width: 48rem) {
  .reading--illustrated,
  .reading--scenes {
    --reader-font: 1.1875rem;
    --reader-leading: 1.75;
  }

  .reading--illustrated .reading__header {
    display: block;
  }

  .reading--scenes .reading__header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .reading--illustrated .reading__cover {
    width: 100%;
    max-width: none;
  }

  .reading--illustrated .reading__sheet {
    padding: 0 0 var(--space-4);
    background: transparent;
  }

  .reading--illustrated .reading__figure {
    margin: 2.25rem 0;
  }
}

.reading__actions,
.story-reader-nav,
.story-print-go {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.reading__actions a,
.reading__actions button {
  min-height: 2.75rem;
}

.story-reader-nav[hidden] {
  display: none;
}

.reading--immersive .story-reader-nav {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 0;
  background: var(--color-bg);
}

.story-expand {
  margin: 1.5rem 0 0;
}

.story-expand button,
.story-reader-nav button,
.story-print-go button {
  min-height: 2.75rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.story-expand button:focus-visible,
.story-reader-nav button:focus-visible,
.story-print-go button:focus-visible,
.reading__actions a:focus-visible,
.reading__actions button:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

body:has(.reading--immersive) .site-header,
body:has(.reading--immersive) .site-footer,
body:has(.reading--immersive) .crumbs,
body:has(.reading--immersive) .page-crumbs,
body:has(.reading--immersive) #dle-comments-form,
body:has(.reading--immersive) #dle-ajax-comments,
body:has(.reading--immersive) .reading__more,
body:has(.reading--immersive) .story-return,
body:has(.reading--immersive) .story-next,
body:has(.reading--immersive) .reading__cover,
body:has(.reading--immersive) .reading__actions,
body:has(.reading--print) .site-header,
body:has(.reading--print) .site-footer,
body:has(.reading--print) .crumbs,
body:has(.reading--print) .page-crumbs,
body:has(.reading--print) #dle-comments-form,
body:has(.reading--print) #dle-ajax-comments,
body:has(.reading--print) .story-next {
  display: none;
}

.story-next {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: var(--measure);
  margin-top: var(--space-5);
}

.story-next__link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.story-next__link:hover {
  background: var(--color-accent-soft);
  border-color: var(--color-accent);
}

.story-next__link:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

.reading--print .reading__crumbs,
.reading--print .page-crumbs,
.reading--print .reading__actions,
.reading--print .reading__tools,
.reading--print .story-reader-nav,
.reading--print .story-expand,
.reading--print .reading__more,
.reading--print .story-return,
.reading--print .story-next,
.reading--print .kp-interaction,
.reading--print-text .reading__figure,
.reading--print-text .reading__cover {
  display: none;
}

@media print {
  .site-header,
  .site-footer,
  .crumbs,
  .page-crumbs,
  .reading__crumbs,
  .reading__actions,
  .reading__tools,
  .story-reader-nav,
  .story-expand,
  .story-print-go,
  .reading__more,
  .story-return,
  .story-next,
  .kp-interaction,
  #dle-comments-form,
  #dle-ajax-comments {
    display: none !important;
  }
}
