/**
 * DBIZ FAQ Accordion Styles
 * 
 * Provides smooth open/close animations for Details blocks used as FAQ accordion.
 * 
 * @since Twenty Twenty-Five 1.0
 */

/* Hide ALL default browser markers/icons on the left */
.dbiz-faq-item summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dbiz-faq-item summary:hover {
    opacity: 0.8;
}

/* Hide default Details marker completely */
.dbiz-faq-item summary::-webkit-details-marker {
    display: none !important;
}

.dbiz-faq-item summary::marker {
    display: none !important;
}

/* Remove any list-style from summary */
.dbiz-faq-item summary {
    list-style-type: none;
}

/* Remove any ::before pseudo-element (left icon) */
.dbiz-faq-item summary::before {
    display: none !important;
    content: none !important;
}

/* Custom blue chevron icon on the RIGHT side - enlarged and blue */
.dbiz-faq-item summary::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 14px solid #2563EB; /* Blue color - matches blue-600 from your theme */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
    flex-shrink: 0;
    margin-left: 1rem; /* Space between text and icon */
}

/* Rotate icon when open (pointing up) */
.dbiz-faq-item[open] summary::after {
    transform: rotate(180deg);
}

/* Smooth slide animation for content */
.dbiz-faq-item {
    display: block;
}

/* Wrapper created by JavaScript */
.dbiz-faq-content-wrapper {
    overflow: hidden;
}

.dbiz-faq-content {
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: max-height, opacity, transform;
}

/* Inner content wrapper */
.dbiz-faq-content > * {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When Details is closed - slide up and fade out */
/* Note: max-height is controlled by JavaScript inline styles */
.dbiz-faq-item:not([open]) .dbiz-faq-content {
    opacity: 0;
    transform: translateY(-10px);
}

.dbiz-faq-item:not([open]) .dbiz-faq-content > * {
    transform: translateY(-5px);
    opacity: 0;
}

/* When Details is open - slide down and fade in */
/* Note: max-height is controlled by JavaScript inline styles */
.dbiz-faq-item[open] .dbiz-faq-content {
    opacity: 1;
    transform: translateY(0);
}

.dbiz-faq-item[open] .dbiz-faq-content > * {
    transform: translateY(0);
    opacity: 1;
}

/* Ensure smooth animation for the Details element itself */
.dbiz-faq-item[open] {
    animation: dbizFaqOpen 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dbizFaqOpen {
    from {
        opacity: 0.95;
    }
    to {
        opacity: 1;
    }
}
