/*
 * JS opt-in only. Load alongside pjm-disclosures.js, preferably after feature CSS.
 * Native details behavior, summary display/padding/focus and semantic icons stay intact.
 * --replace-before/after require BOTH an explicit legacy selector and its arrow signature.
 * Unknown custom indicators get marker hiding only; [data-pjm-disclosure="preserve"]
 * excludes a whole subtree. [data-pjm-disclosures] opts an additional PJM root in.
 * summary[data-pjm-disclosure-before="icon"] (or -after="icon") explicitly preserves
 * that semantic pseudo-element while allowing a separate chevron. No summary layout rules.
 */
summary.pjm-disclosure-summary {
    list-style: none;
}

summary.pjm-disclosure-summary::marker {
    content: "";
}

summary.pjm-disclosure-summary::-webkit-details-marker {
    display: none;
}

summary.pjm-disclosure-summary--replace-before::before,
summary.pjm-disclosure-summary--replace-after::after {
    content: none !important;
    display: none !important;
}

/* A font-independent version of the border chevron already used by portal-layout. */
summary.pjm-disclosure-summary > span.pjm-disclosure-chevron {
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    min-width: 18px;
    flex: 0 0 18px;
    margin: 0;
    vertical-align: middle;
    color: inherit;
    line-height: 1;
    pointer-events: none;
    transform: none !important;
    transition: none !important;
    animation: none !important;
}

/* Preserve auto alignment only where the legacy arrow already had it. */
:is(.pjm-campus-collision,.pjm-campus-privacy-note) > summary.pjm-disclosure-summary > span.pjm-disclosure-chevron--trailing,
.pjm-campus-ui :is(.pjm-material-mail,.pjm-campus-history) summary.pjm-disclosure-summary > span.pjm-disclosure-chevron--trailing {
    margin: 0 0 0 auto;
}

summary.pjm-disclosure-summary > span.pjm-disclosure-chevron::before {
    content: "";
    position: absolute;
    box-sizing: border-box;
    width: 7px;
    height: 7px;
    top: 4px;
    left: 5px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
    transition: none !important;
    animation: none !important;
}

/* State belongs to this indicator, never to an open ancestor details. */
summary.pjm-disclosure-summary > span.pjm-disclosure-chevron[data-pjm-disclosure-open="true"] {
    transform: rotate(180deg) !important;
}

@media (prefers-reduced-motion: reduce) {
    summary.pjm-disclosure-summary > span.pjm-disclosure-chevron,
    summary.pjm-disclosure-summary > span.pjm-disclosure-chevron::before {
        transition: none !important;
        animation: none !important;
    }
}
