/* ============================================================
   RAR PATHOLOGY · Positional Aspiration Selector — page-local styles.
   Scoped to .rar-topic-content .asp-sel so nothing leaks.

   The two panels are height-matched by ONE shared height value
   (--asp-h, scoped to the component root — never :root, which would
   leak a generic --h into the global cascade). Each stage derives its
   own width from its own aspect-ratio, which must equal the base
   PNG's intrinsic ratio exactly or the traced overlays drift off the
   anatomy as the viewport changes.

     frontal  1449 x 1085
     lateral   701 x 1186
   ============================================================ */

.rar-topic-content .asp-sel {
    --asp-h: 470px;
    display: block;
    color: var(--text, #111318);
}

/* ---------- lead ---------- */
.rar-topic-content .asp-sel .asp-lead {
    font-size: 14px;
    line-height: 1.55;
    color: var(--text, #111318);
    margin: 0 0 20px;
}

/* ---------- position picker ---------- */
.rar-topic-content .asp-sel .asp-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.rar-topic-content .asp-sel .asp-pos {
    flex: 1;
    min-width: 190px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font: inherit;
    color: var(--text, #111318);
    border: 1.5px solid #e3e6ec;
    border-radius: 12px;
    background: #fff;
    transition: .16s;
    text-align: left;
}

.rar-topic-content .asp-sel .asp-pos:hover { border-color: #b9c2d0; background: #fafbfc; }

.rar-topic-content .asp-sel .asp-pos[aria-pressed="true"] {
    border-color: #1f6feb;
    background: #f3f8ff;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .1);
}

.rar-topic-content .asp-sel .asp-pos:focus-visible {
    outline: 3px solid rgba(10, 132, 255, .5);
    outline-offset: 2px;
}

.rar-topic-content .asp-sel .asp-pos svg { flex: 0 0 46px; }
.rar-topic-content .asp-sel .asp-pos b { display: block; font-size: 14px; color: var(--text, #111318); }
.rar-topic-content .asp-sel .asp-pos span { display: block; font-size: 12px; color: var(--text, #111318); opacity: .6; margin-top: 2px; }

/* ---------- panels ---------- */
.rar-topic-content .asp-sel .asp-panels {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.rar-topic-content .asp-sel .asp-panel {
    flex: 0 0 auto;
    border: 1px solid #e6e9ef;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.rar-topic-content .asp-sel .asp-phead {
    padding: 11px 14px;
    border-bottom: 1px solid #eef0f4;
    background: #fafbfc;
    min-height: 56px;
}

.rar-topic-content .asp-sel .asp-phead b { font-size: 13px; letter-spacing: .01em; color: var(--text, #111318); }
.rar-topic-content .asp-sel .asp-phead span { display: block; font-size: 11.5px; opacity: .6; margin-top: 1px; color: var(--text, #111318); }

/* Height-driven stage: one shared height, width derived from each
   base image's own intrinsic ratio. Keeps both panels the same height
   with tops and bottoms aligned. */
.rar-topic-content .asp-sel .asp-stage {
    position: relative;
    display: block;
    height: var(--asp-h);
    /* The panel is a column flex container, so a stretched stage would take
       the panel's width (set by the header text) instead of its own
       ratio-derived width, leaving dead space beside the art. Opting out of
       stretch lets aspect-ratio drive the width from the height. */
    align-self: center;
    flex: 0 0 auto;
}

.rar-topic-content .asp-sel .asp-stage--frontal { aspect-ratio: 1449 / 1085; }
.rar-topic-content .asp-sel .asp-stage--lateral { aspect-ratio: 701 / 1186; }

.rar-topic-content .asp-sel .asp-base {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rar-topic-content .asp-sel .asp-ov {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;   /* no clickable overlay regions in this figure */
}

/* ---------- readout ---------- */
.rar-topic-content .asp-sel .asp-readout {
    margin-top: 18px;
    border: 1px solid #e6e9ef;
    border-left: 3px solid #1f6feb;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fbfcfe;
}

.rar-topic-content .asp-sel .asp-readout > b {
    font-size: 13px;
    display: block;
    margin-bottom: 8px;
    color: var(--text, #111318);
}

.rar-topic-content .asp-sel .asp-seg {
    display: flex;
    align-items: baseline;
    gap: 9px;
    padding: 5px 0;
    font-size: 14px;
    color: var(--text, #111318);
}

/* Dependent-segment names carry the answer — bold at detail size so they
   read as terms, not as running text. */
.rar-topic-content .asp-sel .asp-seg b {
    font-weight: 800;
    font-size: var(--text-detail, 15px);
}

.rar-topic-content .asp-sel .asp-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 9px;
    transform: translateY(-1px);
}

.rar-topic-content .asp-sel .asp-seg em {
    font-style: normal;
    opacity: .58;
    font-size: 12.5px;
}

.rar-topic-content .asp-sel .asp-why {
    margin-top: 12px;
    font-size: 13px;
    line-height: 1.55;
    opacity: .82;
    color: var(--text, #111318);
}

/* ---------- replay ---------- */
.rar-topic-content .asp-sel .asp-bar {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.rar-topic-content .asp-sel .asp-replay {
    font: inherit;
    font-size: 13px;
    padding: 7px 15px;
    border: 1px solid #d6dbe3;
    background: #fff;
    color: var(--text, #111318);
    border-radius: 8px;
    cursor: pointer;
}

.rar-topic-content .asp-sel .asp-replay:hover { background: #f5f7fa; }

.rar-topic-content .asp-sel .asp-replay:focus-visible {
    outline: 3px solid rgba(10, 132, 255, .5);
    outline-offset: 2px;
}

/* ---------- responsive: prototype's own breakpoints ---------- */
@media (max-width: 980px) {
    .rar-topic-content .asp-sel { --asp-h: 380px; }
}

@media (max-width: 720px) {
    .rar-topic-content .asp-sel { --asp-h: 320px; }
}
