/* Statics practice pages. Builds on css/main.css (header, footer, buttons). */

.statics-main {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
}

.statics-main a,
.statics-footer a {
    color: #5a4fcf;
}

.intro {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.intro p + p {
    margin-top: 0.75rem;
}

.error-box {
    background: #fff4e5;
    border: 1px solid #f0b46a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    line-height: 1.5;
}

.statics-footer p {
    max-width: 760px;
    margin: 0 auto;
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Hub ----------------------------------------------------------------- */

.chapter + .chapter {
    margin-top: 2rem;
}

.chapter h2 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: #333;
}

.chapter-picker-heading {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    color: #333;
}

.chapter-list {
    margin-bottom: 2rem;
}

.item-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.item-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    height: 100%;
    padding: 1.25rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, #f5f7fa 0%, #dde3f0 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.statics-main .item-card {
    color: inherit;
}

.item-card:hover,
.item-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.item-section {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b63c9;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.item-summary {
    color: #555;
    line-height: 1.45;
}

/* Reference card on a chapter page */

.reference-card {
    margin-top: 1rem;
    padding: 1.25rem;
    border-radius: 10px;
    background: #f7f8fc;
    border: 1px solid #e2e5f0;
}

.reference-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #333;
}

.reference-scroll {
    overflow-x: auto;
}

.reference-card table {
    width: 100%;
    border-collapse: collapse;
    line-height: 1.45;
}

.reference-card th,
.reference-card td {
    text-align: left;
    vertical-align: top;
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid #e2e5f0;
}

.reference-card thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b63c9;
}

.reference-card tbody th {
    font-weight: 600;
    white-space: nowrap;
}

.reference-card td:last-child {
    color: #555;
}

/* On a phone, each letter becomes a small block: letter, meaning, notes. */
@media (max-width: 560px) {
    .reference-card thead {
        display: none;
    }

    .reference-card table,
    .reference-card tbody,
    .reference-card tr,
    .reference-card th,
    .reference-card td {
        display: block;
    }

    .reference-card tr {
        padding: 0.6rem 0;
        border-bottom: 1px solid #e2e5f0;
    }

    .reference-card th,
    .reference-card td {
        padding: 0.1rem 0;
        border-bottom: none;
    }

    .reference-card tbody th {
        white-space: normal;
    }

    .reference-card td:nth-of-type(1) {
        font-weight: 600;
        color: #4a4a6a;
    }
}

.reference-figure {
    margin-bottom: 0.75rem;
    text-align: center;
}

.reference-figure svg {
    max-width: 100%;
    height: auto;
}

.reference-glyph {
    font-family: 'Times New Roman', 'Noto Serif', Georgia, serif;
    font-size: 1.35rem;
    font-weight: normal;
}

/* Practice ------------------------------------------------------------ */

.problem-card,
.solution-card {
    border-radius: 10px;
    padding: 1.5rem;
}

.problem-card {
    background: #f7f8fc;
    border: 1px solid #e2e5f0;
}

.prompt {
    font-size: 1.2rem;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.answer-fields {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.answer-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.answer-label {
    font-size: 1.15rem;
    font-weight: 600;
    min-width: 2.5rem;
}

.answer-label.is-symbol {
    font-style: italic;
}

.answer-input {
    font: inherit;
    font-size: 1.1rem;
    width: 12rem;
    max-width: 100%;
    padding: 0.55rem 0.7rem;
    border: 2px solid #c9cde0;
    border-radius: 6px;
    background: white;
}

.answer-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.answer-unit {
    font-size: 1.1rem;
    min-width: 2.5rem;
}

.answer-mark {
    font-size: 1.3rem;
    font-weight: 700;
    width: 1.5rem;
}

.answer-row.is-correct .answer-input {
    border-color: #2e7d32;
}

.answer-row.is-correct .answer-mark {
    color: #2e7d32;
}

.answer-row.is-incorrect .answer-input {
    border-color: #c62828;
}

.answer-row.is-incorrect .answer-mark {
    color: #c62828;
}

.answer-row:not(.is-correct):not(.is-incorrect) .answer-mark {
    visibility: hidden;
}

/* Multiple-choice answers */

.answer-choice {
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.answer-legend {
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.choice-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.choice {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.8rem;
    border: 2px solid #c9cde0;
    border-radius: 6px;
    background: white;
    font-size: 1.1rem;
    cursor: pointer;
}

.choice input {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: #667eea;
}

.choice:has(input:checked) {
    border-color: #667eea;
    background: #f2f4ff;
}

.choice:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.35);
}

.answer-choice.is-correct .choice:has(input:checked) {
    border-color: #2e7d32;
}

.answer-choice.is-incorrect .choice:has(input:checked) {
    border-color: #c62828;
}

.answer-choice.is-correct .answer-mark {
    color: #2e7d32;
}

.answer-choice.is-incorrect .answer-mark {
    color: #c62828;
}

.answer-choice:not(.is-correct):not(.is-incorrect) .answer-mark {
    visibility: hidden;
}

/* Diagrams */

.problem-figure {
    margin: 0 0 1.25rem;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e2e5f0;
    border-radius: 8px;
    text-align: center;
}

.problem-figure svg {
    display: block;
    width: 100%;
    max-width: 460px;
    height: auto;
    margin: 0 auto;
}

/* Solution lines (find the error) */

.choice-lines .choice {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.98rem;
}

.choice-lines .choice:not(.is-line) {
    font-family: inherit;
    font-size: 1.05rem;
    margin-top: 0.35rem;
}

.line-number {
    flex: none;
    min-width: 1.4rem;
    color: #6b63c9;
    font-weight: 700;
    text-align: right;
}

/* Dropdown answers */

.answer-select-row {
    gap: 0.75rem;
}

.answer-select-label {
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1 1 14rem;
}

.answer-select {
    font: inherit;
    font-size: 1.05rem;
    padding: 0.45rem 0.6rem;
    border: 2px solid #c9cde0;
    border-radius: 6px;
    background: white;
    min-width: 12rem;
    max-width: 100%;
}

.answer-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.answer-row.is-correct .answer-select {
    border-color: #2e7d32;
}

.answer-row.is-incorrect .answer-select {
    border-color: #c62828;
}

/* Tick-all-that-apply answers */

.is-multi .choice:has(input:checked) {
    border-color: #667eea;
    background: #f2f4ff;
}

.answer-choice.is-multi.is-correct .choice:has(input:checked) {
    border-color: #2e7d32;
}

.answer-choice.is-multi.is-incorrect .choice:has(input:checked) {
    border-color: #c62828;
}

/* Put-in-order answers */

.order-list {
    list-style: none;
    counter-reset: order;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0;
    margin: 0;
}

.order-item {
    counter-increment: order;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.5rem 0.45rem 0.8rem;
    border: 2px solid #c9cde0;
    border-radius: 6px;
    background: white;
    font-size: 1.05rem;
}

.order-item::before {
    content: counter(order) ".";
    flex: none;
    min-width: 1.4rem;
    font-weight: 700;
    color: #6b63c9;
}

.order-text {
    flex: 1;
    line-height: 1.4;
}

.order-buttons {
    display: flex;
    gap: 0.3rem;
    flex: none;
}

.order-move {
    font: inherit;
    font-size: 1rem;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid #c9cde0;
    border-radius: 6px;
    background: #f7f8fc;
    cursor: pointer;
}

.order-move:hover {
    background: #e9ecf7;
}

.order-move:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 1px;
}

/* At the ends the button does nothing; it stays focusable so keyboard
   focus isn't lost when an entry reaches the top or bottom. */
.order-item:first-child .order-up,
.order-item:last-child .order-down {
    opacity: 0.35;
    cursor: default;
}

.is-order.is-correct .order-item {
    border-color: #2e7d32;
}

.is-order.is-incorrect .order-item {
    border-color: #c62828;
}

.statics-footer .adapted-credit {
    margin-top: 0.5rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.feedback {
    min-height: 1.5em;
    margin-top: 1rem;
    font-weight: 600;
    line-height: 1.5;
}

.feedback-correct {
    color: #2e7d32;
}

.feedback-incorrect {
    color: #c62828;
}

.feedback-notice {
    color: #8a5300;
}

.solution-card {
    margin-top: 1.5rem;
    background: #f3f1ff;
    border: 1px solid #d9d4fb;
}

.solution-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.solution-card h2:focus {
    outline: none;
}

.solution-answer {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    white-space: pre-line;
}

.solution-steps {
    padding-left: 1.4rem;
    line-height: 1.6;
}

.solution-steps li + li {
    margin-top: 0.4rem;
}

.mistake-note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-left: 4px solid #c62828;
    background: #fff;
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

.fine-print {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
}

@media (max-width: 480px) {
    .problem-card,
    .solution-card {
        padding: 1rem;
    }

    .prompt {
        font-size: 1.1rem;
    }

    .answer-input {
        width: 9rem;
    }
}

/* Progress and Copy -------------------------------------------------- */

/* Where the session deck is, above the prompt (practice.js, deck.js). */
.deck-count {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a4a6a;
}

/* Shown when a round has run out and a new one starts. */
.round-notice {
    margin-bottom: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-left: 4px solid #667eea;
    background: #fff;
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

.item-progress {
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.85rem;
    color: #4a4a6a;
}

.progress-tools {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e5f0;
    color: #555;
    line-height: 1.5;
}

.progress-tools .btn {
    margin-top: 0.6rem;
}

.reset-status,
.copy-status {
    margin-top: 0.5rem;
    color: #555;
    line-height: 1.5;
}

.copy-fallback {
    margin-top: 0.75rem;
}

.copy-fallback label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.copy-fallback textarea {
    width: 100%;
    font: inherit;
    font-size: 0.9rem;
    padding: 0.6rem;
    border: 2px solid #c9cde0;
    border-radius: 6px;
}
