/*
 * disclosure.css — a part of a page that opens and closes: more details, a section on a phone.
 *
 * <details class="app-disclosure" name="(an accordion group)" open>
 *   <summary class="app-disclosure-summary">
 *     <span class="app-disclosure-title">Weitere Angaben</span>
 *     <span class="app-disclosure-meta">3 Felder</span>
 *     <span class="app-disclosure-chevron" aria-hidden="true">[icon: chevron-down]</span>
 *   </summary>
 *   <div class="app-disclosure-body">…</div>
 * </details>
 *
 * The browser's own details: keyboard, state, find-in-page opening a closed one, and with a
 * shared name an accordion where one is open at a time. The summary is a control row; lines
 * between disclosures are inset shadows, one line where two meet.
 */
@layer components {
    .app-disclosure {
        box-shadow: inset 0 calc(-1 * var(--app-border-width)) 0 var(--app-color-line);
    }

    .app-disclosure:not(.app-disclosure + .app-disclosure) {
        box-shadow:
            inset 0 var(--app-border-width) 0 var(--app-color-line),
            inset 0 calc(-1 * var(--app-border-width)) 0 var(--app-color-line);
    }

    .app-disclosure-summary {
        display: flex;
        align-items: center;
        gap: var(--app-space-inline);
        min-block-size: var(--app-control-height);
        padding-block: var(--app-space-control-y);
        border-radius: var(--app-radius-option);
        color: var(--app-color-text);
        list-style: none;
        cursor: pointer;
    }

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

    .app-disclosure-title {
        flex: 1 1 auto;
        min-inline-size: 0;
        font-size: var(--app-text-body-size);
        font-weight: var(--app-text-strong-weight);
        line-height: var(--app-text-body-leading);
    }

    .app-disclosure-meta {
        color: var(--app-color-text-subtle);
        font-size: var(--app-text-help-size);
        line-height: var(--app-text-help-leading);
    }

    .app-disclosure-meta:empty {
        display: none;
    }

    .app-disclosure-chevron {
        display: inline-flex;
        color: var(--app-color-text-subtle);
        transition: transform var(--app-duration-overlay) var(--app-easing);
    }

    .app-disclosure[open] .app-disclosure-chevron {
        transform: rotate(180deg);
    }

    @media (hover: hover) {
        .app-disclosure-summary:hover .app-disclosure-chevron {
            color: var(--app-color-text);
        }
    }

    .app-disclosure-summary:focus-visible {
        outline: var(--app-focus-ring-width) solid var(--app-color-focus);
        outline-offset: var(--app-focus-ring-offset);
    }

    .app-disclosure-body {
        display: flex;
        flex-direction: column;
        gap: var(--app-space-field);
        padding-block: 0 var(--app-space-disclosure);
    }

    @media (pointer: coarse) {
        .app-disclosure-summary {
            min-block-size: var(--app-touch-target);
        }
    }
}
