/*
 * Visual bridge for the TETCTET theme.
 * Scoped to the theme body class and loaded after the plugin's core CSS.
 * Answer states, hidden states, timers and quiz behavior remain plugin-owned.
 */
body.tct-theme :is(.sbmq-quiz, .sbmq-quiz-directory, .sbmq-related-quizzes) {
    --sbmq-radius: 0.8rem;
    --sbmq-radius-lg: 1.1rem;
    font-family: Manrope, "Noto Sans Telugu", "Noto Sans Devanagari", system-ui, sans-serif;
    color: #173239;
}

body.tct-theme .sbmq-quiz {
    border: 1px solid #dfebe3;
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 20px 50px rgba(17, 50, 48, .08);
}

body.tct-theme .sbmq-title {
    color: #173239;
    font-weight: 800;
    letter-spacing: -.035em;
}

/* Keep the quiz language and progress toolbar within the theme palette. */
body.tct-theme .sbmq-quiz .sbmq-toolbar {
    border-color: #cbded1;
    background: linear-gradient(110deg, #f1f8f3, #e5f2eb);
    box-shadow: 0 6px 18px rgba(17, 50, 48, .07);
}
body.tct-theme .sbmq-quiz .sbmq-language-label,
body.tct-theme .sbmq-quiz .sbmq-progress,
body.tct-theme .sbmq-quiz .sbmq-show-at-end-control,
body.tct-theme .sbmq-quiz .sbmq-answer-key-control,
body.tct-theme .sbmq-quiz .sbmq-language-controls label {
    color: #155d57;
}
body.tct-theme .sbmq-quiz :is(input[type="checkbox"], input[type="radio"]) {
    accent-color: #087d70;
}

body.tct-theme .sbmq-question {
    border-bottom-color: #e3ece6;
}

body.tct-theme .sbmq-question-count {
    border-radius: 0.55rem;
    background: #e8f5ed;
    color: #0b7467;
    font-weight: 800;
}

body.tct-theme .sbmq-question-text {
    color: #1c3b3e;
    font-weight: 700;
    line-height: 1.65;
}

body.tct-theme .sbmq-option {
    border-radius: 0.8rem;
    box-shadow: 0 2px 8px rgba(22, 58, 51, .025);
}

body.tct-theme .sbmq-option:not(.sbmq-correct):not(.sbmq-incorrect) {
    border-color: #dfe9e2;
}

body.tct-theme .sbmq-option:not(.sbmq-correct):not(.sbmq-incorrect):hover {
    border-color: #63b69c;
    background: #f6fbf7;
}

body.tct-theme .sbmq-option-marker {
    background: #e9f3ed;
    color: #1b7668;
    font-weight: 800;
}

body.tct-theme .sbmq-button:not(.sbmq-button-secondary):not(.sbmq-share-btn) {
    border-color: #087d70;
    border-radius: 0.65rem;
    background: #087d70;
    font-weight: 800;
}

body.tct-theme .sbmq-button:not(.sbmq-button-secondary):not(.sbmq-share-btn):hover {
    border-color: #096d63;
    background: #096d63;
}

body.tct-theme .sbmq-button-secondary {
    border-color: #cbded1;
    border-radius: 0.65rem;
    background: #fff;
    color: #285050;
    font-weight: 700;
}

body.tct-theme .sbmq-directory-filters {
    border: 1px solid #dce8df;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 16px 36px rgba(16, 54, 48, .07);
}

body.tct-theme .sbmq-filter-heading,
body.tct-theme .sbmq-filter-heading .sbmq-lang {
    color: #173239;
    font-weight: 800 !important;
}

body.tct-theme .sbmq-filter-field {
    color: #355359;
    font-weight: 700;
}

body.tct-theme .sbmq-filter-select,
body.tct-theme .sbmq-filter-input,
body.tct-theme .sbmq-accordion-search {
    border-color: #cfded5;
    border-radius: 0.7rem;
    background-color: #fff;
    color: #173239;
}

body.tct-theme .sbmq-filter-select:focus,
body.tct-theme .sbmq-filter-input:focus,
body.tct-theme .sbmq-accordion-search:focus {
    border-color: #198b77;
    outline-color: rgba(25, 139, 119, .18);
}

body.tct-theme .sbmq-filter-reset {
    border-color: #087d70;
    border-radius: 0.65rem;
    background: #087d70;
    color: #fff;
    font-weight: 800;
}

body.tct-theme .sbmq-filter-reset:hover {
    border-color: #096d63;
    background: #096d63;
}

body.tct-theme .sbmq-other-exams-link {
    color: #087d70;
}

body.tct-theme .sbmq-subject-accordion,
body.tct-theme .sbmq-directory-item,
body.tct-theme .sbmq-directory-simple .sbmq-directory-card {
    border-color: #dce8df;
    border-radius: 0.95rem;
    box-shadow: 0 8px 24px rgba(17, 50, 48, .045);
}

body.tct-theme .sbmq-subject-accordion-trigger,
body.tct-theme .sbmq-taxonomy-accordion-exam .sbmq-subject-accordion-trigger,
body.tct-theme .sbmq-subject-accordion.is-open .sbmq-subject-accordion-trigger {
    background: #e8f4ec;
    color: #155d57;
    font-weight: 800;
}

body.tct-theme .sbmq-subject-accordion-trigger:hover,
body.tct-theme .sbmq-taxonomy-accordion-exam .sbmq-subject-accordion-trigger:hover {
    background: #d8eddf;
}

body.tct-theme .sbmq-subject-accordion.is-open .sbmq-subject-accordion-trigger {
    border-bottom-color: #b8d9c8;
}

body.tct-theme .sbmq-subject-accordion-meta,
body.tct-theme .sbmq-subject-accordion-icon {
    color: #087d70;
}

body.tct-theme .sbmq-accordion-section-title {
    color: #173239 !important;
    font-weight: 800 !important;
}

body.tct-theme .sbmq-directory-card:hover,
body.tct-theme .sbmq-directory-card:focus-within {
    border-color: #8ccbb1;
    box-shadow: 0 14px 34px rgba(17, 50, 48, .09);
}

body.tct-theme .sbmq-directory-title,
body.tct-theme .sbmq-directory-simple h3.sbmq-directory-title {
    color: #173239;
    font-weight: 700 !important;
}

body.tct-theme .sbmq-directory-card-meta {
    border-top-color: #e3ece6;
    background: #f8fbf8;
}

body.tct-theme .sbmq-free-practice-card .sbmq-directory-card-main {
    gap: 0.55rem;
    padding: 1rem 1.2rem 0.9rem;
}

body.tct-theme .sbmq-free-practice-details {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    margin: 0;
    color: #46636a;
    font-size: 0.83rem;
    line-height: 1.4;
}

body.tct-theme .sbmq-free-practice-detail {
    display: grid;
    grid-template-columns: 5.6rem minmax(0, 1fr);
    gap: 0.35rem;
    align-items: baseline;
}

body.tct-theme .sbmq-free-practice-detail dt {
    color: #5a7478;
    font-weight: 700;
}

body.tct-theme .sbmq-free-practice-detail dd {
    min-width: 0;
    margin: 0;
    color: #173239;
    font-weight: 500;
}

body.tct-theme .sbmq-quiz-taxonomy-details {
    border-color: #d6e5de;
    background: #f5faf7;
}

body.tct-theme .sbmq-related-unit { color: #57716e; }

body.tct-theme .sbmq-directory-count {
    background: #e4f2e8;
    color: #0d7163;
    font-weight: 700;
}

body.tct-theme .sbmq-directory-start,
body.tct-theme .sbmq-directory-simple .sbmq-directory-start {
    border-color: #087d70;
    border-radius: 0.65rem;
    background: #087d70;
    color: #fff !important;
    font-weight: 800;
}

body.tct-theme .sbmq-directory-start:hover,
body.tct-theme .sbmq-directory-start:focus {
    border-color: #096d63;
    background: #096d63;
}

@media (max-width: 640px) {
    body.tct-theme .sbmq-quiz {
        border-radius: 0.9rem;
        box-shadow: 0 10px 28px rgba(17, 50, 48, .07);
    }

    body.tct-theme .sbmq-directory-filters {
        border-radius: 0.85rem;
    }
}

/* Match the tighter spacing between TetCTet page sections. */
body.tct-theme .tct-plugin-surface .sbmq-quiz-directory { margin-block: 0; }
body.tct-theme .tct-plugin-surface .sbmq-directory-archive { margin-top: 0; }
body.tct-theme .tct-plugin-surface .sbmq-archive-hero {
    gap: 0.2rem;
    margin-bottom: clamp(12px, 1.5vw, 18px);
    padding: 4px 0 12px;
}
body.tct-theme .tct-plugin-surface .sbmq-directory-layout { gap: clamp(12px, 1.5vw, 18px); }

/* Related quizzes: compact, bilingual cards with one clear visual hierarchy. */
body.tct-theme .sbmq-related-quizzes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    width: min(100%, 1040px);
    max-width: 1040px;
    margin: 48px auto 24px;
    padding: 30px;
    border: 1px solid #dce8df;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(17, 50, 48, .06);
}
body.tct-theme .sbmq-related-heading-wrap {
    grid-column: 1 / -1;
    margin: 0 0 4px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5eee8;
    text-align: left;
}
body.tct-theme .sbmq-related-heading {
    margin: 0;
    color: #173239;
    font-size: clamp(24px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.035em;
}
body.tct-theme .sbmq-related-heading .sbmq-lang { display: block; }
body.tct-theme .sbmq-related-heading .sbmq-lang-te {
    margin-top: 4px;
    color: #52736b;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0;
}
body.tct-theme .sbmq-related-heading .sbmq-language-separator { display: none; }
body.tct-theme .sbmq-related-group,
body.tct-theme .sbmq-related-group + .sbmq-related-group {
    align-self: start;
    min-width: 0;
    margin: 0;
    padding: 22px;
    border: 1px solid #dce8df;
    border-radius: 14px;
    background: #f7faf7;
}
body.tct-theme .sbmq-related-group:only-of-type { grid-column: 1 / -1; max-width: 700px; width: 100%; }
body.tct-theme .sbmq-related-group-title,
body.tct-theme .sbmq-related-group-subject .sbmq-related-group-title,
body.tct-theme .sbmq-related-group-exam .sbmq-related-group-title {
    margin: 0 0 17px;
    color: #173239;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -.025em;
}
body.tct-theme .sbmq-related-group-kicker {
    display: block;
    margin-bottom: 6px;
    color: #087d70;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    line-height: 1.4;
    text-transform: uppercase;
}
body.tct-theme .sbmq-related-title-list { grid-template-columns: 1fr; gap: 10px; }
body.tct-theme .sbmq-related-title-item { border: 0; }
body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link {
    position: relative;
    display: block;
    min-height: 72px;
    padding: 15px 44px 15px 16px;
    border: 1px solid #dce8df;
    border-radius: 10px;
    background: #fff;
    color: #173239;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link::after {
    position: absolute;
    right: 16px;
    top: 50%;
    color: #087d70;
    font-size: 19px;
    font-weight: 700;
    transform: translateY(-50%);
    content: "↗";
}
body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link .sbmq-lang-en { color: #173239; }
body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link .sbmq-lang-te {
    margin-top: 4px;
    color: #57716e;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}
body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link:hover,
body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link:focus-visible {
    border-color: #79bea1;
    box-shadow: 0 8px 22px rgba(17, 50, 48, .09);
    transform: translateY(-2px);
    text-decoration: none;
}
body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link:focus-visible { outline: 3px solid rgba(8, 125, 112, .18); }

@media (max-width: 700px) {
    body.tct-theme .sbmq-related-quizzes { grid-template-columns: 1fr; gap: 14px; margin-top: 34px; padding: 20px; }
    body.tct-theme .sbmq-related-heading-wrap { padding-bottom: 17px; }
    body.tct-theme .sbmq-related-heading { font-size: 23px; }
    body.tct-theme .sbmq-related-heading .sbmq-lang-te { font-size: 15px; }
    body.tct-theme .sbmq-related-group,
    body.tct-theme .sbmq-related-group + .sbmq-related-group { padding: 18px; }
    body.tct-theme .sbmq-related-group-title { font-size: 17px; }
    body.tct-theme .sbmq-related-quizzes .sbmq-related-title-link { font-size: 14px; }
}

/* Shared TETCTET reading scale for bilingual tests and directories. */
body.tct-theme :is(.sbmq-quiz, .sbmq-quiz-directory, .sbmq-related-quizzes) {
    --sbmq-font: 1rem;
    --sbmq-font-sm: .85rem;
    --sbmq-font-lg: 1.1rem;
    --sbmq-font-xl: clamp(1.5rem, 2vw, 2rem);
    --sbmq-container: min(60rem, 100%);
    --sbmq-container-wide: min(75rem, 100%);
    color: var(--tct-ink, #18363b);
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0;
}

body.tct-theme .sbmq-title {
    letter-spacing: -.035em;
    line-height: 1.3;
}

body.tct-theme .sbmq-question-text {
    font-size: clamp(17px, 1.25vw, 19px);
    font-weight: 700;
    line-height: 1.65;
}

body.tct-theme .sbmq-option-content {
    font-size: 16px;
    line-height: 1.65;
}

body.tct-theme .sbmq-question-count,
body.tct-theme .sbmq-directory-count {
    font-size: 13px;
}

body.tct-theme .sbmq-filter-field,
body.tct-theme .sbmq-filter-select,
body.tct-theme .sbmq-filter-input,
body.tct-theme .sbmq-accordion-search {
    font-size: 14px;
    line-height: 1.45;
}

body.tct-theme .sbmq-filter-select,
body.tct-theme .sbmq-filter-input,
body.tct-theme .sbmq-accordion-search {
    min-height: 45px;
}

body.tct-theme .sbmq-subject-accordion-trigger {
    font-size: 18px;
    line-height: 1.4;
    letter-spacing: -.025em;
}

body.tct-theme .sbmq-quiz-directory h3.sbmq-directory-title,
body.tct-theme .sbmq-directory-item h3.sbmq-directory-title,
body.tct-theme .sbmq-directory-card h3.sbmq-directory-title {
    font-size: 17px;
    line-height: 1.5;
    letter-spacing: -.02em;
}

body.tct-theme .sbmq-button,
body.tct-theme .sbmq-directory-start,
body.tct-theme .sbmq-filter-reset {
    font-size: 14px;
    line-height: 1.35;
}

@media (max-width: 640px) {
    body.tct-theme :is(.sbmq-quiz, .sbmq-quiz-directory, .sbmq-related-quizzes) {
        --sbmq-font: .96rem;
        --sbmq-font-lg: 1.05rem;
        font-size: 15px;
    }

    body.tct-theme .sbmq-question-text,
    body.tct-theme .sbmq-subject-accordion-trigger {
        font-size: 17px;
    }

    body.tct-theme .sbmq-option-content {
        font-size: 15px;
    }
}

body.tct-theme .sbmq-related-quizzes { margin-block: 28px 18px; padding: 20px; gap: 14px; }
@media (max-width: 640px) {
    body.tct-theme .sbmq-related-quizzes { margin-top: 22px; padding: 16px; }
}
