/* Help Centre (/docs) - layout, typography, and component styling.
   Scoped under .docs-page / .docs-prose so it never leaks into unrelated
   public pages, and never touches shared layout classes (navbar, footer).
   Font sizes/weights/line-heights use !important throughout this file
   (not just .docs-prose) because global site stylesheets (site.css,
   Styles.css, dashboard.css) load earlier but can carry higher-specificity
   selectors (e.g. ".container p") that would otherwise silently override
   the deliberate Help Centre type scale below. */

.docs-page {
    font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
}

.docs-page * {
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
}

/* ---- Type scale (deliberate, limited set - do not add ad-hoc sizes) ---- */
.docs-page-title,
.docs-hero__title {
    font-size: 2rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #1a202c;
}

.docs-section__title {
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    color: #1a202c;
}

.docs-title,
.docs-category-card__title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #1a202c;
}

.docs-body-text,
.docs-article-row__title {
    font-size: 1.125rem !important;
    font-weight: 400 !important;
    line-height: 1.6 !important;
    color: #2d3748;
}

.docs-article-row__title {
    font-weight: 600 !important;
}

.docs-lead,
.docs-hero__lead,
.docs-category-card__desc,
.docs-article-row__subtitle,
.docs-subtitle {
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
    color: #4a5568;
}

.docs-meta,
.docs-article-row__meta,
.docs-category-card__count,
.docs-category-card__arrow,
.docs-badge,
.docs-clear-search,
.docs-breadcrumb {
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
}

/* ---- Layout container / section rhythm ---- */
.docs-container {
    max-width: 61.25rem !important; /* ~980px - guard against Bootstrap's own
        breakpoint-scoped .container max-width rules winning at lg/xl */
    margin-left: auto;
    margin-right: auto;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.docs-container--narrow {
    max-width: 50rem !important; /* ~800px, readable column for a single category's articles */
}

.docs-section {
    margin-bottom: 2.5rem; /* 40px */
}

.docs-section:last-of-type {
    margin-bottom: 0;
}

.docs-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.docs-section__title {
    margin: 0;
}

.docs-clear-search {
    color: #6c757d;
    text-decoration: none;
}

.docs-clear-search:hover {
    color: var(--elimys, #3A648A);
}

.docs-empty {
    text-align: center;
    color: #6c757d;
    padding: 2.5rem 1.5rem;
    font-size: 1.125rem;
}

/* ---- Breadcrumb ---- */
.docs-breadcrumb-wrap {
    margin-top: 1.5rem;
}

.docs-breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    color: #6c757d;
}

.docs-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

/* ---- Hero ---- */
.docs-hero {
    background-color: #EEF3F8;
    border-bottom: 1px solid #E1E8F0;
    padding: 3rem 1.25rem 2.5rem;
    text-align: center;
}

.docs-hero__inner {
    max-width: 61.25rem; /* matches .docs-container so hero and body align */
    margin: 0 auto;
}

.docs-hero--compact {
    padding: 2rem 1.25rem 1.75rem;
}

.docs-hero__title {
    margin-bottom: 0.65rem;
}

.docs-hero__title i {
    color: var(--elimys, #3A648A);
    margin-right: 0.5rem;
}

.docs-hero__lead {
    max-width: 640px;
    margin: 0 auto 1.75rem;
    color: #4a5568 !important;
}

/* Search bar: reuses the site's existing .elimys-search component (icon
   inside the pill, transparent input, integrated circular submit button,
   shared border/radius/hover/focus - see SearchBar.css) rather than a
   separate, disconnected input+button pairing. .elimys-search--docs only
   tunes sizing/typography for the Help Centre's larger type scale. */
.docs-search-wrap {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.elimys-search--docs {
    height: 48px;
}

.elimys-search--docs .elimys-search__icon {
    width: 46px;
    height: 46px;
}

.elimys-search--docs .elimys-search__input.form-control {
    height: 46px;
    font-size: 1rem !important;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
}

.elimys-search--docs .elimys-search__submit {
    width: 40px;
    height: 40px;
}

.docs-search--loading .elimys-search__icon i {
    opacity: 0.5;
}

/* Suggestion items rendered inside the shared .ui-autocomplete dropdown
   (base dropdown chrome - border/radius/shadow/z-index/hover - already
   comes from SearchBar.css; these rules only style each row's content). */
.docs-suggest-item {
    list-style: none;
}

.docs-suggest {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
}

.docs-suggest__title {
    font-size: 1rem;
    font-weight: 600;
    color: #1a202c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-suggest__title mark {
    background: transparent;
    color: var(--elimys, #3A648A);
    padding: 0;
}

.docs-suggest__meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.docs-suggest__badge {
    font-size: 0.8rem !important;
    padding: 0.1rem 0.5rem;
}

.docs-suggest__excerpt {
    font-size: 0.85rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.docs-suggest-empty {
    list-style: none;
    padding: 0.75rem;
    color: #6c757d;
    font-size: 0.9rem;
    text-align: center;
}

/* ---- Category cards ---- */
.docs-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.docs-category-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 0.625rem; /* 10px */
    padding: 1.5rem; /* 24px */
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.docs-category-card:hover,
.docs-category-card:focus-visible {
    box-shadow: 0 6px 18px rgba(26, 32, 44, 0.09);
    border-color: var(--elimys, #3A648A);
    transform: translateY(-2px);
    color: inherit;
    text-decoration: none;
}

.docs-category-card:focus-visible {
    outline: 2px solid var(--elimys, #3A648A);
    outline-offset: 2px;
}

.docs-category-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem; /* 44px */
    height: 2.75rem;
    border-radius: 0.5rem;
    background: #EEF3F8;
    color: var(--elimys, #3A648A);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.docs-category-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.docs-category-card__title {
    margin-bottom: 0.5rem;
}

.docs-category-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #eef0f3;
}

.docs-category-card__count {
    color: #6c757d;
}

.docs-category-card__arrow {
    display: flex;
    align-items: center;
    font-weight: 600 !important;
    color: var(--elimys, #3A648A);
}

.docs-category-card__arrow i {
    transition: transform 0.15s ease;
    margin-left: 0.35rem;
}

.docs-category-card:hover .docs-category-card__arrow i,
.docs-category-card:focus-visible .docs-category-card__arrow i {
    transform: translateX(4px);
}

/* ---- Subcategory pills (main category page) ---- */
.docs-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.5rem 0 2rem;
}

.docs-pill {
    padding: 0.5rem 1.1rem;
    border: 1px solid #d7dee6;
    border-radius: 2rem;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: #495057;
    text-decoration: none;
}

.docs-pill:hover,
.docs-pill:focus-visible {
    border-color: var(--elimys, #3A648A);
    color: var(--elimys, #3A648A);
    text-decoration: none;
}

/* ---- Article list panel (recently updated / category listing / search) ----
   A single contained card - not a full-bleed strip - housing one row per
   article, with a divider between rows only when there is more than one. */
.docs-article-panel {
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 0.625rem; /* 10px */
    overflow: hidden;
}

.docs-article-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.125rem 1.5rem; /* ~18px vertical, 24px horizontal */
    border-bottom: 1px solid #eef0f3;
    color: inherit;
    text-decoration: none;
}

.docs-article-panel .docs-article-row:last-child {
    border-bottom: 0;
}

.docs-article-row:hover,
.docs-article-row:focus-visible {
    background-color: #F5F8FB;
    color: inherit;
    text-decoration: none;
}

.docs-article-row:hover .docs-article-row__title,
.docs-article-row:focus-visible .docs-article-row__title {
    color: var(--elimys, #3A648A);
}

.docs-article-row:hover .docs-article-row__chevron,
.docs-article-row:focus-visible .docs-article-row__chevron {
    color: var(--elimys, #3A648A);
    transform: translateX(3px);
}

.docs-article-row:focus-visible {
    outline: 2px solid var(--elimys, #3A648A);
    outline-offset: -2px;
}

.docs-article-row__main {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.docs-article-row__title {
    transition: color 0.15s ease;
}

.docs-article-row__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #8a94a3;
}

.docs-article-row__chevron-area {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.5rem;
    margin-left: 1.5rem; /* keeps the chevron well clear of the panel edge */
}

.docs-article-row__chevron {
    color: #c3cad3;
    transition: color 0.15s ease, transform 0.15s ease;
}

.docs-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background: #EEF3F8;
    color: var(--elimys, #3A648A);
    font-weight: 600 !important;
}

/* ---- Support CTA callout ---- */
.docs-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    background: #EEF3F8;
    border: 1px solid #E1E8F0;
    border-radius: 0.625rem;
    padding: 1.75rem 2rem;
}

.docs-cta__title {
    display: block;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #1a202c;
}

.docs-cta__body {
    display: block;
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
    color: #6c757d;
    margin-top: 0.25rem;
}

.docs-cta__button {
    background: var(--elimys, #3A648A);
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem 1.4rem;
    font-weight: 600 !important;
    font-size: 1rem !important;
    text-decoration: none;
    white-space: nowrap;
}

.docs-cta__button:hover,
.docs-cta__button:focus-visible {
    background: #2c4d6b;
    color: #fff;
    text-decoration: none;
}

.docs-cta__button:focus-visible {
    outline: 2px solid #1a202c;
    outline-offset: 2px;
}

/* ---- Sidebar (article page) ---- */
.docs-sidebar {
    position: sticky;
    top: 90px;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 0.625rem;
    padding: 1.5rem;
}

.docs-sidebar-tree .docs-sidebar-link,
.docs-sidebar-link {
    display: block;
    padding: 0.4rem 0;
    color: #495057;
    text-decoration: none;
    font-size: 1rem !important;
    min-height: 32px;
}

.docs-sidebar-link--main {
    font-weight: 700 !important;
    color: #1a202c;
}

.docs-sidebar-link:hover,
.docs-sidebar-link:focus-visible {
    color: var(--elimys, #3A648A);
}

.docs-sidebar-link.active {
    color: var(--elimys, #3A648A);
    font-weight: 700 !important;
}

/* ---- Article body card ---- */
.docs-article {
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 0.625rem;
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .docs-article {
        padding: 1.75rem;
    }
}

@media (min-width: 992px) {
    .docs-article {
        padding: 2rem;
    }
}

/* Article content rendered from CKEditor - mirrors the Blog module's
   .blog-prose scoping approach so it overrides broad layout CSS without
   leaking into other pages. */
article .docs-prose * {
    font-family: Calibri, "Segoe UI", Arial, sans-serif !important;
    line-height: 1.6 !important;
}

article .docs-prose p {
    font-size: 1.125rem !important;
    font-weight: 400 !important;
    margin-bottom: 1.25rem !important;
    color: #2d3748 !important;
}

article .docs-prose h1 {
    font-size: 1.7rem !important;
    font-weight: 700 !important;
    margin-top: 2rem !important;
    margin-bottom: 1rem !important;
    color: #1a202c !important;
}

article .docs-prose h2 {
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    margin-top: 1.75rem !important;
    margin-bottom: 0.875rem !important;
    color: #1a202c !important;
}

article .docs-prose h3 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
    color: #2d3748 !important;
}

article .docs-prose h4,
article .docs-prose h5,
article .docs-prose h6 {
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
    color: #2d3748 !important;
}

article .docs-prose ul,
article .docs-prose ol {
    margin-left: 2rem !important;
    margin-bottom: 1.25rem !important;
    font-size: 1.125rem !important;
}

article .docs-prose li {
    margin-bottom: 0.5rem !important;
    color: #2d3748 !important;
}

article .docs-prose a {
    color: #0d6efd !important;
    text-decoration: underline !important;
}

article .docs-prose a:hover {
    color: #0a58ca !important;
}

article .docs-prose strong,
article .docs-prose b {
    font-weight: 700 !important;
    color: #1a202c !important;
}

article .docs-prose em,
article .docs-prose i {
    font-style: italic !important;
}

article .docs-prose blockquote {
    border-left: 4px solid var(--elimys, #3A648A) !important;
    padding: 1rem !important;
    margin: 1.5rem 0 !important;
    background-color: #f8f9fa !important;
    font-style: italic !important;
}

article .docs-prose code {
    background-color: #f1f3f5 !important;
    color: #e83e8c !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 0.25rem !important;
    font-family: "Courier New", monospace !important;
    font-size: 0.95em !important;
}

article .docs-prose pre {
    background-color: #2d3748 !important;
    color: #e2e8f0 !important;
    padding: 1rem !important;
    border-radius: 0.5rem !important;
    overflow-x: auto !important;
    margin-bottom: 1.25rem !important;
}

article .docs-prose pre code {
    background-color: transparent !important;
    color: inherit !important;
    padding: 0 !important;
}

/* Preserve CKEditor image markup/alignment/captions as-is - no forced overrides
   beyond making sure oversized images never break the layout. */
article .docs-prose img {
    max-width: 100% !important;
    height: auto !important;
}

article .docs-prose table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-bottom: 1.25rem !important;
}

article .docs-prose th,
article .docs-prose td {
    border: 1px solid #dee2e6 !important;
    padding: 0.75rem !important;
    text-align: left !important;
    font-size: 1.05rem !important;
}

article .docs-prose th {
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
}

/* Make wide CKEditor tables horizontally scrollable on small screens instead
   of overflowing/breaking the page layout. */
@media (max-width: 767.98px) {
    article .docs-prose table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
}

/* ---- Responsive tweaks ---- */
@media (max-width: 767.98px) {
    .docs-container {
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }

    .docs-section {
        margin-bottom: 2rem; /* 32px */
    }

    .docs-category-card {
        padding: 1.25rem; /* 20px */
    }

    .docs-article-row {
        padding: 1.125rem 1.5rem; /* 18px vertical, 24px horizontal - keeps the chevron clear of the edge */
    }

    .docs-article-row__chevron-area {
        margin-left: 1rem;
    }

    .docs-cta {
        padding: 1.25rem 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .docs-hero {
        padding: 2rem 1rem 1.75rem;
    }

    .docs-hero__title {
        font-size: 1.6rem !important;
    }

    .docs-hero__lead {
        font-size: 1rem !important;
    }

    .docs-cta {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
}
