/*
 * KanumHost Knowledge Base — visual refresh
 * Scope: public Support Manager knowledge-base pages only.
 * Does not change Blesta routes, content, permissions, or database records.
 */

:root {
    --kh-kb-ink: #172033;
    --kh-kb-muted: #64748b;
    --kh-kb-border: #e2e8f0;
    --kh-kb-surface: #ffffff;
    --kh-kb-soft: #f8fafc;
    --kh-kb-blue: #155eef;
    --kh-kb-blue-dark: #124ac4;
    --kh-kb-radius: 16px;
    --kh-kb-shadow: 0 8px 24px rgba(15, 23, 42, .045);
}

/* Main layout rhythm */
.navfix {
    margin-top: 0;
}

.section-title {
    margin: 30px 0 16px;
}

.section-title h3 {
    color: var(--kh-kb-ink);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.35;
    margin: 0 0 8px;
}

.section-title h3 > i {
    color: var(--kh-kb-blue);
    margin-right: 8px;
    font-size: .95em;
}

.section-title p {
    color: var(--kh-kb-muted);
    font-size: .98rem;
    font-style: normal;
    line-height: 1.6;
    margin: 0;
}

/* Search panel */
.card-kb {
    background: var(--kh-kb-surface) !important;
    border: 1px solid var(--kh-kb-border) !important;
    border-radius: var(--kh-kb-radius) !important;
    box-shadow: var(--kh-kb-shadow);
    font-size: 1rem;
    margin: 0 0 22px;
    padding: 18px !important;
    text-align: left;
}

.card-kb form {
    margin: 0;
}

.card-kb .input-group {
    align-items: stretch;
    display: flex;
    gap: 10px;
}

.card-kb .form-control {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px !important;
    box-shadow: none;
    color: var(--kh-kb-ink);
    font-size: 1rem;
    height: auto;
    min-height: 50px;
    padding: 12px 16px;
}

.card-kb .form-control:focus {
    border-color: var(--kh-kb-blue);
    box-shadow: 0 0 0 3px rgba(21, 94, 239, .12);
    outline: none;
}

.card-kb .form-control::placeholder {
    color: #8491a3;
    opacity: 1;
}

.card-kb .input-group-append {
    display: flex;
}

.card-kb .btn {
    align-items: center;
    background: var(--kh-kb-blue);
    border: 1px solid var(--kh-kb-blue);
    border-radius: 10px !important;
    color: #fff;
    display: inline-flex;
    font-size: .98rem;
    font-weight: 600;
    justify-content: center;
    min-height: 50px;
    padding: 11px 20px;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.card-kb .btn:hover,
.card-kb .btn:focus {
    background: var(--kh-kb-blue-dark);
    border-color: var(--kh-kb-blue-dark);
    color: #fff;
}

.card-kb .btn:focus-visible,
.categories a:focus-visible,
.breadcrumb a:focus-visible {
    outline: 3px solid rgba(21, 94, 239, .28);
    outline-offset: 3px;
}

/* Breadcrumbs */
.breadcrumb {
    background: transparent;
    border: 0;
    border-radius: 0;
    color: var(--kh-kb-muted);
    margin: 0 0 22px;
    padding: 0;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: var(--kh-kb-muted);
    font-size: .9rem;
}

.breadcrumb-item a:hover {
    color: var(--kh-kb-blue);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--kh-kb-ink);
    font-weight: 600;
}

/* Category cards */
.categories {
    margin-bottom: 12px;
}

.categories > .row {
    row-gap: 16px;
}

.categories .col-md-4,
.categories .col-sm-6 {
    margin-bottom: 14px;
}

.categories .col-md-4 > .bg-light,
.categories .col-sm-6 > .bg-light {
    background: var(--kh-kb-surface) !important;
    border: 1px solid var(--kh-kb-border);
    border-radius: var(--kh-kb-radius) !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .025);
    height: 100%;
    min-height: 132px;
    padding: 22px !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.categories .col-md-4 > .bg-light:hover,
.categories .col-sm-6 > .bg-light:hover {
    border-color: #b7cdfd;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
    transform: translateY(-2px);
}

.categories .col-md-4 > .bg-light > i,
.categories .col-sm-6 > .bg-light > i {
    align-items: center;
    background: #eef4ff;
    border-radius: 11px;
    color: var(--kh-kb-blue);
    display: inline-flex;
    font-size: 1.15rem;
    height: 42px;
    justify-content: center;
    margin: 0 0 14px;
    width: 42px;
}

.categories a {
    color: var(--kh-kb-blue);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none;
}

.categories a:hover {
    color: var(--kh-kb-blue-dark);
    text-decoration: none;
}

.categories p {
    color: var(--kh-kb-muted);
    font-size: .91rem;
    line-height: 1.6;
    margin: 8px 0 0;
}

/* Article rows: homepage, category and search results */
.categories .col-md-12 > .bg-light,
.categories > .col-md-12 {
    background: var(--kh-kb-surface);
    border: 1px solid var(--kh-kb-border);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 15px 18px;
    transition: border-color .18s ease, background .18s ease;
}

.categories .col-md-12 > .bg-light:hover {
    background: #f8fbff !important;
    border-color: #b7cdfd;
}

.categories .col-md-12 > .bg-light > i,
.categories > .col-md-12 > i {
    color: var(--kh-kb-blue);
    margin-right: 9px;
}

.categories .col-md-12 > .bg-light a,
.categories > .col-md-12 a {
    color: var(--kh-kb-ink);
    font-size: .98rem;
    font-weight: 600;
    text-decoration: none;
}

.categories .col-md-12 > .bg-light a:hover,
.categories > .col-md-12 a:hover {
    color: var(--kh-kb-blue);
}

/* Article reading experience */
.article {
    background: var(--kh-kb-surface);
    border: 1px solid var(--kh-kb-border);
    border-radius: var(--kh-kb-radius);
    color: #334155;
    font-size: 1rem;
    line-height: 1.8;
    margin-top: 20px;
    padding: clamp(20px, 4vw, 38px);
}

.article h1,
.article h2,
.article h3,
.article h4,
.article h5 {
    color: var(--kh-kb-ink);
    font-weight: 700;
    line-height: 1.35;
    margin: 1.65em 0 .65em;
}

.article h1 { font-size: 1.9rem; }
.article h2 { font-size: 1.55rem; }
.article h3 { font-size: 1.25rem; }
.article h4 { font-size: 1.1rem; }
.article h5 { font-size: 1rem; }

.article h1:first-child,
.article h2:first-child,
.article h3:first-child {
    margin-top: 0;
}

.article p {
    margin: 0 0 1.05rem;
}

.article a {
    color: var(--kh-kb-blue);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article ul,
.article ol {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
}

.article li {
    margin-bottom: .45rem;
}

.article code {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    color: #0f172a;
    font-size: .9em;
    padding: .12em .35em;
    overflow-wrap: anywhere;
}

.article table {
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.25rem 0;
    max-width: 100%;
    overflow: hidden;
    width: 100%;
}

.article th,
.article td {
    border-bottom: 1px solid var(--kh-kb-border);
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.article th {
    background: var(--kh-kb-soft);
    color: var(--kh-kb-ink);
    font-weight: 700;
}

.article blockquote {
    background: #f8fbff;
    border-left: 4px solid var(--kh-kb-blue);
    border-radius: 0 10px 10px 0;
    color: #475569;
    margin: 1.25rem 0;
    padding: 14px 18px;
}

.article img {
    border-radius: 10px;
    height: auto;
    max-width: 100%;
}

/* Article title */
.section-title h3 {
    overflow-wrap: anywhere;
}

/* Feedback / article rating */
.rate {
    background: var(--kh-kb-soft);
    border: 1px solid var(--kh-kb-border);
    border-radius: 14px;
    font-size: 1rem;
    margin: 24px 0 10px;
    padding: 18px 20px;
}

.rate h5 {
    color: var(--kh-kb-ink);
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.rate a {
    border: 1px solid var(--kh-kb-border);
    border-radius: 9px;
    margin-right: 8px;
    padding: 6px 10px;
    text-decoration: none;
}

.rate a.green { color: #15803d; }
.rate a.red { color: #b91c1c; }
.rate a.green:hover { background: #f0fdf4; }
.rate a.red:hover { background: #fef2f2; }
.rate p.voted { color: var(--kh-kb-muted); font-size: .9rem; }

/* Search result empty state and pagination */
.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1e40af;
    padding: 16px 18px;
}

div.pagination {
    margin-top: 22px;
}

/* Mobile */
@media (max-width: 767.98px) {
    .section-title {
        margin-top: 24px;
    }

    .section-title h3 {
        font-size: 1.2rem;
    }

    .card-kb {
        padding: 12px !important;
    }

    .card-kb .input-group {
        display: flex;
        flex-direction: column;
    }

    .card-kb .input-group-append,
    .card-kb .btn {
        width: 100%;
    }

    .categories .col-md-4 > .bg-light,
    .categories .col-sm-6 > .bg-light {
        min-height: 0;
        padding: 18px !important;
    }

    .article {
        border-radius: 12px;
        padding: 20px 16px;
    }

    .article table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .categories .col-md-4 > .bg-light,
    .categories .col-sm-6 > .bg-light,
    .categories .col-md-12 > .bg-light {
        transition: none;
    }
}

/* KanumHost KB refinement v2 — small finishing touches */

/* Let category cards use the available width instead of leaving a large empty column. */
.categories > .row > .col-md-4,
.categories > .row > .col-sm-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

/* Keep category cards visually balanced and align their descriptions consistently. */
.categories .col-md-4 > .bg-light,
.categories .col-sm-6 > .bg-light {
    min-height: 150px;
    padding: 24px !important;
}

.categories .col-md-4 > .bg-light > p,
.categories .col-sm-6 > .bg-light > p {
    margin-top: 12px;
}

/* Article content: more comfortable reading measure on wide screens. */
.article {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding: clamp(24px, 3.2vw, 42px);
}

.article p,
.article li {
    line-height: 1.8;
}

.article h1,
.article h2,
.article h3,
.article h4,
.article h5 {
    letter-spacing: -.015em;
}

.article hr {
    border: 0;
    border-top: 1px solid var(--kh-kb-border);
    margin: 1.75rem 0;
}

/* Give the article feedback panel a more deliberate, compact layout. */
.rate {
    max-width: 680px;
}

.rate .btn {
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.rate .btn:not(.disabled):hover {
    transform: translateY(-1px);
}

/* Better keyboard focus without changing the site's language or behavior. */
.article a:focus-visible,
.rate a:focus-visible,
.categories a:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(21, 94, 239, .28);
    outline-offset: 3px;
}

@media (max-width: 767.98px) {
    .categories > .row > .col-md-4,
    .categories > .row > .col-sm-6 {
        flex-basis: 100%;
        max-width: 100%;
    }

    .article {
        max-width: none;
        padding: 22px 18px;
    }
}
