/**
 * Knowledge Page Styles
 * Design tokens sourced from theme.json:
 *   Content width: 720px (72ch)
 *   Base font: 18px, line-height 1.65
 *   Colors: #111 text, #333 secondary, #666 muted, #f8f8f8 bg-alt, #fff bg, #e0e0e0 border
 *   System font stack
 *   WCAG AA contrast minimum (Rule 84)
 */

/* ==========================================================================
   Layout
   ========================================================================== */

.knowledge-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 64px;
}

.knowledge-page__content {
    margin-top: 32px;
}

.knowledge-page__title {
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
    color: #111;
    margin: 0 0 24px;
}

.knowledge-page__section {
    margin-top: 48px;
}

.knowledge-page__section h2 {
    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    color: #111;
    margin: 0 0 16px;
}

.knowledge-page__section h3 {
    font-size: 21px;
    line-height: 1.4;
    font-weight: 600;
    color: #111;
    margin: 0 0 12px;
}

.knowledge-page__wysiwyg {
    font-size: 18px;
    line-height: 1.65;
    color: #111;
}

.knowledge-page__wysiwyg p {
    margin: 0 0 16px;
}

.knowledge-page__wysiwyg ul,
.knowledge-page__wysiwyg ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.knowledge-page__wysiwyg li {
    margin-bottom: 8px;
}

/* Fail-closed placeholder (Rule 62) */
.knowledge-page__section--placeholder {
    border-left: 3px solid #e0e0e0;
    padding-left: 16px;
}

.knowledge-page__placeholder {
    color: #666;
    font-style: italic;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    padding: 16px 0 8px;
}

.breadcrumbs__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 14px;
    color: #666;
}

.breadcrumbs__item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumbs__item::after {
    content: '>';
    color: #e0e0e0;
    margin: 0 4px;
}

.breadcrumbs__item:last-child::after {
    display: none;
}

.breadcrumbs__item a {
    color: #666;
    text-decoration: none;
}

.breadcrumbs__item a:hover {
    color: #111;
    text-decoration: underline;
}

.breadcrumbs__item--current {
    color: #111;
}

/* ==========================================================================
   Definition Block
   ========================================================================== */

.knowledge-page__definition {
    margin-top: 32px;
}

.definition-block {
    background: #f8f8f8;
    border-left: 4px solid #e0e0e0;
    padding: 20px 24px;
    font-size: 18px;
    line-height: 1.65;
    color: #333;
}

.definition-block p {
    margin: 0;
}

.definition-block p + p {
    margin-top: 12px;
}

/* ==========================================================================
   Key Takeaways
   ========================================================================== */

.knowledge-page__takeaways {
    margin-top: 32px;
}

.knowledge-page__takeaways h2 {
    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    color: #111;
    margin: 0 0 16px;
}

.takeaways-box {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    padding: 20px 24px;
}

.takeaways-box__list {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: disc;
}

.takeaways-box__list li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #111;
}

.takeaways-box__list li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Factors Table
   ========================================================================== */

.knowledge-page__factors {
    margin-top: 48px;
}

.factors-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.factors-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
}

.factors-table caption {
    text-align: left;
    font-size: 14px;
    color: #666;
    padding-bottom: 8px;
    caption-side: top;
}

.factors-table thead {
    border-bottom: 2px solid #111;
}

.factors-table th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
}

.factors-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    vertical-align: top;
}

.factors-table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================================================
   Examples / Scenarios
   ========================================================================== */

.knowledge-page__examples {
    margin-top: 48px;
}

.examples-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.example-card {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    padding: 20px 24px;
}

.example-card__title {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    margin: 0 0 12px;
}

.example-card__scenario,
.example-card__outcome {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 8px;
}

.example-card__scenario strong,
.example-card__outcome strong {
    color: #111;
}

.example-card__outcome {
    margin-bottom: 0;
}

/* ==========================================================================
   Common Mistakes
   ========================================================================== */

.knowledge-page__mistakes {
    margin-top: 48px;
}

.mistakes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mistakes-list__item {
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
    line-height: 1.6;
}

.mistakes-list__item:last-child {
    border-bottom: none;
}

.mistakes-list__item strong {
    display: block;
    color: #111;
    margin-bottom: 4px;
}

.mistakes-list__item p {
    margin: 0;
    color: #333;
    font-size: 16px;
}

/* ==========================================================================
   Documents Needed
   ========================================================================== */

.knowledge-page__documents {
    margin-top: 48px;
}

.documents-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.documents-list__item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
    line-height: 1.5;
}

.documents-list__item:last-child {
    border-bottom: none;
}

.documents-list__check {
    flex-shrink: 0;
    font-size: 16px;
    color: #666;
}

.documents-list__note {
    display: block;
    font-size: 14px;
    color: #666;
    margin-left: 4px;
}

/* ==========================================================================
   FAQ Accordion
   ========================================================================== */

.knowledge-page__faq {
    margin-top: 48px;
}

.faq-item {
    border-bottom: 1px solid #e0e0e0;
}

.faq-item:first-of-type {
    border-top: 1px solid #e0e0e0;
}

.faq-item__question {
    display: block;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #111;
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 32px;
}

/* Remove default marker */
.faq-item__question::-webkit-details-marker {
    display: none;
}

.faq-item__question::marker {
    display: none;
    content: '';
}

/* Custom indicator */
.faq-item__question::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 16px;
    font-size: 20px;
    font-weight: 400;
    color: #666;
    transition: transform 0.15s ease;
}

.faq-item[open] .faq-item__question::after {
    content: '\2212'; /* minus sign */
}

.faq-item__question:hover {
    color: #333;
}

.faq-item__question:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.faq-item__answer {
    padding: 0 0 16px;
    font-size: 16px;
    line-height: 1.65;
    color: #333;
}

.faq-item__answer p {
    margin: 0 0 12px;
}

.faq-item__answer p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Review Line
   ========================================================================== */

.knowledge-page__review {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

/* ==========================================================================
   Related Knowledge
   ========================================================================== */

.knowledge-page__related {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid #e0e0e0;
}

.knowledge-page__related h2 {
    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    color: #111;
    margin: 0 0 16px;
}

.related-grid__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.related-grid__item a {
    display: block;
    padding: 12px 16px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #111;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.4;
    transition: background-color 0.15s ease;
}

.related-grid__item a:hover {
    background: #fff;
    border-color: #111;
}

.related-grid__item a:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* ==========================================================================
   Pathways Callout
   ========================================================================== */

.pathways-callout {
    margin-top: 48px;
    padding: 24px;
    text-align: center;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.pathways-callout__text {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.pathways-callout__link {
    color: #111;
    font-weight: 600;
    text-decoration: underline;
}

.pathways-callout__link:hover {
    color: #333;
}

/* ==========================================================================
   Hub Page
   ========================================================================== */

.hub-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 64px;
}

.hub-page__header {
    max-width: 720px;
    margin: 0 auto 48px;
}

.hub-page__title {
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
    color: #111;
    margin: 0 0 16px;
}

.hub-page__description {
    font-size: 18px;
    line-height: 1.65;
    color: #333;
}

.hub-page__featured {
    margin-bottom: 48px;
}

.hub-page__featured h2,
.hub-page__index h2,
.hub-page__faq h2 {
    font-size: 26px;
    line-height: 1.3;
    font-weight: 600;
    color: #111;
    margin: 0 0 16px;
}

.hub-page__index {
    margin-bottom: 48px;
}

.hub-page__faq {
    max-width: 720px;
    margin: 0 auto;
}

/* ==========================================================================
   Grid Cards (shared: homepage, hub, featured)
   ========================================================================== */

.ml-grid {
    display: grid;
    gap: 16px;
}

.ml-grid--domains {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.ml-grid--featured {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.ml-grid--index {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.ml-grid-card {
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e0e0e0;
    text-decoration: none;
    color: #111;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ml-grid-card:hover {
    border-color: #111;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.ml-grid-card:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.ml-grid-card strong {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #111;
}

.ml-grid-card span {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.ml-grid-card--featured {
    background: #f8f8f8;
}

.ml-grid-card--featured span {
    font-size: 15px;
    color: #333;
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.ml-search-form {
    display: flex;
    max-width: 600px;
    margin: 24px auto 0;
    gap: 0;
}

.ml-search-form input[type="text"] {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-right: none;
    background: #fff;
    color: #111;
    font-family: inherit;
}

.ml-search-form input[type="text"]::placeholder {
    color: #999;
}

.ml-search-form input[type="text"]:focus {
    outline: 2px solid #111;
    outline-offset: -2px;
    border-color: #111;
}

.ml-search-form button {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}

.ml-search-form button:hover {
    background: #333;
    border-color: #333;
}

.ml-search-form button:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.ml-search-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================================
   Qualify Page
   ========================================================================== */

.qualify-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 32px 16px 64px;
}

.qualify-page__container {
    text-align: center;
}

.qualify-page__title {
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
    color: #111;
    margin: 0 0 12px;
}

.qualify-page__intro {
    font-size: 18px;
    color: #666;
    margin: 0 0 32px;
}

/* Progress bar */
.qualify-page__progress {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    margin-bottom: 32px;
    overflow: hidden;
}

.qualify-page__progress-bar {
    height: 100%;
    background: #111;
    transition: width 0.3s ease;
}

/* Question area */
.qualify-page__question {
    text-align: left;
}

.qualify-question__prompt {
    font-size: 21px;
    font-weight: 600;
    color: #111;
    margin: 0 0 20px;
}

.qualify-question__choices {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qualify-question__choice {
    display: block;
}

.qualify-question__choice label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    transition: border-color 0.15s ease;
}

.qualify-question__choice label:hover {
    border-color: #111;
}

.qualify-question__choice input[type="radio"] {
    flex-shrink: 0;
}

.qualify-question__choice input[type="radio"]:focus-visible + span {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.qualify-question__next {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    cursor: pointer;
    font-family: inherit;
}

.qualify-question__next:hover {
    background: #333;
}

.qualify-question__next:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Error */
.qualify-page__error {
    text-align: center;
    padding: 16px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    color: #333;
    margin-top: 16px;
}

/* Results */
.qualify-page__results {
    text-align: left;
}

.qualify-results__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qualify-results__item {
    padding: 16px 20px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
}

.qualify-results__item a {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
}

.qualify-results__item a:hover {
    text-decoration: underline;
}

.qualify-results__reason {
    font-size: 14px;
    color: #666;
    margin-top: 4px;
}

.qualify-results__order {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* Actions */
.qualify-page__actions {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.qualify-page__restart,
.qualify-page__browse {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border: 1px solid #e0e0e0;
}

.qualify-page__restart:hover,
.qualify-page__browse:hover {
    color: #111;
    border-color: #111;
}

.qualify-page__loading {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .knowledge-page {
        padding: 0 16px 48px;
    }

    .knowledge-page__title {
        font-size: 28px;
    }

    .knowledge-page__section {
        margin-top: 36px;
    }

    .knowledge-page__section h2 {
        font-size: 22px;
    }

    .hub-page {
        padding: 0 16px 48px;
    }

    .hub-page__title {
        font-size: 28px;
    }

    .ml-grid--domains,
    .ml-grid--featured,
    .ml-grid--index {
        grid-template-columns: 1fr;
    }

    .ml-search-form {
        flex-direction: column;
    }

    .ml-search-form input[type="text"] {
        border-right: 1px solid #e0e0e0;
        border-bottom: none;
    }

    .factors-table {
        font-size: 14px;
    }

    .factors-table th,
    .factors-table td {
        padding: 8px;
    }

    .faq-item__question {
        font-size: 16px;
    }

    .qualify-page__title {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .knowledge-page__title {
        font-size: 24px;
    }

    .hub-page__title {
        font-size: 24px;
    }

    .knowledge-page__section h2 {
        font-size: 20px;
    }

    .ml-grid-card {
        padding: 16px;
    }

    .qualify-page__title {
        font-size: 24px;
    }
}
