/* =============================================================================
   KNOWLEDGE BASE — CSS
   Peptide Science: A Knowledge Base
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Index Page
   ----------------------------------------------------------------------------- */

.kb-index-header {
    margin-bottom: 1.25rem;
}

.kb-index-intro {
    font-size: 1.05em;
    color: #666;
    max-width: 800px;
    margin-bottom: 0;
}

/* Stats — compact inline */
.kb-stats-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.95em;
    color: #666;
}

.kb-stats-inline strong {
    color: var(--aps-blue);
    font-weight: 700;
}

.kb-stat-divider {
    color: #ccc;
}

/* Search */
.kb-search {
    margin-bottom: 2rem;
    max-width: 600px;
}

.kb-search-wrapper {
    position: relative;
}

.kb-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.kb-search-input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.kb-search-input:focus {
    outline: none;
    border-color: var(--aps-blue);
}

/* Search results */
.kb-search-result {
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
}

.kb-search-result h3 {
    font-size: 1.1em;
    margin-bottom: 0.3rem;
}

.kb-search-result h3 a {
    color: var(--aps-text);
    text-decoration: none;
}

.kb-search-result h3 a:hover {
    color: var(--aps-blue);
}

/* Accordion — Parts */
.kb-accordion {
    margin-bottom: 2rem;
}

.kb-accordion-item {
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.kb-accordion-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    font-size: 1em;
    background: #fff !important;
    box-shadow: none !important;
}

.kb-accordion-btn:not(.collapsed) {
    background: #f8f9fb !important;
}

.kb-acc-part-label {
    font-weight: 700;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--aps-blue);
    white-space: nowrap;
}

.kb-acc-part-title {
    font-weight: 600;
    color: var(--aps-text);
    flex-grow: 1;
}

.kb-acc-badge {
    font-size: 0.7em;
    flex-shrink: 0;
}

.kb-acc-chapter-count {
    font-size: 0.8em;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.kb-accordion-body {
    padding: 0.5rem 1.25rem 1rem;
}

.kb-acc-part-desc {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

/* Chapter rows inside accordion */
.kb-chapter-list {
    display: flex;
    flex-direction: column;
}

.kb-chapter-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.5rem;
    text-decoration: none;
    color: var(--aps-text);
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.kb-chapter-row:last-child {
    border-bottom: none;
}

.kb-chapter-row:hover {
    background: #f5f7fa;
    color: var(--aps-blue);
}

.kb-chapter-row-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 10px;
    background: var(--aps-blue);
    color: #fff;
    font-weight: 700;
    font-size: 0.72em;
    border-radius: 12px;
    flex-shrink: 0;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.kb-chapter-row-title {
    flex-grow: 1;
    font-weight: 500;
    font-size: 0.92em;
}

.kb-chapter-row-count {
    font-size: 0.78em;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.kb-chapter-row-arrow {
    color: #ccc;
    font-size: 0.75em;
    flex-shrink: 0;
    transition: color 0.15s;
}

.kb-chapter-row:hover .kb-chapter-row-arrow {
    color: var(--aps-blue);
}

/* Chapter row as button (nested accordion on index) */
button.kb-chapter-row {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    text-align: left;
}

button.kb-chapter-row .kb-chapter-row-arrow {
    transition: transform 0.2s;
}

.kb-chapter-item.open > button.kb-chapter-row .kb-chapter-row-arrow {
    transform: rotate(180deg);
    color: var(--aps-blue);
}

/* Nested article list (hidden by default) */
.kb-article-list {
    display: none;
    padding: 0.25rem 0 0.5rem 2.75rem;
}

.kb-chapter-item.open > .kb-article-list {
    display: block;
}

.kb-article-list-link {
    display: block;
    padding: 4px 8px;
    font-size: 0.82em;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s;
}

a.kb-article-list-link:hover {
    background: #f0f3fa;
    color: var(--aps-blue);
}

.kb-article-list-link.kb-article-stub {
    color: #bbb;
    cursor: default;
}

.kb-article-list-num {
    font-weight: 700;
    color: var(--aps-blue);
    margin-right: 4px;
}

.kb-article-stub .kb-article-list-num {
    color: #ccc;
}


/* -----------------------------------------------------------------------------
   Article Page — Left Sidebar Accordion
   ----------------------------------------------------------------------------- */

.kb-article-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    font-size: 0.82em;
}

.kb-sidebar-home {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--aps-blue);
}

.kb-sidebar-home a {
    font-weight: 600;
    color: var(--aps-blue);
    text-decoration: none;
}

/* Part level */
.kb-side-part {
    margin-bottom: 0.25rem;
}

.kb-side-part-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 6px 4px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
    font-size: 0.95em;
}

.kb-side-part-btn:hover {
    background: #f5f5f5;
}

.kb-side-part-btn.active {
    color: var(--aps-blue);
}

.kb-side-part-label {
    font-weight: 700;
    color: var(--aps-blue);
    flex-shrink: 0;
}

.kb-side-part-title {
    font-weight: 600;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-side-arrow {
    font-size: 0.65em;
    color: #999;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.kb-side-part.open > .kb-side-part-btn .kb-side-arrow {
    transform: rotate(180deg);
}

/* Chapters list (collapsed by default) */
.kb-side-chapters {
    display: none;
    padding-left: 0.5rem;
}

.kb-side-part.open > .kb-side-chapters {
    display: block;
}

/* Chapter level */
.kb-side-ch-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    padding: 4px 4px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s;
    font-size: 0.92em;
}

.kb-side-ch-btn:hover {
    background: #f5f5f5;
}

.kb-side-ch-btn.active {
    color: var(--aps-blue);
    font-weight: 600;
}

.kb-side-ch-num {
    font-weight: 700;
    color: var(--aps-blue);
    min-width: 16px;
}

.kb-side-ch-title {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kb-side-chapter.open > .kb-side-ch-btn .kb-side-arrow {
    transform: rotate(180deg);
}

/* Articles inside chapter (collapsed by default) */
.kb-side-articles {
    display: none;
    padding-left: 1.25rem;
}

.kb-side-chapter.open > .kb-side-articles {
    display: block;
}

.kb-side-art-link {
    display: block;
    padding: 3px 6px;
    font-size: 0.9em;
    color: #666;
    text-decoration: none;
    border-radius: 3px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}

.kb-side-art-link:hover {
    background: #f0f0f0;
    color: var(--aps-blue);
}

.kb-side-art-link.active {
    background: rgba(58, 83, 164, 0.08);
    border-left-color: var(--aps-blue);
    color: var(--aps-blue);
    font-weight: 600;
}

.kb-side-art-num {
    font-weight: 700;
    color: var(--aps-blue);
    margin-right: 2px;
}


/* -----------------------------------------------------------------------------
   Article Meta Bar
   ----------------------------------------------------------------------------- */

.kb-article-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.85em;
    color: #777;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.kb-article-meta-bar .difficulty-badge {
    font-size: 0.8em;
}

/* -----------------------------------------------------------------------------
   In This Chapter — sidebar card
   ----------------------------------------------------------------------------- */

.kb-chapter-nav-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.kb-chapter-nav-card h4 {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin-bottom: 0.75rem;
}

.kb-chapter-nav-list {
    display: flex;
    flex-direction: column;
}

.kb-chapter-nav-link {
    display: block;
    padding: 5px 8px;
    font-size: 0.82em;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}

.kb-chapter-nav-link:hover {
    background: #f0f0f0;
    color: var(--aps-blue);
}

.kb-chapter-nav-link.active {
    background: rgba(58, 83, 164, 0.08);
    border-left-color: var(--aps-blue);
    color: var(--aps-blue);
    font-weight: 600;
}

.kb-chapter-nav-link .art-num {
    font-weight: 700;
    color: var(--aps-blue);
    margin-right: 4px;
}

.kb-article-link:hover {
    background: #f0f0f0;
    color: var(--aps-text);
}

.kb-article-link.active {
    background: var(--aps-blue);
    color: #fff;
}

.art-num {
    font-weight: 600;
    margin-right: 2px;
}

.kb-read-check {
    color: var(--aps-green);
    font-size: 0.85em;
}


/* -----------------------------------------------------------------------------
   Chapter Page
   ----------------------------------------------------------------------------- */

.kb-part-banner {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--aps-blue);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}

.kb-chapter-description {
    font-size: 1.05em;
    color: #666;
}

.kb-access-notice {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    font-size: 0.95em;
}

.kb-access-notice a {
    font-weight: 600;
    color: var(--aps-blue);
}

/* Article cards in chapter listing */
.kb-article-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.kb-article-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kb-article-card-number {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--aps-blue);
    min-width: 40px;
    padding-top: 2px;
}

.kb-article-card-content h3 {
    font-size: 1.05em;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.kb-article-card-content h3 a {
    color: var(--aps-text);
    text-decoration: none;
}

.kb-article-card-content h3 a:hover {
    color: var(--aps-blue);
}

.kb-article-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8em;
    color: #999;
    margin-bottom: 0.5rem;
}

.kb-article-card-excerpt {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 0;
}

/* Chapter progress bar */
.kb-chapter-progress .progress {
    height: 8px;
    border-radius: 4px;
}


/* -----------------------------------------------------------------------------
   Article Page — Main Content
   ----------------------------------------------------------------------------- */

.kb-breadcrumb {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 1rem;
}

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

.kb-breadcrumb .separator {
    margin: 0 6px;
    color: #ccc;
}

.kb-excerpt {
    font-size: 1.15em;
    color: #555;
    border-left: 4px solid var(--aps-green);
    padding-left: 16px;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Key Terms box */
.kb-key-terms-box {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.kb-key-terms-box h3 {
    font-size: 1em;
    font-weight: 700;
    color: var(--aps-blue);
    margin-bottom: 1rem;
}

.kb-key-terms {
    margin: 0;
}

.kb-key-terms dt {
    font-weight: 600;
    color: var(--aps-text);
    margin-top: 0.75rem;
}

.kb-key-terms dt:first-child {
    margin-top: 0;
}

.kb-key-terms dd {
    margin-left: 0;
    padding-left: 1rem;
    border-left: 2px solid #ddd;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 0;
}

/* Article body — scientific-grade typography */
.kb-article-content {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05em;
    line-height: 1.65;
    color: #333;
}

.kb-article-content h2 {
    font-family: 'azo-sans-web', Arial, sans-serif;
    font-size: 1.4em;
    font-weight: 600;
    color: var(--aps-text);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #eee;
}

.kb-article-content h3 {
    font-family: 'azo-sans-web', Arial, sans-serif;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--aps-text);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.kb-article-content p {
    margin-bottom: 1.25em;
}

.kb-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1rem 0;
}

.kb-article-content figure {
    margin: 1.5rem 0;
}

.kb-article-content figcaption {
    font-family: 'azo-sans-web', Arial, sans-serif;
    font-size: 0.85em;
    color: #777;
    margin-top: 0.5rem;
}

.kb-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: 'azo-sans-web', Arial, sans-serif;
    font-size: 0.9em;
}

.kb-article-content table th,
.kb-article-content table td {
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.kb-article-content table th {
    background: #f5f5f5;
    font-weight: 600;
}

.kb-article-content table tr:nth-child(even) {
    background: #fafafa;
}

/* Callout boxes */
.kb-callout {
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-family: 'azo-sans-web', Arial, sans-serif;
    font-size: 0.9em;
}

.kb-callout.tip {
    background: #e8f5e9;
    border-left: 4px solid var(--aps-green);
}

.kb-callout.note {
    background: #e3f2fd;
    border-left: 4px solid var(--aps-blue);
}

.kb-callout.warning {
    background: #fff3e0;
    border-left: 4px solid var(--aps-orange);
}

.kb-callout-title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Sequence/formula blocks */
.kb-sequence {
    font-family: 'Courier New', Courier, monospace;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.9em;
    letter-spacing: 0.02em;
}


/* -----------------------------------------------------------------------------
   Article Page — Right Info Sidebar
   ----------------------------------------------------------------------------- */

.kb-info-section {
    position: sticky;
    top: 20px;
}

/* Scroll-spy TOC */
.kb-toc {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.kb-toc h4 {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin-bottom: 0.75rem;
}

.kb-toc-link {
    display: block;
    padding: 3px 0 3px 12px;
    font-size: 0.8em;
    color: #666;
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}

.kb-toc-link:hover {
    color: var(--aps-blue);
}

.kb-toc-link.active {
    color: var(--aps-blue);
    font-weight: 600;
    border-left-color: var(--aps-blue);
}

.kb-toc-link.toc-h3 {
    padding-left: 24px;
    font-size: 0.75em;
}

/* Article Info Card */
.kb-info-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.kb-info-card h4 {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin-bottom: 0.75rem;
}

.kb-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.85em;
}

.kb-info-item i {
    color: var(--aps-blue);
    width: 16px;
    text-align: center;
}

.kb-info-item .label {
    color: #999;
}

.kb-info-item .value {
    color: var(--aps-text);
}

/* Difficulty badges */
.difficulty-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.difficulty-badge.foundational {
    background: #e8f5e9;
    color: #2e7d32;
}

.difficulty-badge.intermediate {
    background: #fff3e0;
    color: #e65100;
}

.difficulty-badge.advanced {
    background: #fce4ec;
    color: #c62828;
}

/* Cite button */
.kb-cite {
    margin-bottom: 1.5rem;
}

.kb-cite-text {
    font-size: 0.8em;
    background: #f8f8f8;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #eee;
    line-height: 1.5;
    word-break: break-word;
}

/* Rating widget */
.kb-rating-widget {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.kb-rating-widget h4 {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin-bottom: 0.5rem;
}

.star-rating {
    font-size: 1.5em;
    cursor: pointer;
}

.star-rating .star {
    color: #ddd;
    transition: color 0.15s;
}

.star-rating .star.filled,
.star-rating .star.active {
    color: #ffc107;
}

.star-rating .star:hover {
    color: #ffb300;
}

.rating-count {
    font-size: 0.8em;
    color: #999;
    margin-top: 0.25rem;
}

/* Related articles */
.kb-related {
    margin-bottom: 1.5rem;
}

.kb-related h4 {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #999;
    margin-bottom: 0.5rem;
}

.kb-related-link {
    display: block;
    padding: 6px 0;
    font-size: 0.85em;
    color: var(--aps-text);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.kb-related-link:hover {
    color: var(--aps-blue);
}

.kb-related-link .art-num {
    color: var(--aps-blue);
}


/* -----------------------------------------------------------------------------
   Citations / References
   ----------------------------------------------------------------------------- */

.kb-citations {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.kb-citations h3 {
    font-size: 1.1em;
    color: var(--aps-text);
}

.kb-citations div {
    font-size: 0.9em;
    line-height: 1.6;
}

/* Reviewed By */
.kb-reviewed-by {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: #f0f7ee;
    border-radius: 6px;
    font-size: 0.85em;
    color: #555;
}


/* -----------------------------------------------------------------------------
   Comments
   ----------------------------------------------------------------------------- */

.kb-comments {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.kb-comments h3 {
    font-size: 1.1em;
    margin-bottom: 1rem;
}

.kb-comment {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fafafa;
    border-radius: 8px;
}

.kb-comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.kb-comment-author {
    font-weight: 600;
    font-size: 0.9em;
}

.kb-comment-date {
    font-size: 0.8em;
    color: #999;
}

.kb-comment-content {
    font-size: 0.9em;
}

.kb-comment-form {
    margin-top: 1.5rem;
}

.kb-comment-form h4 {
    font-size: 1em;
    margin-bottom: 0.75rem;
}

.kb-comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9em;
    margin-bottom: 0.5rem;
    resize: vertical;
}

.kb-comment-form textarea:focus {
    outline: none;
    border-color: var(--aps-blue);
}

.moderation-note {
    font-size: 0.8em;
    color: #999;
    margin-top: 0.5rem;
}


/* -----------------------------------------------------------------------------
   Article Navigation (Prev/Next)
   ----------------------------------------------------------------------------- */

.kb-article-nav {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.kb-nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: var(--aps-text);
    max-width: 48%;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.kb-nav-btn:hover {
    border-color: var(--aps-blue);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    color: var(--aps-blue);
}

.kb-nav-btn small {
    display: block;
    font-size: 0.75em;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kb-nav-btn span span {
    font-size: 0.85em;
    font-weight: 500;
}

.kb-nav-next {
    margin-left: auto;
    text-align: right;
}


/* -----------------------------------------------------------------------------
   Gated Article
   ----------------------------------------------------------------------------- */

.kb-gated-teaser {
    position: relative;
    max-height: 200px;
    overflow: hidden;
    margin-bottom: 0;
}

.kb-gated-blur {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05em;
    line-height: 1.65;
    color: #aaa;
    filter: blur(3px);
    user-select: none;
}

.kb-gated-teaser::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(transparent, #fff);
}

.kb-gate-cta {
    text-align: center;
    padding: 3rem 2rem;
    margin: 0 auto 2rem;
    max-width: 600px;
}

.kb-gate-cta-icon {
    font-size: 3em;
    color: var(--aps-blue);
    margin-bottom: 1rem;
}

.kb-gate-cta h3 {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 1rem;
}

.kb-gate-cta p {
    color: #666;
    margin-bottom: 1.5rem;
}

.kb-gate-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}


/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */

@media (max-width: 991.98px) {
    .kb-acc-chapter-count {
        display: none;
    }

    .kb-sidebar-col {
        margin-bottom: 1.5rem;
    }

    .kb-article-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        border: 1px solid #eee;
        border-radius: 8px;
        padding: 0.75rem;
    }

    .kb-info-section {
        position: static;
        margin-top: 2rem;
    }

    .kb-article-nav {
        flex-direction: column;
    }

    .kb-nav-btn {
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .kb-stats-inline {
        flex-wrap: wrap;
    }

    .kb-gate-cta-buttons {
        flex-direction: column;
    }

    .kb-article-card {
        flex-direction: column;
        gap: 0.5rem;
    }
}


/* -----------------------------------------------------------------------------
   Print Styles
   ----------------------------------------------------------------------------- */

@media print {
    .kb-info-col,
    .kb-article-nav,
    .kb-comments,
    .kb-rating-widget,
    .kb-toc {
        display: none !important;
    }

    .kb-main-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }

    .kb-article-content {
        max-width: 100%;
        font-size: 11pt;
    }
}
