/* FAQ Accordion Block Styles */
.faq-accordion-wrapper {
    margin: 2rem 0;
    background: transparent;
    /* Width will be controlled by parent container */
    display: block;
    position: relative;
}

.faq-accordion-container {
    padding: 0;
    /* Container respects parent bounds */
}

.faq-item {
    border-bottom: 1px solid var(--faq-border-color, #e0e0e0);
    transition: border-color 0.2s ease;
    background: transparent;
    /* Let parent control width instead of forcing 100% */
    box-sizing: border-box;
}

.faq-item:last-child {
    border-bottom: 1px solid var(--faq-border-color, #e0e0e0);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    max-width: 100%;
    text-align: left;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-sizing: border-box;
}

.faq-question:hover {
    background: transparent;
}

.faq-question:focus {
    outline: none;
}

.faq-question-text {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    color: inherit;
    flex: 1;
    padding-right: 1rem;
    line-height: 1.6;
    font-family: 'PTMonoWebRegular', 'Courier New', monospace;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0; /* Allows flex item to shrink below content size */
}

.faq-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: transparent;
    color: currentColor;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 20px;
    font-weight: 300;
}

.faq-toggle-icon svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-width: 1;
}

.faq-item-open .faq-toggle-icon svg {
    transform: rotate(45deg);
}

.faq-answer {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    width: 100%;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 0;
    padding-bottom: 0;
    box-sizing: border-box;
}

.faq-answer-open {
    max-height: 300px; /* Maximum height before scrolling */
    opacity: 1;
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
    background-color: var(--faq-answer-bg-color, #FFFAF0);
    margin-top: 0.5rem;
    border-radius: 4px;
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scrolling */
}

.faq-answer-content {
    padding: 1rem 1.5rem;
    color: inherit;
    opacity: 0.7;
    font-family: 'PTMonoWebRegular', 'Courier New', monospace;
    transform: translateY(-10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.faq-answer-open .faq-answer-content {
    transform: translateY(0);
    opacity: 0.7;
}

/* Custom scrollbar styling for answer sections */
.faq-answer-open::-webkit-scrollbar {
    width: 8px;
}

.faq-answer-open::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.faq-answer-open::-webkit-scrollbar-thumb {
    background: var(--faq-accent-color, #99c3b9);
    border-radius: 4px;
    opacity: 0.6;
}

.faq-answer-open::-webkit-scrollbar-thumb:hover {
    background: var(--faq-accent-color, #99c3b9);
    opacity: 0.8;
}

/* Firefox scrollbar styling */
.faq-answer-open {
    scrollbar-width: thin;
    scrollbar-color: var(--faq-accent-color, #99c3b9) rgba(0, 0, 0, 0.05);
}

.faq-answer-content p {
    margin: 0 0 1rem 0;
    line-height: 1.6;
    font-size: 0.9rem;
}

.faq-answer-content p:last-child {
    margin-bottom: 0;
}

/* Clean design - no hover effects needed */

/* Mobile responsive */
@media (max-width: 768px) {
    .faq-question {
        padding: 1.25rem 0;
    }
    
    .faq-answer-open {
        padding-top: 0.25rem;
        padding-bottom: 1.25rem;
        max-height: 250px; /* Slightly smaller for tablets */
    }
    
    .faq-answer-content {
        padding: 0.75rem 1rem;
    }
    
    .faq-question-text {
        font-size: 0.9rem;
        padding-right: 0.75rem;
    }
    
    .faq-toggle-icon {
        width: 20px;
        height: 20px;
    }
    
    .faq-toggle-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .faq-question {
        padding: 1rem 0;
    }
    
    .faq-answer-open {
        padding-top: 0.25rem;
        padding-bottom: 1rem;
        max-height: 200px; /* Smaller for mobile screens */
    }
    
    .faq-answer-content {
        padding: 0.5rem 0.75rem;
    }
    
    .faq-question-text {
        font-size: 0.85rem;
    }
}

/* Ensure FAQ accordion respects parent container constraints */
.wp-block-cakeclub-faq-accordion {
    /* Let parent container control the width */
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    display: block;
}

/* Force accordion to stay within any parent container */
.faq-accordion-wrapper {
    /* Let parent container control width */
    width: auto;
    max-width: 100%;
    min-width: 0;
    position: relative;
    display: block;
    box-sizing: border-box;
    overflow: hidden;
}

/* Ensure all child elements respect container bounds */
.faq-accordion-container,
.faq-item,
.faq-question,
.faq-answer {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Prevent text from breaking container bounds */
.faq-question-text,
.faq-answer-content {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
} 