/* Insights — index and article (Figma 50:3398 and 50:2909). */

/* ------------------------------------------------------------------ Index */

.in-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6) var(--space-5);
}

.in-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.in-card-media {
  display: block;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--cream-dim);
}

.in-card-media img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}

.in-card:hover .in-card-media img { transform: scale(1.04); }

.in-card-title {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

.in-card:hover .in-card-title { text-decoration: underline; text-underline-offset: 4px; }

.in-card-date {
  margin: 0.35rem 0 0;
  font-size: var(--text-sm);
  color: rgb(5 50 37 / 0.7);
}

/* ---- pager ---- */

.in-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-block-start: var(--space-7);
}

.in-page {
  min-inline-size: 2rem;
  padding: 0.35rem 0.5rem;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.in-page:hover { background: var(--cream-dim); }
.in-page.is-current { font-weight: 700; text-decoration: underline; text-underline-offset: 5px; }
/* Kept in the flow rather than hidden, so the row does not shift width as the
   visitor moves between the first and last page. */
.in-page.is-off { opacity: 0.3; }

/* ---------------------------------------------------------------- Article */

.ar-head { padding-block-end: 0; }

/* The suggested-articles band that follows is the same cream and brings its own
   --space-8, so the two lead-ins stacked to 320px between the byline and
   "Suggested articles". The boundary is left to the band below. */
.ar-body { padding-block-end: 0; }

.ar-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  align-items: start;
  gap: var(--space-6);
}

.ar-cover img {
  inline-size: 100%;
  block-size: auto;
  display: block;
  border-radius: var(--radius-md);
}

.ar-title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

.ar-tag { margin: var(--space-3) 0 0; }

.ar-tag span {
  display: inline-block;
  padding: 0.4rem var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--cream-dim);
  font-size: var(--text-sm);
}

.ar-lead {
  margin: var(--space-4) 0 0;
  color: rgb(5 50 37 / 0.78);
}

/* ---- sections ---- */

/* Full container width — the sections are not a narrow reading column, they run
   the width of the page like every other section on the site. */

/* Rule and space go ABOVE each section, not around it. Padding on both sides
   would double the gap between two adjacent blocks (64 + 64) and put a stray
   rule under the last one, right above the byline. This way the spacing is the
   same 64px whether the sections come from the data or the markdown fallback. */
.ar-block {
  padding-block: var(--space-6) 0;
  border-block-start: 1px solid var(--line);
}

.ar-block:first-of-type {
  padding-block-start: 0;
  border-block-start: 0;
}

.ar-block .eyebrow { margin: 0 0 var(--space-3); }

.ar-text {
  margin: 0;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
}

/* Markdown fallback — used for articles whose sections have not been moved into
   the sections_* columns yet. Styled to match .ar-block exactly so the page
   reads the same either way: full width, the same air, the same rules. */
.ar-body .prose p {
  max-inline-size: none;              /* ui.css caps prose at 62ch */
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  margin-block-end: 0;
}

.ar-body .prose h2 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: rgb(5 50 37 / 0.6);
  margin-block: 0 var(--space-3);
  padding-block-start: var(--space-6);
  border-block-start: 1px solid var(--line);
}

.ar-body .prose h2:first-child {
  padding-block-start: 0;
  border-block-start: 0;
}

/* The space below each block, mirroring .ar-block's padding. */
.ar-body .prose p + h2 { margin-block-start: var(--space-6); }

/* ---- author ---- */

.ar-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-block-start: var(--space-6);
}

.ar-avatar {
  inline-size: 3rem;
  block-size: 3rem;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.ar-author-date {
  margin: 0;
  font-size: var(--text-sm);
  color: rgb(5 50 37 / 0.7);
}

.ar-author-name {
  margin: 0.1rem 0 0;
  font-weight: 700;
}

/* ----------------------------------------------------------- Responsive --- */

@media (max-width: 60rem) {
  .in-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ar-split { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
}

@media (max-width: 48rem) {
  .in-grid { grid-template-columns: minmax(0, 1fr); }
}
