/* ============================================================
   Category landing page - hero, tool grid, search, FAQ tweaks.
   All color accents inherit from the parent `.kx-ic-*` token
   (set on `.kx-cp-hero` via the category's `color` field), so
   each category page tints in its own hue.
   ============================================================ */

/* ─── Hero ─────────────────────────────────────────────── */

.kx-cp-hero {
    position: relative;
    padding: 56px 0 48px;
    overflow: hidden;
    border-bottom: 1px solid var(--hairline);
    background: var(--surface);
}

.kx-cp-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 75% 60% at 12% 14%, var(--ic-bg, var(--brand-soft)) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 90% 10%, var(--ic-bg, var(--brand-soft)) 0%, transparent 55%);
    opacity: .9;
}

.kx-cp-hero-inner {
    position: relative;
    z-index: 1;
}

.kx-cp-hero .kx-tool-breadcrumb {
    margin-bottom: 24px;
}

.kx-cp-hero-headline {
    max-width: 760px;
}

.kx-cp-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--ic-bg, var(--brand-soft));
    color: var(--ic-fg, var(--brand));
    font-size: 26px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-1);
}

.kx-cp-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    margin-bottom: 14px;
}
.kx-cp-hero-eyebrow .pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--ic-fg, var(--brand));
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}
.kx-cp-hero-eyebrow .dot { color: var(--ink-3); }

.kx-cp-hero-h1 {
    font-family: var(--font-body);
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin: 0 0 16px;
}

.kx-cp-hero-lead {
    font-size: 18px;
    line-height: 1.55;
    color: var(--ink-2);
    margin: 0 0 28px;
    max-width: 620px;
}
.kx-cp-hero-lead strong { color: var(--ink); font-weight: 600; }

/* ─── In-page search bar ───────────────────────────────── */

.kx-cp-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--hairline-strong);
    border-radius: 14px;
    box-shadow: var(--shadow-1);
    transition: border-color .15s ease, box-shadow .15s ease;
    max-width: 560px;
}
.kx-cp-search:focus-within {
    border-color: var(--ic-fg, var(--brand));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ic-fg, var(--brand)) 18%, transparent), var(--shadow-2);
}
.kx-cp-search > i {
    color: var(--ink-3);
    font-size: 18px;
}
.kx-cp-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font: 500 15px/1.4 var(--font-body);
}
.kx-cp-search input::placeholder { color: var(--ink-3); font-weight: 400; }
.kx-cp-search input::-webkit-search-cancel-button { display: none; }

.kx-cp-search-kbd {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    font: 600 12px/1 var(--font-mono);
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: 6px;
}
.kx-cp-search:focus-within .kx-cp-search-kbd { opacity: 0; }

.kx-cp-search-meta {
    margin-top: 10px;
    font-size: 13px;
    color: var(--ink-3);
}
.kx-cp-search-meta strong { color: var(--ink); font-weight: 600; }

/* ─── Tool grid (name + desc + CTA button) ─────────────── */

.kx-cp-grid-section { padding: 40px 0 24px; }

.kx-cp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
@media (max-width: 1000px) { .kx-cp-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px)  { .kx-cp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px)  { .kx-cp-grid { grid-template-columns: 1fr; } }

/* Tool card - mirrors .kx-cat-card so the "More categories" and
   "Tools in this category" sections feel like one cohesive grid. */
.kx-cp-tool {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--r-lg, 22px);
    text-decoration: none;
    color: inherit;
    transition: transform .18s var(--ease, ease), border-color .18s var(--ease, ease), box-shadow .18s var(--ease, ease);
    position: relative;
    overflow: hidden;
}
.kx-cp-tool:hover {
    transform: translateY(-3px);
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-2);
    color: inherit;
}
.kx-cp-tool[data-cp-hidden] { display: none; }

/* PRO page - category-grouped variant. Each group has a small header
   (category name + tool count) above its own .kx-cp-grid. */
.kx-cp-pro-group + .kx-cp-pro-group { margin-top: 36px; }
.kx-cp-pro-group[data-cp-hidden]    { display: none; }

.kx-cp-pro-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hairline);
}
.kx-cp-pro-group-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--ink);
}
.kx-cp-pro-group-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-3);
}

.kx-cp-tool-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--ic-bg, var(--surface-2));
    color: var(--ic-fg, var(--ink-2));
    border-radius: 12px;
    font-size: 22px;
}

.kx-cp-tool-name {
    margin: 0;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kx-cp-pro {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    color: var(--ic-fg, var(--brand));
    background: var(--ic-bg, var(--brand-soft));
    border-radius: 4px;
    text-transform: uppercase;
}

.kx-cp-tool-desc {
    margin: 0;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kx-cp-tool-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--hairline);
    font-size: 13px;
}
.kx-cp-tool-foot b {
    color: var(--ink);
    font-weight: 600;
}
.kx-cp-tool-foot .arrow {
    color: var(--brand);
    transition: transform .18s var(--ease, ease);
}
.kx-cp-tool:hover .kx-cp-tool-foot .arrow { transform: translateX(4px); }

/* ─── Empty-state when filter matches nothing ──────────── */

.kx-cp-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--ink-2);
}
.kx-cp-empty[hidden] { display: none; }
.kx-cp-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--ink-3);
    font-size: 24px;
    margin-bottom: 14px;
}
.kx-cp-empty h3 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
}
.kx-cp-empty p { margin: 0; font-size: 14px; }
.kx-cp-empty-reset {
    background: none;
    border: 0;
    padding: 0;
    color: var(--ic-fg, var(--brand));
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* ─── FAQ section tweaks (uses existing kx-faq-* styles) ── */

.kx-cp-faq-section { padding: 48px 0; background: var(--surface-2); }
.kx-cp-faq-section .kx-faq-aside h2 br { display: block; }

/* ─── Mobile ───────────────────────────────────────────── */

@media (max-width: 768px) {
    .kx-cp-hero { padding: 40px 0 36px; }
    .kx-cp-hero-icon { width: 48px; height: 48px; font-size: 22px; border-radius: 12px; }
    .kx-cp-hero-lead { font-size: 16px; }
    .kx-cp-grid-section { padding: 24px 0 16px; }
    .kx-cp-search { padding: 10px 12px; }
    .kx-cp-search-kbd { display: none; }
}
