/* ─── Resources pages — np-res-* ────────────────────────────────
   Shared between /resources (hub) and /resources/{slug} (detail)
   ──────────────────────────────────────────────────────────────── */

.np-res-page {
    padding: 3rem 0 5rem;
}

/* ─── Hero (hub) ─────────────────────────────────────────────── */
.np-res-hero {
    max-width: 640px;
    margin-bottom: 3.5rem;
}


.np-res-hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--np-text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.np-res-hero-sub {
    font-size: 1rem;
    color: var(--np-text-secondary);
    line-height: 1.65;
}

/* ─── Filter bar ────────────────────────────────────────────── */
.np-res-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    padding: 1rem 1.25rem;
    background: var(--np-bg-card);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius-sm);
}

.np-res-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.np-res-search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--np-text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.np-res-search-input {
    width: 100%;
    background: var(--np-bg-input);
    border: 1px solid var(--np-border);
    border-radius: 8px;
    color: var(--np-text-primary);
    font: inherit;
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem 0.55rem 2.2rem;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}

.np-res-search-input:focus {
    border-color: var(--np-border-focus);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.np-res-search-input::placeholder { color: var(--np-text-muted); }

/* Remove default search clear button in webkit */
.np-res-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.np-res-filter-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    align-items: flex-start;
}

.np-res-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.4rem;
}

.np-res-filter-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--np-text-muted);
    margin-right: 0.15rem;
    white-space: nowrap;
}

.np-res-pill {
    padding: 0.28rem 0.7rem;
    background: transparent;
    border: 1px solid var(--np-border);
    border-radius: 6px;
    color: var(--np-text-secondary);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    line-height: 1.4;
}

.np-res-pill:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(99,102,241,0.25);
    color: var(--np-text-primary);
}

.np-res-pill--active {
    background: rgba(99,102,241,0.16);
    border-color: rgba(99,102,241,0.35);
    color: var(--np-accent-light);
}

.np-res-pill--active:hover {
    background: rgba(99,102,241,0.22);
}


/* ─── Empty state ────────────────────────────────────────────── */
.np-res-empty {
    padding: 2rem 0;
    color: var(--np-text-muted);
    font-size: 0.9rem;
    text-align: center;
}

/* ─── Section ────────────────────────────────────────────────── */
.np-res-section {
    margin-bottom: 3.5rem;
}

.np-res-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--np-text-muted);
    margin-bottom: 1.25rem;
}

/* ─── Grids ──────────────────────────────────────────────────── */
.np-res-grid--featured {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.np-res-grid--all {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

/* ─── Card ───────────────────────────────────────────────────── */
.np-res-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: var(--np-bg-card);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    padding: 1.25rem 1.375rem 1.125rem;
    transition: border-color 0.15s, background 0.15s;
}

/* display:flex above would override the UA [hidden]{display:none} rule —
   restore it explicitly so JS can toggle card.hidden */
.np-res-card[hidden] { display: none; }

/* Featured cards in Browse are hidden until a filter makes them relevant.
   Two-class selector (0,2,0) beats .np-res-card (0,1,0) regardless of order. */
.np-res-card.np-res-card--in-featured { display: none; }
[data-res-filter-active] .np-res-card.np-res-card--in-featured { display: flex; }

.np-res-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at top left, rgba(99,91,255,0.07), transparent 60%);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.np-res-card:hover {
    border-color: rgba(99, 91, 255, 0.28);
}

.np-res-card:hover::before { opacity: 1; }

.np-res-card--featured {
    padding: 1.5rem 1.625rem 1.375rem;
}

/* ─── Card meta row ──────────────────────────────────────────── */
.np-res-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

/* ─── Badges ─────────────────────────────────────────────────── */
.np-res-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.4;
    white-space: nowrap;
}

.np-res-badge--cat {
    background: rgba(99, 91, 255, 0.12);
    color: var(--np-accent-light);
    border: 1px solid rgba(99, 91, 255, 0.2);
}

.np-res-badge--diff { border: 1px solid transparent; }
.np-res-badge--diff-beginner    { background: rgba(34, 197, 94, 0.1);  color: #86efac; border-color: rgba(34,197,94,0.2); }
.np-res-badge--diff-intermediate{ background: rgba(251,191,36, 0.1);  color: #fbbf24; border-color: rgba(251,191,36,0.2); }
.np-res-badge--diff-advanced    { background: rgba(239, 68, 68, 0.1);  color: #fca5a5; border-color: rgba(239,68,68,0.2); }

/* ─── Card title / summary ───────────────────────────────────── */
.np-res-card-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--np-text-primary);
    margin: 0;
}

.np-res-card-link {
    color: inherit;
    text-decoration: none;
}

.np-res-card-link:hover { color: var(--np-accent-light); text-decoration: none; }

.np-res-card-summary {
    font-size: 0.84rem;
    color: var(--np-text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* ─── Model chips ────────────────────────────────────────────── */
.np-res-card-models {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.np-res-model-chip {
    padding: 0.15rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--np-border);
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--np-text-muted);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ─── Tags ───────────────────────────────────────────────────── */
.np-res-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.np-res-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--np-border);
    border-radius: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--np-text-muted);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ─── Card hint (microcopy) ──────────────────────────────────── */
.np-res-card-hint {
    font-size: 0.78rem;
    color: var(--np-text-muted);
    line-height: 1.45;
    margin: 0;
}

.np-res-tag--header {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--np-border);
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--np-text-secondary);
    white-space: nowrap;
}

/* ─── Card CTA ───────────────────────────────────────────────── */
.np-res-card-cta {
    display: inline-flex;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--np-accent-light);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.np-res-card-cta:hover { color: var(--np-text-primary); text-decoration: none; }

/* ═══════════════════════════════════════════════════════════════
   DETAIL PAGE
   ═══════════════════════════════════════════════════════════════ */

/* ─── Breadcrumb ─────────────────────────────────────────────── */
.np-res-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--np-text-muted);
    margin-bottom: 2rem;
}

.np-res-breadcrumb a {
    color: var(--np-text-secondary);
    text-decoration: none;
}

.np-res-breadcrumb a:hover { color: var(--np-text-primary); }

/* ─── Detail hero ────────────────────────────────────────────── */
.np-res-detail-hero {
    margin-bottom: 3rem;
    max-width: 780px;
}

.np-res-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 1rem;
    align-items: center;
}

.np-res-detail-title {
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--np-text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.15;
}

.np-res-detail-summary {
    font-size: 1rem;
    color: var(--np-text-secondary);
    line-height: 1.65;
}

/* ─── Layout ─────────────────────────────────────────────────── */
.np-res-detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 900px) {
    .np-res-detail-layout {
        grid-template-columns: 1fr;
    }
}

/* ─── Content blocks ─────────────────────────────────────────── */
.np-res-block {
    margin-bottom: 2rem;
}

.np-res-block-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--np-text-muted);
    margin-bottom: 0.875rem;
}

.np-res-block-body {
    font-size: 0.9375rem;
    color: var(--np-text-secondary);
    line-height: 1.7;
}

/* ─── Two-col ────────────────────────────────────────────────── */
.np-res-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .np-res-two-col { grid-template-columns: 1fr; }
}

/* ─── Lists ──────────────────────────────────────────────────── */
.np-res-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.np-res-list li {
    font-size: 0.875rem;
    color: var(--np-text-secondary);
    line-height: 1.5;
    padding-left: 1.1rem;
    position: relative;
}

.np-res-list li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: var(--np-text-muted);
}

.np-res-list--yes li::before { content: '✓'; color: #86efac; font-size: 0.7rem; top: 0.15rem; }
.np-res-list--no  li::before { content: '✕'; color: #fca5a5; font-size: 0.7rem; top: 0.15rem; }
.np-res-list--why li::before { content: '→'; color: var(--np-accent-light); font-size: 0.72rem; top: 0.1rem; }

/* ─── Workflow steps ─────────────────────────────────────────── */
.np-res-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.np-res-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.np-res-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(99, 91, 255, 0.15);
    border: 1px solid rgba(99, 91, 255, 0.25);
    color: var(--np-accent-light);
    font-size: 0.75rem;
    font-weight: 700;
}

.np-res-step-body { flex: 1; }

.np-res-step-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 650;
    color: var(--np-text-primary);
    margin-bottom: 0.2rem;
}

.np-res-step-desc {
    font-size: 0.84rem;
    color: var(--np-text-secondary);
    line-height: 1.55;
    margin: 0;
}

/* ─── Aside ──────────────────────────────────────────────────── */
.np-res-detail-aside {
    position: sticky;
    top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.np-res-prompt-block {
    background: var(--np-bg-card);
    border: 1px solid var(--np-border);
    border-radius: var(--np-radius);
    padding: 1rem 1.25rem;
    overflow: hidden;
}

.np-res-prompt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}

.np-res-prompt-header .np-res-block-title { margin-bottom: 0; }

.np-res-copy-btn {
    padding: 0.35rem 0.9rem;
    background: rgba(99, 91, 255, 0.12);
    border: 1px solid rgba(99, 91, 255, 0.25);
    border-radius: 7px;
    color: var(--np-accent-light);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.np-res-copy-btn:hover {
    background: rgba(99, 91, 255, 0.2);
    border-color: rgba(99, 91, 255, 0.4);
}

.np-res-prompt-pre {
    margin: 0;
    padding: 0.875rem 1rem;
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--np-border);
    border-radius: 8px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.775rem;
    line-height: 1.6;
    color: var(--np-text-secondary);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.np-res-prompt-pre code {
    background: none;
    padding: 0;
    font: inherit;
    color: inherit;
}

/* ─── Open in Generator block ────────────────────────────────── */
.np-res-open-block {
    background: rgba(99, 91, 255, 0.06);
    border: 1px solid rgba(99, 91, 255, 0.22);
    border-radius: var(--np-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.np-res-open-title {
    color: var(--np-accent-light) !important;
}

.np-res-open-desc {
    font-size: 0.84rem;
    color: var(--np-text-secondary);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.np-res-open-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 9px;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.np-res-open-btn--active {
    background: rgba(99, 91, 255, 0.85);
    border: 1px solid rgba(99, 91, 255, 0.9);
    color: #fff;
    cursor: pointer;
}

.np-res-open-btn--active:hover {
    background: rgba(99, 91, 255, 1);
    border-color: rgba(99, 91, 255, 1);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(99, 91, 255, 0.35);
}

button.np-res-open-btn[disabled] {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--np-border);
    color: var(--np-text-muted);
    cursor: not-allowed;
    opacity: 0.65;
}

/* ─── Prompt block (secondary) ───────────────────────────────── */

/* ─── Related tools links ────────────────────────────────────── */
.np-res-tool-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.np-res-tool-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--np-border);
    border-radius: 9px;
    text-decoration: none;
    transition: border-color 0.12s, background 0.12s;
}

.np-res-tool-link:hover {
    border-color: rgba(99,91,255,0.25);
    background: rgba(99,91,255,0.06);
    text-decoration: none;
}

.np-res-tool-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.np-res-tool-name {
    flex: 1;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--np-text-secondary);
}

.np-res-tool-link:hover .np-res-tool-name { color: var(--np-text-primary); }

.np-res-tool-arrow {
    color: var(--np-text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
    .np-res-grid--featured,
    .np-res-grid--all {
        grid-template-columns: 1fr;
    }

    .np-res-detail-aside {
        position: static;
    }
}
