:root {
  --content-width: 46rem;
  --page-gutter: 1rem;
  --card-gap: 1rem;
  --bottom-space: 6.5rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 20rem;
  overflow-x: hidden;
  padding-bottom: var(--bottom-space);
}

img {
  display: block;
  max-width: 100%;
}

a,
button,
summary {
  touch-action: manipulation;
}

.skip-link {
  left: 1rem;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0.5rem;
}

.site-header {
  align-items: center;
  display: flex;
  height: 3.5rem;
  justify-content: center;
  padding: 0 var(--page-gutter);
}

.site-name {
  align-items: center;
  display: inline-flex;
  gap: 0.65rem;
  min-height: 2.75rem;
}

.precious-dot {
  flex: 0 0 auto;
  height: 0.7rem;
  width: 0.7rem;
}

.question-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 0 auto;
  max-width: var(--content-width);
  padding: 0.5rem var(--page-gutter) 1rem;
}

.question-tab {
  align-items: center;
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
}

.story-flow {
  display: flex;
  flex-direction: column;
  gap: var(--card-gap);
  margin: 0 auto;
  max-width: calc(var(--content-width) + (var(--page-gutter) * 2));
  padding: 1.25rem var(--page-gutter) 2.5rem;
  width: 100%;
}

.chapter-opener {
  padding: 2rem 0 1rem;
}

.chapter-intro {
  max-width: 42rem;
}

.editorial-photo {
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  width: 100%;
}

.editorial-photo img {
  color: transparent;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.answer-card,
.chapter-recap,
.not-found-card {
  position: relative;
  width: 100%;
}

.answer-card {
  min-height: 18rem;
  padding: 1.5rem 1.5rem 4.75rem;
}

.answer-card h2,
.answer-card .large-answer {
  max-width: 39rem;
}

.card-copy > :first-child {
  margin-top: 0;
}

.card-copy > :last-child {
  margin-bottom: 0;
}

.card-copy ul {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.card-copy li {
  margin: 0 0 0.75rem;
  padding-left: 0.3rem;
}

.source-note {
  align-items: center;
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.45rem 0;
}

.source-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.source-links a {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-height: 3.25rem;
  padding: 0.75rem 1rem;
}

.reaction {
  bottom: 1.25rem;
  position: absolute;
  right: 1.25rem;
  z-index: 2;
}

.reaction summary {
  align-items: center;
  display: flex;
  height: 2.75rem;
  justify-content: center;
  list-style: none;
  width: 2.75rem;
}

.reaction summary::-webkit-details-marker {
  display: none;
}

.reaction-message {
  bottom: 0;
  min-height: 2.75rem;
  padding: 0.7rem 3.35rem 0.7rem 1rem;
  position: absolute;
  right: 0;
  white-space: nowrap;
  z-index: -1;
}

.chapter-recap {
  padding: 1.5rem;
}

.next-page,
.primary-button,
.print-button {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 3.5rem;
  padding: 0.9rem 1.5rem;
  width: 100%;
}

.next-page {
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
}

.next-page > span:first-child {
  flex-basis: 100%;
  text-align: center;
}

.print-button {
  border: 0;
  cursor: pointer;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.checklist-card {
  padding-left: 3.8rem;
}

.print-check {
  height: 1.5rem;
  left: 1.5rem;
  position: absolute;
  top: 1.6rem;
  width: 1.5rem;
}

.site-footer {
  margin: 0 auto;
  max-width: calc(var(--content-width) + (var(--page-gutter) * 2));
  padding: 1.5rem var(--page-gutter) 2rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-bottom: 1.5rem;
}

.site-footer nav a {
  align-items: center;
  display: inline-flex;
  min-height: 2.75rem;
}

.bottom-bar {
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 4.75rem;
  left: 0;
  position: fixed;
  right: 0;
  z-index: 20;
}

.bottom-link {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  justify-content: center;
  min-height: 3.5rem;
  min-width: 2.75rem;
  position: relative;
}

.bottom-icon {
  line-height: 1;
}

.bottom-link[aria-current="page"]::after {
  bottom: 0.32rem;
  content: "";
  height: 0.125rem;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  width: 0.9rem;
}

.not-found-page .story-flow {
  min-height: calc(100vh - 14rem);
  justify-content: center;
}

.not-found-card .primary-button {
  margin-top: 1.5rem;
}

@media (min-width: 48rem) {
  :root {
    --page-gutter: 1.5rem;
    --card-gap: 1.25rem;
  }

  body {
    padding-bottom: 0;
  }

  .site-header {
    justify-content: flex-start;
    margin: 0 auto;
    max-width: calc(var(--content-width) + (var(--page-gutter) * 2));
  }

  .question-tabs {
    justify-content: flex-start;
  }

  .chapter-opener {
    padding: 4rem 0 2rem;
  }

  .answer-card {
    min-height: 20rem;
    padding: 2rem 2rem 5rem;
  }

  .reaction {
    bottom: 1.5rem;
    right: 1.5rem;
  }

  .chapter-recap {
    padding: 2rem;
  }

  .bottom-bar {
    border-top: 0;
    height: auto;
    left: auto;
    position: static;
    right: auto;
    margin: 0 auto 1.5rem;
    max-width: var(--content-width);
  }

  .bottom-link {
    min-height: 4rem;
  }
}

@media print {
  body {
    padding: 0;
  }

  .site-header,
  .question-tabs,
  .editorial-photo,
  .reaction,
  .next-page,
  .site-footer,
  .bottom-bar,
  .print-button,
  .source-note {
    display: none !important;
  }

  .story-flow {
    display: block;
    max-width: none;
    padding: 0;
  }

  .chapter-opener {
    padding: 0 0 1rem;
  }

  .answer-card,
  .chapter-recap {
    break-inside: avoid;
    margin-bottom: 0.75rem;
  }
}
