/* PRISM authored-content rendering: headers, callouts, questions, and their
 * input controls (prism-*). Previously this CSS lived only inside
 * PrismRenderer::getStyles(), which is emitted in exactly one place (the
 * PRISM editor preview iframe). Every other consumer of PrismRenderer output
 * (decks, the teacher lesson view, the PRISM library view) rendered these
 * class names completely unstyled, so a short-answer textarea fell back to
 * the browser default cols=20/rows=3, about 180px wide.
 *
 * Loaded from app/views/partials/prism/assets.php, included from the same
 * layouts and standalone views as partials/math/assets.php, since anywhere
 * math can appear, a PRISM question can appear too.
 *
 * WCAG 2.1 AA: nothing below 0.75rem. See documents/WCAG-STYLE-GUIDE.md.
 */

.prism-header { margin-bottom: 2rem; }
.prism-title { font-size: 1.75rem; margin-bottom: 0.5rem; }
.prism-subtitle { font-size: 1.25rem; color: #666; margin-bottom: 1rem; }
.prism-meta-bar { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.prism-meta-item { font-size: 0.9rem; }
.prism-objectives { background: #f5f5f5; padding: 1rem; border-radius: 4px; margin-top: 1rem; }
.prism-objectives h3 { margin-top: 0; }
.prism-block { margin-bottom: 1.5rem; }
.prism-video-container { position: relative; padding-bottom: 56.25%; height: 0; }
.prism-video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Deck video cards whose url isn't embeddable (not YouTube, not a raw file)
   render as a link-out instead of an empty figure. */
.prism-media-caption { margin: 0 0 0.5rem; color: #444; }
.prism-media-linkout { margin: 0; }
.prism-media-linkout a {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #1976d2;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
}
.prism-media-linkout a:hover { background: #14539e; }
.prism-media-privacy-note { margin: 0.5rem 0 0; font-size: 0.8rem; color: #666; }

.prism-callout { padding: 1rem; border-radius: 4px; margin: 1rem 0; border-left: 4px solid; }
.prism-callout-info { background: #e7f3ff; border-color: #0066cc; }
.prism-callout-tip { background: #e6f4ea; border-color: #137333; }
.prism-callout-warning { background: #fef7e0; border-color: #f9ab00; }
.prism-callout-danger { background: #fce8e6; border-color: #c5221f; }
.prism-callout-keyFact { background: #f3e8ff; border-color: #7c3aed; }
.prism-callout-definition { background: #dbeafe; border-color: #2563eb; }
.prism-callout-example { background: #f0fdf4; border-color: #16a34a; }
.prism-callout-quote { background: #f9fafb; border-color: #6b7280; }
.prism-callout-note { background: #f5f5f5; border-color: #9ca3af; }
.prism-callout-success { background: #e6f4ea; border-color: #137333; }

/* ---------- questions ---------- */

.prism-question { padding: 1rem; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 1rem; }
.prism-question-header { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.prism-question-number { font-weight: bold; flex: 0 0 auto; }
/* No rule existed for the stem: inside the flex header it could not shrink
   below its content width, which pushed long stems past the card edge. */
.prism-question-stem { flex: 1 1 auto; min-width: 0; }

.prism-options { display: flex; flex-direction: column; gap: 0.5rem; }
.prism-option { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.5rem; border-radius: 4px; cursor: pointer; }
.prism-option:hover { background: #f5f5f5; }
.prism-option-correct { background: #e6f4ea; }

/* ---------- short answer / essay ---------- */

.prism-short-answer, .prism-essay { margin-top: 0.75rem; }
.prism-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 5.5rem;   /* 3 rows */
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.55;
    resize: vertical;
}
.prism-essay-input { min-height: 12rem; }
.prism-char-count { text-align: right; font-size: 0.8rem; color: #666; }

/* ---------- ordering ---------- */

.prism-ordering-list { list-style: none; padding: 0; }
.prism-ordering-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; background: #f5f5f5; border-radius: 4px; margin-bottom: 0.5rem; cursor: move; }
.prism-ordering-item.dragging { opacity: 0.5; }
.prism-ordering-input { width: 3rem; text-align: center; }

/* ---------- fill in the blank ---------- */

.prism-word-bank { margin-bottom: 1rem; padding: 0.75rem; background: #f5f5f5; border-radius: 4px; }
.prism-word { display: inline-block; padding: 0.25rem 0.5rem; background: white; border-radius: 4px; margin: 0 0.25rem; }
.prism-blank-row { margin-bottom: 0.5rem; }
.prism-blank-row label { display: flex; align-items: center; gap: 0.5rem; }
.prism-blank-input {
    width: min(100%, 22rem);
    flex: 0 1 22rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.prism-answer { color: #137333; font-style: italic; margin-left: 0.5rem; }

/* ---------- matching ---------- */

.prism-matching-grid { display: flex; gap: 2rem; flex-wrap: wrap; }
.prism-matching-term { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.prism-matching-term select { min-width: 200px; max-width: 100%; }

/* ---------- rubric ---------- */

.prism-rubric { margin-bottom: 1rem; }
.prism-rubric summary { cursor: pointer; padding: 0.5rem; background: #f5f5f5; border-radius: 4px; }
.prism-rubric-content { padding: 1rem; border: 1px solid #ddd; border-top: none; }
.prism-rubric-criterion { margin-bottom: 0.5rem; }

/* ---------- misc ---------- */

.prism-concept { border-bottom: 1px dotted currentColor; cursor: help; font-style: italic; }
.prism-formula { margin: 1rem 0; }
.prism-formula.display-block { display: block; text-align: center; font-size: 1.25em; }
.prism-formula-alt { font-size: 0.85rem; color: #666; margin-top: 0.25rem; text-align: center; font-style: italic; }
.prism-diagram { margin: 1.5rem 0; }
.prism-diagram-title { font-weight: 600; margin-bottom: 0.5rem; }
.prism-diagram-svg svg { max-width: 100%; height: auto; }
.prism-diagram-caption { font-size: 0.85rem; color: #666; margin-top: 0.5rem; font-style: italic; }
.prism-math-block { display: block; text-align: center; margin: 1rem 0; }
