/* Тест в тексте страницы учебника — см. /local/assets/js/quiz.js */
.quiz {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
}
.quiz-questions { padding-left: 1.25rem; margin: 0; }
.quiz-q { margin-bottom: 1.25rem; }
.quiz-text { font-weight: 600; margin-bottom: .5rem; }
.quiz-options { list-style: none; padding: 0; margin: 0; }
.quiz-options > li { padding: .15rem 0; }

/* Со скриптом: варианты — кнопки, пояснения скрыты до проверки */
.quiz-ready .quiz-options > li {
    padding: .45rem .75rem;
    margin-bottom: .35rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.quiz-ready .quiz-options > li:hover { background: var(--bs-tertiary-bg); }
.quiz-ready .quiz-options > li:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 1px; }
.quiz-ready .quiz-options > li.quiz-selected { border-color: var(--bs-primary); background: var(--bs-primary-bg-subtle); }
.quiz-ready .quiz-explain { display: none; }

.quiz-done .quiz-options > li { cursor: default; }
.quiz-done .quiz-options > li:hover { background: none; }
.quiz-done .quiz-options > li.quiz-is-correct { border-color: var(--bs-success); background: var(--bs-success-bg-subtle); }
.quiz-done .quiz-options > li.quiz-is-wrong { border-color: var(--bs-danger); background: var(--bs-danger-bg-subtle); }
.quiz-done .quiz-explain {
    display: block;
    margin-top: .4rem;
    padding: .5rem .75rem;
    border-left: 3px solid var(--bs-info);
    background: var(--bs-tertiary-bg);
    font-size: .95rem;
}
.quiz-q-empty > .quiz-text::after { content: ' —'; color: var(--bs-secondary-color); }

.quiz-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: .5rem; }
.quiz-result { font-weight: 600; }

/* Таблица формул (раздел формул: тема и страница класса) */
table.formulas { width: 100%; margin: .5rem 0 1rem; border-collapse: collapse; }
table.formulas th, table.formulas td { border: 1px solid var(--bs-border-color); padding: .4rem .6rem; vertical-align: top; }
table.formulas th { background: var(--bs-tertiary-bg); font-weight: 600; }
table.formulas td.formula { white-space: nowrap; font-family: "Cambria Math", "STIX Two Math", Georgia, serif; font-size: 1.1em; }
table.formulas ul { margin: 0; padding-left: 1rem; }

/* Портрет в статье (раздел учёных): справа, текст обтекает — и на телефоне (уже, до 42 %); подпись — автор и лицензия */
figure.portrait { float: right; width: 42%; max-width: 230px; margin: .3rem 0 .75rem 1rem; }
@media (min-width: 768px) { figure.portrait { width: 230px; margin-left: 1.5rem; } }
figure.portrait img { width: 100%; height: auto; border-radius: .375rem; }
figure.portrait figcaption { font-size: .78rem; line-height: 1.3; color: var(--bs-secondary-color); margin-top: .35rem; }
figure.portrait figcaption a { color: inherit; }
/* Таблица «Коротко» рядом с портретом: по ширине содержимого, а не на всю строку — иначе уходит под портрет */
table.facts { width: auto; max-width: 100%; }
table.facts th { font-weight: 600; padding-right: 1rem; }
@media (min-width: 768px) { table.facts th { white-space: nowrap; } }
/* Портрет не вылезает за текст статьи */
#content_area::after { content: ""; display: table; clear: both; }

/* Карточки учёных (class_view = cards): фото, имя, годы, подпись */
.person-card { display: flex; flex-direction: column; height: 100%; border: 1px solid var(--bs-border-color); border-radius: .5rem; overflow: hidden; background: var(--bs-body-bg); color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.person-card:hover { box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .12); transform: translateY(-2px); color: inherit; }
.person-photo { display: block; aspect-ratio: 4 / 5; background: var(--bs-tertiary-bg); overflow: hidden; }
.person-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }
.person-initials { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 2.5rem; color: var(--bs-secondary-color); }
.person-body { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .65rem .7rem; }
.person-name { font-weight: 600; line-height: 1.25; color: var(--bs-link-color); }
.person-card:hover .person-name { text-decoration: underline; }
.person-years { font-size: .8rem; color: var(--bs-secondary-color); }
.person-note { font-size: .8rem; line-height: 1.3; color: var(--bs-body-color); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
