/*
 * Copyright 2026 Element Creations Ltd.
 *
 * SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
 * Please see LICENSE files in the repository root for full details.
 */

.header {
    /* Remove button default style */
    background: unset;
    border: none;
    text-align: unset;

    width: 100%;
    cursor: pointer;
    font: var(--cpd-font-body-md-regular);
    color: var(--cpd-color-text-secondary);
    padding: var(--cpd-space-1x) 0;
    background-color: var(--cpd-color-bg-canvas-default);

    &:hover,
    &:focus-visible,
    &:has(button[data-state="open"]) {
        color: var(--cpd-color-text-primary);

        svg {
            fill: var(--cpd-color-icon-primary);
        }

        .container {
            background-color: var(--cpd-color-bg-action-tertiary-hovered);
        }

        .menu {
            display: initial;
        }
    }

    .chevron {
        transition: transform 0.05s linear;
    }

    @media (prefers-reduced-motion: reduce) {
        .chevron {
            transition: none;
        }
    }

    &[aria-expanded="true"] {
        .chevron {
            transform: rotate(90deg);
        }
    }

    &.unread {
        font: var(--cpd-font-body-md-semibold);
        color: var(--cpd-color-text-primary);
    }
}

.container {
    margin: 0 var(--cpd-space-3x);
    padding: var(--cpd-space-1-5x) var(--cpd-space-2x) var(--cpd-space-1-5x) var(--cpd-space-1x);
    border-radius: 8px;

    div {
        min-width: 0;
    }

    svg {
        flex-shrink: 0;
    }
}

.title {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.firstHeader {
    padding-top: 0;
}

.lastHeader {
    padding-bottom: 0;
}

.menu {
    display: none;
}
