/**
 * Answering Questions — widget styles.
 *
 * Sits INSIDE the fleet UniversalContainer card (navy-gray field, blue instruction
 * banner on top, footer at the bottom) — this file styles only the exercise content:
 * the picture (which IS the audio button), the written-sentence slot, the question and
 * the choice cards. Styled like the fleet's other tap-a-choice widgets (Articles /
 * Sentence Builder): white cards, 2px neutral edge, soft shadow, blue hover.
 *
 * STATIC FRAME (§7.1): fixed minimum sizes on the picture, sentence and feedback slots;
 * choices keyed per item so state never ghosts (§6.6); `transition: none` on state-
 * swapped nodes. Every interactive state declared. No !important.
 */

.answering-questions-root {
    font-family: var(--as-font, inherit);
    color: var(--as-text, #1f2937);
}

.answering-questions-root .aq-loading,
.answering-questions-root .aq-error,
.answering-questions-root .aq-empty {
    padding: 32px 16px;
    text-align: center;
}
.answering-questions-root .aq-empty-sub { color: #6b7280; }

.answering-questions-root .aq-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---- frame (inside the container card) ---------------------------------- */

.answering-questions-root .aq-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 480px;
    padding: 4px 4px 8px;
}
.answering-questions-root .aq-body--complete { min-height: 0; }
/* Lyda 09-18: the fleet card is OUTLINE only here — white inside, keep the edge. */
.answering-questions-root .uf-container { background: #fff; }

/* ---- picture = the audio button ------------------------------------------- */

.answering-questions-root .aq-stimulus {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1 / 1;
}
.answering-questions-root .aq-picture {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 2px solid #d1d5db;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
}
.answering-questions-root .aq-picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.answering-questions-root .aq-picture:hover,
.answering-questions-root .aq-picture:focus {
    background: #fff;
    border-color: var(--as-read-accent, #2563eb);
}
.answering-questions-root .aq-picture:focus-visible {
    outline: 3px solid var(--as-read-accent, #2563eb);
    outline-offset: 2px;
}
/* audio-only tap acknowledgment (§12.3): a brief blue ring while the clip plays */
.answering-questions-root .aq-picture--speaking,
.answering-questions-root .aq-picture--speaking:hover,
.answering-questions-root .aq-picture--speaking:focus {
    border-color: var(--as-read-accent, #2563eb);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}
/* listening-only level: the same card, no picture */
.answering-questions-root .aq-stimulus--audio-only { max-width: 200px; aspect-ratio: 2 / 1; }
.answering-questions-root .aq-audio-only {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--as-read-accent, #2563eb);
}

/* ---- written sentence slot (pre-allocated) ----------------------------------- */

.answering-questions-root .aq-sentence-slot {
    width: 100%;
    min-height: 3.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.answering-questions-root .aq-sentence {
    margin: 0;
    text-align: center;
    font-size: 1.2rem;
    line-height: 1.45;
    color: var(--as-text, #1f2937);
}

/* ---- blocked-autoplay CTA ------------------------------------------------------ */

.answering-questions-root .aq-listen-cta {
    min-height: 56px;
    padding: 12px 36px;
    border: 0;
    border-radius: 999px;
    background: var(--as-primary-bg, #15803d);
    color: var(--as-primary-text, #fff);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: none;
    cursor: pointer;
}
.answering-questions-root .aq-listen-cta:hover,
.answering-questions-root .aq-listen-cta:focus { background: #166534; color: #fff; }
.answering-questions-root .aq-listen-cta:focus-visible { outline: 3px solid var(--as-read-accent, #2563eb); outline-offset: 2px; }

/* ---- question (tap = hear it again) ------------------------------------------------ */

.answering-questions-root .aq-question {
    width: 100%;
    max-width: 560px;
    min-height: 52px;
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--as-field-instruction, #1e40af);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
}
.answering-questions-root .aq-question:hover,
.answering-questions-root .aq-question:focus { background: rgba(255, 255, 255, 0.6); color: var(--as-field-instruction, #1e40af); }
.answering-questions-root .aq-question:focus-visible { outline: 3px solid var(--as-read-accent, #2563eb); outline-offset: 2px; }

/* ---- choices: white cards, like Articles' choice buttons ---------------------------- */

.answering-questions-root .aq-choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 560px;
}
.answering-questions-root .aq-choice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 10px 18px;
    border: 2px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    color: var(--as-text, #1f2937);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    transition: none;
}
.answering-questions-root .aq-choice:hover,
.answering-questions-root .aq-choice:focus {
    background: var(--as-read-bg, #eff6ff);
    border-color: var(--as-read-accent, #2563eb);
    color: #1d4ed8;
}
.answering-questions-root .aq-choice:focus-visible { outline: 3px solid var(--as-read-accent, #2563eb); outline-offset: 2px; }
.answering-questions-root .aq-choice:active { transform: translateY(1px); }
.answering-questions-root .aq-choice:disabled { cursor: default; transform: none; }

.answering-questions-root .aq-choice--correct,
.answering-questions-root .aq-choice--correct:hover,
.answering-questions-root .aq-choice--correct:focus,
.answering-questions-root .aq-choice--correct:disabled {
    background: var(--as-primary-bg, #15803d);
    border-color: var(--as-primary-bg, #15803d);
    color: #fff;
    opacity: 1;
}
.answering-questions-root .aq-choice--notyet,
.answering-questions-root .aq-choice--notyet:hover,
.answering-questions-root .aq-choice--notyet:focus,
.answering-questions-root .aq-choice--notyet:disabled {
    background: #f9fafb;
    border-color: #fca5a5;
    color: #6b7280;
    opacity: 1;
}
.answering-questions-root .aq-choice--out,
.answering-questions-root .aq-choice--out:hover,
.answering-questions-root .aq-choice--out:focus,
.answering-questions-root .aq-choice--out:disabled {
    background: #f9fafb;
    border-style: dashed;
    border-color: #d1d5db;
    color: #9ca3af;
    box-shadow: none;
    opacity: 0.7;
}
.answering-questions-root .aq-choice--rest,
.answering-questions-root .aq-choice--rest:disabled { color: #6b7280; opacity: 0.8; }
.answering-questions-root .aq-choice--glow,
.answering-questions-root .aq-choice--glow:hover,
.answering-questions-root .aq-choice--glow:focus {
    background: #fff;
    border-color: var(--as-success, #15803d);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.3);
    color: var(--as-text, #1f2937);
}
.answering-questions-root .aq-choice-text { min-width: 0; overflow-wrap: anywhere; }
.answering-questions-root .aq-choice-mark { flex: 0 0 auto; font-size: 1.3rem; font-weight: 700; }

/* ---- feedback slot (pre-allocated) ------------------------------------------------------ */

.answering-questions-root .aq-feedback-slot {
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.answering-questions-root .aq-feedback {
    padding: 4px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--as-text, #1f2937);
    font-size: 1.05rem;
    font-weight: 600;
}
.answering-questions-root .aq-feedback--ok { background: var(--as-success-bg, #f0fdf4); color: var(--as-success, #15803d); }

.answering-questions-root .aq-preview-note {
    padding: 24px;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    text-align: center;
    color: #6b7280;
}

@media (min-width: 768px) {
    .answering-questions-root .aq-body { gap: 14px; }
    .answering-questions-root .aq-stimulus { max-width: 300px; }
    .answering-questions-root .aq-choices--4 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 380px) {
    .answering-questions-root .aq-stimulus { max-width: 230px; }
    .answering-questions-root .aq-question { font-size: 1.15rem; }
    .answering-questions-root .aq-choice { font-size: 1.05rem; padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .answering-questions-root .aq-choice:active { transform: none; }
}
