/*
 * Styles for DITA expander headings (e.g. embedded videos in user guide
 * articles). The article HTML is injected into the sspContentDetail LWC
 * via innerHTML, so component-scoped CSS cannot reach it. Loaded as a
 * global stylesheet via lightning/platformResourceLoader (loadStyle).
 *
 * The expander class is added to the heading by sspContentDetail.js
 * (_initExpanders), and `sspExpander--open` is toggled on click.
 */

/*
 * The heading uses normal block/inline flow (NOT flex) so the title
 * text and the trailing copy-link anchor (.sspHeadingLink) stay inline
 * with each other and wrap together onto the same lines. The arrow is
 * an inline-block ::before that vertical-aligns with the text. Wrapped
 * lines hang under the title (text-indent + padding-left trick), so the
 * second line starts where the first line of text begins, not under
 * the arrow.
 */
/*
 * Heading uses normal inline flow so the title text and the trailing
 * copy-link anchor wrap together. The arrow is absolutely positioned in
 * a reserved gutter on the left so it stays put regardless of how many
 * lines the title wraps to, and rotates around its own center.
 */
.sspExpander {
    position: relative;
    cursor: pointer;
    user-select: none;
    padding: 0.4rem 0.6rem 0.4rem 1.8rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    transition: background-color 0.15s ease;
}

.sspExpander:hover {
    background-color: #F4F6FB;
}

.sspExpander:focus-visible {
    outline: 2px solid #0A1541;
    outline-offset: 2px;
}

.sspExpander::before {
    /* U+25B6 + U+FE0E (variation selector 15) forces text-style rendering
       so iOS / macOS don't substitute the emoji "play button" glyph. */
    content: '\25B6\FE0E';
    position: absolute;
    left: 0.5rem;
    top: 0.8rem;
    width: 1rem;
    height: 1.5em;
    line-height: 1.5em;
    text-align: center;
    font-size: 0.7em;
    color: #0A1541;
    /* Stick to a generic family so the glyph doesn't pick up an emoji
       font's color rendering on platforms that ignore the VS15 hint. */
    font-family: 'Arial', sans-serif;
    transition: transform 0.2s ease;
    transform-origin: 50% 50%;
}

.sspExpander.sspExpander--open::before {
    transform: rotate(90deg);
}

/* Add breathing room above every sibling that follows the expander
   heading. Using `~` instead of `+` ensures the gap appears in both
   states: between the heading and the first paragraph (collapsed) and
   between the video and the paragraph below it (expanded). */
.sspExpander ~ * {
    margin-top: 0.75rem;
}

/* ─── DITA article spacing ─────────────────────────────────────────────
 * The SLDS reset strips margin/padding from <p>, <h1>–<h6>, <ol>, <ul>, <dl>.
 * Restore vertical rhythm for all block elements inside article content.
 * Uses !important to override the SLDS reset which has platform specificity.
 */
.sspArticleContent p,
.sspArticleContent div,
.sspArticleContent ol,
.sspArticleContent ul,
/* .sspArticleContent h1,
.sspArticleContent h2, */
.sspArticleContent h3,
.sspArticleContent h4,
.sspArticleContent h5,
.sspArticleContent h6,
.sspArticleContent dl,
.sspArticleContent table,
.sspArticleContent pre,
.sspArticleContent figure,
.sspArticleContent img,
.sspArticleContent span.figcap,
.sspArticleContent .fig--title {
    margin-top: 0.75rem !important;
}

/* Images inside running text are inline icons; drop the block top margin so
   they align to the text. Standalone/figure images are unmatched and keep it. */
.sspArticleContent :is(p, li, dt, dd, td, th, a, span, h1, h2, h3, h4, h5, h6) img {
    margin-top: 0 !important;
    vertical-align: middle;
}

/* Remove top margin from the very first child to avoid double spacing at top */
.sspArticleContent > :first-child {
    margin-top: 0 !important;
}

/* Figure captions are <span> (inline) — force block display so margin-top works */
.sspArticleContent span.figcap,
.sspArticleContent .fig--title {
    display: block;
}

/* ─── Image-map figures ────────────────────────────────────────────────
 * Image-map screenshots are wrapped (in JS, sspContentDetail._createImageMapOverlays)
 * in `.sspImageMapContainer`, with an absolutely-positioned SVG hover
 * overlay pinned to top:0 of that container. The generic `img` margin-top
 * above overrides the image's inline `margin:0` and pushes the image DOWN
 * inside its container while the overlay stays put — so the blue hover
 * highlight no longer lines up with the image. The container (a <div>)
 * already receives the spacing via the `.sspArticleContent div` rule, so
 * zero out the margin on the inner image to keep image and overlay aligned.
 * More specific than `.sspArticleContent img`, so it wins the !important tie.
 */
.sspArticleContent .sspImageMapContainer img {
    margin-top: 0 !important;
}

/* ─── Image-map card ───────────────────────────────────────────────────
 * sspContentDetail._styleImageMapHeaders() wraps the instruction banner
 * (.sspImageMapHeader) and the screenshot together in .sspImageMapCard so
 * they read as a single component: one border, one radius and one layered
 * drop shadow around the pair. `overflow:hidden` clips the screenshot's
 * bottom corners to the rounded card; the banner text is inset by its own
 * padding while the screenshot sits flush to the card edges. Width follows
 * the screenshot so the border hugs it at every breakpoint.
 */
.sspArticleContent .sspImageMapCard {
    width: fit-content;
    max-width: 100%;
    background: #FFFFFF;
    border: 1px solid rgba(229, 233, 243, 1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0px 0.33px 1.11px 0px rgba(0, 37, 133, 0.0055),
        0px 1.46px 2.57px 0px rgba(0, 37, 133, 0.0088),
        0px 3.63px 5.88px 0px rgba(0, 37, 133, 0.0112),
        0px 7.07px 12.52px 0px rgba(0, 37, 133, 0.0145),
        0px 12px 24px 0px rgba(0, 37, 133, 0.02);
}

/* ─── Image-map instruction banner ────────────────────────────────────
 * The "Select different parts of the screenshot below ..." line that sits
 * above an image-map screenshot, inside .sspImageMapCard.
 * sspContentDetail._styleImageMapHeaders() builds it: an inline SVG
 * hand-cursor icon (.sspImageMapHeaderIcon) followed by the instruction
 * text (.sspImageMapHeaderText).
 *
 * Layout: icon + text in a row. Font size/line-height match the page body
 * text via the DXP theme tokens (--dxp-s-body-font-size / -line-height), so
 * the banner reads at the same size as the surrounding article text and
 * scales responsively with the theme's root font (no fixed px breakpoint).
 * Padding, gap and the icon are em-based so the whole banner scales as one
 * unit. Colour stays navy #0A1541 in the heading font.
 */
.sspArticleContent .sspImageMapHeader {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
    padding: 1.25em 1.75em;
    color: #0A1541;
    font-family: var(--m-files-font-heading, 'Figtree', sans-serif);
    font-weight: 400;
    font-size: var(--dxp-s-body-font-size, 1rem);
    line-height: var(--dxp-s-body-line-height, 1.5);
    box-sizing: border-box;
}

.sspArticleContent .sspImageMapHeaderIcon {
    /* Size to the line box (1.5em ≈ one text line) so the icon stays aligned
       with the first line of text and scales with the font. */
    flex: 0 0 1.5em;
    width: 1.5em;
    height: 1.5em;
    display: block;
}

.sspArticleContent .sspImageMapHeaderText {
    flex: 1 1 auto;
    min-width: 0; /* allow the text to wrap instead of overflowing on small screens */
}

/* Inside the card the banner sits flush at the top and the screenshot flush
 * below it. The generic `.sspArticleContent div { margin-top }` rule would
 * otherwise add 0.75rem above the banner and above the figure wrapper /
 * nested containers (.imagemap, .sspImageMapContainer) — and because the
 * card's `overflow:hidden` traps those first-child margins inside it, they
 * reopen gaps. Zero the whole chain so spacing is controlled only by the
 * banner padding. Scoped to the card / “directly after a banner”, so image
 * maps without a banner keep their normal spacing. */
.sspArticleContent .sspImageMapCard > .sspImageMapHeader,
.sspArticleContent .sspImageMapHeader + *,
.sspArticleContent .sspImageMapHeader + * .imagemap,
.sspArticleContent .sspImageMapHeader + * .sspImageMapContainer {
    margin-top: 0 !important;
}
