/* ==========================================================================
   Section: journal  →  assets/section-journal.css
   Figma 1352-3436: a full-bleed #f6f6f6 band, 561 tall at 1440, 64px below the Instagram feed.
   64px in: a 40px header row (Heading/H3 title, "ALL STORIES ↗" on its bottom edge) → 24px →
   four 327px article cards 4px apart; the band ends 40px under the cards.
   Settings — custom properties on .journal
     --section-top 64px   --band-bg #f6f6f6
   ========================================================================== */
.journal {
  --section-top: 64px;
  --band-bg: var(--color-surface-tertiary);

  margin-top: var(--section-top);
  padding: 64px 0 40px;
  background: var(--band-bg);
}

.journal__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.journal__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  height: 40px;
}

/* Heading/H3 on Figma's 38px box */
.journal__title {
  color: var(--color-text-primary);
  font-family: var(--font-display);
  font-size: var(--text-display-s-size);
  font-weight: 500;
  line-height: 38px;
  white-space: nowrap;
}

/* the tertiary button's 1px underline slot sits below the row, as in Figma */
.journal__all {
  margin-bottom: -1px;
}

/* Figma rounds the hug-width label up to whole pixels */
.journal__all > span {
  width: var(--width-whole-px);
}

.journal__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

@media (max-width: 989px) {
  .journal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 24px;
  }
}

/* Phones: a sideways row that runs to the screen edge, one card and a bit per view */
@media (max-width: 749px) {
  .journal {
    padding-top: 48px;
  }

  .journal__title {
    font-size: 28px;
    line-height: 34px;
  }

  .journal__grid {
    grid-template-columns: none;
    grid-auto-columns: 80%;
    grid-auto-flow: column;
    margin-inline: calc(-1 * var(--page-gutter));
    padding-inline: var(--page-gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-padding-inline: var(--page-gutter);
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .journal__grid::-webkit-scrollbar {
    display: none;
  }

  .journal__grid > * {
    scroll-snap-align: start;
  }
}
