/* ==========================================================
   Playbooks — the workflow layer above tools and resources.
   Shares the NewPrompt design tokens but uses its own np-pb-*
   namespace and a workflow motif (numbered, connected steps)
   to stay visually distinct from the Resource Library.
   ========================================================== */

.np-pb-page { padding: 2.5rem 0 4rem; color: var(--np-text-primary); }

/* ── Hero ─────────────────────────────────────────────── */
.np-pb-hero { max-width: 760px; margin: 0 auto 2.25rem; text-align: center; }
.np-pb-hero-badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.8rem; margin-bottom: 1.1rem;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.01em;
    color: var(--np-accent-light);
    background: var(--np-accent-dim);
    border: 1px solid rgba(99,91,255,0.25);
    border-radius: 999px;
}
.np-pb-hero-badge-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--np-accent-light); box-shadow: 0 0 0 3px rgba(99,91,255,0.18);
}
.np-pb-hero-title { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.np-pb-hero-sub { font-size: 1.02rem; line-height: 1.6; color: var(--np-text-secondary); margin: 0; }

/* ── Filter bar ───────────────────────────────────────── */
.np-pb-filter-bar {
    display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
    margin-bottom: 2rem; padding: 0.9rem 1rem;
    background: var(--np-bg-card); border: 1px solid var(--np-border); border-radius: var(--np-radius);
}
.np-pb-search-wrap { position: relative; flex: 1 1 220px; min-width: 180px; }
.np-pb-search-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--np-text-muted); display: inline-flex; }
.np-pb-search-input {
    width: 100%; padding: 0.6rem 0.8rem 0.6rem 2.1rem;
    background: var(--np-bg-input); border: 1px solid var(--np-border); border-radius: var(--np-radius-sm);
    color: var(--np-text-primary); font-size: 0.92rem; font-family: var(--np-font);
}
.np-pb-search-input:focus { outline: none; border-color: var(--np-border-focus); }
.np-pb-filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.np-pb-filter-label { font-size: 0.78rem; font-weight: 600; color: var(--np-text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 0.2rem; }
.np-pb-pill {
    padding: 0.4rem 0.85rem; font-size: 0.85rem; font-weight: 600;
    color: var(--np-text-secondary); background: transparent;
    border: 1px solid var(--np-border); border-radius: 999px; cursor: pointer;
    transition: all 0.15s ease;
}
.np-pb-pill:hover { color: var(--np-text-primary); border-color: var(--np-accent); }
.np-pb-pill--active { color: #fff; background: var(--np-accent); border-color: var(--np-accent); }

/* ── Section header + count ───────────────────────────── */
.np-pb-section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.np-pb-section-title { font-size: 1.25rem; font-weight: 700; margin: 0; }
.np-pb-count { font-size: 0.85rem; color: var(--np-text-muted); margin: 0; }

/* ── Featured section — curated "start here" highlights ── */
.np-pb-featured { margin-bottom: 2.25rem; }
.np-pb-card--featured {
    border-color: rgba(99,91,255,0.35);
    background: linear-gradient(180deg, var(--np-accent-dim), var(--np-bg-card));
}
.np-pb-card--featured:hover { border-color: var(--np-accent); }
/* Featured marker — a plain white star in the card's top-right corner (not a button).
   pointer-events:none keeps the whole card clickable through it. */
.np-pb-badge--feat {
    position: absolute; top: 1.25rem; right: 1.3rem; z-index: 3;
    padding: 0; background: none; border: none;
    color: #fff; font-size: 0.95rem; line-height: 1;
    pointer-events: none;
}

/* ── Card grid ────────────────────────────────────────── */
.np-pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; }
.np-pb-card {
    position: relative;
    display: flex; flex-direction: column; gap: 0.7rem;
    padding: 1.3rem; background: var(--np-bg-card);
    border: 1px solid var(--np-border); border-radius: var(--np-radius);
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.np-pb-card:hover { border-color: var(--np-accent); transform: translateY(-2px); }
/* The filter/search JS toggles the [hidden] attribute; the explicit display:flex
   above would otherwise override the UA [hidden]{display:none}, so re-assert it. */
.np-pb-card[hidden] { display: none; }
.np-pb-card-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.np-pb-badge { display: inline-flex; align-items: center; padding: 0.22rem 0.6rem; font-size: 0.72rem; font-weight: 600; border-radius: 999px; }
.np-pb-badge--cat { color: var(--np-accent-light); background: var(--np-accent-dim); border: 1px solid rgba(99,91,255,0.25); }
.np-pb-badge--diff { color: var(--np-text-secondary); background: var(--np-bg-hover); border: 1px solid var(--np-border); }
.np-pb-badge--workflow { color: var(--np-success); background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); }
.np-pb-card-title { font-size: 1.1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.np-pb-card-link { color: var(--np-text-primary); text-decoration: none; }
.np-pb-card-link:hover { color: var(--np-accent-light); text-decoration: none; }
/* Stretched link: the title's ::after covers the whole card so the entire card
   is clickable (navigates to the playbook), while real links/buttons sit above. */
.np-pb-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.np-pb-card-summary { font-size: 0.9rem; line-height: 1.55; color: var(--np-text-secondary); margin: 0; flex: 1; }
.np-pb-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: 0.3rem; padding-top: 0.8rem; border-top: 1px solid var(--np-border); }
.np-pb-card-stat { font-size: 0.8rem; color: var(--np-text-muted); display: inline-flex; align-items: center; gap: 0.3rem; }
.np-pb-card-cta { position: relative; z-index: 2; margin-left: auto; font-size: 0.85rem; font-weight: 600; color: #6ee7a8; text-decoration: none; }
.np-pb-card-cta:hover { color: #34d77b; text-decoration: none; }
.np-pb-card-when { font-size: 0.82rem; line-height: 1.45; color: var(--np-text-muted); margin: 0; }
.np-pb-card-when-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--np-accent-light); margin-right: 0.35rem; }

/* ── Empty states ─────────────────────────────────────── */
.np-pb-empty { text-align: center; color: var(--np-text-muted); padding: 2rem 0; }
.np-pb-emptystate { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--np-border); border-radius: var(--np-radius); }
.np-pb-emptystate-icon { font-size: 2rem; color: var(--np-text-muted); }
.np-pb-emptystate h3 { margin: 0.6rem 0 0.4rem; }
.np-pb-emptystate p { color: var(--np-text-secondary); margin: 0; }
.np-pb-emptystate a { color: var(--np-accent-light); }

/* ── Breadcrumb ───────────────────────────────────────── */
.np-pb-breadcrumb { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.85rem; color: var(--np-text-muted); margin-bottom: 1.4rem; }
.np-pb-breadcrumb a { color: var(--np-text-secondary); text-decoration: none; }
.np-pb-breadcrumb a:hover { color: var(--np-accent-light); }

/* ── Detail hero ──────────────────────────────────────── */
.np-pb-detail-hero { margin-bottom: 2rem; }
.np-pb-detail-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.np-pb-detail-title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 0.7rem; }
.np-pb-detail-summary { font-size: 1.05rem; line-height: 1.6; color: var(--np-text-secondary); max-width: 720px; margin: 0; }

/* ── Detail layout ────────────────────────────────────── */
.np-pb-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.np-pb-detail-main { min-width: 0; display: flex; flex-direction: column; gap: 1.6rem; }
.np-pb-detail-aside { display: flex; flex-direction: column; gap: 1.1rem; position: sticky; top: 1.5rem; }

/* "Use this when" trigger — the first thing on the detail page, so a user can
   confirm they're on the right playbook before reading further. */
.np-pb-trigger {
    display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap;
    padding: 0.85rem 1.1rem;
    border: 1px solid rgba(99,91,255,0.3); border-left: 3px solid var(--np-accent);
    border-radius: var(--np-radius); background: var(--np-accent-dim);
}
.np-pb-trigger-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--np-accent-light); flex-shrink: 0; }
.np-pb-trigger-text { margin: 0; font-size: 0.95rem; line-height: 1.5; color: var(--np-text-primary); }

.np-pb-block { background: var(--np-bg-card); border: 1px solid var(--np-border); border-radius: var(--np-radius); padding: 1.4rem 1.5rem; }
.np-pb-block-title { font-size: 1.15rem; font-weight: 700; margin: 0 0 0.8rem; }
.np-pb-block-body { font-size: 0.97rem; line-height: 1.65; color: var(--np-text-secondary); margin: 0; }
.np-pb-block-intro { font-size: 0.92rem; line-height: 1.6; color: var(--np-text-muted); margin: 0 0 1.3rem; }
.np-pb-block--outcome { border-color: rgba(34,197,94,0.3); background: linear-gradient(180deg, rgba(34,197,94,0.05), var(--np-bg-card)); }

/* ── Steps (numbered, connected) ──────────────────────── */
.np-pb-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; }
.np-pb-step { position: relative; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 1rem; padding-bottom: 1.7rem; }
.np-pb-step:last-child { padding-bottom: 0; }
/* connector line between step numbers */
.np-pb-step::before {
    content: ""; position: absolute; left: 19px; top: 40px; bottom: 0;
    width: 2px; background: var(--np-border);
}
.np-pb-step:last-child::before { display: none; }
.np-pb-step-num {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1rem;
    color: #fff; background: var(--np-accent);
    border: 3px solid var(--np-bg); position: relative; z-index: 1;
}
.np-pb-step-body { min-width: 0; padding-top: 0.2rem; }
.np-pb-step-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4rem; }
.np-pb-step-desc { font-size: 0.94rem; line-height: 1.6; color: var(--np-text-secondary); margin: 0 0 0.7rem; }
.np-pb-step-goal {
    display: flex; gap: 0.55rem; align-items: baseline;
    font-size: 0.88rem; line-height: 1.5; color: var(--np-text-secondary);
    padding: 0.55rem 0.75rem; margin: 0 0 0.85rem;
    background: rgba(34,197,94,0.06); border-left: 2px solid var(--np-success); border-radius: var(--np-radius-sm);
}
.np-pb-step-goal-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--np-success); flex-shrink: 0; }

.np-pb-step-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.8rem; }
.np-pb-step-link {
    display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap;
    padding: 0.45rem 0.7rem; font-size: 0.85rem;
    background: var(--np-bg-input); border: 1px solid var(--np-border); border-radius: var(--np-radius-sm);
}
.np-pb-step-link-kind { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.12rem 0.4rem; border-radius: 4px; }
.np-pb-step-link--res .np-pb-step-link-kind { color: var(--np-accent-light); background: var(--np-accent-dim); }
.np-pb-step-link--tool .np-pb-step-link-kind { color: var(--np-text-secondary); background: var(--np-bg-hover); }
.np-pb-step-link-title { font-weight: 600; color: var(--np-text-primary); text-decoration: none; }
.np-pb-step-link-title:hover { color: var(--np-accent-light); }
.np-pb-step-link-rel { font-size: 0.78rem; color: var(--np-text-muted); }

.np-pb-step-open {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.86rem; font-weight: 600; color: var(--np-accent-light); text-decoration: none;
}
.np-pb-step-open:hover { color: var(--np-accent); }

/* ── Two-col (best/not for) ───────────────────────────── */
.np-pb-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.np-pb-list { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.92rem; line-height: 1.5; color: var(--np-text-secondary); }
.np-pb-list--yes { list-style: none; padding-left: 0; }
.np-pb-list--yes li { position: relative; padding-left: 1.5rem; }
.np-pb-list--yes li::before { content: "✓"; position: absolute; left: 0; color: var(--np-success); font-weight: 700; }
.np-pb-list--no { list-style: none; padding-left: 0; }
.np-pb-list--no li { position: relative; padding-left: 1.5rem; }
.np-pb-list--no li::before { content: "✕"; position: absolute; left: 0; color: var(--np-text-muted); font-weight: 700; }

/* ── FAQ ──────────────────────────────────────────────── */
.np-pb-faq { display: flex; flex-direction: column; gap: 0.6rem; }
.np-pb-faq-item { border: 1px solid var(--np-border); border-radius: var(--np-radius-sm); padding: 0.7rem 0.9rem; background: var(--np-bg-input); }
.np-pb-faq-q { font-weight: 600; cursor: pointer; color: var(--np-text-primary); font-size: 0.94rem; }
.np-pb-faq-q::marker { color: var(--np-accent-light); }
.np-pb-faq-a { font-size: 0.9rem; line-height: 1.6; color: var(--np-text-secondary); margin: 0.6rem 0 0; }

/* ── Aside cards ──────────────────────────────────────── */
.np-pb-aside-card { padding: 1.1rem 1.2rem; }
.np-pb-aside-title { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--np-text-muted); margin-bottom: 0.75rem; }
.np-pb-glance { margin: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.np-pb-glance-row { display: grid; grid-template-columns: 56px 1fr; gap: 0.6rem; align-items: baseline; }
.np-pb-glance-row dt { font-size: 0.76rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--np-text-muted); margin: 0; }
.np-pb-glance-row dd { font-size: 0.9rem; color: var(--np-text-secondary); margin: 0; line-height: 1.45; }

.np-pb-rel-list { display: flex; flex-direction: column; gap: 0.5rem; }
.np-pb-rel-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; background: var(--np-bg-input); border: 1px solid var(--np-border); border-radius: var(--np-radius-sm); text-decoration: none; transition: border-color 0.15s ease; }
.np-pb-rel-item:hover { border-color: var(--np-accent); text-decoration: none; }
.np-pb-rel-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--np-accent-dim); color: var(--np-accent-light); font-size: 0.8rem; flex-shrink: 0; }
.np-pb-rel-icon--res { background: rgba(34,197,94,0.1); color: var(--np-success); }
.np-pb-rel-title { font-size: 0.88rem; font-weight: 600; color: var(--np-text-primary); flex: 1; min-width: 0; }
.np-pb-rel-arrow { color: var(--np-text-muted); }

/* ── Discovery layer: Recommended Next + Related Workflows ── */
.np-pb-disc { margin-top: 2rem; }
.np-pb-disc-hdr { font-size: 1.25rem; font-weight: 700; margin: 0 0 1rem; }
.np-pb-disc-sub { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--np-text-muted); margin: 1.5rem 0 0.8rem; }

/* Recommended Next — the prominent, accent-framed card */
.np-pb-next {
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 1.3rem 1.5rem;
    border: 1px solid var(--np-accent); border-radius: var(--np-radius);
    background: linear-gradient(180deg, var(--np-accent-dim), var(--np-bg-card));
    text-decoration: none; transition: border-color 0.15s ease, transform 0.12s ease;
}
.np-pb-next:hover { border-color: var(--np-accent-light); transform: translateY(-2px); text-decoration: none; }
.np-pb-next-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--np-accent-light); }
.np-pb-next-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; color: #fff; }
.np-pb-next-summary { font-size: 0.95rem; line-height: 1.55; color: var(--np-text-secondary); }
.np-pb-next-when { font-size: 0.85rem; line-height: 1.45; color: var(--np-text-muted); margin-top: 0.1rem; }
.np-pb-next-when-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--np-accent-light); margin-right: 0.35rem; }
.np-pb-next-cta { margin-top: 0.4rem; font-size: 0.9rem; font-weight: 700; color: var(--np-accent-light); }

/* Related Workflows — quieter card grid */
.np-pb-related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.np-pb-related-card {
    display: flex; flex-direction: column; gap: 0.45rem;
    padding: 1.1rem 1.2rem;
    background: var(--np-bg-card); border: 1px solid var(--np-border); border-radius: var(--np-radius);
    text-decoration: none; transition: border-color 0.15s ease, transform 0.12s ease;
}
.np-pb-related-card:hover { border-color: var(--np-accent); transform: translateY(-2px); text-decoration: none; }
.np-pb-related-cat { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--np-accent-light); }
.np-pb-related-title { font-size: 1rem; font-weight: 700; color: var(--np-text-primary); line-height: 1.3; }
.np-pb-related-summary { font-size: 0.86rem; line-height: 1.5; color: var(--np-text-secondary); flex: 1; }
.np-pb-related-when { font-size: 0.78rem; line-height: 1.4; color: var(--np-text-muted); }
.np-pb-related-when-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--np-accent-light); margin-right: 0.3rem; }
.np-pb-related-cta { font-size: 0.84rem; font-weight: 600; color: #6ee7a8; margin-top: 0.1rem; }
.np-pb-related-card:hover .np-pb-related-cta { color: #34d77b; }

/* ── Tip bar ──────────────────────────────────────────── */
.np-pb-tipbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; margin-top: 2rem; padding: 1rem 1.3rem; background: linear-gradient(180deg, var(--np-accent-dim), var(--np-bg-card)); border: 1px solid rgba(99,91,255,0.25); border-radius: var(--np-radius); }
.np-pb-tipbar-icon { color: var(--np-accent-light); display: inline-flex; flex-shrink: 0; }
.np-pb-tipbar-text { flex: 1; min-width: 200px; margin: 0; font-size: 0.9rem; color: var(--np-text-secondary); }
.np-pb-tipbar-btn { font-size: 0.88rem; font-weight: 600; color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a); padding: 0.5rem 1rem; border-radius: var(--np-radius-sm); text-decoration: none; white-space: nowrap; }
.np-pb-tipbar-btn:hover { background: linear-gradient(135deg, #34d77b, #22c55e); text-decoration: none; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
    .np-pb-detail-layout { grid-template-columns: 1fr; }
    .np-pb-detail-aside { position: static; }
}
@media (max-width: 560px) {
    .np-pb-two-col { grid-template-columns: 1fr; }
    .np-pb-grid { grid-template-columns: 1fr; }
    .np-pb-card-foot { gap: 0.6rem; }
}
