/* Insights hub - filter bar, type chips, card and article extensions.
   Bento card base styles live in main.css; this file only adds hub-specific layers. */

/* Type filter bar */
.insights-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.insights-filter-link {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.insights-filter-link:hover {
  color: var(--text-primary);
  border-color: rgba(62, 174, 44, 0.5);
  background: rgba(62, 174, 44, 0.08);
}

.insights-filter-link[aria-current="page"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(90deg, #3EAE2C, #009B85);
}

[data-theme="light"] .insights-filter-link[aria-current="page"] {
  color: #fff;
}

/* Type chips on cards */
.insight-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.type-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.type-chip--article { background: linear-gradient(90deg, #3EAE2C, #00A65B); }
.type-chip--guide   { background: linear-gradient(90deg, #00A65B, #009B85); }
.type-chip--radar   { background: linear-gradient(90deg, #008EA8, #006CC1); }
.type-chip--tool    { background: linear-gradient(90deg, #3EAE2C, #006CC1); }

.insight-card-top .bento-category {
  margin: 0;
}

/* Card title links inherit card styling */
.insight-card .bento-title a {
  color: inherit;
  text-decoration: none;
}

.insight-card .bento-title a:hover {
  color: var(--green, #3EAE2C);
}

/* Hub filter state (JS-applied) */
.insight-card.is-filtered-out {
  display: none;
}

/* Wide article pages (tools etc): full measure, no TOC rail.
   Everything shares ONE left edge: banner side padding matches the
   prose inner padding (24px), prose fills the container, running text
   stays capped for readability while headings/components span full width. */
.post-content--wide {
  max-width: 1080px;
}

.post-content--wide .article-banner {
  padding-left: 24px;
  padding-right: 24px;
}

.post-content--wide .article-banner-content {
  max-width: none;
}

.post-content--wide .article-prose {
  max-width: none;
}

.post-content--wide .article-prose > p {
  max-width: 880px;
}

/* Article TOC - JS-built, desktop rail + mobile collapsible.
   The rail lives INSIDE .post-content (880px), so the container must widen
   when the rail exists or prose gets crushed. */
@media (min-width: 1024px) {
  /* rail 220 + gap 48 + prose 880 + side padding 40 = exact fit, no slack.
     Side padding keeps the rail off the screen edge below 1188px;
     banner and layout sit inside the same box so alignment holds. */
  .post-content.has-toc {
    max-width: 1188px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .post-content.has-toc .article-layout {
    max-width: none;
    padding: 0;
  }

  .post-content.has-toc .article-layout-main {
    max-width: 880px;
  }

  /* Banner text aligns with the prose column (rail 220 + gap 48 + prose inner padding 24) */
  .post-content.has-toc .article-banner {
    padding-left: 0;
    padding-right: 0;
  }

  .post-content.has-toc .article-banner-content {
    max-width: none;
    margin: 0;
    padding-left: 292px;
  }

  /* CLS fix: every standard article gets a TOC, but hub.js builds it after
     first paint. Reserve the rail's geometry up front so the column does not
     jump right when .has-toc lands. Scoped to :not(.has-toc) so it yields the
     instant the JS grid takes over - the two states are pixel-identical. */
  .post-content:not(.post-content--wide):not(.has-toc) {
    max-width: 1188px;
    padding-left: 20px;
    padding-right: 20px;
  }

  .post-content:not(.post-content--wide):not(.has-toc) .article-banner {
    padding-left: 0;
    padding-right: 0;
  }

  .post-content:not(.post-content--wide):not(.has-toc) .article-banner-content {
    max-width: none;
    margin: 0;
    padding-left: 292px;
  }

  .post-content:not(.post-content--wide):not(.has-toc) .article-prose {
    max-width: 880px;
    margin-left: 268px;
    margin-right: auto;
  }
}

/* Article TOC - JS-built, desktop rail + mobile collapsible */
.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.article-layout .article-prose {
  /* prose keeps its own max-width/centering from main.css; neutralize inside the grid */
  margin-left: 0;
  margin-right: 0;
}

.article-toc {
  position: sticky;
  top: 96px;
  font-size: 14px;
}

.article-toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.article-toc-nav ul {
  /* the global `nav ul` rule is flex-row - force a vertical list here */
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.article-toc-nav li {
  margin: 0;
}

.article-toc-nav a {
  display: block;
  padding: 6px 0 6px 14px;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  margin-left: -1px;
  line-height: 1.4;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.article-toc-nav .toc-h3 a {
  padding-left: 28px;
  font-size: 13px;
}

.article-toc-nav a:hover {
  color: var(--text-primary);
}

.article-toc-nav a.is-active {
  color: var(--green, #3EAE2C);
  border-left-color: var(--green, #3EAE2C);
}

.article-toc-mobile {
  display: none;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.article-toc-mobile summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
}

.article-toc-mobile .article-toc-nav {
  margin-top: 10px;
}

@media (max-width: 1023px) {
  .article-layout {
    display: block;
    padding: 0;
  }

  .article-toc {
    display: none;
  }

  .article-toc-mobile {
    display: block;
    margin: 0 20px 24px;
  }
}

/* Training page */
.training-body {
  padding: 48px 0 80px;
}

.training-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.training-module {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.training-module:hover {
  border-color: rgba(62, 174, 44, 0.45);
  transform: translateY(-2px);
}

.training-module h2 {
  font-size: 1.35rem;
  margin: 14px 0 10px;
}

.training-module p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.training-notes,
.training-crosslink {
  max-width: 720px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.training-cta {
  max-width: 720px;
  margin: 48px 0 32px;
}

.training-cta h2 {
  margin-bottom: 8px;
}

.training-cta > p {
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 760px) {
  .training-grid {
    grid-template-columns: 1fr;
  }
}

/* Skills pack index - flowing columns so short groups leave no holes */
.skills-index {
  columns: 2;
  column-gap: 40px;
  margin: 28px 0 8px;
}

.skills-group {
  break-inside: avoid;
  margin-bottom: 28px;
}

.skills-group h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #3EAE2C, #006CC1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 10px;
}

.skills-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.skills-group li {
  position: relative;
  padding: 8px 0 8px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.skills-group li:last-child {
  border-bottom: none;
}

.skills-group li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 16px;
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: linear-gradient(135deg, #3EAE2C, #006CC1);
}

.skills-group li b {
  color: var(--text-primary);
  font-weight: 650;
}

@media (max-width: 760px) {
  .skills-index {
    columns: 1;
  }
}

/* Email gate */
.email-gate {
  margin: 40px 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(62, 174, 44, 0.06), rgba(0, 108, 193, 0.06));
}

.email-gate-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.email-gate-label {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.email-gate-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.email-gate-input {
  flex: 1;
  min-width: 220px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 15px;
}

.email-gate-input:focus {
  outline: 2px solid var(--green, #3EAE2C);
  outline-offset: 1px;
  border-color: transparent;
}

.email-gate-smallprint {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.email-gate-thanks {
  font-weight: 600;
  margin: 0 0 14px;
}

/* Radar digest */
.radar-container {
  max-width: 800px;
  padding-top: 64px;
  padding-bottom: 64px;
}

.radar-header {
  margin-bottom: 32px;
}

.radar-title {
  font-size: var(--fs-display);
  line-height: 1.15;
  margin: 16px 0 12px;
}

.radar-lead {
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 0;
}

.radar-intro {
  margin-bottom: 24px;
}

.radar-items {
  list-style: none;
  margin: 32px 0 48px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.radar-item {
  display: flex;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.radar-item:hover {
  border-color: rgba(0, 142, 168, 0.5);
  background: rgba(0, 142, 168, 0.05);
}

.radar-item-num {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(180deg, #008EA8, #006CC1);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  flex-shrink: 0;
}

.radar-item-source {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.radar-item-title {
  font-size: 1.15rem;
  line-height: 1.35;
  margin: 0 0 8px;
}

.radar-item-title a {
  color: var(--text-primary);
}

.radar-item-title a:hover {
  color: #008EA8;
}

.radar-item-take {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 600px) {
  .radar-item {
    flex-direction: column;
    gap: 10px;
  }
}

/* Article footer: prev/next + related */
.post-neighbors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0;
}

.post-neighbor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.post-neighbor:hover {
  border-color: rgba(62, 174, 44, 0.5);
  background: rgba(62, 174, 44, 0.06);
}

.post-neighbor--next {
  text-align: right;
}

.post-neighbor-dir {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.post-neighbor-title {
  font-weight: 600;
  color: var(--text-primary);
}

.post-related {
  margin: 40px 0;
}

.bento-grid--related {
  margin-top: 16px;
}

@media (max-width: 700px) {
  .post-neighbors {
    grid-template-columns: 1fr;
  }

  .post-neighbor--next {
    text-align: left;
  }
}
