/* =============================================================
   TransRisk v3 — insights.css
   Post list for /insights/. Cards are generated at build time from
   src/content/insights/*.md — see src/lib/insights.ts.
============================================================= */

.insights-section {
  background: var(--color-light);
}

.insights-list {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.insight-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.insight-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(45, 122, 58, 0.28);
}

/* Fixed 1.91:1 box — LinkedIn's native share ratio (1200x627), so social
   creatives drop in uncropped. Images that differ are centre-cropped, which
   keeps the list even without forcing every asset to one size. */
.insight-media {
  aspect-ratio: 1.91 / 1;
  background: var(--color-light);
  border-bottom: 1px solid var(--color-border);
}

.insight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.insight-body {
  padding: 28px 32px 32px;
}

.insight-meta {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 10px;
}

.insight-author {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.insight-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-navy);
  margin: 0 0 14px;
}

.insight-text {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--color-text-secondary);
  margin: 0 0 0.9em;
}

.insight-text:last-of-type {
  margin-bottom: 0;
}

.insight-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-green-dark);
  text-decoration: none;
  transition: gap var(--transition);
}

.insight-link:hover {
  gap: 10px;
}

.insights-empty {
  text-align: center;
  color: var(--color-text-muted);
}

@media (max-width: 640px) {
  .insight-body {
    padding: 22px 20px 24px;
  }

  .insight-title {
    font-size: 1.125rem;
  }
}


/* =============================================================
   HOMEPAGE TEASER STRIP
   Up to three latest posts as cover-image cards — tag chip, title,
   one-line excerpt, "Read more" and the date. Deliberately sparse:
   the full bodies live on /insights/ only, so this never duplicates
   that text, and each card is a SINGLE link to the post's anchor
   there. Sits low on the page, above the final CTA, so it does not
   intercept the primary conversion path.
============================================================= */

.insights-teaser-section {
  background: var(--color-light);
  border-top: 1px solid var(--color-border);
}

/* Scoped: .section-header carries no styles of its own, and other pages
   rely on that. */
.insights-teaser-section .section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 44px;
}

/* Flex rather than grid so a partial row centres — the strip shows up to
   three posts, and there may legitimately be one or two. */
.insights-teaser-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.insights-teaser-grid > .insight-teaser {
  flex: 0 1 calc((100% - 2 * 24px) / 3);
  min-width: 0;
}

.insight-teaser {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 6px 6px 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: box-shadow var(--transition), border-color var(--transition),
    transform var(--transition);
}

/* No cover image: the chip sits in flow, so only a little breathing room. */
.insight-teaser--no-media {
  padding-top: 20px;
}

.insight-teaser:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 133, 64, 0.28);
  transform: translateY(-2px);
}

.insight-teaser:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 3px;
}

/* The source ratio, so nothing is cropped. These covers are designed title
   cards — centred branding, headline, a green rule along the bottom edge —
   not photographs, so any crop cuts artwork rather than trimming scenery.
   The card is shorter than the reference's photo cards as a result. */
.insight-teaser-media {
  position: relative;
  display: block;
  aspect-ratio: 1200 / 627;
  overflow: hidden;
  border-radius: calc(var(--radius-md) - 3px);
  background: var(--color-light);
}

.insight-teaser-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Notched into the cover's bottom-left corner. The reference card puts this
   top-left, but these covers carry their own "TRANSRISK · INSIGHTS" line
   across the top, which the chip runs into at three-up widths. */
.insight-teaser-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1;
  padding: 8px 12px 8px 10px;
  background: var(--color-white);
  border-top-right-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-navy);
}

/* No cover: the chip has nothing to sit on, so it becomes a plain label. */
.insight-teaser--no-media .insight-teaser-tag {
  position: static;
  align-self: flex-start;
  padding: 0 0 0 16px;
  background: none;
}

.insight-teaser-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 16px 0;
}

.insight-teaser-title {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--color-navy);
  margin: 0 0 10px;
  transition: color var(--transition);
}

.insight-teaser:hover .insight-teaser-title {
  color: var(--color-green-dark);
}

.insight-teaser-excerpt {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--color-muted);
  margin: 0 0 20px;
}

/* margin-top:auto pins the footer so cards align regardless of title or
   excerpt length. */
.insight-teaser-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 16px;
  border-top: 1px solid var(--color-border);
}

.insight-teaser-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-navy);
}

.insight-teaser-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-navy);
  transition: background-color var(--transition), border-color var(--transition),
    color var(--transition);
}

.insight-teaser:hover .insight-teaser-arrow {
  background: var(--color-green);
  border-color: var(--color-green);
  color: var(--color-white);
}

.insight-teaser-date {
  font-size: 0.8125rem;
  color: var(--color-muted);
  white-space: nowrap;
}

.insights-teaser-all {
  text-align: center;
  margin: 34px 0 0;
}

.insights-teaser-all a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-green-dark);
  text-decoration: none;
}

.insights-teaser-all a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .insights-teaser-grid {
    gap: 16px;
  }
  .insights-teaser-grid > .insight-teaser {
    flex-basis: 100%;
    max-width: 460px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .insight-teaser,
  .insight-teaser-title,
  .insight-teaser-arrow {
    transition: none;
  }
  .insight-teaser:hover {
    transform: none;
  }
}
