/* RAR Medical Microbiology subject and topic styles. */

/* ============================================================
   Hover-definition tooltips must NEVER be clipped or covered.
   Set once here for EVERY RAR med-micro topic page — this used to be
   patched per-page (and forgotten on most), which is the single most
   recurring bug on these pages. The shared .cav-term tooltip is an
   absolutely-positioned ::after; two things break it:
     1) a later card / panel stacking over it  → fix with z-index
     2) a card (or a horizontal CardSlider, whose overflow-x:auto forces
        overflow-y:auto) clipping the bubble    → fix with overflow + flip
   ============================================================ */

/* 1) Always paint the bubble above any later card/sticky panel. */
.rar-topic-content .cav-term::after { z-index: 90; }

/* 2) Ordinary (non-scrolling) card wrappers never clip the bubble. */
.rar-topic-content .topic-section-card,
.rar-topic-content .solid-text-card,
.rar-topic-content .atl-card,
.rar-topic-content .pneu-org,
.rar-topic-content .phx-org,
.rar-topic-content .hf-factor,
.rar-topic-content .bp-factor,
.rar-topic-content .hy-callout { overflow: visible; }

/* 3) Inside a horizontal card slider the track HAS to clip vertically
   (overflow-x:auto → overflow-y:auto). A term in the card HEADER would have
   its upward bubble clipped off the top of the track, so flip the header
   terms to open DOWNWARD, into the tall card body where there's room. Deeper
   terms (below the card image) keep the default upward bubble. */
.rar-topic-content .cardslider__track .atl-card__h .cav-term::after,
.rar-topic-content .cardslider__track .phx-org-class .cav-term::after,
.rar-topic-content .cardslider__track .hf-factor__name .cav-term::after,
.rar-topic-content .cardslider__track .bp-factor__name .cav-term::after {
    bottom: auto;
    top: calc(100% + 10px);
    left: 0;                       /* anchor to the term's left edge, not centered… */
    right: auto;
    transform: translateY(-6px);   /* …so a header term at the card's left edge can't
                                       overflow the slider's left clip boundary. */
}
.rar-topic-content .cardslider__track .atl-card__h .cav-term:hover::after,
.rar-topic-content .cardslider__track .atl-card__h .cav-term:focus::after,
.rar-topic-content .cardslider__track .atl-card__h .cav-term:focus-visible::after,
.rar-topic-content .cardslider__track .phx-org-class .cav-term:hover::after,
.rar-topic-content .cardslider__track .phx-org-class .cav-term:focus::after,
.rar-topic-content .cardslider__track .phx-org-class .cav-term:focus-visible::after,
.rar-topic-content .cardslider__track .hf-factor__name .cav-term:hover::after,
.rar-topic-content .cardslider__track .hf-factor__name .cav-term:focus::after,
.rar-topic-content .cardslider__track .hf-factor__name .cav-term:focus-visible::after,
.rar-topic-content .cardslider__track .bp-factor__name .cav-term:hover::after,
.rar-topic-content .cardslider__track .bp-factor__name .cav-term:focus::after,
.rar-topic-content .cardslider__track .bp-factor__name .cav-term:focus-visible::after {
    transform: translateY(0);
}
/* keep the bubble from being wider than the card in a slider */
.rar-topic-content .cardslider__track .cav-term::after { max-width: min(280px, 78vw); }
