/* ══ Insights storyline: six chapters (hub + article) ═══════════════════════
   Loaded only from templates/insights.html and templates/insight_article.html.
   Uses the DaasLabs tokens from style.css (--ink, --accent, --line, …). */

/* chapter tag inside kickers */
.kick .chtag {
    display: inline-block; margin-right: 8px; padding: 1px 6px;
    border: 1px solid var(--accent-line, #C9D4FF); color: var(--accent, #2251FF);
    font-size: .6875rem; letter-spacing: .06em; line-height: 1.5; border-radius: 2px;
}

/* featured hero framing */
.feat-frame {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: 0 0 14px; font-size: .8125rem; font-weight: 600; color: var(--ink);
}
.feat-frame span {
    background: var(--ink); color: #fff; padding: 3px 8px; font-size: .6875rem;
    letter-spacing: .1em; text-transform: uppercase; border-radius: 2px;
}

/* ── Story navigator (hub) ── */
.st-sec { border-top: 1px solid var(--line); }
.st-path {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0;
    border-top: 2px solid var(--ink); counter-reset: st;
}
.st-step { position: relative; min-width: 0; }
.st-step + .st-step { border-left: 1px solid var(--line); }
.st-a {
    display: flex; flex-direction: column; gap: 8px; height: 100%;
    padding: 20px 18px 22px; color: var(--ink); text-decoration: none;
    transition: background .2s ease;
}
.st-step:first-child .st-a { padding-left: 0; }
.st-a:hover { background: var(--surface-2); }
.st-step:first-child .st-a:hover { background: transparent; }
.st-a::before {
    content: ''; position: absolute; top: -2px; left: 0; right: 0; height: 2px;
    background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s ease;
}
.st-a:hover::before, .st-a:focus-visible::before { transform: scaleX(1); }
.st-n { font-family: var(--font-serif); font-size: 2rem; line-height: 1; color: var(--accent); font-weight: 500; font-variant-numeric: lining-nums; }
.st-name { font-family: var(--font-serif); font-size: 1.1875rem; line-height: 1.2; font-weight: 600; }
.st-line { font-size: .875rem; line-height: 1.5; color: var(--ink-3); flex: 1; }
.st-count { font-size: .75rem; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.st-step:nth-child(4) .st-n { background: var(--accent); color: #fff; display: inline-block; padding: 4px 6px; align-self: flex-start; font-size: 1.5rem; }

/* numbers: chapter label */
.num-ch { font-size: .6875rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }

/* ── Chapter rails (hub) ── */
.ch-block { scroll-margin-top: calc(var(--navh, 68px) + 64px); }
.ch-block .series-head { align-items: flex-end; flex-wrap: wrap; }
.ch-line { margin: 6px 0 0; font-size: .9375rem; color: var(--ink-3); max-width: 640px; }
.ch-go { font-size: .875rem; font-weight: 600; color: var(--accent); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.ch-go:hover { text-decoration: underline; text-underline-offset: 3px; }
.ch-cta {
    scroll-snap-align: start; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
    align-self: start; aspect-ratio: 16 / 10; padding: 22px; background: var(--ink); color: #fff; text-decoration: none;
    transition: background .2s ease;
}
.ch-cta .kick { color: rgba(255,255,255,.7); margin: 0; }
.ch-cta strong { color: #fff; font-family: var(--font-serif); font-size: 1.375rem; line-height: 1.2; font-weight: 500; }
.ch-cta i { font-size: 1.25rem; color: var(--cyan, #00A9F4); transition: transform .25s ease; }
.ch-cta:hover { background: var(--accent); color: #fff; }
.ch-cta:hover i { transform: translateX(4px); color: #fff; }
.ch-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ch-tool {
    display: flex; flex-direction: column; gap: 8px; padding: 22px; border: 1px solid var(--line);
    background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .2s ease;
}
.ch-tool i { font-size: 1.375rem; color: var(--accent); }
.ch-tool strong { font-family: var(--font-serif); font-size: 1.1875rem; font-weight: 600; }
.ch-tool span { font-size: .875rem; color: var(--ink-3); line-height: 1.5; }
.ch-tool:hover { border-color: var(--ink); }

/* ── Article: where this fits ── */
.art-story { padding: 56px 0; border-top: 1px solid var(--line); background: var(--surface); }
.art-story .as-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: end; margin-bottom: 24px; }
.art-story h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 8px 0 0; }
.art-story .as-head p { margin: 0; color: var(--ink-3); font-size: 1rem; line-height: 1.55; }
.art-story .as-head strong { color: var(--ink); }
.as-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 2px solid var(--line-2, #CDD2D8); }
.as-steps li { position: relative; min-width: 0; }
.as-steps li.is-done, .as-steps li.is-cur { border-top: 2px solid var(--ink); margin-top: -2px; }
.as-steps li.is-cur { border-top-color: var(--accent); }
.as-steps a { display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 14px 0; color: var(--ink-3); text-decoration: none; }
.as-steps a:hover { color: var(--ink); }
.as-n { font-family: var(--font-serif); font-size: 1.25rem; color: var(--ink-4); line-height: 1; }
.as-t { font-size: .875rem; font-weight: 600; line-height: 1.3; }
.as-c { font-size: .75rem; color: var(--ink-4); }
.as-steps li.is-done .as-n { color: var(--ink); }
.as-steps li.is-cur .as-n { color: var(--accent); }
.as-steps li.is-cur .as-t { color: var(--ink); }
.as-next { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center; margin-top: 24px; }
.as-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; padding: 11px 20px; font-size: .875rem; font-weight: 600; border-radius: 2px; text-decoration: none; }
.as-btn:hover { background: var(--accent); color: #fff; }
.as-link { font-size: .875rem; font-weight: 600; color: var(--accent); display: inline-flex; gap: 6px; align-items: center; }

@media (max-width: 1100px) {
    .st-path { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .st-step:nth-child(4) { border-left: 0; }
    .st-step:nth-child(n+4) { border-top: 1px solid var(--line); }
    .st-step:nth-child(4) .st-a { padding-left: 0; }
    .st-step:nth-child(4) .st-a:hover { background: transparent; }
}
@media (max-width: 767px) {
    .st-path { grid-template-columns: minmax(0, 1fr); }
    .st-step + .st-step { border-left: 0; border-top: 1px solid var(--line); }
    .st-a, .st-step:first-child .st-a, .st-step:nth-child(4) .st-a { padding: 16px 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; }
    .st-a > :not(.st-n) { grid-column: 2; }
    .st-n { grid-row: 1 / span 3; font-size: 1.625rem; }
    .st-step:nth-child(4) .st-n { font-size: 1.25rem; align-self: start; }
    .st-a:hover { background: transparent; }
    .ch-tools { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .ch-cta { aspect-ratio: auto; min-height: 140px; }
    .art-story .as-head { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .as-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .as-steps li:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
    .st-a::before, .ch-cta i { transition: none; }
}
@media print { .art-story { display: none !important; } }
