/* PageTree Accordion block (native <details>/<summary>, no JavaScript) */

:where(.ptb-accordion__title) {
    margin-block: 0 var(--ptb-space-s);
}

:where(.ptb-accordion__item) {
    border-block-end: 1px solid var(--ptb-border);
}

:where(.ptb-accordion__item:first-of-type) {
    border-block-start: 1px solid var(--ptb-border);
}

:where(.ptb-accordion__question) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 1rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

/* Hide the native marker, replaced by a +/- sign */
:where(.ptb-accordion__question)::-webkit-details-marker {
    display: none;
}

:where(.ptb-accordion__question)::after {
    content: "+";
    flex-shrink: 0;
    color: var(--ptb-primary);
    font-size: 1.5em;
    font-weight: 400;
    line-height: 1;
    transition: transform 0.2s ease;
}

:where(.ptb-accordion__item[open] > .ptb-accordion__question)::after {
    transform: rotate(45deg);
}

:where(.ptb-accordion__question:hover, .ptb-accordion__question:focus-visible) {
    color: var(--ptb-primary);
}

:where(.ptb-accordion__answer) {
    padding-block-end: 1rem;
}

:where(.ptb-accordion__answer > :first-child) {
    margin-block-start: 0;
}

:where(.ptb-accordion__answer > :last-child) {
    margin-block-end: 0;
}
