/* TinyMCE Accordion plugin styles (ta- prefix) */
.ta-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin: 1em 0;
    overflow: hidden;
}

.ta-accordion__summary {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    user-select: none;
}

.ta-accordion__summary::-webkit-details-marker {
    display: none;
}

.ta-accordion__title {
    flex: 1;
}

.ta-accordion__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: transparent;
    color: #333;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    margin-left: 0.5rem;
}

.ta-accordion__remove:hover {
    background: rgba(0, 0, 0, 0.06);
}

.ta-accordion__toggle {
    display: inline-block;
    font-size: 1.1rem;
    transition: transform 0.2s ease;
    margin-left: 0.5rem;
}

.ta-accordion[open] .ta-accordion__toggle {
    transform: rotate(180deg);
}

.ta-accordion__toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.ta-accordion[open] .ta-accordion__toggle svg {
    transform-origin: 50% 50%;
    transform: rotate(180deg);
}

/* Use data URL SVG as background to avoid WP stripping inline SVGs */
.ta-accordion__toggle {
    width: 18px;
    height: 18px;
    display: inline-block;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 640'><path d='M297.4 470.6C309.9 483.1 330.2 483.1 342.7 470.6L534.7 278.6C547.2 266.1 547.2 245.8 534.7 233.3C522.2 220.8 501.9 220.8 489.4 233.3L320 402.7L150.6 233.4C138.1 220.9 117.8 220.9 105.3 233.4C92.8 245.9 92.8 266.2 105.3 278.7L297.3 470.7z' fill='%23000'/></svg>");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.2s ease;
}

.ta-accordion[open] .ta-accordion__toggle {
    transform: rotate(180deg);
}

/* Hide remove on frontend; shown in editor iframe via .mce-content-body */
.ta-accordion__remove {
    display: none;
}

.mce-content-body .ta-accordion__remove {
    display: inline-flex;
}

.ta-accordion__content {
    padding: 1rem 1.5rem;
    background: #fff;
}

.ta-accordion__summary:hover {
    background: #eee;
}

/* Hide spacer paragraph on frontend only */
.ta-accordion-spacer {
    display: none;
}

.mce-content-body .ta-accordion-spacer {
    display: block;
}
