/* ==================================================================
 * HostRomeo — Knowledgebase UI
 * Uses the tokens/buttons from css/billing.css (loaded before this).
 * ================================================================== */

/* ---------- Hero + search ---------- */
.hr-kb-hero {
    position: relative;
    overflow: hidden;
    background: var(--hr-ink);
    border-radius: 20px;
    padding: 36px 36px 32px;
    margin-bottom: 34px;
    color: rgba(255, 255, 255, .72);
    box-shadow: 0 30px 60px -28px rgba(14, 16, 25, .55);
}
.hr-kb-hero::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: var(--hr-gradient);
}
.hr-kb-hero__glow {
    position: absolute; right: -140px; top: -180px; width: 440px; height: 440px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(255, 46, 147, .38), rgba(138, 63, 252, .22) 55%, transparent 75%);
}
.hr-kb-hero > *:not(.hr-kb-hero__glow) { position: relative; }
.hr-kb-hero .hr-eyebrow { color: rgba(255, 255, 255, .6); }
.hr-kb-hero .hr-kb-hero__title {
    color: #fff !important;
    font-size: 30px !important;
    font-weight: 800 !important;
    letter-spacing: -.02em;
    margin: 8px 0 6px !important;
    line-height: 1.2 !important;
}
.hr-kb-hero .hr-kb-hero__sub { margin: 0 0 22px; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .72) !important; max-width: 560px; }

.hr-kb-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 999px;
    padding: 6px 6px 6px 50px;
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45);
    margin: 0;
}
.hr-kb-search > i {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    color: var(--hr-faint); font-size: 16px;
}
.hr-billing .hr-kb-search__input {
    flex: 1;
    min-width: 0;
    height: 46px !important;
    border: 0 !important;
    outline: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font: 500 16px/1 'Plus Jakarta Sans', sans-serif !important;
    color: var(--hr-text) !important;
    padding: 0 !important;
    margin: 0 !important;
}
.hr-kb-search__input::placeholder { color: var(--hr-faint); }
.hr-kb-search .hr-btn { height: 46px; padding: 0 26px !important; }
.hr-kb-search:focus-within { box-shadow: 0 0 0 4px rgba(255, 46, 147, .25), 0 10px 30px -12px rgba(0, 0, 0, .45); }
.hr-kb-search--light {
    border: 1px solid var(--hr-line);
    box-shadow: var(--hr-shadow);
    margin-bottom: 28px;
}
.hr-kb-search--light:focus-within { box-shadow: var(--hr-focus), var(--hr-shadow); border-color: rgba(138, 63, 252, .45); }

/* ---------- Section headings ---------- */
.hr-kb-section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    margin: 0 0 16px;
}
.hr-billing .hr-kb-section-head h3 {
    font-size: 20px !important;
    font-weight: 800 !important;
    color: var(--hr-text) !important;
    margin: 0 !important;
}
.hr-kb-count { font-size: 13px; color: var(--hr-muted); font-weight: 600; }

/* ---------- Category grid ---------- */
.hr-kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin-bottom: 38px;
}
.hr-kb-cat { position: relative; display: flex; }
.hr-billing a.hr-kb-cat__link {
    display: flex !important;
    gap: 14px;
    align-items: flex-start;
    width: 100%;
    padding: 18px !important;
    background: #fff;
    border: 1px solid var(--hr-line);
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    text-decoration: none !important;
    color: var(--hr-body) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    margin: 0 !important;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.hr-billing a.hr-kb-cat__link:hover,
.hr-billing a.hr-kb-cat__link:focus {
    transform: translateY(-2px);
    border-color: rgba(138, 63, 252, .35);
    box-shadow: 0 16px 32px -18px rgba(138, 63, 252, .45);
    text-decoration: none !important;
    outline: none;
}
.hr-kb-cat__icon {
    flex: none;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: #f3edff;
    color: var(--hr-purple);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    transition: background .18s ease, color .18s ease;
}
.hr-kb-cat__icon i { margin: 0 !important; font-size: 18px !important; color: inherit !important; }
.hr-kb-cat__link:hover .hr-kb-cat__icon { background: var(--hr-gradient); color: #fff; }
.hr-kb-cat__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hr-kb-cat__name { font-size: 15.5px; font-weight: 700; color: var(--hr-text); line-height: 1.3; }
.hr-kb-cat__desc {
    font-size: 13px; line-height: 1.5; color: var(--hr-muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hr-kb-cat__meta {
    margin-top: 4px;
    font-size: 12.5px; font-weight: 700; color: var(--hr-purple);
    display: inline-flex; align-items: center; gap: 6px;
}
.hr-kb-cat__meta i { font-size: 10px; transition: transform .18s ease; }
.hr-kb-cat__link:hover .hr-kb-cat__meta i { transform: translateX(3px); }

.hr-billing a.hr-kb-edit {
    position: absolute; right: 10px; top: 10px;
    font-size: 11px !important; font-weight: 600 !important;
    padding: 2px 8px !important; border-radius: 6px;
    background: #fff7e6; color: #b54708 !important;
    margin: 0 !important;
}

/* ---------- Article lists ---------- */
.hr-kb-list { overflow: hidden; margin-bottom: 38px; }
.hr-kb-item { position: relative; }
.hr-kb-item + .hr-kb-item { border-top: 1px solid var(--hr-line-soft); }
.hr-billing a.hr-kb-item__link {
    display: flex !important;
    align-items: center;
    gap: 16px;
    padding: 18px 22px !important;
    margin: 0 !important;
    text-decoration: none !important;
    color: var(--hr-body) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    transition: background-color .15s ease;
}
.hr-billing a.hr-kb-item__link:hover,
.hr-billing a.hr-kb-item__link:focus { background: #faf8ff; text-decoration: none !important; outline: none; }
.hr-kb-item__icon {
    flex: none;
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--hr-line-soft); color: var(--hr-muted);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px;
    transition: background .15s, color .15s;
}
.hr-kb-item__icon i { margin: 0 !important; font-size: 15px !important; color: inherit !important; }
.hr-kb-item__link:hover .hr-kb-item__icon { background: #f3edff; color: var(--hr-purple); }
.hr-kb-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hr-kb-item__title { font-size: 15.5px; font-weight: 700; color: var(--hr-text); line-height: 1.35; }
.hr-kb-item__link:hover .hr-kb-item__title { color: var(--hr-purple); }
.hr-kb-item__excerpt {
    font-size: 13.5px; color: var(--hr-muted); line-height: 1.5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hr-kb-item__chev { color: var(--hr-faint); font-size: 12px; transition: transform .15s, color .15s; }
.hr-kb-item__link:hover .hr-kb-item__chev { transform: translateX(3px); color: var(--hr-purple); }

/* ---------- Article page ---------- */
.hr-kb-article { overflow: hidden; margin-bottom: 34px; position: relative; }
.hr-kb-article::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--hr-gradient);
}
.hr-kb-article__head { padding: 30px 34px 22px; border-bottom: 1px solid var(--hr-line-soft); }
.hr-kb-article__head .hr-eyebrow i { color: var(--hr-purple); margin-right: 4px; }
.hr-billing .hr-kb-article__title {
    font-size: 28px !important; font-weight: 800 !important; line-height: 1.25 !important;
    color: var(--hr-text) !important; letter-spacing: -.02em; margin: 8px 0 14px !important;
}
.hr-kb-article__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 13px; color: var(--hr-muted); }
.hr-kb-article__meta i { color: var(--hr-faint); margin-right: 4px; }
.hr-kb-article__meta .fa-heart { color: var(--hr-pink); }
.hr-billing a.hr-kb-article__print {
    margin-left: auto;
    font-size: 13px !important; font-weight: 600 !important;
    color: var(--hr-body) !important; text-decoration: none !important;
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--hr-line);
}
.hr-billing a.hr-kb-article__print + a.hr-kb-article__print { margin-left: 0; }
.hr-billing a.hr-kb-article__print:hover { color: var(--hr-purple) !important; border-color: rgba(138, 63, 252, .45); }
.hr-kb-notice {
    margin: 20px 34px 0; padding: 12px 16px; border-radius: 12px;
    background: #ecfdf3; border: 1px solid #c7f0d8; color: #05603a; font-weight: 600; font-size: 14px;
}
.hr-kb-article__content.kb-article-content {
    padding: 28px 34px 30px !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--hr-body);
}
.hr-kb-article__content img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--hr-line); }

.hr-kb-rate {
    background: #fbfcfe;
    border-top: 1px solid var(--hr-line-soft);
    padding: 18px 34px;
}
.hr-kb-rate form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.hr-kb-rate__q { font-weight: 700; color: var(--hr-text); }
.hr-kb-rate__btns { display: flex; gap: 8px; }
.hr-kb-rate__result { color: var(--hr-muted); font-size: 13.5px; }

/* ---------- Help CTA ---------- */
.hr-kb-cta {
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
    background: var(--hr-ink);
    border-radius: 20px;
    padding: 26px 30px;
    color: rgba(255, 255, 255, .7);
}
.hr-kb-cta::after {
    content: ""; position: absolute; left: -80px; bottom: -160px; width: 360px; height: 300px; pointer-events: none;
    background: radial-gradient(closest-side, rgba(14, 165, 233, .3), rgba(138, 63, 252, .18) 55%, transparent 75%);
}
.hr-kb-cta > * { position: relative; z-index: 1; }
.hr-kb-cta .hr-kb-cta__title { color: #fff !important; font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; }
.hr-kb-cta .hr-kb-cta__text { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .72) !important; }
.hr-kb-cta__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Sidebar category list on KB pages ---------- */
.sidebar .list-group-item .badge,
.panel-sidebar .list-group-item .badge {
    background: #f3edff !important;
    color: var(--hr-purple) !important;
    border: 0 !important;
    min-width: 30px;
    text-align: center;
    font-size: 12px !important;
    padding: 4px 9px !important;
    line-height: 1.2 !important;
}
.sidebar .list-group-item.active .badge,
.sidebar .list-group-item:hover .badge {
    background: var(--hr-gradient) !important;
    color: #fff !important;
}
.sidebar a.list-group-item { display: flex !important; align-items: center; gap: 6px; }
.sidebar a.list-group-item .badge { order: 2; margin-left: auto; float: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
    .hr-kb-hero { padding: 26px 20px 22px; border-radius: 16px; }
    .hr-kb-hero .hr-kb-hero__title { font-size: 24px !important; }
    .hr-kb-search { padding-left: 42px; }
    .hr-kb-search > i { left: 16px; }
    .hr-kb-search .hr-btn { padding: 0 16px !important; }
    .hr-kb-article__head, .hr-kb-article__content.kb-article-content, .hr-kb-rate { padding-left: 20px !important; padding-right: 20px !important; }
    .hr-billing .hr-kb-article__title { font-size: 23px !important; }
    .hr-billing a.hr-kb-article__print { margin-left: 0; }
    .hr-kb-item__excerpt { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .hr-kb-cta { padding: 22px 20px; }
}

@media print {
    .hr-kb-cta, .hr-kb-rate, .sidebar { display: none !important; }
    .hr-kb-article { border: 0 !important; box-shadow: none !important; }
}
