.articles-page {
  background: #fffbf3;
}

.article-shell {
  max-width: 72rem;
  margin-inline: auto;
  padding: clamp(2rem, 4.166667vw, 5rem) clamp(20px, 4.166667vw, 80px);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.article-shell :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-heading);
  font-weight: 400;
}

.article-shell .page-label {
  margin-bottom: 1rem;
}

.article-intro {
  margin-bottom: 2rem;
  text-align: center;
}

.article-paper {
  padding: clamp(20px, 3vw, 48px);
  border: 3px solid var(--brand-green);
  border-radius: clamp(24px, 3vw, 48px);
  background: #fffbf3;
}

.article-search {
  margin-bottom: 2rem;
}

.article-search label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.article-search-controls {
  display: flex;
  gap: 12px;
}

.article-search-controls :is(input, button) {
  min-height: 48px;
  padding: 8px 16px;
  border: 2px solid var(--brand-green);
  border-radius: 24px;
  background: #fffefb;
  color: var(--ink);
  font: inherit;
}

.article-search-controls input {
  flex: 1;
  min-width: 0;
}

.article-search-controls button {
  flex-shrink: 0;
  font-weight: 700;
  cursor: pointer;
}

.article-search-controls button:is(:hover, :focus-visible) {
  background: #fffbf3;
}

.article-search-controls :focus-visible {
  outline: 3px solid #882f29;
  outline-offset: 3px;
}

.article-search > p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.article-search-heading {
  margin-bottom: 1.5rem;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-list-item {
  min-width: 0;
}

.article-card {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 2px solid var(--brand-green);
  border-radius: 20px;
  background: #fffefb;
  text-decoration: none;
}

.article-card:focus-visible {
  box-shadow: 4px 4px 0 var(--brand-green);
}

.article-card:focus-visible {
  outline: 3px solid #882f29;
  outline-offset: 4px;
}

.article-card-content {
  padding: 20px;
}

.article-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 2rem;
}

.article-pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid var(--brand-green);
  border-radius: 999px;
}

.article-list h2 {
  margin-block: 0.25rem 0.75rem;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.5;
}

.article-card:is(:hover, :focus-visible) h2 {
  text-decoration: underline;
}

.article-date {
  color: #882f29;
  font-size: 0.875rem;
  line-height: 1.7;
}

.article-heading h1 {
  margin-block: 0.5rem 1.5rem;
  font-size: clamp(1.75rem, 3vw, 3rem);
  line-height: 1.5;
}

.article-heading {
  margin-bottom: 2rem;
}

.article-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}

.article-terms a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  border: 2px solid var(--brand-green);
  border-radius: 999px;
}

.article-return {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: 1rem;
  padding: 8px 12px;
}

.article-shell a {
  text-underline-offset: 0.2em;
}

.article-shell a:hover {
  color: #882f29;
  text-decoration-thickness: 2px;
}

.article-shell a:active {
  text-decoration-style: double;
}

.article-pagination a:is(:hover, :focus-visible),
.article-terms a:is(:hover, :focus-visible) {
  background: #e6eddf;
}

.article-shell :is(.article-pagination a, .article-terms a, .article-return):focus-visible {
  outline: 3px solid #882f29;
  outline-offset: 4px;
}

@media (hover: hover) {
  .article-card:hover {
    box-shadow: 4px 4px 0 var(--brand-green);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .article-card,
  .article-search-controls button,
  .article-pagination a,
  .article-terms a,
  .article-return {
    transition:
      transform 180ms ease,
      box-shadow 180ms ease,
      background-color 180ms ease,
      color 180ms ease;
  }

  .article-card:focus-visible {
    transform: translateY(-4px);
  }

  @media (hover: hover) {
    .article-card:hover {
      transform: translateY(-4px);
    }

    .article-search-controls button:hover,
    .article-pagination a:hover,
    .article-terms a:hover,
    .article-return:hover {
      transform: translateY(-2px);
    }
  }

  .article-search-controls button:focus-visible,
  .article-pagination a:focus-visible,
  .article-terms a:focus-visible,
  .article-return:focus-visible {
    transform: translateY(-2px);
  }

  .article-shell
    :is(
      .article-card,
      .article-search-controls button,
      .article-pagination a,
      .article-terms a,
      .article-return
    ):active {
    transform: scale(0.98);
  }
}

.article-preview {
  margin-bottom: 1rem;
  padding: 12px 20px;
  border: 3px dashed #882f29;
  border-radius: 20px;
}

.article-image {
  margin-bottom: 2rem;
}

.article-image img,
.article-body img,
.article-body video,
.article-body iframe {
  max-width: 100%;
  height: auto;
}

.article-body > * + * {
  margin-top: 1.25rem;
}

.article-body :is(h2, h3, h4) {
  margin-block: 2rem 1rem;
  line-height: 1.5;
}

.article-body h2 {
  font-size: clamp(1.375rem, 2vw, 2rem);
}

.article-body :is(h3, h4) {
  font-size: 1.25rem;
}

.article-body :is(ul, ol) {
  padding-left: 1.5rem;
}

.article-body blockquote {
  margin-inline: 0;
  padding: 12px 20px;
  border-left: 4px solid var(--brand-green);
}

.article-body pre {
  max-width: 100%;
  overflow: auto;
  padding: 16px;
  background: #fffefb;
  border: 2px solid var(--brand-green);
}
