/*
 * 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);
  overflow: hidden;
  padding: var(--plx-space-8) 0;
  position: relative;
}

.plx-insights-hero-bg {
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: right center;
  position: absolute;
  width: 100%;
}

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

.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-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 {
  border-bottom: 1px solid var(--plx-border-default);
  font-size: var(--plx-text-sm);
  line-height: 20px;
  margin-bottom: var(--plx-space-8);
  padding-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);
}

/* The [hidden] attribute is used by the category filter; an explicit
   display on the card would otherwise override it. */
.plx-insights-card[hidden] {
  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;
  border-top: 1px solid var(--plx-border-default);
  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;
}

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

@media (max-width: 1199.98px) {
  .plx-insights-feature-title {
    font-size: var(--plx-text-3xl);
  }

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

@media (max-width: 991.98px) {
  .plx-insights-title {
    font-size: var(--plx-text-4xl);
  }

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

@media (max-width: 767.98px) {
  .plx-insights-hero-bg {
    opacity: 0.35;
  }

  .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;
    margin: 0 calc(var(--plx-container-padding-x) * -1);
    overflow-x: auto;
    padding: 0 var(--plx-container-padding-x);
    scrollbar-width: none;
    width: calc(100% + var(--plx-container-padding-x) * 2);
  }

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