/* ============================================================
   Insights hub + article layout
   Built on meridian.css tokens (--ink, --blue, --mist, --line,
   --paper, --night, --sans, --ease). Client-side only.
   ============================================================ */

/* ---------- Hub hero ---------- */
.ih-hero { padding: clamp(62px, 6.4vw, 92px) 0 clamp(28px, 3vw, 42px); border-bottom: 1px solid var(--line); }
.ih-hero-inner { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); gap: clamp(32px, 6vw, 108px); align-items: end; }
.ih-kicker { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 15px; color: var(--blue);    }
.ih-kicker::before { content: ""; width: 26px; height: 1px; background: currentColor; }
.ih-hero h1 { margin: 0;   }
.ih-hero-note { max-width: 41ch; margin: 0 0 3px; color: var(--grey);   }

/* ---------- Filter chips ---------- */
.ih-filter { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.ih-filter-inner { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 13px 0; }
.ih-chip { appearance: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink);   padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.ih-chip:hover { border-color: var(--ink); }
.ih-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }
.ih-count { margin-left: auto; color: var(--grey);  }

/* ---------- Card grid ---------- */
.ih-grid-wrap { padding: clamp(34px, 4vw, 64px) 0 clamp(60px, 8vw, 110px); }
.ih-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(18px, 1.6vw, 28px); }
.ih-card { display: flex; flex-direction: column; min-height: 300px; padding: clamp(26px, 2vw, 34px); border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; position: relative; transition: border-color .2s, transform .2s, box-shadow .3s; }
.ih-card::before { content: ""; position: absolute; top: 0; left: 0; height: 3px; width: 0; background: var(--blue); transition: width .3s var(--ease); }
.ih-card:hover { border-color: var(--blue); transform: translateY(-3px); box-shadow: 0 18px 46px rgba(4,16,30,.09); }
.ih-card:hover::before { width: 100%; }
.ih-card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.ih-card-cat { color: var(--blue);    }
.ih-card-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }
.ih-card-date { color: var(--grey);   }
.ih-card h3 { margin: 0 0 18px;   text-wrap: initial; overflow-wrap: normal; hyphens: none; }
.ih-card p { margin: 0; color: var(--grey); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.ih-card-go { margin-top: auto; padding-top: 24px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink);  }
.ih-card-go i {  color: var(--blue); transition: transform .25s var(--ease); }
.ih-card:hover .ih-card-go i { transform: translate(3px, -3px); }

.ih-card .ih-card-figure { flex: none; height: 188px; margin: calc(clamp(26px, 2vw, 34px) * -1) calc(clamp(26px, 2vw, 34px) * -1) 22px; background: var(--mist) var(--ih-img, none) center/cover no-repeat; }
.ih-card .ih-card-figure + .ih-card-meta { margin-top: 0; }

/* Featured (first) card spans two columns on wide screens */
.ih-card.is-featured { grid-column: span 3; flex-direction: row; gap: clamp(28px, 3.4vw, 64px); min-height: 380px; align-items: center; }
.ih-card.is-featured .ih-card-body { flex: 1; }
.ih-card.is-featured .ih-card-figure { flex: 0 0 52%; height: auto; margin: 0; align-self: stretch; background: var(--mist) var(--ih-img, none) center/cover no-repeat; min-height: 300px; }
.ih-card.is-featured h3 {    }
.ih-card.is-featured p { max-width: 48ch; -webkit-line-clamp: 8; }

.ih-empty { display: none; padding: 60px 0; text-align: center; color: var(--grey);  }
.ih-empty.is-on { display: block; }

@media (max-width: 1080px) {
  .ih-hero-inner { grid-template-columns: 1fr; align-items: start; gap: 20px; }
  .ih-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ih-card.is-featured { grid-column: span 2; }
}
@media (max-width: 680px) {
  .ih-hero { padding-top: 42px; }
  .ih-hero-note { max-width: 48ch; }
  .ih-grid { grid-template-columns: 1fr; }
  .ih-card.is-featured { grid-column: span 1; flex-direction: column; align-items: stretch; }
  .ih-card.is-featured .ih-card-figure { flex-basis: auto; min-height: 180px; }
  .ih-count { display: none; }
}

/* ============================================================
   Article layout
   ============================================================ */
.ia-hero { padding: clamp(46px, 6vw, 92px) 0 clamp(28px, 3vw, 44px); border-bottom: 1px solid var(--line); }
.ia-crumb { display: flex; align-items: center; gap: 10px; margin-bottom: 26px;  color: var(--grey); }
.ia-crumb a { color: var(--grey); text-decoration: none; }
.ia-crumb a:hover { color: var(--blue); }
.ia-crumb i {  opacity: .5; }
.ia-cat { color: var(--blue);    }
.ia-hero h1 { margin: 16px 0 0; max-width: 20ch;   }
.ia-dek { margin: 22px 0 0; max-width: 62ch; color: var(--grey);   }
.ia-meta { margin-top: 26px; display: flex; gap: 18px; color: var(--grey);   }

.ia-body { padding: clamp(40px, 5vw, 76px) 0 clamp(50px, 6vw, 90px); }
.ia-body-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 60px); }
.ia-prose { grid-column: 2; }
.ia-prose > * { max-width: 68ch; }
.ia-prose h2 { margin: 46px 0 14px;   }
.ia-prose h2:first-child { margin-top: 0; }
.ia-prose p { margin: 0 0 20px;   color: #263341; }
.ia-prose ul { margin: 0 0 20px; padding-left: 20px; }
.ia-prose li { margin: 0 0 9px;   color: #263341; }
.ia-prose strong { color: var(--ink);  }
.ia-pull { margin: 34px 0; padding: 4px 0 4px 26px; border-left: 3px solid var(--blue);   color: var(--ink); }
.ia-note { margin: 30px 0 0; padding: 20px 22px; background: var(--mist); border: 1px solid var(--line);   color: var(--grey); }

@media (max-width: 1000px) {
  .ia-body-grid { grid-template-columns: 1fr; }
  .ia-prose { grid-column: 1; }
  .ia-prose > * { max-width: none; }
}

/* ---------- Article extras: reading progress, share, related ---------- */
.ia-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--blue); z-index: 100; }
.ia-share { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 8px 13px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);  cursor: pointer; transition: border-color .2s, background .2s; }
.ia-share:hover { border-color: var(--ink); }
.ia-share svg { width: 14px; height: 14px; }
.ia-share.is-done { border-color: var(--blue); color: var(--blue); }
.ia-meta { align-items: center; }
.ia-related { border-top: 1px solid var(--line); background: var(--mist); }
.ia-related-inner { padding: clamp(40px, 5vw, 72px) 0; }
.ia-related-head { margin: 0 0 24px;    color: var(--grey); }
.ia-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 1.4vw, 22px); }
.ia-rel { display: flex; flex-direction: column; min-height: 150px; padding: 24px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; transition: border-color .2s, transform .2s; }
.ia-rel:hover { border-color: var(--blue); transform: translateY(-2px); }
.ia-rel-cat { color: var(--blue);    margin-bottom: 12px; }
.ia-rel h3 { margin: 0;   }
.ia-rel-go { margin-top: auto; padding-top: 18px; color: var(--ink);  }
.ia-rel-go i {  color: var(--blue); }
@media (max-width: 720px) { .ia-related-grid { grid-template-columns: 1fr; } }

/* Adaptive feed — 'For you' recommendation badge */
.ih-rec { position: absolute; top: 14px; right: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; background: var(--blue); color: #fff;    border-radius: 999px; }
.ih-card.is-featured .ih-rec { top: 18px; right: 18px; }

/* Markets band: the submarket tape and jurisdiction routes */
.ih-markets { position: relative; overflow: hidden; margin-top: clamp(64px, 8vw, 110px); padding: clamp(64px, 7vw, 100px) 0 clamp(70px, 7vw, 104px); background: #f7f9fb; border-top: 1px solid var(--ice); }
.ih-markets-tape { position: absolute; top: clamp(18px, 2.4vw, 34px); left: 0; display: flex; white-space: nowrap; pointer-events: none; }
.ih-markets-tape span { flex: none; color: rgba(31,103,233,.08);   animation: ih-tape 90s linear infinite; }
@keyframes ih-tape { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.ih-markets-head { position: relative; max-width: 54ch; margin-bottom: clamp(30px, 4vw, 48px); padding-top: clamp(34px, 4vw, 56px); }
.ih-kicker-light { color: var(--blue); }
.ih-markets-head h2 { margin: 0;   color: var(--ink); }
.ih-markets-head p:not(.ih-kicker) { margin: 16px 0 0; color: var(--grey);   }
.ih-markets-grid { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--ice); border: 1px solid var(--ice); }
.ih-markets-grid a { display: block; padding: clamp(22px, 2.2vw, 32px); background: var(--white); color: var(--ink); text-decoration: none; transition: background .25s; }
.ih-markets-grid a:hover, .ih-markets-grid a:focus-visible { background: var(--mist); }
.ih-markets-grid b { display: block; color: var(--blue);    }
.ih-markets-grid strong { display: block; margin: 13px 0 7px;    }
.ih-markets-grid p { margin: 0; color: var(--grey);   }
.ih-markets-grid span { display: inline-block; margin-top: 16px; color: var(--blue);   }
@media (max-width: 1080px) { .ih-markets-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .ih-markets-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .ih-markets-tape span { animation: none; } }

/* Pager */
.ih-pager { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: clamp(34px, 4vw, 52px); }
.ih-pager[hidden] { display: none; }
.ih-page-nums { display: inline-flex; gap: 8px; }
.ih-page-btn { min-height: 44px; padding: 0 18px; border: 1px solid var(--line); background: var(--white); color: var(--ink);  cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.ih-page-btn.is-num { min-width: 44px; padding: 0; }
.ih-page-btn:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.ih-page-btn[aria-current="page"] { background: var(--night); border-color: var(--night); color: var(--white); }
.ih-page-btn:disabled { opacity: .4; cursor: default; }

@media print {
  .site-header, .mobile-menu, .mobile-cta, .newsletter-section, .site-footer, .modal, .ia-share, .scroll-progress, .ih-markets { display: none !important; }
  .ia-hero, .ia-body { padding: 0 !important; }
  a { text-decoration: none !important; }
}

/* Glossary term tooltips inside articles */
.gl-term { position: relative; color: var(--ink); text-decoration: underline dotted var(--blue); text-underline-offset: 3px; }
.gl-term:hover, .gl-term:focus-visible { color: var(--blue); }
.gl-term::after { content: attr(data-def); position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 30; width: 260px; padding: 12px 14px; background: var(--night); color: #fff;    opacity: 0; visibility: hidden; transition: opacity .2s; pointer-events: none; }
.gl-term:hover::after, .gl-term:focus-visible::after { opacity: 1; visibility: visible; }
@media (max-width: 680px) { .gl-term::after { display: none; } }
