/* Article page: progress bar, split header, contents on the left, chapters, keep reading. */

.progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 60;
  height: 5px;
  pointer-events: none;
}

.progress__fill {
  display: block;
  height: 100%;
  background-color: var(--brick);
  transform: scaleX(0);
  transform-origin: left center;
}

.story__head {
  background-color: var(--sand);
  border-bottom: 2px solid var(--ink);
}

.story__head-grid {
  display: grid;
  gap: var(--s-4);
  padding-block: var(--s-4) var(--section);
}

.story__kicker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: var(--s-2);
  font-family: var(--ff-head);
  font-size: var(--fs-tiny);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story__no {
  padding: 0.1rem 0.45rem;
  color: var(--white);
  background-color: var(--brick);
  border-radius: var(--radius);
}

.story__title {
  margin-bottom: var(--s-3);
  font-size: var(--fs-h1);
  letter-spacing: -0.035em;
}

.story__lead {
  font-size: var(--fs-lead);
  font-weight: 600;
  line-height: 1.5;
}

.story__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-top: var(--s-3);
  font-size: var(--fs-small);
  color: var(--ink-soft);
  list-style: none;
}

.story__facts li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.story__facts li::before {
  width: 0.5rem;
  height: 0.5rem;
  content: "";
  background-color: var(--saffron);
  border: 1px solid var(--ink);
}

.story__figure {
  justify-self: center;
  margin-right: 8px;
  width: 100%;
  max-width: 40rem;
}

.story__figure picture {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-l);
  box-shadow: 8px 8px 0 var(--ink);
}

.story__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

@media (min-width: 64em) {
  .story__head-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: var(--s-5);
  }
}

.story__grid {
  display: grid;
  gap: var(--s-4);
  padding-block: var(--s-4) var(--section);
  max-width: calc(66rem + 2 * var(--gutter));
}

.story__body {
  max-width: 44rem;
  font-size: var(--fs-read);
  line-height: 1.8;
}

.story__intro {
  margin-bottom: var(--s-4);
  padding-left: var(--s-3);
  font-size: var(--fs-lead);
  line-height: 1.6;
  border-left: 4px solid var(--saffron);
}

.chapter + .chapter {
  margin-top: var(--s-5);
}

.chapter p + p {
  margin-top: 1em;
}

.chapter__title {
  margin-bottom: var(--s-2);
  padding-bottom: 0.6rem;
  font-size: var(--fs-h2);
  background-image: linear-gradient(var(--ink), var(--ink));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 3rem 3px;
}

.chapter__sub {
  margin-bottom: var(--s-2);
  font-family: var(--ff-head);
  font-size: var(--fs-lead);
  font-weight: 600;
  line-height: 1.4;
  color: var(--brick);
}

.story__body .remark {
  margin-top: var(--s-5);
}

/* Contents */

.contents {
  background-color: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-l);
}

.contents__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3);
  font-family: var(--ff-head);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.contents__toggle::-webkit-details-marker {
  display: none;
}

.contents__toggle::after {
  width: 0.65rem;
  height: 0.65rem;
  content: "";
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg) translateY(-25%);
  transition: transform var(--ease);
}

.contents[open] .contents__toggle::after {
  transform: rotate(-135deg) translateY(-25%);
}

.contents__list {
  display: grid;
  padding: 0 var(--s-2) var(--s-2);
  list-style: none;
  counter-reset: contents;
}

.contents__link {
  display: flex;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  font-size: var(--fs-small);
  line-height: 1.4;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 3px solid transparent;
  counter-increment: contents;
  transition:
    border-color var(--ease),
    background-color var(--ease);
}

.contents__link::before {
  font-family: var(--ff-head);
  font-weight: 700;
  color: var(--brick);
  content: counter(contents, decimal-leading-zero);
}

.contents__link:hover {
  color: var(--ink);
  background-color: var(--ivory);
}

.contents__link--current {
  font-weight: 700;
  color: var(--ink);
  background-color: var(--saffron-wash);
  border-left-color: var(--brick);
}

@media (min-width: 64em) {
  .story__grid {
    grid-template-columns: 16rem minmax(0, 44rem);
    justify-content: space-between;
    align-items: start;
  }

  .story__aside {
    position: sticky;
    top: calc(var(--topbar-h) + var(--s-3));
  }

  .contents__toggle {
    cursor: default;
    pointer-events: none;
  }

  .contents__toggle::after {
    display: none;
  }
}

/* Keep reading */

.more {
  padding-top: 0;
}

.more__title {
  margin-bottom: var(--s-3);
  padding-top: var(--s-4);
  font-size: var(--fs-h2);
  border-top: 2px solid var(--ink);
}

.more__list {
  display: grid;
  gap: var(--s-3);
}

@media (min-width: 64em) {
  .more__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
