/**
 * Archive & Single Insight Styles
 *
 * Covers:
 *  - /insights/              → archive-insight.php
 *  - /insight-category/{x}/  → taxonomy-insight_category.php
 *  - /insights/{post-slug}/  → single-insight.php
 *
 * Loaded conditionally via inc/enqueue.php — only on insight pages.
 *
 * @package Foursees
 */

/* ================================================================
   INSIGHTS ARCHIVE
   ================================================================ */

/* ── Archive Hero Banner ───────────────────────────────────────── */

.archive-hero {
  background: #02325e;
  padding: 140px 0 80px;
  position: relative;
  overflow: hidden;
}

/* Decorative radial glow — top right */
.archive-hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.12) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  pointer-events: none;
}

/* Decorative radial glow — bottom left */
.archive-hero::after {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
  bottom: -80px;
  left: -60px;
  pointer-events: none;
}

/* Eyebrow: light sky-blue — high contrast on navy (#02325e) ≈ 7.5:1 */
.archive-hero .eyebrow {
  color: #bae6fd;
  margin-bottom: 12px;
  display: block;
}

/* Heading: pure white — maximum contrast on navy ≈ 14:1 */
.archive-hero .h2 {
  color: #ffffff;
  margin-bottom: 16px;
}

/* Description: 85% white — strong readable contrast on navy ≈ 10:1 */
.archive-hero .body-lg {
  color: rgba(255, 255, 255, 0.85);
  max-width: 600px;
}

/* ── Archive Grid Section ──────────────────────────────────────── */

.archive-insights {
  background: var(--surface-soft, #faf8fc);
  padding: 80px 0 120px;
}

.archive-grid {
  margin-top: 40px;
}

/* ── Category Filter Pills ─────────────────────────────────────── */

.insight-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.insight-filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 9999px;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--smoky-500, #777);
  background: var(--surface-white, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}

.insight-filter-pill:hover,
.insight-filter-pill.active {
  color: var(--primary-600, #7c3aed);
  background: rgba(163, 82, 166, 0.08);
  border-color: rgba(163, 82, 166, 0.25);
}

/* ── Pagination ────────────────────────────────────────────────── */

.insight-pagination {
  margin-top: 60px;
  text-align: center;
}

.insight-pagination .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.insight-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md, 8px);
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--smoky-600, #555);
  background: var(--surface-white, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: color 0.25s, background 0.25s, border-color 0.25s;
}

.insight-pagination .page-numbers:hover,
.insight-pagination .page-numbers.current {
  color: #fff;
  background: var(--primary-500, #a352a6);
  border-color: var(--primary-500, #a352a6);
}

.insight-pagination .prev,
.insight-pagination .next {
  width: auto;
  padding: 0 20px;
  font-size: 13px;
}

/* ── No Posts State ────────────────────────────────────────────── */

.no-insights {
  text-align: center;
  padding: 80px 0;
}

.no-insights h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--smoky-700, #444);
  margin-bottom: 12px;
}

.no-insights p {
  color: var(--smoky-500, #777);
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}


/* ================================================================
   SINGLE INSIGHT
   ================================================================ */

/* ── Article Hero ──────────────────────────────────────────────── */

.single-insight {
  display: block; /* override WordPress <article> flex if any theme adds it */
}

.insight-hero {
  position: relative;
  padding: 180px 0 80px;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--surface-dark, #0f0f23); /* fallback when no featured image */
}

/* Featured image — positioned absolute, stretched to fill */
.insight-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* Dark gradient overlay — gives text contrast over any image */
.insight-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 15, 35, 0.45) 0%,
    rgba(15, 15, 35, 0.92) 100%
  );
  z-index: 1;
}

/* Purple glow decoration (visible when no featured image) */
.insight-hero::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(163, 82, 166, 0.12) 0%, transparent 65%);
  top: -200px;
  right: -150px;
  pointer-events: none;
  z-index: 0;
}

.insight-hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

/* ── Back Link ─────────────────────────────────────────────────── */

.insight-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  margin-bottom: 36px;
  transition: color 0.25s;
}

.insight-back:hover {
  color: var(--primary-300, #c084fc);
}

/* ── Hero Meta Row ─────────────────────────────────────────────── */

.insight-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.insight-hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  background: rgba(163, 82, 166, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(163, 82, 166, 0.35);
  border-radius: 9999px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.insight-hero-date,
.insight-hero-reading {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.04em;
}

/* Separator dot between date and reading time */
.insight-hero-reading::before {
  content: '·';
  margin-right: 16px;
  opacity: 0.4;
}

/* ── Hero Title & Excerpt ──────────────────────────────────────── */

.insight-hero-title {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.18;
  color: #ffffff;
  margin-bottom: 18px;
}

.insight-hero-excerpt {
  font-size: 18px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.62);
  max-width: 660px;
  margin-bottom: 0;
}

/* ── Article Content Area ──────────────────────────────────────── */

.insight-content-wrap {
  background: var(--surface-white, #fff);
  padding: 80px 0 100px;
}

.insight-content {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 17px;
  line-height: 1.82;
  color: var(--smoky-700, #444);
}

/* ── Content Typography ────────────────────────────────────────── */

.insight-content h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--smoky-800, #222);
  margin: 52px 0 16px;
}

.insight-content h3 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--smoky-800, #222);
  margin: 42px 0 12px;
}

.insight-content h4 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--smoky-700, #444);
  margin: 32px 0 10px;
}

.insight-content p {
  margin-bottom: 26px;
}

.insight-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg, 12px);
  margin: 36px 0;
  display: block;
}

.insight-content figure {
  margin: 36px 0;
}

.insight-content figcaption {
  font-size: 13px;
  color: var(--smoky-400, #999);
  text-align: center;
  margin-top: 10px;
  font-family: var(--font-mono, monospace);
}

.insight-content blockquote {
  border-left: 3px solid var(--primary-500, #a352a6);
  padding: 18px 0 18px 28px;
  margin: 36px 0;
  font-style: italic;
  font-size: 18px;
  line-height: 1.7;
  color: var(--smoky-600, #555);
  background: var(--surface-soft, #faf8fc);
  border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
}

.insight-content blockquote p:last-child {
  margin-bottom: 0;
}

.insight-content ul,
.insight-content ol {
  padding-left: 24px;
  margin: 8px 0 26px;
}

.insight-content li {
  margin-bottom: 8px;
}

.insight-content code {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  background: var(--surface-soft, #f5f3f7);
  color: var(--primary-700, #6b21a8);
  padding: 2px 8px;
  border-radius: 4px;
}

.insight-content pre {
  background: var(--surface-dark, #0f0f23);
  color: rgba(255, 255, 255, 0.85);
  padding: 28px;
  border-radius: var(--radius-lg, 12px);
  overflow-x: auto;
  margin: 36px 0;
  font-size: 14px;
  line-height: 1.65;
}

.insight-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.insight-content a {
  color: var(--primary-500, #a352a6);
  text-decoration: underline;
  text-decoration-color: rgba(163, 82, 166, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.25s;
}

.insight-content a:hover {
  text-decoration-color: var(--primary-500, #a352a6);
}

/* Button links inside the content area — reset prose link overrides.
   .insight-content a applies purple + underline to all <a> tags, but
   .btn / .btn-primary need white text and no underline on all states. */
.insight-content a.btn,
.insight-content a.btn:hover {
  color: #ffffff;
  text-decoration: none;
  text-decoration-color: transparent;
}

.insight-content hr {
  border: none;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 48px 0;
}

/* WordPress block: separator with wide style */
.insight-content .wp-block-separator {
  border-top-color: rgba(163, 82, 166, 0.2);
}

/* WordPress block: image align */
.insight-content .alignwide {
  max-width: 900px;
  margin-left: calc(50% - 450px);
}

.insight-content .alignfull {
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* ── "More Insights" Section ───────────────────────────────────── */

.more-insights {
  background: var(--surface-soft, #faf8fc);
  padding: 80px 0 100px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.more-insights-title {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--smoky-800, #222);
  margin-bottom: 40px;
}


/* ================================================================
   RESPONSIVE
   ================================================================ */

/* ── Tablet (≤900px) ───────────────────────────────────────────── */

@media (max-width: 900px) {

  /* Archive */
  .archive-hero {
    padding: 120px 0 60px;
  }

  .archive-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Single */
  .insight-hero {
    padding: 140px 0 60px;
    min-height: 420px;
  }

  .insight-hero-title {
    font-size: 28px;
  }

  .insight-content-wrap {
    padding: 60px 0 80px;
  }

  .insight-content {
    font-size: 16px;
  }

  .insight-content h2 {
    font-size: 24px;
  }

  .insight-content h3 {
    font-size: 20px;
  }

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

/* ── Mobile (≤640px) ───────────────────────────────────────────── */

@media (max-width: 640px) {

  /* Archive */
  .archive-hero {
    padding: 100px 0 48px;
  }

  .archive-grid {
    grid-template-columns: 1fr !important;
  }

  .insight-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    /* Hide scrollbar but keep scrollable */
    scrollbar-width: none;
  }

  .insight-filters::-webkit-scrollbar {
    display: none;
  }

  .insight-filter-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Single */
  .insight-hero {
    padding: 120px 0 48px;
    min-height: 360px;
  }

  .insight-hero-title {
    font-size: 24px;
  }

  .insight-hero-excerpt {
    font-size: 16px;
  }

  .insight-content {
    font-size: 15.5px;
  }

  .insight-content h2 {
    font-size: 22px;
  }

  .insight-content blockquote {
    font-size: 16px;
    padding: 14px 0 14px 20px;
  }

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

  .more-insights-title {
    font-size: 24px;
  }
}
