/* CaQeh Insights — extends landing.css product tokens */

.insights-page {
  background: #f8fafc;
  color: #0f172a;
  overflow-x: clip;
}

.insights-main {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0 20px 4rem;
}

/* Full-bleed hero: break out of the 1120px content column on wide desktops.
   Horizontal padding keeps copy aligned with .insights-main. */
.insights-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
  padding:
    clamp(2.5rem, 6vw, 4.5rem)
    max(20px, calc((100vw - 1120px) / 2 + 20px));
  background:
    radial-gradient(900px 400px at 20% -10%, rgba(99, 102, 241, 0.35), transparent 55%),
    linear-gradient(165deg, #1e1b4b 0%, #312e81 48%, #1e1b4b 100%);
  color: #eef2ff;
}

.insights-hero-inner {
  width: min(100%, 720px);
}

.insights-hero h1 {
  max-width: 18ch;
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  line-height: 1.12;
  font-weight: 800;
  color: #fff;
}

.insights-hero-lede {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: rgba(238, 242, 255, 0.9);
}

.insights-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.insights-hero-cta .btn {
  min-height: 44px;
}

.insights-breadcrumbs {
  padding: 0.5rem 0 0.25rem;
  font-size: 0.85rem;
}

.insights-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: #64748b;
  align-items: center;
}

.insights-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.insights-breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: #94a3b8;
}

.insights-breadcrumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.1rem;
  color: #4338ca;
  text-decoration: none;
  font-weight: 600;
}

.insights-breadcrumbs a:hover,
.insights-breadcrumbs a:focus-visible {
  text-decoration: underline;
}

.insights-section-head {
  margin: 2.25rem 0 1.25rem;
}

.insights-section-head h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  color: #0f172a;
}

.insights-section-head p {
  margin: 0;
  color: #64748b;
  max-width: 40rem;
}

.insight-featured-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
}

.insight-featured-media {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  min-height: 100%;
}

.insight-featured-media:focus-visible,
.insight-card-media:focus-visible {
  outline: 3px solid #6366f1;
  outline-offset: 2px;
}

.insight-featured-media img,
.insight-card-media img,
.insight-hero-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.insight-featured-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  gap: 0.35rem;
}

.insight-featured-body > p:not(.insight-meta):not(.insight-byline) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}

.insight-featured-body h3 {
  margin: 0.35rem 0 0.5rem;
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  line-height: 1.2;
}

.insight-featured-body h3 a,
.insight-card-title a {
  color: #0f172a;
  text-decoration: none;
}

.insight-featured-body h3 a:hover,
.insight-card-title a:hover,
.insight-featured-body h3 a:focus-visible,
.insight-card-title a:focus-visible {
  color: #4338ca;
}

.insight-featured-body h3 a:focus-visible,
.insight-card-title a:focus-visible,
.insight-meta a:focus-visible,
.insight-byline a:focus-visible,
.insights-related a:focus-visible,
.insights-author-list a:focus-visible,
.insight-article-footer a:focus-visible,
.insights-breadcrumbs a:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  border-radius: 4px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
  /* Sparse archives (1–2 cards): keep cards at a readable max width */
  justify-content: start;
}

.insight-card {
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  min-height: 100%;
  max-width: 420px;
  width: 100%;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.insight-card:hover,
.insight-card:focus-within {
  border-color: #c7d2fe;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.insight-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  flex-shrink: 0;
}

.insight-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem 1.15rem;
  flex: 1;
  min-height: 0;
}

.insight-card-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
  /* Reserve 3 lines so multi-column rows stay even */
  min-height: calc(1.3em * 3);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.insight-card-excerpt {
  margin: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.5;
  flex: 1;
  /* Clamp excerpts so card heights align within rows */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.insight-meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.4rem;
  align-items: center;
  line-height: 1.35;
}

/* Expanded hit area keeps 44×44 taps without inflating card chrome */
.insight-meta a {
  position: relative;
  display: inline;
  color: #4338ca;
  text-decoration: none;
  padding: 0.05rem 0;
}

.insight-meta a::before {
  content: "";
  position: absolute;
  inset: -12px -6px;
  min-width: 44px;
  min-height: 44px;
}

.insight-byline {
  margin: 0;
  font-size: 0.85rem;
  color: #334155;
}

.insight-byline a {
  position: relative;
  display: inline;
  color: #312e81;
  font-weight: 700;
  text-decoration: none;
}

.insight-byline a::before {
  content: "";
  position: absolute;
  inset: -12px -4px;
  min-width: 44px;
  min-height: 44px;
}

.insights-topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.insights-topic-list a {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  min-height: 100%;
}

.insights-topic-list a:hover,
.insights-topic-list a:focus-visible {
  border-color: #a5b4fc;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.insights-topic-list strong {
  color: #312e81;
  font-size: 1rem;
}

.insights-topic-list span {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}

.insights-author-list {
  margin: 0;
  padding-left: 1.15rem;
  color: #334155;
  line-height: 1.7;
}

.insights-author-list li {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.insights-author-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #4338ca;
  font-weight: 700;
  text-decoration: none;
}

.insights-cta-band {
  margin-top: 3rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: 16px;
  background: linear-gradient(135deg, #312e81, #4f46e5);
  color: #eef2ff;
  overflow: hidden;
}

.insights-cta-band h2 {
  margin: 0 0 0.65rem;
  color: #fff;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
}

.insights-cta-band p {
  margin: 0 0 1rem;
  max-width: 40rem;
  line-height: 1.55;
}

/* CTA actions: flex-wrap avoids side-by-side clip on narrow phones */
.insights-cta-band p:has(.btn) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: none;
  margin-bottom: 0;
}

.insights-cta-band .btn {
  margin: 0;
  min-height: 44px;
  flex: 0 1 auto;
}

/* Article */
.article-main {
  width: min(100%, 820px);
}

.insight-article-header {
  padding-top: 0.75rem;
}

.insight-article-header h1 {
  margin: 0.65rem 0 0.85rem;
  font-size: clamp(1.75rem, 4.2vw, 2.45rem);
  line-height: 1.15;
  color: #0f172a;
  max-width: none;
}

.insight-dek {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  line-height: 1.55;
  color: #475569;
}

.insight-author-chip {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.insight-author-chip img {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center 20%;
  background: #e2e8f0;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px #eef2ff;
}

.insight-author-role {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #64748b;
}

.insight-hero-figure {
  margin: 0 0 1.75rem;
  border-radius: 14px;
  overflow: hidden;
  background: #e2e8f0;
  border: 1px solid #e2e8f0;
}

.insight-hero-figure img {
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

.insight-hero-figure figcaption {
  padding: 0.65rem 0.85rem 0.85rem;
  font-size: 0.85rem;
  color: #64748b;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.insight-article-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #1e293b;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  hyphens: auto;
}

.insight-article-body .lede {
  font-size: 1.12rem;
  color: #334155;
}

.insight-article-body h2 {
  margin: 2rem 0 0.75rem;
  font-size: 1.4rem;
  color: #0f172a;
}

.insight-article-body h3 {
  margin: 1.35rem 0 0.5rem;
  font-size: 1.12rem;
  color: #1e1b4b;
}

.insight-article-body p,
.insight-article-body ul,
.insight-article-body ol {
  margin: 0 0 1rem;
}

.insight-article-body a {
  color: #4338ca;
  font-weight: 600;
}

.insight-article-body li {
  margin-bottom: 0.35rem;
}

.insight-article-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.tag-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.tag:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

.insight-disclaimer {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #475569;
}

.insight-disclaimer p {
  margin: 0;
}

.insights-related {
  margin-top: 2.5rem;
  padding: 1.25rem 1.35rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
}

.insights-related h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.insights-related ul {
  margin: 0;
  padding-left: 1.1rem;
}

.insights-related a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #4338ca;
  font-weight: 600;
}

.insight-article-footer a:not(.tag):not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* Insights footer links: match 44px mobile tap guidance without changing global marketing footer */
.insights-page .site-footer .footer-nav a {
  min-height: 44px;
  padding: 0.2rem 0.15rem;
}

.insights-archive-header,
.insights-author-header {
  padding: 1rem 0 0.5rem;
}

.insights-author-header {
  display: flex;
  gap: 1.35rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.insights-author-header img {
  width: 128px;
  height: 128px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center 20%;
  background: #e2e8f0;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

.insights-author-header h1 {
  margin: 0.15rem 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
  max-width: none;
}

.insights-author-header > div {
  min-width: 0;
  flex: 1;
}

/* CTA actions fallback when :has() is unavailable */
.insights-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-nav a.is-active {
  color: #4338ca;
  font-weight: 800;
}

@media (max-width: 820px) {
  .insight-featured-card {
    grid-template-columns: 1fr;
  }

  .insight-featured-media {
    min-height: 0;
  }

  .insights-author-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .insights-author-header img {
    width: 112px;
    height: 112px;
  }

  .insight-card {
    max-width: none;
  }
}

/* Phone: stack hero CTAs full-width; tighten card/media rhythm */
@media (max-width: 480px) {
  .insights-hero-cta {
    flex-direction: column;
  }

  .insights-hero-cta .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .insights-cta-band p:has(.btn),
  .insights-cta-actions {
    flex-direction: column;
  }

  .insights-cta-band .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

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

  .insight-author-chip img {
    width: 64px;
    height: 64px;
  }

  .insights-author-header img {
    width: 96px;
    height: 96px;
  }
}

/* Tablet: keep featured stacked a bit longer for comfortable reading */
@media (min-width: 821px) and (max-width: 1023px) {
  .insight-featured-card {
    gap: 1.25rem;
  }

  .insight-card {
    max-width: none;
  }
}

/* Desktop multi-column: allow cards to fill grid tracks evenly */
@media (min-width: 1024px) {
  .insight-card {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
