/* ─────────────────────────────────────────────────────────────
   ACERTI INSIGHTS — editorial blog styles
   Sits on top of colors_and_type.css + marketing-site.css.
   Two concerns:
     1. Index / listing layout  (.ins-*)
     2. Long-form article prose  (.ins-prose)  ← the "rich HTML" canvas
   ───────────────────────────────────────────────────────────── */

/* ============================================================
   1 · INDEX / LISTING
   ============================================================ */

/* Toolbar: search + filters */
.ins-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin: 0 0 36px;
}
.ins-search {
  position: relative; display: flex; align-items: center;
  flex: 1 1 280px; max-width: 380px;
}
.ins-search svg { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.ins-search input {
  width: 100%; height: 46px; padding: 0 40px 0 44px;
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--radius-pill); outline: none;
  transition: border-color 150ms var(--ease-standard), box-shadow 150ms var(--ease-standard);
}
.ins-search input::placeholder { color: var(--muted-soft); }
.ins-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(244,144,30,0.12); }
.ins-search-clear {
  position: absolute; right: 10px; width: 26px; height: 26px;
  border: none; background: var(--surface-card); color: var(--muted);
  border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.ins-search-clear:hover { background: var(--surface-cream-strong); color: var(--ink); }

/* Category filter pills */
.ins-filter {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.ins-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: var(--radius-pill);
  background: transparent; color: var(--muted);
  border: 1px solid var(--hairline); cursor: pointer;
  transition: all 150ms var(--ease-standard);
}
.ins-chip:hover { color: var(--ink); border-color: var(--muted-soft); }
.ins-chip.active { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.ins-chip-n {
  font-size: 11px; font-weight: 600; min-width: 18px; text-align: center;
  padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--surface-card); color: var(--muted);
}
.ins-chip.active .ins-chip-n { background: rgba(255,255,255,0.16); color: var(--on-dark); }

/* Result count line */
.ins-resultline { font-size: 14px; color: var(--muted); margin: 0 0 24px; }
.ins-resultline strong { color: var(--ink); font-weight: 600; }

/* Load more */
.ins-more { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 48px; }
.ins-more-count { font-size: 13px; color: var(--muted-soft); }

/* Featured (latest) — wide split card */
.ins-featured {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
  border: 1px solid var(--hairline); border-radius: var(--radius-xl);
  overflow: hidden; background: var(--canvas);
  margin-bottom: 56px;
  transition: box-shadow 240ms var(--ease-standard);
}
.ins-featured:hover { box-shadow: var(--shadow-card); }
.ins-featured .cover {
  min-height: 0; position: relative;
  background: var(--surface-dark);
  display: flex; align-items: flex-end; padding: 20px;
  overflow: hidden;
}
.ins-featured .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ins-featured image-slot { position: absolute; inset: 0; width: 100%; height: 100%; }
.ins-featured .copy { padding: 24px 30px; display: flex; flex-direction: column; }
.ins-featured .copy .ins-meta { margin-top: auto; }
.ins-featured h2 {
  font-size: 24px; line-height: 1.15; letter-spacing: -0.4px;
  margin: 8px 0 8px;
}
.ins-featured p {
  font-size: 15px; line-height: 1.5; color: var(--body);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Card grid */
.ins-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
@media (max-width: 900px) { .ins-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ins-grid { grid-template-columns: 1fr; } }

.ins-card {
  display: flex; flex-direction: column;
  background: var(--canvas);
  border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none;
  transition: transform 220ms var(--ease-standard), box-shadow 220ms var(--ease-standard), border-color 220ms var(--ease-standard);
}
.ins-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: var(--hairline); text-decoration: none; }
.ins-card .cover {
  aspect-ratio: 16 / 10; position: relative; overflow: hidden;
  background: var(--surface-card);
  display: flex; align-items: flex-end; padding: 18px;
}
.ins-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Typographic cover fallback — no image needed */
.ins-cover-type {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(244,144,30,0.18), transparent 60%),
    var(--surface-dark);
}
.ins-featured .ins-meta-abs { position: absolute; left: 20px; bottom: 18px; z-index: 2; }
.ins-featured .cover.cover-slot { background: var(--surface-soft); }
.ins-featured .cover.has-photo::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 100px;
  background: linear-gradient(transparent, rgba(0,0,0,0.45)); z-index: 1; pointer-events: none;
}
.ins-featured .cover > a { position: absolute; inset: 0; display: block; }
/* Copy side is a link — keep it reading as text, not an anchor */
.ins-featured .copy, .ins-featured .copy:hover { text-decoration: none; border-bottom: none; }
.ins-featured .copy h2, .ins-featured .copy p { color: var(--ink); }
.ins-featured .copy p { color: var(--body); }
.ins-featured:hover .copy h2 { color: var(--primary-active); transition: color 150ms var(--ease-standard); }
.ins-cover-type .glyph {
  font-family: var(--font-display); font-size: 90px; line-height: 0.8;
  color: rgba(255,255,255,0.10); position: absolute; top: 8px; right: 18px;
  user-select: none;
}
.ins-card .body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ins-card h3 {
  font-size: 21px; line-height: 1.22; letter-spacing: -0.3px; color: var(--ink);
}
.ins-card .excerpt { font-size: 14.5px; line-height: 1.55; color: var(--body); flex: 1; }

/* Shared meta row (category · date · read time) */
.ins-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.ins-cat {
  font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase;
  font-size: 11px; color: var(--primary-active);
}
.ins-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-soft); }
.ins-meta .when { color: var(--muted); }
/* On dark covers */
.cover .ins-meta .ins-cat { color: var(--accent-amber); }
.cover .ins-meta .when { color: var(--on-dark-soft); }
.cover h2, .cover h3 { color: var(--on-dark); }

/* Empty state */
.ins-empty { text-align: center; color: var(--muted); padding: 80px 0; font-size: 16px; }

/* ============================================================
   2 · ARTICLE LAYOUT
   ============================================================ */

.ins-article { padding-bottom: 24px; }

/* Article header band */
.ins-head { max-width: var(--max-prose); margin: 0 auto; padding: 48px 0 8px; }
.ins-head .breadcrumb { margin-bottom: 22px; }
.ins-head h1 {
  font-size: clamp(36px, 5vw, 56px); line-height: 1.06; letter-spacing: -1px;
  margin: 14px 0 0;
}
.ins-dek {
  font-family: var(--font-display); font-style: italic;
  font-size: clamp(20px, 2.6vw, 26px); line-height: 1.4;
  color: var(--body-strong); margin: 22px 0 0; max-width: 40ch;
}

/* Byline */
.ins-byline {
  display: flex; align-items: center; gap: 14px;
  margin: 32px 0 0; padding: 20px 0;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.ins-byline .avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.ins-byline .avatar img { width: 100%; height: 100%; object-fit: cover; }
.ins-byline .who { display: flex; flex-direction: column; gap: 2px; }
.ins-byline .nm { font-size: 14px; font-weight: 600; color: var(--ink); }
.ins-byline .sub { font-size: 13px; color: var(--muted); }
.ins-byline .spacer { flex: 1; }

/* Cover figure (full prose width, can go wide) */
.ins-cover-fig { max-width: var(--max-content); margin: 36px auto 0; padding: 0 32px; }
.ins-cover-fig img { width: 100%; border-radius: var(--radius-xl); display: block; }
.ins-cover-fig figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ── PROSE CANVAS ──────────────────────────────────────────── */
.ins-prose {
  max-width: var(--max-prose); margin: 0 auto; padding: 44px 0 8px;
  font-size: 18px; line-height: 1.72; color: var(--body-strong);
}
.ins-prose > * + * { margin-top: 26px; }

/* Paragraphs & inline */
.ins-prose p { font-size: 18px; line-height: 1.72; color: var(--body-strong); }
.ins-prose a { color: var(--primary-active); border-bottom: 1px solid rgba(210,122,19,0.35); }
.ins-prose a:hover { border-bottom-color: var(--primary-active); }
.ins-prose strong { color: var(--ink); font-weight: 600; }
.ins-prose em { font-style: italic; }

/* Lead paragraph */
.ins-prose .lead {
  font-size: 22px; line-height: 1.6; color: var(--ink); font-weight: 400;
}
/* Optional drop-cap on the first lead */
.ins-prose .dropcap::first-letter {
  font-family: var(--font-display); font-weight: 500;
  float: left; font-size: 76px; line-height: 0.74;
  padding: 6px 12px 0 0; color: var(--primary-active);
}

/* Headings within prose */
.ins-prose h2 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 32px; line-height: 1.18; letter-spacing: -0.5px; color: var(--ink);
  margin-top: 52px;
}
.ins-prose h3 {
  font-family: var(--font-body); font-weight: 600;
  font-size: 21px; line-height: 1.3; color: var(--ink);
  margin-top: 40px;
}
.ins-prose h2 + p, .ins-prose h3 + p { margin-top: 14px; }

/* Lists */
.ins-prose ul, .ins-prose ol { padding-left: 0; list-style: none; }
.ins-prose li { position: relative; padding-left: 30px; margin-top: 12px; line-height: 1.65; }
.ins-prose ul > li::before {
  content: ""; position: absolute; left: 6px; top: 13px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary);
}
.ins-prose ol { counter-reset: ol; }
.ins-prose ol > li { counter-increment: ol; }
.ins-prose ol > li::before {
  content: counter(ol); position: absolute; left: 0; top: 1px;
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  color: var(--primary-active); width: 22px; text-align: left;
}

/* Blockquote (editorial) */
.ins-prose blockquote {
  margin: 36px 0; padding: 4px 0 4px 28px;
  border-left: 2px solid var(--primary);
  font-family: var(--font-display); font-style: italic;
  font-size: 24px; line-height: 1.45; color: var(--ink);
}
.ins-prose blockquote cite { display: block; margin-top: 14px; font-style: normal; font-family: var(--font-body); font-size: 14px; color: var(--muted); }

/* Pullquote — big centered, breaks rhythm */
.ins-prose .pullquote {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(28px, 4vw, 40px); line-height: 1.22; letter-spacing: -0.5px;
  color: var(--ink); text-align: center; max-width: 16ch; margin: 56px auto;
  text-wrap: balance;
}
.ins-prose .pullquote::before { content: "\201C"; color: var(--primary); }
.ins-prose .pullquote::after { content: "\201D"; color: var(--primary); }

/* Figures + captions */
.ins-prose figure { margin: 40px 0; }
.ins-prose figure img { width: 100%; border-radius: var(--radius-lg); display: block; }
.ins-prose figcaption { font-size: 13.5px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
/* Wider-than-prose media */
.ins-prose .wide {
  width: min(100vw - 64px, var(--max-content));
  margin-left: 50%; transform: translateX(-50%);
}

/* Key-takeaways / aside card (cream, no left-rule trope) */
.ins-prose .ins-box {
  background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 28px 30px; margin: 40px 0;
}
.ins-prose .ins-box .ins-box-label {
  font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--primary-active); margin-bottom: 16px;
}
.ins-prose .ins-box > :first-child { margin-top: 0; }
.ins-prose .ins-box p, .ins-prose .ins-box li { font-size: 16px; line-height: 1.6; }
.ins-prose .ins-box ul > li::before { top: 11px; }

/* Stat row — serif numerals */
.ins-prose .ins-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  margin: 44px 0; padding: 32px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
@media (max-width: 600px) { .ins-prose .ins-stats { grid-template-columns: 1fr; gap: 20px; } }
.ins-prose .ins-stats .num { font-family: var(--font-display); font-weight: 500; font-size: 46px; line-height: 1; letter-spacing: -1px; color: var(--ink); }
.ins-prose .ins-stats .lbl { font-size: 13.5px; line-height: 1.45; color: var(--muted); margin-top: 10px; }
.ins-prose .ins-stats > div { margin-top: 0; }

/* Tables */
.ins-prose .table-wrap { overflow-x: auto; margin: 36px 0; }
.ins-prose table {
  width: 100%; border-collapse: collapse; font-size: 15px;
  border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden;
}
.ins-prose thead th {
  background: var(--surface-dark); color: var(--on-dark); text-align: left;
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.8px; padding: 14px 18px;
}
.ins-prose tbody td { padding: 13px 18px; border-bottom: 1px solid var(--hairline); vertical-align: top; color: var(--body); }
.ins-prose tbody tr:last-child td { border-bottom: none; }
.ins-prose tbody td:first-child { font-weight: 500; color: var(--ink); }

/* Inline code + code block */
.ins-prose code {
  font-family: var(--font-mono); font-size: 0.86em;
  background: var(--surface-card); padding: 2px 6px; border-radius: var(--radius-xs); color: var(--accent-deep);
}
.ins-prose pre {
  background: var(--surface-dark); color: var(--on-dark);
  border-radius: var(--radius-lg); padding: 22px 24px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.65; margin: 32px 0;
}
.ins-prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* Divider */
.ins-prose hr {
  border: none; height: 1px; background: none; margin: 48px 0; text-align: center;
}
.ins-prose hr::before {
  content: "\00A7"; font-family: var(--font-display); font-size: 22px; color: var(--muted-soft);
}

/* First child no top margin */
.ins-prose > :first-child { margin-top: 0; }

/* ── BYLINE / AVATAR ───────────────────────────────────────── */
.avatar.avatar-logo {
  background: var(--surface-dark);
  display: flex; align-items: center; justify-content: center;
}
.avatar.avatar-logo img {
  width: 58%; height: 58%; object-fit: contain;
}

/* ── SHARE BAR ─────────────────────────────────────────────── */
.ins-share { max-width: var(--max-prose); margin: 44px auto 0; padding: 28px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ins-share .lbl { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.ins-share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ins-sbtn {
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  border: 1px solid var(--hairline); background: var(--canvas); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all 150ms var(--ease-standard); text-decoration: none;
}
.ins-sbtn:hover { background: var(--ink); color: var(--on-dark); border-color: var(--ink); transform: translateY(-2px); }
.ins-sbtn.copied { background: var(--accent-teal); color: #fff; border-color: var(--accent-teal); }

/* ── AUTHOR CARD ───────────────────────────────────────────── */
.ins-author {
  max-width: var(--max-prose); margin: 40px auto 0;
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface-soft); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 26px 28px;
}
.ins-author .avatar { width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.ins-author .avatar img { width: 100%; height: 100%; object-fit: cover; }
.ins-author .nm { font-size: 15px; font-weight: 600; color: var(--ink); }
.ins-author .role { font-size: 13px; color: var(--muted); margin: 2px 0 10px; }
.ins-author .bio { font-size: 14.5px; line-height: 1.6; color: var(--body); }

/* ── RELATED ───────────────────────────────────────────────── */
.ins-related { margin-top: 8px; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 860px) {
  .ins-featured { grid-template-columns: 1fr; }
  .ins-featured .cover { min-height: 220px; }
  .ins-featured .copy { padding: 32px; }
}
@media (max-width: 700px) {
  .ins-head, .ins-prose, .ins-share, .ins-author { padding-left: 0; padding-right: 0; }
  .ins-prose .wide { width: 100%; margin-left: 0; transform: none; }
}
