/* The Unit - standalone accordion quiz */

.tuc-quiz {
    max-width: 900px;
    margin: 0 auto;
    font-family: inherit;
}


/* ============================================================
   STATUS OVERVIEW
   ============================================================ */

.tuc-quiz-status {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f7f7f7;
}

.tuc-quiz-status:last-child {
    margin-top: 18px;
    margin-bottom: 0;
}

.tuc-status-item {
    white-space: nowrap;
}

.tuc-status-unanswered strong {
    font-weight: 700;
}

.tuc-status-correct strong {
    color: #247437;
}

.tuc-status-incorrect strong {
    color: #a52f2f;
}


/* ============================================================
   QUESTION
   ============================================================ */

.tuc-question {
    margin: 0 0 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}

.tuc-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 18px 22px;
    border: 0;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .2s ease;
}

.tuc-question-header:hover {
    background: #f7f7f7;
}

.tuc-question-header h3 {
    margin: 0;
    font-size: 1.15em;
    line-height: 1.4;
}

.tuc-question-toggle {
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
    transition: transform .2s ease;
}

.tuc-question.is-open .tuc-question-toggle {
    transform: rotate(180deg);
}


/* ============================================================
   QUESTION STATUS
   ============================================================ */

.tuc-question.status-correct .tuc-question-header {
    background: #eaf6ed;
}

.tuc-question.status-wrong .tuc-question-header {
    background: #fff1df;
}

.tuc-question.status-correct .tuc-question-header:hover {
    background: #e2f1e6;
}

.tuc-question.status-wrong .tuc-question-header:hover {
    background: #fbe8cf;
}


/* ============================================================
   EXPANDABLE CONTENT
   ============================================================ */

.tuc-question-body {
    padding: 0 22px 22px;
    border-top: 1px solid #eee;
}

.tuc-question-body[hidden] {
    display: none !important;
}

.tuc-question-layout.left {
    display: grid;
    grid-template-columns: minmax(180px, 35%) 1fr;
    gap: 24px;
    align-items: start;
    padding-top: 20px;
}

.tuc-question-layout:not(.left) {
    padding-top: 20px;
}


/* ============================================================
   IMAGES
   ============================================================ */

.tuc-question-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 0 20px;
}

.tuc-question-layout.left .tuc-question-image {
    margin: 0;
}


/* ============================================================
   ANSWERS
   ============================================================ */

.tuc-answers {
    display: grid;
    gap: 10px;
}

.tuc-answer {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: inherit;
    font: inherit;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}

.tuc-answer:hover {
    border-color: #777;
}

.tuc-answer-label {
    min-width: 1.5em;
    font-weight: 700;
}

.tuc-answer.is-correct {
    border-color: #27823b;
    background: #f1f8f3;
}

.tuc-answer.is-wrong {
    border-color: #b63838;
    background: #fff4f4;
}


/* ============================================================
   FEEDBACK
   ============================================================ */

.tuc-feedback {
    margin-top: 14px;
    font-weight: 700;
}

.tuc-feedback.correct {
    color: #247437;
}

.tuc-feedback.wrong {
    color: #a52f2f;
}


/* ============================================================
   ACTION BUTTONS
   ============================================================ */

.tuc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tuc-action {
    padding: 8px 12px;
    border: 1px solid #999;
    border-radius: 4px;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.tuc-action:hover {
    background: #f5f5f5;
}


/* ============================================================
   EXPLANATION
   ============================================================ */

.tuc-explanation {
    margin-top: 14px;
    padding: 12px 14px;
    border-left: 3px solid #999;
    background: #f7f7f7;
    line-height: 1.5;
}


/* ============================================================
   HIDDEN ELEMENTS
   ============================================================ */

[hidden] {
    display: none !important;
}


/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {

    .tuc-quiz-status {
        gap: 8px 18px;
        padding: 12px 16px;
    }

    .tuc-question-header {
        padding: 16px;
    }

    .tuc-question-body {
        padding: 0 16px 18px;
    }

    .tuc-question-layout.left {
        display: block;
    }

    .tuc-question-layout.left .tuc-question-image {
        margin-bottom: 20px;
    }
}
