/*
 * FAQ Answer Library — standalone customer portal FAQs only.
 *
 * IMPORTANT: Keep the existing portal header, banner, cart, breadcrumb, footer,
 * global typography and .categories-section/.faqs-content positioning intact.
 * Every selector here is scoped to .faq-library and its descendants.
 */

.faq-library {
    --faq-library-ink: #223047;
    --faq-library-muted: #75869c;
    --faq-library-edge: #dde5ed;
    --faq-library-red: var(--faq-accent, #c8202a);

    /*
     * Fill the existing centered .faqs-content container, which is also
     * used by the breadcrumb (max-width: 900px in the shared portal CSS).
     * This keeps both left edges aligned AND the outer margins equal,
     * without moving or styling the breadcrumb itself.
     */
    width: 100%;
    max-width: 100%;

    padding: 0 0 70px;
    text-align: left;
    color: var(--faq-library-ink);
}

.faq-library .faq-library-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 27px;
}

.faq-library .faq-library-heading {
    min-width: 0;
}

.faq-library .faq-library-eyebrow {
    display: inline-block;
    margin: 0 0 8px;
    color: var(--faq-library-red);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .13em;
}

.faq-library .faq-library-heading h2 {
    margin: 0 0 9px;
    font-size: clamp(27px, 3.1vw, 37px);
    font-weight: 700;
    letter-spacing: -.027em;
    line-height: 1.26;
    color: #202e41;
}

.faq-library .faq-library-heading p {
    margin: 0;
    color: var(--faq-library-muted);
    font-size: 14px;
    line-height: 1.75;
}

.faq-library .faq-library-total {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 6px 13px;
    border: 1px solid #e5eaf0;
    border-radius: 999px;
    background: #fbfcfd;
    color: #53647b;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}

.faq-library .faq-library-total-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--faq-library-red);
}

.faq-library .faq-library-search {
    position: relative;
    width: 100%;
    height: 58px;
    margin-bottom: 32px;
}

.faq-library .faq-library-search input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 58px;
    margin: 0;
    padding: 0 190px 0 53px;
    border: 1px solid #d6e0ea;
    border-radius: 12px;
    background: #fff;
    color: #25374f;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: 0 6px 16px rgba(29, 48, 76, .025);
    transition: border-color .17s ease, box-shadow .17s ease;
}

.faq-library .faq-library-search input::placeholder {
    color: #91a0b1;
    opacity: 1;
}

.faq-library .faq-library-search input:hover {
    border-color: #afbdcd;
}

.faq-library .faq-library-search input:focus-visible {
    border-color: #6084a8;
    box-shadow: 0 0 0 3px rgba(96, 132, 168, .17);
}

.faq-library .faq-library-search-icon {
    position: absolute;
    top: 50%;
    left: 19px;
    z-index: 1;
    display: inline-flex;
    transform: translateY(-50%);
    color: #8798ae;
    pointer-events: none;
}

.faq-library .faq-library-search-hint {
    position: absolute;
    top: 50%;
    right: 19px;
    transform: translateY(-50%);
    color: #94a2b2;
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
}

.faq-library .faq-library-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}

.faq-library .faq-library-section-heading h3 {
    margin: 0;
    color: #263448;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
}

.faq-library .faq-library-section-heading span {
    color: #91a0b1;
    font-size: 12px;
    line-height: 1.5;
}

.faq-library .faq-library-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.faq-library .faq-library-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 226px;
    margin: 0;
    padding: 25px 25px 27px;
    border: 1px solid var(--faq-library-edge);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(28, 47, 75, .012);
}

.faq-library .faq-library-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 20px;
    line-height: 1.5;
}

.faq-library .faq-library-number {
    color: var(--faq-library-red);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.faq-library .faq-library-card-label {
    color: #a1aec0;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: .11em;
}

.faq-library .faq-library-card h4 {
    margin: 0 0 16px;
    color: #24354e;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: normal;
    overflow-wrap: anywhere;
}

.faq-library .faq-library-accent-rule {
    display: block;
    width: 30px;
    height: 2px;
    min-height: 2px;
    margin: 0 0 16px;
    background: var(--faq-library-red);
    opacity: .47;
}

.faq-library .faq-library-card p {
    margin: 0;
    color: #687b92;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.82;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.faq-library .faq-library-empty,
.faq-library .faq-library-loading {
    padding: 36px 16px;
    border: 1px solid var(--faq-library-edge);
    border-radius: 14px;
    background: #fbfcfd;
    text-align: center;
    color: #70829a;
}

.faq-library .faq-library-empty h4 {
    margin: 0 0 7px;
    color: #263448;
    font-size: 18px;
    font-weight: 700;
}

.faq-library .faq-library-empty p {
    margin: 0;
    color: #748499;
    font-size: 14px;
    line-height: 1.65;
}

/* A clear, balanced action that matches the FAQ heading's navy palette. */
/* Use the same tenant primary button colors as the rest of the portal. */
.faq-library .faq-library-load-more {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 150px;
    min-height: 42px;
    margin: 24px auto 0;
    padding: 9px 16px;
    border: 1px solid var(--faq-load-more-bg, #1557d5);
    border-radius: 12px;
    background: var(--faq-load-more-bg, #1557d5);
    color: var(--faq-load-more-text, #ffffff);
    box-shadow: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: filter .16s ease;
}

.faq-library .faq-library-load-more:hover:not(:disabled) {
    border-color: var(--faq-load-more-bg, #1557d5);
    background: var(--faq-load-more-bg, #1557d5);
    color: var(--faq-load-more-text, #ffffff);
    filter: brightness(.94);
}

.faq-library .faq-library-load-more:focus-visible {
    outline: 2px solid var(--faq-load-more-bg, #1557d5);
    outline-offset: 3px;
}

.faq-library .faq-library-load-more:disabled {
    opacity: .7;
    cursor: wait;
}

.faq-library .faq-library-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex-wrap: wrap;
    margin: 25px 0 0;
    color: #8c9baf;
    font-size: 13px;
    line-height: 1.7;
}

.faq-library .faq-library-contact a {
    color: var(--faq-library-red);
    font-weight: 700;
    text-decoration: none;
}

.faq-library .faq-library-contact a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.faq-library .faq-library-contact a:focus-visible {
    outline: 2px solid #5d83a9;
    outline-offset: 3px;
}

@media (max-width: 991.98px) {
    .faq-library {
        /* At smaller widths use the parent's normal content area. */
        position: static;
        left: auto;
        width: 100%;
        transform: none;
    }
}

@media (max-width: 767.98px) {
    .faq-library {
        padding-bottom: 55px;
    }

    .faq-library .faq-library-intro {
        align-items: flex-start;
        gap: 13px;
        margin-bottom: 23px;
    }

    .faq-library .faq-library-eyebrow {
        margin-bottom: 8px;
    }

    .faq-library .faq-library-heading h2 {
        font-size: 28px;
    }

    .faq-library .faq-library-heading p {
        font-size: 13px;
    }

    .faq-library .faq-library-total {
        min-height: 32px;
        padding: 5px 9px;
        font-size: 11px;
    }

    .faq-library .faq-library-search,
    .faq-library .faq-library-search input {
        height: 54px;
    }

    .faq-library .faq-library-search {
        margin-bottom: 29px;
    }

    .faq-library .faq-library-search input {
        padding-left: 49px;
        padding-right: 15px;
    }

    .faq-library .faq-library-search-hint {
        display: none;
    }

    .faq-library .faq-library-section-heading h3 {
        font-size: 16px;
    }

    .faq-library .faq-library-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .faq-library .faq-library-card {
        min-height: 0;
        padding: 23px 22px 25px;
    }

    .faq-library .faq-library-card-meta {
        margin-bottom: 18px;
    }

    .faq-library .faq-library-card h4 {
        font-size: 16px;
    }
}

/* Match the existing portal breadcrumb's 8px inset at <= 640px.
 * Do not override or reposition the shared breadcrumb. */
@media (max-width: 640px) {
    .faq-library {
        box-sizing: border-box;
        padding-inline: 8px;
    }
}

@media (max-width: 420px) {
    .faq-library .faq-library-intro {
        align-items: flex-start;
    }

    .faq-library .faq-library-total {
        margin-top: 3px;
    }

    .faq-library .faq-library-heading h2 {
        font-size: 26px;
        line-height: 1.22;
    }
}

@media (prefers-reduced-motion: reduce) {
    .faq-library *,
    .faq-library *::before,
    .faq-library *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
