/**
 * Neural Resources hub — page styles (np-res- prefix; scoped, main.css is global).
 * A simpler sibling to intelligence-hub-v2.css: one category rail, a uniform
 * card grid, no featured/archive tiers. Light theme, matches the site.
 * Rendered by scripts/build-resources.cjs; filtered by np-resources-hub.js.
 */

.np-res {
    --np-res-ink: #111827;
    --np-res-ink-2: #4b5563;
    --np-res-ink-3: #6b7280;
    --np-res-ink-4: #9ca3af;
    --np-res-line: #e5e7eb;
    --np-res-line-2: #d1d5db;
    --np-res-page: #f9fafb;
    --np-res-panel: #ffffff;
    --np-res-panel-2: #f3f4f6;
    display: block;
    background: var(--np-res-page);
    color: var(--np-res-ink);
}

/* Type accent system — per data-type color, tint, and glyph. */
.np-res-card[data-type="guide"]     { --np-res-c: #6E56CF; --np-res-t: #efecfb; --np-res-g: "\25C6"; } /* ◆ */
.np-res-card[data-type="template"]  { --np-res-c: #1f9c90; --np-res-t: #e4f4f2; --np-res-g: "\25A4"; } /* ▤ */
.np-res-card[data-type="checklist"] { --np-res-c: #c2600f; --np-res-t: #f7ede2; --np-res-g: "\2713"; } /* ✓ */

.np-res-wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 48px);
}

/* ---- hero ---- */
.np-res-hero {
    position: relative;
    padding: clamp(48px, 8vw, 96px) 0 clamp(32px, 5vw, 56px);
}
/* Hero spans the full content width (inherits .np-res-wrap's 1600px cap, so it
   lines up with the feed below). Two columns: headline left, subtitle bottom-right
   filling the space. Kicker spans the top. Stacks on mobile. */
.np-res-hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: clamp(36px, 6vw, 100px);
    align-items: end;
}
.np-res-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6E56CF;
    margin: 0 0 14px;
    grid-column: 1 / -1;
}
.np-res-h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.04;
    letter-spacing: -0.025em;
    font-weight: 700;
    margin: 0;
    grid-column: 1;
    text-wrap: balance;
}
.np-res-h1 em { font-style: italic; color: #6E56CF; }
.np-res-sub {
    font-size: clamp(1rem, 1.6vw, 1.15rem);
    line-height: 1.6;
    color: var(--np-res-ink-2);
    max-width: 52ch;
    margin: 0 0 8px;
    grid-column: 2;
    align-self: end;
}
.np-res-seam {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--np-res-line-2) 20%, var(--np-res-line-2) 80%, transparent 100%);
}

/* ---- feed layout: rail + grid ---- */
.np-res-feed-section { padding: clamp(28px, 5vw, 48px) 0 clamp(56px, 9vw, 110px); }
.np-res-feed {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: clamp(24px, 4vw, 52px);
    align-items: start;
}

.np-res-rail {
    position: sticky;
    top: 36px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.np-res-rail-group { display: flex; flex-direction: column; gap: 4px; }
.np-res-rail-head {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--np-res-ink-4);
    margin: 0 0 6px 4px;
}
.np-res-rail-head--bare { margin-bottom: 2px; }

.np-res-cat {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13.5px;
    color: var(--np-res-ink-2);
    cursor: pointer;
    text-align: left;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.np-res-cat:hover { background: var(--np-res-panel); color: var(--np-res-ink); }
.np-res-cat.np-res-active {
    background: var(--np-res-panel);
    border-color: var(--np-res-line);
    color: var(--np-res-ink);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.np-res-cat-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--np-res-line-2);
    flex: 0 0 auto;
}
.np-res-cat.np-res-active .np-res-cat-dot { background: #6E56CF; }
.np-res-cat-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.np-res-cat-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--np-res-ink-4);
    flex: 0 0 auto;
}

.np-res-synd { gap: 6px; }
.np-res-synd-link {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: var(--np-res-ink-3);
    text-decoration: none;
    padding: 1px 4px;
}
.np-res-synd-link:hover { color: #6E56CF; }
.np-res-synd-note {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--np-res-ink-4);
    margin: 6px 4px 0;
}

/* ---- main column ---- */
.np-res-main { min-width: 0; }
.np-res-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.np-res-query {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--np-res-ink-3);
    min-width: 0;
    display: flex;
    gap: 7px;
    align-items: baseline;
}
.np-res-query-prompt { color: #6E56CF; flex: 0 0 auto; }
.np-res-query-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.np-res-search {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--np-res-ink);
    border: 1px solid var(--np-res-line);
    border-radius: 8px;
    padding: 8px 13px;
    background: var(--np-res-panel);
    min-width: 220px;
}
.np-res-search::placeholder { color: var(--np-res-ink-4); }
.np-res-search:focus { outline: 2px solid #6E56CF; outline-offset: 1px; border-color: transparent; }

/* ---- grid + cards ---- */
.np-res-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.np-res-card {
    display: flex;
    flex-direction: column;
    gap: 11px;
    background: var(--np-res-panel);
    border: 1px solid var(--np-res-line);
    border-radius: 14px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s, box-shadow 0.16s;
}
.np-res-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(17,24,39,0.08); }
.np-res-card:focus-visible { outline: 2px solid #6E56CF; outline-offset: 2px; }

.np-res-media {
    height: 78px;
    border-radius: 9px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.np-res-media img { width: 100%; height: 100%; object-fit: cover; }
.np-res-media--tint { background: var(--np-res-t); }
.np-res-glyph::before {
    content: var(--np-res-g);
    color: var(--np-res-c);
    font-size: 26px;
    line-height: 1;
}

.np-res-card-body { display: flex; flex-direction: column; gap: 7px; flex: 1 1 auto; }
.np-res-card-type {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--np-res-c);
}
.np-res-card-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--np-res-ink);
}
.np-res-card-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--np-res-ink-3);
    margin-top: auto;
}
.np-res-card-cta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--np-res-c);
}

/* ---- empty state ---- */
.np-res-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 40px 4px;
}
.np-res-empty-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--np-res-ink-3);
}
.np-res-reset {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #6E56CF;
    background: transparent;
    border: 1px solid var(--np-res-line-2);
    border-radius: 7px;
    padding: 7px 13px;
    cursor: pointer;
}
.np-res-reset:hover { background: var(--np-res-panel); }

/* ---- suppress the sitewide newsletter band on this hub (simpler page) ---- */
body:has(main.np-res) #newsletter-section { display: none; }

/* ---- responsive ---- */
@media (max-width: 768px) {
    /* stack the hero: headline, then subtitle below */
    .np-res-hero-inner { display: block; }
    .np-res-h1 { margin-bottom: 16px; }
    .np-res-sub { max-width: 60ch; margin-bottom: 0; }
}
@media (max-width: 1080px) {
    .np-res-feed { grid-template-columns: 1fr; }
    .np-res-rail { position: static; flex-direction: row; flex-wrap: wrap; gap: 16px; }
    .np-res-rail-group { flex: 0 0 auto; }
    .np-res-cat { width: auto; }
    .np-res-synd { display: none; }
    .np-res-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .np-res-grid { grid-template-columns: 1fr; }
    .np-res-bar { flex-direction: column; align-items: stretch; }
    .np-res-search { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .np-res-card, .np-res-cat { transition: none; }
    .np-res-card:hover { transform: none; }
}
