html.journal-page {
  --paper: #fff;
  --muted: #626262;
  --line: #e5e5e5;
  --wash: #f4f4f4;
}

.journal,
.journal-page .footer {
  font-family: Manrope, system-ui, sans-serif;
}

.journal.shell { width: min(1140px, calc(100% - 48px)); }

.journal-breadcrumbs {
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .875rem;
  line-height: 20px;
}

.journal-title {
  margin: 24px 0 32px;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}

.journal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 276px;
  grid-template-areas: "feed sidebar";
  align-items: start;
  gap: 24px;
}

.journal-feed { grid-area: feed; display: grid; gap: 32px; }

.journal-section h2 {
  margin-bottom: 16px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -.025em;
}

.journal-guides {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.journal-article-grid,
.journal-guide-grid {
  display: grid;
  gap: 24px;
}

.journal-article-grid { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); }
.journal-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.journal-card-link {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
}

.journal-cover {
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--wash);
}

.journal-story-link .journal-cover { aspect-ratio: 2 / 1; }
.journal-article-grid > :first-child .journal-cover { aspect-ratio: 16 / 9; }

.journal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#journal-first .journal-cover img { object-position: center 46%; }

.journal-story-link h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 28px;
  letter-spacing: -.02em;
}

.journal-article-grid > :first-child h3 {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  line-height: 1.13;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.journal-guide-link h3 {
  font-size: 1rem;
  font-weight: 650;
  line-height: 24px;
}

.journal-excerpt,
.journal-read {
  color: var(--muted);
  font-size: .875rem;
  line-height: 20px;
}

.journal-read { margin-top: auto; }

.journal-sidebar {
  grid-area: sidebar;
  display: grid;
  justify-items: start;
  gap: 24px;
}

.journal-sidebar h2 {
  margin-bottom: 12px;
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 24px;
}

.journal-topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journal-topic-links a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--wash);
  font-size: .875rem;
  line-height: 20px;
  text-decoration: none;
}

.journal-calculator-link {
  display: inline-block;
  font-size: .875rem;
  line-height: 20px;
}

@media (hover: hover) and (pointer: fine) {
  .journal-card-link:hover .journal-cover { box-shadow: 0 0 0 2px var(--yellow); }
  .journal-topic-links a:hover { background-color: var(--yellow-soft); }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .journal-cover img { transition: transform .22s ease-out; }
  .journal-card-link:hover img { transform: scale(1.03); }
}

.journal-page .footer { margin-top: 56px; }

@media (max-width: 1024px) {
  .journal-title { margin-bottom: 24px; }

  .journal-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "sidebar" "feed";
  }

  .journal-sidebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
  }

  .journal-sidebar h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .journal-topic-links a,
  .journal-calculator-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

@media (max-width: 760px) {
  .journal.shell,
  .journal-page .footer.shell { width: calc(100% - 32px); }

  .journal-title {
    margin: 16px 0 24px;
    font-size: 2.25rem;
    line-height: 40px;
  }

  .journal-article-grid,
  .journal-guide-grid { grid-template-columns: minmax(0, 1fr); }
  .journal-article-grid,
  .journal-guide-grid { gap: 32px; }
  .journal-story-link .journal-cover { aspect-ratio: 16 / 9; }
  .journal-page .footer { margin-top: 40px; }
}
