/* ============================================================
   BizPlan AI Pro — Business Planning Blueprint hub (PHASE 4)
   Namespaced .bpq-* — loads only on the /blueprint/ page.
   Built on the deployed v5 design tokens (navy/indigo/purple,
   white workspace, restrained surfaces).
   ============================================================ */

.bpq {
    --bp-bg: #ffffff;
    --bp-surface: #f8fafc;
    --bp-surface-strong: #f1f5f9;
    --bp-text: #0f172a;
    --bp-text-muted: #55637a;
    --bp-border: #e2e8f0;
    --bp-primary: #4f46e5;
    --bp-primary-dark: #3730a3;
    --bp-primary-soft: #eef2ff;
    --bp-dark: #0b1120;
    --bp-radius: 12px;
    --bp-radius-lg: 16px;
    --bp-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .07);
    --bp-shadow-lg: 0 24px 60px -24px rgba(15, 23, 42, .28);
    --bp-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bp-max: 1180px;

    font-family: var(--bp-font);
    color: var(--bp-text);
    background: var(--bp-bg);
}

.bpq-container { max-width: var(--bp-max); margin: 0 auto; padding: 0 24px; }
.bpq-section { padding: 88px 0; background: var(--bp-bg); }
.bpq-surface { background: var(--bp-surface); }

/* ---------- type ---------- */
.bpq h1, .bpq h2, .bpq h3, .bpq h4 { font-family: var(--bp-font); color: var(--bp-text); margin: 0; }
.bpq p { margin: 0; }
.bpq a { text-decoration: none; }

.bpq-eyebrow {
    display: inline-block;
    font-size: .78rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
    color: var(--bp-primary); background: var(--bp-primary-soft);
    padding: 5px 12px; border-radius: 999px; margin: 0 0 10px;
}
.bpq-h1 {
    font-weight: 700; letter-spacing: -.025em;
    font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.08;
    margin: 12px 0 18px;
}
.bpq-lede {
    font-size: 1.135rem; line-height: 1.65; color: var(--bp-text-muted);
    max-width: 560px; margin-bottom: 30px;
}
.bpq-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.bpq-head-left { margin-left: 0; text-align: left; }
.bpq-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; margin-bottom: 12px; }
.bpq-head .bpq-sub { color: var(--bp-text-muted); font-size: 1.03rem; line-height: 1.65; }

/* ---------- buttons ---------- */
.bpq-btn {
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    font-family: var(--bp-font); font-weight: 600; font-size: .95rem; line-height: 1.2;
    padding: 13px 24px; border-radius: 10px; border: 1px solid transparent;
    cursor: pointer; white-space: nowrap;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.bpq-btn-primary { background: var(--bp-primary); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.4), 0 8px 20px -8px rgba(79,70,229,.55); }
.bpq-btn-primary:hover { background: var(--bp-primary-dark); color: #fff; transform: translateY(-1px); }
.bpq-btn-secondary { background: #fff; color: var(--bp-text); border-color: var(--bp-border); box-shadow: var(--bp-shadow); }
.bpq-btn-secondary:hover { border-color: #c7d2fe; color: var(--bp-primary-dark); }
.bpq-btn-light { background: #fff; color: var(--bp-primary-dark); }
.bpq-btn-light:hover { background: var(--bp-primary-soft); color: var(--bp-primary-dark); }
.bpq-btn-ghost { background: transparent; color: rgba(255,255,255,.95); border-color: rgba(255,255,255,.4); }
.bpq-btn-ghost:hover { border-color: rgba(255,255,255,.75); background: rgba(255,255,255,.08); color: #fff; }
.bpq-btn-sm { padding: 10px 18px; font-size: .88rem; }
.bpq-btn:focus-visible, .bpq a:focus-visible, .bpq input:focus-visible, .bpq select:focus-visible {
    outline: 2px solid var(--bp-primary); outline-offset: 2px; border-radius: 6px;
}

/* ---------- HERO ---------- */
.bpq-hero { background: var(--bp-bg); padding: 76px 0 84px; position: relative; overflow: hidden; }
.bpq-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(560px 300px at 85% 6%, rgba(79,70,229,.08), transparent 65%),
        linear-gradient(180deg, var(--bp-surface) 0%, var(--bp-bg) 46%);
}
.bpq-hero > .bpq-container { position: relative; }
.bpq-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 48px; align-items: center; }
.bpq-hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; }

.bpq-hero-rail {
    background: #fff; border: 1px solid var(--bp-border); border-radius: var(--bp-radius-lg);
    box-shadow: var(--bp-shadow-lg); padding: 10px;
}
.bpq-rail-link {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px; border-radius: 10px;
    color: var(--bp-text); font-weight: 600; font-size: .94rem;
}
.bpq-rail-link:hover { background: var(--bp-primary-soft); color: var(--bp-primary-dark); }
.bpq-rail-count {
    flex: 0 0 auto; min-width: 26px; text-align: center;
    font-size: .75rem; font-weight: 700; color: var(--bp-text-muted);
    background: var(--bp-surface-strong); border-radius: 999px; padding: 3px 8px;
}

/* ---------- chips (content-type badges) ---------- */
.bpq-chip {
    display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .08em;
    padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
    background: var(--bp-primary-soft); color: var(--bp-primary-dark);
}
.bpq-chip-guide      { background: #eef2ff; color: #3730a3; }
.bpq-chip-research   { background: #ecfdf5; color: #047857; }
.bpq-chip-tool       { background: #fff7ed; color: #c2410c; }
.bpq-chip-template   { background: #faf5ff; color: #7e22ce; }
.bpq-chip-example    { background: #f0f9ff; color: #0369a1; }
.bpq-chip-playbook   { background: #fefce8; color: #a16207; }
.bpq-chip-case       { background: #fdf2f8; color: #be185d; }
.bpq-chip-destination{ background: #f1f5f9; color: #475569; }

/* ---------- cards ---------- */
.bpq-grid { display: grid; gap: 22px; }
.bpq-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bpq-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.bpq-card {
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid var(--bp-border); border-radius: var(--bp-radius-lg);
    padding: 26px 24px; box-shadow: var(--bp-shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.bpq-card:hover { transform: translateY(-3px); box-shadow: var(--bp-shadow-lg); border-color: #c7d2fe; }
.bpq-card h3 { font-size: 1.09rem; line-height: 1.35; font-weight: 700; margin-bottom: 10px; }
.bpq-card h3 a { color: var(--bp-text); }
.bpq-card h3 a:hover { color: var(--bp-primary-dark); }
.bpq-card p { color: var(--bp-text-muted); font-size: .93rem; line-height: 1.6; flex: 1 1 auto; }
.bpq-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.bpq-read { color: var(--bp-primary); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.bpq-read:hover { color: var(--bp-primary-dark); }
.bpq-time { color: var(--bp-text-muted); font-size: .8rem; white-space: nowrap; }

.bpq-card-feature { border-top: 3px solid var(--bp-primary); }
.bpq-card-sm { padding: 20px; }
.bpq-card-sm h3 { font-size: .97rem; margin-bottom: 6px; }
.bpq-card-sm .bpq-card-foot { margin-top: 12px; }
.bpq-card-eco { border-style: dashed; background: var(--bp-surface); }
.bpq-card-eco:hover { border-style: solid; }

/* ---------- tiles (planning stack) ---------- */
.bpq-tile {
    display: block; background: #fff; border: 1px solid var(--bp-border);
    border-radius: var(--bp-radius-lg); padding: 26px 24px; box-shadow: var(--bp-shadow);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.bpq-tile:hover { transform: translateY(-3px); box-shadow: var(--bp-shadow-lg); border-color: #c7d2fe; }
.bpq-tile-k {
    display: inline-block; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: var(--bp-primary); margin-bottom: 10px;
}
.bpq-tile h3 { font-size: 1.06rem; font-weight: 700; margin-bottom: 8px; }
.bpq-tile p { color: var(--bp-text-muted); font-size: .92rem; line-height: 1.6; }

/* ---------- filter bar ---------- */
.bpq-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 30px; }
.bpq-input, .bpq-select {
    font-family: var(--bp-font); font-size: .93rem; color: var(--bp-text);
    background: #fff; border: 1px solid var(--bp-border); border-radius: 10px;
    padding: 11px 14px;
}
.bpq-input { flex: 1 1 260px; min-width: 0; }
.bpq-select { flex: 0 0 auto; max-width: 100%; }
.bpq-reset { color: var(--bp-text-muted); font-size: .88rem; font-weight: 600; }
.bpq-reset:hover { color: var(--bp-primary-dark); }
.bpq-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- library list ---------- */
.bpq-list { display: flex; flex-direction: column; gap: 14px; }
.bpq-row {
    display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; gap: 20px; align-items: center;
    background: #fff; border: 1px solid var(--bp-border); border-radius: var(--bp-radius-lg);
    padding: 20px 22px; box-shadow: var(--bp-shadow);
}
.bpq-row > .bpq-chip { margin-bottom: 0; justify-self: start; align-self: start; }
.bpq-row h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 5px; }
.bpq-row h3 a { color: var(--bp-text); }
.bpq-row h3 a:hover { color: var(--bp-primary-dark); }
.bpq-row p { color: var(--bp-text-muted); font-size: .9rem; line-height: 1.55; }
.bpq-row-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; color: var(--bp-text-muted); font-size: .78rem; }
.bpq-row-cat { color: var(--bp-primary-dark); font-weight: 600; }
.bpq-row-cta { align-self: center; }
.bpq-empty { color: var(--bp-text-muted); padding: 18px 2px; }
.bpq-empty a { color: var(--bp-primary); font-weight: 600; }

/* ---------- pagination ---------- */
.bpq-pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 34px; }
.bpq-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 10px;
    border: 1px solid var(--bp-border); border-radius: 10px; background: #fff;
    color: var(--bp-text); font-weight: 600; font-size: .9rem;
}
.bpq-pagination .page-numbers.current { background: var(--bp-primary); border-color: var(--bp-primary); color: #fff; }
.bpq-pagination .page-numbers:hover:not(.current) { border-color: #c7d2fe; color: var(--bp-primary-dark); }

/* ---------- CTA band ---------- */
.bpq-cta-band { background: linear-gradient(135deg, var(--bp-dark) 0%, #1e1b4b 100%); color: #fff; padding: 72px 0; }
.bpq-cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.bpq-cta-inner h2 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 10px; }
.bpq-cta-inner p { color: rgba(255,255,255,.75); font-size: 1rem; line-height: 1.6; max-width: 520px; }
.bpq-cta-actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- anchor offset for topic-rail links ---------- */
.bpq-section[id] { scroll-margin-top: 84px; }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
    .bpq-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bpq-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bpq-hero-grid { grid-template-columns: 1fr; gap: 36px; }
    .bpq-hero-rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .bpq-section { padding: 64px 0; }
    .bpq-hero { padding: 52px 0 60px; }
    .bpq-head { margin-bottom: 32px; }
    .bpq-row { grid-template-columns: 1fr; gap: 10px; }
    .bpq-row > .bpq-chip { justify-self: start; }
    .bpq-row-cta { justify-self: start; }
    .bpq-cta-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
    .bpq-grid-3, .bpq-grid-4 { grid-template-columns: 1fr; }
    .bpq-hero-rail { grid-template-columns: 1fr; }
    .bpq-filter { flex-direction: column; align-items: stretch; }
    .bpq-select { width: 100%; }
    .bpq-btn { width: 100%; }
    .bpq-cta-actions { width: 100%; }
}
@media (max-width: 480px) {
    .bpq-container { padding: 0 18px; }
    .bpq-h1 { font-size: 2rem; }
    .bpq-lede { font-size: 1.05rem; }
}
