/*
 * EA manual display corrections, 2026-10-06.
 * Purpose: label the existing Flare expand/collapse button, prevent decorative
 * control images from covering policy text, and suppress retired session UI.
 * Load after the manual's normal stylesheet. No policy typography is reset.
 */

/* Exactly one native ExpandAll proxy belongs in this master-page container. */
.ea-manual-topic-tools {
    margin: 0.5rem 0;
}

.ea-manual-topic-tools[hidden],
.ea-manual-topic-tools .ea-manual-duplicate-control {
    display: none !important;
}

.ea-manual-topic-tools .button.expand-all-button,
.ea-manual-topic-tools .button.collapse-all-button {
    box-sizing: border-box;
    width: auto !important;
    height: auto !important;
    min-width: 7.5em;
    min-height: 2em;
    padding: 0.25em 0.65em !important;
    color: #0e406a;
    font: inherit;
    line-height: 1.4;
    white-space: normal;
}

/* Retain the native button and its event handlers; replace only its icon UI. */
.ea-manual-topic-tools .button.expand-all-button .button-icon-wrapper,
.ea-manual-topic-tools .button.collapse-all-button .button-icon-wrapper {
    display: none !important;
}

.ea-manual-topic-tools .ea-manual-control-label {
    display: inline;
    font: inherit;
    color: inherit;
}

/* A visible label is also available before the small display script starts. */
.ea-manual-topic-tools .button.expand-all-button:not(.ea-manual-labeled)::after {
    content: "Expand all";
}

.ea-manual-topic-tools .button.collapse-all-button:not(.ea-manual-labeled)::after {
    content: "Collapse all";
}

.ea-manual-topic-tools .button:focus-visible,
.ea-topic-content .MCDropDownHotSpot:focus-visible,
.ea-topic-content .MCTextPopupHotSpot:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Keep the existing authored SNAP paragraph hierarchy when the shared light
 * master replaces an old topic template. These four values come from the
 * prior manual-level rules; they apply only to paragraphs already marked with
 * those classes and do not depend on an inherited body.manual-topic class.
 */
.ea-topic-content p.manual-level-1 { margin-left: 10px !important; }
.ea-topic-content p.manual-level-2 { margin-left: 36px !important; }
.ea-topic-content p.manual-level-3 { margin-left: 62px !important; }
.ea-topic-content p.manual-level-4 { margin-left: 88px !important; }

/*
 * Flare uses a background icon plus a transparent spacer image. Old imported
 * topic styles and global image rules can collapse that spacer. Reserve a
 * separate area for a CSS-drawn indicator, keeping native links/state intact.
 */
.ea-topic-content .MCDropDownHotSpot {
    position: relative;
    display: inline-block;
    box-sizing: border-box;
    max-width: 100%;
    padding-left: 1.4em !important;
    text-indent: 0 !important;
    background-image: none !important;
}

.ea-topic-content .MCDropDownHotSpot > .MCDropDown_Image_Icon {
    display: none !important;
}

.ea-topic-content .MCDropDownHotSpot::before {
    content: "";
    position: absolute;
    left: 0.05em;
    top: 0.22em;
    box-sizing: border-box;
    width: 0.85em;
    height: 0.85em;
    border: 1px solid currentColor;
    border-radius: 1px;
    background-image: linear-gradient(currentColor, currentColor),
                      linear-gradient(currentColor, currentColor);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 65% 1px, 1px 65%;
    pointer-events: none;
}

.ea-topic-content .MCDropDownHotSpot[aria-expanded="true"]::before,
.ea-topic-content .MCDropDown_Open > .MCDropDownHead > .MCDropDownHotSpot::before {
    background-size: 65% 1px, 0 0;
}

/* Glossary terms remain ordinary inline links with their native popup. */
.ea-topic-content .MCTextPopupHotSpot {
    display: inline !important;
    float: none !important;
    padding: 0 !important;
    background-image: none !important;
}

.ea-topic-content .MCTextPopupHotSpot > .MCHelpControl_Image_Icon {
    display: none !important;
}

/*
 * Retired light-template UI only. These exact IDs do not match policy notes.
 * No localStorage, sessionStorage, or cookies are read, cleared, or rewritten.
 * Source references to EA_SessionTools.js must also be removed.
 */
#ea-session-tools,
#ea-session-panel,
#ea-session-panel-backdrop,
#ea-daily-reset-notice {
    display: none !important;
}

@media print {
    .ea-manual-topic-tools {
        display: none !important;
    }

    .ea-topic-content .MCDropDownHotSpot {
        padding-left: 0 !important;
    }

    .ea-topic-content .MCDropDownHotSpot::before {
        display: none;
    }
}
