/*
 * plx pages — insights
 * Insights listing page (hero, featured article, filterable latest grid).
 */

/* ══════════════════ HERO ══════════════════ */

.plx-insights-hero {
  background: var(--plx-bg-accent);
  border-bottom: 1px solid var(--plx-border-default);
  min-height: 250px;
  overflow: hidden;
  padding: var(--plx-space-8) 0;
  position: relative;
}

/* Figma placement: 1440 x 611 photo, right-anchored, shifted up 360.7px. */
.plx-insights-hero-bg {
  height: 611px;
  max-width: none;
  position: absolute;
  right: 0;
  bottom: -0.3px;
  width: 1440px;
  z-index: 0;
}

/* Figma scrim over the 1440px frame: solid to 515px, clear by 728px. */
.plx-insights-hero::before {
  background: linear-gradient(
    90deg,
    var(--plx-bg-accent) 515.5px,
    color-mix(in srgb, var(--plx-bg-accent) 0%, transparent) 728px
  );
  content: '';
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  width: 1440px;
  z-index: 1;
}

.plx-insights-hero-inner {
  position: relative;
  z-index: 2;
}

.plx-insights-badge {
  align-items: center;
  background: var(--plx-bg-glass-light);
  border: 1px solid var(--plx-border-default);
  border-radius: var(--plx-radius-full);
  color: var(--plx-text-primary);
  display: inline-flex;
  gap: var(--plx-space-3);
  padding: var(--plx-space-2) var(--plx-space-4);
}

.plx-insights-badge::before {
  background: var(--plx-color-primary);
  border-radius: var(--plx-radius-full);
  content: '';
  height: 8px;
  width: 8px;
}

.plx-insights-title {
  font-family: var(--plx-font-display);
  font-size: var(--plx-text-5xl);
  letter-spacing: -2px;
  line-height: 1;
  margin: var(--plx-space-5) 0 var(--plx-space-6);
}

.plx-insights-lead {
  color: var(--plx-text-primary);
  font-size: var(--plx-text-md);
  max-width: 480px;
}

/* Dark theme: the hero photo is a light-toned banner, so it is dimmed
   rather than swapped. */
:root[data-plx-theme='dark'] .plx-insights-hero-bg {
  opacity: 0.3;
}

/* ══════════════════ SHARED ══════════════════ */

.plx-insights-heading {
  font-family: var(--plx-font-display);
  font-size: var(--plx-text-xl);
  font-weight: var(--plx-weight-semibold);
}

.plx-insights-featured .plx-insights-heading {
  margin-bottom: var(--plx-space-6);
}

/* ══════════════════ FEATURED ══════════════════ */

.plx-insights-feature {
  background: var(--plx-bg-surface);
  border: 1px solid var(--plx-border-default);
  border-radius: var(--plx-radius-lg);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 350px;
  overflow: hidden;
}

/* The image is taken out of flow so its intrinsic ratio no longer sets the
   card height — the row height comes from the content (350px in the design). */
.plx-insights-feature-media {
  position: relative;
}

.plx-insights-feature-media img {
  height: 100%;
  inset: 0;
  position: absolute;
  object-fit: cover;
  object-position: 30% center;
  width: 100%;
}

.plx-insights-feature-body {
  display: flex;
  flex-direction: column;
  padding: var(--plx-space-8);
}

.plx-insights-meta {
  align-items: baseline;
  color: var(--plx-text-secondary);
  display: flex;
  font-size: var(--plx-text-xs);
  justify-content: space-between;
}

.plx-insights-feature-title {
  font-family: var(--plx-font-display);
  font-size: 44px;
  letter-spacing: -1px;
  line-height: 1.05;
  margin: var(--plx-space-4) 0;
}

.plx-insights-feature-copy {
  font-size: var(--plx-text-sm);
  line-height: 20px;
  margin-bottom: var(--plx-space-8);
}

.plx-insights-feature-cta {
  align-self: flex-start;
  margin-top: auto;
}

/* ══════════════════ LATEST ══════════════════ */

.plx-insights-latest {
  background: var(--plx-bg-ecosystem);
}

.plx-insights-latest-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--plx-space-4);
  justify-content: space-between;
  margin-bottom: var(--plx-space-8);
}

.plx-insights-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--plx-space-2);
}

.plx-insights-grid {
  display: grid;
  gap: var(--plx-space-5);
  grid-template-columns: repeat(3, 1fr);
}

/* Category filter state: insights.js toggles data-plx-visible. */
.plx-insights-card[data-plx-visible='false'],
.plx-insights-empty[data-plx-visible='false'] {
  display: none;
}

.plx-insights-card {
  background: var(--plx-bg-surface);
  border: 1px solid var(--plx-border-default);
  border-radius: var(--plx-radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow var(--plx-transition-base);
}

.plx-insights-card:hover {
  box-shadow: var(--plx-shadow-card-hover);
}

.plx-insights-card-media {
  aspect-ratio: 387 / 212;
  overflow: hidden;
  position: relative;
}

.plx-insights-card-media img {
  height: 100%;
  object-fit: cover;
  transition: transform var(--plx-transition-slow);
  width: 100%;
}

.plx-insights-card:hover .plx-insights-card-media img {
  transform: scale(1.06);
}

.plx-insights-date {
  align-items: center;
  background: var(--plx-bg-glass-lighter);
  border-radius: var(--plx-radius-full);
  color: var(--plx-text-primary);
  display: inline-flex;
  font-size: var(--plx-text-xs);
  gap: var(--plx-space-1);
  left: var(--plx-space-3);
  padding: var(--plx-space-1) var(--plx-space-3);
  position: absolute;
  top: var(--plx-space-3);
}

.plx-insights-date svg {
  color: var(--plx-color-primary);
}

.plx-insights-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: var(--plx-space-5);
}

.plx-insights-card-title {
  font-family: var(--plx-font-display);
  font-size: var(--plx-text-lg);
  font-weight: var(--plx-weight-semibold);
  line-height: var(--plx-leading-snug);
  margin: var(--plx-space-4) 0 var(--plx-space-2);
}

.plx-insights-card-copy {
  font-size: var(--plx-text-sm);
  line-height: 20px;
  margin-bottom: var(--plx-space-4);
}

.plx-insights-card-foot {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: var(--plx-space-4);
}

.plx-insights-readtime {
  color: var(--plx-text-muted);
  font-size: var(--plx-text-xs);
}

.plx-insights-empty {
  text-align: center;
}

.plx-insights-empty-grid {
  grid-column: 1 / -1;
  padding: var(--plx-space-8) 0;
}

/* ══════════════════ RESPONSIVE ══════════════════ */

/* ─── Responsive: xs ─── */
@media (max-width: 575.98px) {
  .plx-insights-hero-bg {
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: right center;
    opacity: 1;
    width: 100%;
  }

  .plx-insights-hero::before {
    background: linear-gradient(180deg, color-mix(in srgb, var(--plx-bg-accent) 88%, transparent) 0%, color-mix(in srgb, var(--plx-bg-accent) 74%, transparent) 100%);
    height: auto;
    inset: 0;
    width: auto;
  }

  .plx-insights-feature-title {
    font-size: var(--plx-text-3xl);
  }

  .plx-insights-feature-body {
    padding: var(--plx-space-6);
  }

  .plx-insights-title {
    font-size: var(--plx-text-4xl);
  }

  .plx-insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }


  .plx-insights-title {
    font-size: var(--plx-text-3xl);
    letter-spacing: -1px;
  }

  .plx-insights-feature {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .plx-insights-feature-media {
    aspect-ratio: 16 / 10;
  }

  .plx-insights-feature-title {
    font-size: var(--plx-text-2xl);
  }

  .plx-insights-grid {
    grid-template-columns: 1fr;
  }

  .plx-insights-filters {
    flex-wrap: nowrap;
  }

  .plx-insights-filters .plx-chip {
    flex-shrink: 0;
  }
}

/* ─── Responsive: sm ─── */
@media (min-width: 576px) and (max-width: 767.98px) {
  .plx-insights-hero-bg {
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: right center;
    opacity: 1;
    width: 100%;
  }

  .plx-insights-hero::before {
    background: linear-gradient(180deg, color-mix(in srgb, var(--plx-bg-accent) 88%, transparent) 0%, color-mix(in srgb, var(--plx-bg-accent) 74%, transparent) 100%);
    height: auto;
    inset: 0;
    width: auto;
  }

  .plx-insights-feature-title {
    font-size: var(--plx-text-3xl);
  }

  .plx-insights-feature-body {
    padding: var(--plx-space-6);
  }

  .plx-insights-title {
    font-size: var(--plx-text-4xl);
  }

  .plx-insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }


  .plx-insights-title {
    font-size: var(--plx-text-3xl);
    letter-spacing: -1px;
  }

  .plx-insights-feature {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .plx-insights-feature-media {
    aspect-ratio: 16 / 10;
  }

  .plx-insights-feature-title {
    font-size: var(--plx-text-2xl);
  }

  .plx-insights-grid {
    grid-template-columns: 1fr;
  }

  .plx-insights-filters {
    flex-wrap: nowrap;
  }

  .plx-insights-filters .plx-chip {
    flex-shrink: 0;
  }
}

/* ─── Responsive: md ─── */
@media (min-width: 768px) and (max-width: 991.98px) {
  .plx-insights-hero-bg {
    height: 100%;
    inset: 0;
    object-fit: cover;
    object-position: right center;
    opacity: 1;
    width: 100%;
  }

  .plx-insights-hero::before {
    background: linear-gradient(
      90deg,
      var(--plx-bg-accent) 0%,
      color-mix(in srgb, var(--plx-bg-accent) 92%, transparent) 40%,
      color-mix(in srgb, var(--plx-bg-accent) 55%, transparent) 70%,
      color-mix(in srgb, var(--plx-bg-accent) 20%, transparent) 100%
    );
    height: auto;
    inset: 0;
    width: auto;
  }

  .plx-insights-feature-title {
    font-size: var(--plx-text-3xl);
  }

  .plx-insights-feature-body {
    padding: var(--plx-space-6);
  }

  .plx-insights-title {
    font-size: var(--plx-text-4xl);
  }

  .plx-insights-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Responsive: lg ─── */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .plx-insights-feature-title {
    font-size: var(--plx-text-3xl);
  }

  .plx-insights-feature-body {
    padding: var(--plx-space-6);
  }
}
