/* =========================================================
   Insights Page - Engage Intelligently
   Sectioned CSS for premium consultancy-style layout
   ========================================================= */

/* ---------- Page Tokens ---------- */
:root {
  --ins-bg-deep: #17072f;
  --ins-bg-mid: #2a0d4c;
  --ins-surface: #ffffff;
  --ins-surface-soft: #f8f4ff;
  --ins-border: rgba(57, 28, 94, 0.18);
  --ins-text: #230d3f;
  --ins-text-soft: #5b457d;
  --ins-amber: #f9a620;
  --ins-shadow: 0 16px 44px rgba(8, 3, 24, 0.28);
  --ins-radius-lg: 20px;
  --ins-radius-md: 14px;
  --ins-max: 1180px;
  --ins-pad-x: clamp(1rem, 2.4vw, 2.2rem);
  --purple: #4A0374;
  --yellow: #F9A620;
  --white: #F4F4F9;
  --max: 1280px;
  --padX: clamp(1rem, 2.4vw, 2.2rem);
  --text: rgba(244, 244, 249, 0.96);
}

/* ---------- Global Page Base ---------- */
body {
    background: var(--lineargradient);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: clamp(16px, 0.28vw + 15px, 18px);
    line-height: 1.6;
}

main {
  position: relative;
  z-index: 1;
}

.section-inner {
  width: min(var(--ins-max), calc(100% - (2 * var(--ins-pad-x))));
  margin: 0 auto;
}

.section-block {
  padding: clamp(2.2rem, 6vw, 4.5rem) 0;
}

/* ---------- Header Integration ---------- */
.main-header .nav-link.active,
.main-header .nav-link[aria-current="page"] {
  opacity: 1;
  color: #ffffff;
  position: relative;
}

.main-header .nav-link.active::after,
.main-header .nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  border-radius: 2px;
  background: var(--ins-amber);
}

.highlight {
    color: var(--yellow);
}


/* ---------- Hero Section ---------- */
.insights-hero {
  padding-top: clamp(2.6rem, 7vw, 5.5rem);
  padding-bottom: clamp(2.2rem, 5vw, 4rem);
}

.insights-hero .section-inner {
  max-width: 900px;
}

.hero-eyebrow {
  margin: 0 0 0.8rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(244, 244, 249, 0.74);
}

#insights-hero-title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: #ffffff;
  max-width: 14ch;
}

.hero-subheading {
  margin: 1rem 0 0;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  line-height: 1.4;
  color: rgba(244, 244, 249, 0.9);
  max-width: 40ch;
}

.hero-body {
  margin: 1rem 0 0;
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.72;
  color: rgba(244, 244, 249, 0.82);
  max-width: 64ch;
}

.hero-cta-btn {
  margin-top: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  background: var(--ins-amber);
  color: #2a0f4b;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.hero-cta-btn:hover,
.hero-cta-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(249, 166, 32, 0.32);
}

/* ---------- Shared Surface Blocks ---------- */
.featured-card,
.insight-article-card,
.insights-cta .section-inner {
  background: linear-gradient(180deg, var(--ins-surface), var(--ins-surface-soft));
  border: 1px solid var(--ins-border);
  box-shadow: var(--ins-shadow);
  border-radius: var(--ins-radius-lg);
}

.featured-case h2,
.latest-insights h2,
.insights-cta h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* ---------- Tags / Meta ---------- */
.topic-tags {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag,
.category-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.64rem;
  border-radius: 999px;
  border: 1px solid rgba(74, 3, 116, 0.2);
  background: rgba(74, 3, 116, 0.08);
  color: #47206f;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.read-time,
.meta-label {
  color: var(--ins-text-soft);
}

.read-time {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.meta-label {
  font-weight: 700;
}

/* ---------- Featured Case Study ---------- */
.featured-card {
  padding: clamp(1.15rem, 2.2vw, 1.7rem);
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.featured-card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

#featured-title {
  margin: 0.4rem 0 0;
  color: var(--ins-text);
  font-size: clamp(1.35rem, 2.3vw, 1.9rem);
  line-height: 1.24;
}

.featured-summary {
  margin: 0;
  color: #3d285f;
  line-height: 1.62;
  max-width: 74ch;
}

/* ---------- Insights Grid ---------- */
.latest-insights {
  padding-top: clamp(2rem, 4vw, 3rem);
}

.insights-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.insight-article-card {
  padding: 1rem;
  color: var(--ins-text);
  display: grid;
  align-content: start;
  gap: 0.7rem;
}

.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.insight-article-card h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.34;
}

.article-summary {
  margin: 0;
  line-height: 1.62;
  color: #3e2a5f;
}

.editor-take {
  margin: 0;
  padding: 0.72rem 0.8rem;
  border-left: 4px solid var(--ins-amber);
  border-radius: 10px;
  background: rgba(249, 166, 32, 0.1);
  color: #40275f;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ---------- Expand / Collapse Panels ---------- */
.expandable-panel {
  border: 1px solid rgba(74, 3, 116, 0.16);
  border-radius: var(--ins-radius-md);
  background: rgba(255, 255, 255, 0.72);
  margin-top: 0.15rem;
  overflow: clip;
}

.expandable-panel summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.72rem 0.86rem;
  font-weight: 700;
  color: #3e1a66;
}

.expandable-panel summary::-webkit-details-marker {
  display: none;
}

.summary-label {
  font-size: 0.94rem;
}

.summary-hint {
  font-size: 0.79rem;
  color: #64448a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.expandable-panel[open] .summary-hint {
  color: #3e1a66;
}

.expandable-panel[open] .summary-hint::after {
  content: " (open)";
}

.expandable-panel summary:hover,
.expandable-panel summary:focus-visible {
  background: rgba(255, 255, 255, 0.95);
}

.expanded-content {
  border-top: 1px solid rgba(74, 3, 116, 0.12);
  padding: 0.95rem 0.9rem 1rem;
  color: #2d1b4e;
}

.expanded-content h4 {
  margin: 0.2rem 0 0;
  font-size: 1.03rem;
  color: #311259;
}

.expanded-content p {
  margin: 0.48rem 0 0;
  line-height: 1.68;
  max-width: 70ch;
}

.expanded-content ul {
  margin: 0.55rem 0 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 0.45rem;
}

/* ---------- Insight Modal Overlay ---------- */
body.modal-open {
  overflow: hidden;
}

.insight-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 1.4rem);
}

/* Ensure modal does not render until JS opens it */
.insight-modal[hidden] {
  display: none !important;
}

.insight-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  background: rgba(12, 5, 24, 0.66);
}

.insight-modal__dialog {
  position: relative;
  width: min(860px, calc(100vw - 2rem));
  max-height: min(86vh, 900px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, #ffffff, #f8f4ff);
  color: #2a124a;
  box-shadow: 0 28px 58px rgba(4, 1, 18, 0.45);
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: opacity 180ms ease, transform 180ms ease;
}

.insight-modal.is-open .insight-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.insight-modal__header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1rem 0.8rem;
  background: linear-gradient(180deg, #ffffff, #fbf8ff);
  border-bottom: 1px solid rgba(74, 3, 116, 0.12);
}

.insight-modal__title {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw, 1.6rem);
  line-height: 1.3;
}

.insight-modal__meta {
  margin: 0;
  padding: 0.75rem 1rem 0;
  font-size: 0.86rem;
  color: #5d4382;
  font-weight: 600;
}

.insight-modal__close {
  border: 1px solid rgba(74, 3, 116, 0.24);
  background: #ffffff;
  color: #3a1862;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.insight-modal__body {
  padding: 0.9rem 1rem 1.2rem;
}

.insight-modal .expanded-content {
  border-top: 0;
  padding: 0;
}

.insight-modal .expanded-content h4 {
  margin-top: 0.65rem;
}

@media (prefers-reduced-motion: reduce) {
  .insight-modal__dialog {
    transition: none;
  }
}

/* ---------- Lower CTA ---------- */
.insights-cta {
  padding-top: clamp(2.4rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 6vw, 5rem);
}

.insights-cta .section-inner {
  padding: clamp(1.25rem, 3vw, 2.1rem);
  text-align: center;
  display: grid;
  justify-items: center;
}

.insights-cta h2 {
  color: var(--ins-text);
  margin-bottom: 0.7rem;
}

.insights-cta p {
  margin: 0;
  color: #3f2b61;
  line-height: 1.65;
  max-width: 68ch;
}


.cta-primary-btn:hover,
.cta-primary-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(52, 19, 100, 0.28);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
}

/* ---------- Interactive States ---------- */
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(249, 166, 32, 0.92);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .insights-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .section-block {
    padding: 2rem 0;
  }

  .featured-case h2,
  .latest-insights h2,
  .insights-cta h2 {
    margin-bottom: 0.85rem;
  }

  .featured-card,
  .insight-article-card,
  .insights-cta .section-inner {
    border-radius: 16px;
  }

  .featured-card-header,
  .article-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .expanded-content {
    padding: 0.85rem;
  }
}

/* ========== Desktop Optimization (1920px+) ========== */
@media (min-width: 1920px) {
  :root {
    --ins-max: 1400px;
    --ins-pad-x: 2.5rem;
    --max: 1400px;
    --padX: 2.5rem;
  }

  .section-block {
    padding: 4rem 0 5rem;
  }

  .featured-case,
  .latest-insights,
  .insights-cta {
    margin-bottom: 2rem;
  }

  .featured-case h2,
  .latest-insights h2,
  .insights-cta h2 {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
  }

  .featured-case h2::after,
  .latest-insights h2::after {
    height: 5px;
    width: 60px;
    margin-top: 0.75rem;
  }

  .featured-card {
    padding: 2rem;
    border-radius: 20px;
  }

  .featured-card-header {
    gap: 1.5rem;
  }

  .featured-card-header h3 {
    font-size: 1.6rem;
  }

  .featured-category {
    font-size: 1.05rem;
  }

  .featured-date {
    font-size: 1rem;
  }

  .insights-card-grid {
    gap: 1.75rem;
  }

  .insight-article-card {
    padding: 1.75rem;
    border-radius: 18px;
    min-height: 420px;
  }

  .article-header {
    gap: 1.25rem;
    margin-bottom: 1.25rem;
  }

  .article-header img {
    width: 360px;
    height: 240px;
  }

  .article-header h3 {
    font-size: 1.4rem;
  }

  .insights-meta {
    font-size: 1rem;
  }

  .insights-excerpt {
    font-size: 1.05rem;
    line-height: 1.65;
  }

  .insights-cta .section-inner {
    padding: 2.5rem;
    border-radius: 20px;
  }

  .insights-cta-content h3 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
  }

  .insights-cta-content p {
    font-size: 1.1rem;
  }

  .insights-cta .button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
}
