/* ============================================
   B GLAD Expand / Collapse
   ============================================ */

.bglad-ec {
    width: 100%;
    max-width: var(--ec-max-width, 100%);
}

/* ---- Header (clickable) ---- */
.bglad-ec__header {
    display: flex;
    align-items: center;
    gap: var(--ec-gap, 4px);
    justify-content: flex-end;
    width: 100%;
    padding: 16px 0;
    margin: 0;
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: opacity 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.bglad-ec__header:hover .bglad-ec__arrow {
    transform: translateY(3px);
}

.bglad-ec--open .bglad-ec__header:hover .bglad-ec__arrow {
    transform: rotate(180deg) translateY(3px);
}

.bglad-ec__header:focus-visible {
    outline: 2px solid var(--ec-arrow-color, #fff);
    outline-offset: 2px;
}

/* ---- Title ---- */
.bglad-ec__title {
    font-size: var(--ec-title-size, 18px);
    font-weight: var(--ec-title-weight, 400);
    color: var(--ec-title-color, #fff);
    line-height: 1.4;
    margin: 0;
}


/* ---- Arrow ---- */
.bglad-ec__arrow {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--ec-arrow-color, #fff);
    transition: transform 0.3s ease;
}

.bglad-ec--open .bglad-ec__arrow {
    transform: rotate(180deg);
}

/* ---- Body ---- */
.bglad-ec__body {
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}

.bglad-ec__body[hidden] {
    display: block !important;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
}

.bglad-ec--open .bglad-ec__body {
    max-height: 2000px;
    opacity: 1;
    pointer-events: auto;
}

/* ---- Content ---- */
.bglad-ec__content {
    padding: 16px 0 24px;
    color: var(--ec-content-color, #ccc);
    font-size: 15px;
    line-height: 1.7;
}

.bglad-ec__content p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Styles
   ============================================ */

/* Minimal - clean, no border */
.bglad-ec--minimal .bglad-ec__header {
    border-bottom: none;
}

/* Bordered - full border around */
.bglad-ec--bordered {
    border: 1px solid var(--ec-border-color, #333);
    border-radius: 8px;
    overflow: hidden;
}

.bglad-ec--bordered .bglad-ec__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ec-border-color, #333);
}

.bglad-ec--bordered .bglad-ec__content {
    padding: 16px 20px 24px;
}

.bglad-ec--bordered.bglad-ec--open .bglad-ec__header {
    border-bottom-color: var(--ec-border-color, #333);
}

.bglad-ec--bordered:not(.bglad-ec--open) .bglad-ec__header {
    border-bottom-color: transparent;
}

/* Filled - background color */
.bglad-ec--filled {
    background: var(--ec-bg-color, #1a1a1a);
    border-radius: 8px;
    overflow: hidden;
}

.bglad-ec--filled .bglad-ec__header {
    padding: 16px 20px;
    border-bottom: none;
}

.bglad-ec--filled .bglad-ec__content {
    padding: 0 20px 24px;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .bglad-ec__header {
        padding: 0;
        margin-top: -10px;
    }

    .bglad-ec__title {
        font-size: calc(var(--ec-title-size, 18px) - 2px);
    }

    .bglad-ec__content {
        font-size: 14px;
    }

    .bglad-ec__arrow {
        width: 20px;
        height: 20px;
    }
}
