/* ============================================================
   RAR MEDICAL MICROBIOLOGY · "Haemophilus influenzae" page styles
   Scoped to .rar-topic-content. Reuses the shared canonical blocks
   (.topic-section-card, .section-label, .solid-text-card, .atl-figure,
   .atl-find-list, .atl-flag, .hy-callout, .cav-term, .vasc-tbd). Mirrors
   the Streptococcus pyogenes / Bordetella pertussis pages. Prefix: hf-.
   ============================================================ */

.rar-topic-content #hf-split h3,
.rar-topic-content #hf-epiglottitis h3,
.rar-topic-content #hf-labid h3,
.rar-topic-content #hf-prevention h3 { color: #111111; margin: 2px 0 12px; }

.rar-topic-content .hf-lead { color: #111111; margin: 2px 0 12px; font-size: 15px; line-height: 1.55; }
.rar-topic-content .hf-body { color: #111111; margin: 4px 0 10px; font-size: 15px; line-height: 1.6; }

/* ---------- Section 1 quick-hit chips ---------- */
.rar-topic-content .hf-chips {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 14px 0 2px;
}
.rar-topic-content .hf-chip {
    display: inline-flex; align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(10, 132, 255, 0.24);
    background: rgba(10, 132, 255, 0.07);
    color: #111111;
    font-size: 12.5px; font-weight: 700; letter-spacing: 0.01em;
    white-space: nowrap;
}

/* ---------- subheads ---------- */
.rar-topic-content .hf-subhead {
    color: #111111; margin: 16px 0 6px; font-size: 16px; font-weight: 800;
}
.rar-topic-content .hf-subhead-note { font-weight: 600; color: #4a5a74; font-size: 14px; }

/* ---------- bullet lists (mirror sp-vf / bp-vf) ---------- */
.rar-topic-content .hf-vf { margin: 4px 0 0; }
.rar-topic-content .hf-vf li { color: #111111; }
.rar-topic-content .hf-vf--lg li { font-size: 15px; line-height: 1.6; margin-bottom: 6px; }
.rar-topic-content .hf-vf--lg .atl-find-emoji { font-size: 15px; }
.rar-topic-content #hf-split .hf-vf strong { font-size: 15px; }

/* ---------- lab-identification card ---------- */
.rar-topic-content .hf-card {
    margin: 4px 0 0;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid rgba(10, 132, 255, 0.16);
    background: linear-gradient(180deg, rgba(238, 245, 255, 0.55), rgba(255, 255, 255, 0.96));
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

/* ---------- clinical / board pearl ---------- */
.rar-topic-content .hf-pearl { display: block; margin-top: 14px; font-size: 14.5px; }

/* ---------- cross-link button (→ SOM) ---------- */
.rar-topic-content .hf-xlink-btn { margin-top: 10px; }

/* ---------- interactive / figure placeholders ---------- */
.rar-topic-content .hf-mount { margin-top: 14px; }

/* ============================================================
   Type b vs. nontypeable — two comparison cards side by side
   (mirrors the Bordetella factor-card pattern; hf- prefix)
   ============================================================ */
.rar-topic-content .hf-factor-grid {
    display: grid; gap: 14px; margin: 6px 0 0;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}
.rar-topic-content .hf-factor-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.rar-topic-content .hf-factor {
    display: flex; flex-direction: column;
    padding: 14px 16px; border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #fff; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}
/* title = black + bold inside a fun colored pill, hover-underline kept */
.rar-topic-content .hf-factor__name {
    margin: 0; color: #111111; font-weight: 800; line-height: 1.3;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.rar-topic-content .hf-factor__name .cav-term {
    display: inline-block; padding: 3px 11px; border-radius: 9px;
    background: var(--hff-bg, rgba(15, 23, 42, 0.05));
    border: 1px solid var(--hff-bd, rgba(15, 23, 42, 0.16));
    color: #111111; font-weight: 800; font-size: 17px;
    text-decoration: underline dotted rgba(17, 17, 17, 0.45);
    text-underline-offset: 3px;
}
.rar-topic-content .hf-factor__name .cav-term:hover,
.rar-topic-content .hf-factor__name .cav-term:focus-visible {
    text-decoration-color: rgba(17, 17, 17, 0.85); filter: brightness(0.97);
}
.rar-topic-content .hf-factor__name .atl-find-emoji { font-size: 17px; }
.rar-topic-content .hf-factor__role { margin: 8px 0 8px; font-size: 13px; font-weight: 700; color: #4a5a74; }
.rar-topic-content .hf-factor__body { margin: 0 0 10px; font-size: 14.5px; line-height: 1.6; color: #111111; }
.rar-topic-content .hf-factor .hf-xlink-btn { margin-top: auto; align-self: flex-start; }

/* per-card hues */
.rar-topic-content .hf-factor--red   { --hff-bg: #ffe0e0; --hff-bd: #ef8a8a; }
.rar-topic-content .hf-factor--green { --hff-bg: #ddf4d9; --hff-bd: #7bc86a; }

/* inline lead-term pill — the syndrome sections (Epiglottitis = type b, Pneumonia =
   nontypeable) open with their strain in a larger red/green pill, mirroring the split
   cards above. Black bold title, dotted hover-underline kept. */
.rar-topic-content .hf-lead .hf-leadpill {
    display: inline-block; padding: 3px 12px; border-radius: 9px;
    background: var(--hff-bg, rgba(15, 23, 42, 0.05));
    border: 1px solid var(--hff-bd, rgba(15, 23, 42, 0.16));
    color: #111111; font-weight: 800; font-size: 18px;
    text-decoration: underline dotted rgba(17, 17, 17, 0.45); text-underline-offset: 3px;
}
.rar-topic-content .hf-lead .hf-leadpill:hover,
.rar-topic-content .hf-lead .hf-leadpill:focus-visible {
    text-decoration-color: rgba(17, 17, 17, 0.85); filter: brightness(0.97);
}
.rar-topic-content .hf-lead .hf-leadpill--red   { --hff-bg: #ffe0e0; --hff-bd: #ef8a8a; }
.rar-topic-content .hf-lead .hf-leadpill--green { --hff-bg: #ddf4d9; --hff-bd: #7bc86a; }

/* enlarged lead titles in Lab-ID / Prevention lists */
.rar-topic-content .hf-vf--titled li > strong:first-of-type { font-size: 16.5px; font-weight: 800; }

/* ============================================================
   Epiglottitis figures — the two shorter shots stacked on the left,
   the tall thumb-sign x-ray on the right; the stack's combined height
   ≈ the x-ray's height (tune the column ratio if the art changes).
   ============================================================ */
/* Presentation text on the left, the compact image block on the right */
.rar-topic-content .hf-epi-row {
    display: flex; gap: 24px; align-items: flex-start; margin-top: 6px;
}
.rar-topic-content .hf-epi-text { flex: 1 1 auto; min-width: 0; }
.rar-topic-content .hf-epi-text .hf-subhead { margin-top: 0; }
.rar-topic-content .hf-epi-row .hf-figgrid { flex: 0 0 auto; margin-top: 0; }

.rar-topic-content .hf-figgrid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
    gap: 12px; align-items: start; margin-top: 16px;
    max-width: 500px;   /* keep the whole block compact — x-ray ≈ half its old size */
}
@media (max-width: 820px) {
    .rar-topic-content .hf-epi-row { flex-direction: column; }
    .rar-topic-content .hf-epi-row .hf-figgrid { width: 100%; }
}
.rar-topic-content .hf-figcol { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rar-topic-content .hf-gridfig { margin: 0; min-width: 0; }
.rar-topic-content .hf-gridfig__title {
    font-size: 13.5px; font-weight: 800; color: #111111; text-align: center;
    margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* hints wrap at this compact width and break the height match — the ⤢ Zoom
   button already signals interactivity, so drop them here. */
.rar-topic-content .hf-gridfig__hint { display: none; }
.rar-topic-content .hf-gridfig .atl-figure__img {
    width: 100%; height: auto; max-width: 100%; border-radius: 12px; display: block;
}
@media (max-width: 720px) {
    .rar-topic-content .hf-figgrid { grid-template-columns: 1fr; }
}

/* ============================================================
   Lab-ID — two-column (text left · chocolate-agar figure right)
   ============================================================ */
.rar-topic-content .hf-labid-row {
    display: flex; gap: 18px; align-items: flex-start; margin-top: 4px;
}
.rar-topic-content .hf-labid-row .hf-card { flex: 1 1 auto; margin: 0; }
.rar-topic-content .hf-labid-row .hf-labfig { flex: 0 0 300px; max-width: 300px; margin: 0; }
.rar-topic-content .hf-labid-row .hf-labfig .atl-figure__img { width: 100%; height: auto; border-radius: 12px; }
.rar-topic-content .hf-labid-row .hf-labfig figcaption {
    margin-top: 8px; font-size: 12.5px; color: #4a5a74; text-align: center; line-height: 1.45;
}

@media (max-width: 760px) {
    .rar-topic-content .hf-factor-grid--2 { grid-template-columns: minmax(0, 1fr); }
    .rar-topic-content .hf-labid-row { flex-direction: column; }
    .rar-topic-content .hf-labid-row .hf-labfig { flex-basis: auto; max-width: 100%; }
}
