/* Advanced FAQ Block - Clean Modern Design */
.wp-custom-blocks-faq {
    --faq-accent-color: #667eea;
    --faq-text-color: #1e293b;
    --faq-text-secondary: #6a7184;
    --faq-border-color: #e2e8f0;
    --faq-background: #f9fafb;
    --faq-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    font-family: inherit;
    width: 100%;
    max-width: 100%;
}

/* ===================================
   Standard Preset - Clean Accordion
   =================================== */
.wp-custom-blocks-faq.wp-custom-blocks-faq--preset-standard {
    padding: 3rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

/* Header Section */
.wp-custom-blocks-faq__header {
    margin: 0 0 2.5rem 0;
}

.wp-custom-blocks-faq__header h2,
.wp-custom-blocks-faq__header h3,
.wp-custom-blocks-faq__header h4 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--faq-text-color);
    margin: 0;
    line-height: 1.2;
}

.wp-custom-blocks-faq__header p {
    font-size: 1rem;
    color: var(--faq-text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* FAQ Items Container */
.wp-custom-blocks-faq__container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Individual FAQ Item */
.wp-custom-blocks-faq .faq-item,
.wp-custom-blocks-faq .wp-custom-blocks-faq-item {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    transition: var(--faq-transition);
}

.wp-custom-blocks-faq .faq-item:first-child {
    border-top: 1px solid #e5e7eb;
}

.wp-custom-blocks-faq .faq-item:last-child {
    border-bottom: 1px solid #e5e7eb;
}

/* Question Button */
.wp-custom-blocks-faq .faq-question {
    width: 100%;
    padding: 1.75rem 0;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--faq-text-color);
    line-height: 1.5;
    transition: color 0.2s ease;
    gap: 1rem;
}

.wp-custom-blocks-faq .faq-question:hover {
    background: transparent;
    color: var(--faq-accent-color);
}

.wp-custom-blocks-faq .faq-question:focus {
    outline: none;
}

.wp-custom-blocks-faq .faq-question-text {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    flex: 1;
}

/* Plus/Minus Icon */
.wp-custom-blocks-faq .faq-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6b7280;
    transition: color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.wp-custom-blocks-faq .faq-icon::before,
.wp-custom-blocks-faq .faq-icon::after {
    content: '';
    position: absolute;
    background: currentColor;
    transition: transform 0.2s ease;
}

/* Horizontal line (always visible) */
.wp-custom-blocks-faq .faq-icon::before {
    width: 14px;
    height: 2px;
}

/* Vertical line (hidden when expanded) */
.wp-custom-blocks-faq .faq-icon::after {
    width: 2px;
    height: 14px;
}

/* Hide vertical line when expanded (making it a minus) */
.wp-custom-blocks-faq .faq-item.active .faq-icon::after,
.wp-custom-blocks-faq .faq-item.expanded .faq-icon::after {
    transform: rotate(90deg) scale(0);
}

/* Hover color */
.wp-custom-blocks-faq .faq-question:hover .faq-icon {
    color: var(--faq-accent-color);
}

.wp-custom-blocks-faq .faq-icon svg {
    display: none;
}

/* Answer Content */
.wp-custom-blocks-faq .faq-answer {
    padding: 0;
    color: var(--faq-text-secondary) !important;
    font-size: 1rem;
    line-height: 1.7;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.wp-custom-blocks-faq .faq-answer,
.wp-custom-blocks-faq .faq-answer * {
    color: #6a7184 !important;
}

.wp-custom-blocks-faq .faq-item.active .faq-answer,
.wp-custom-blocks-faq .faq-item.expanded .faq-answer {
    max-height: 2000px;
    opacity: 1;
    padding: 0 0 1.75rem 0;
}

.wp-custom-blocks-faq .faq-answer-content {
    padding-top: 0.5rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-custom-blocks-faq .faq-answer > *:first-child {
    margin-top: 0;
}

.wp-custom-blocks-faq .faq-answer > *:last-child {
    margin-bottom: 0;
}

/* ===================================
   Featured Preset - With Background Image
   =================================== */
.wp-custom-blocks-faq.wp-custom-blocks-faq--preset-featured {
    position: relative;
    min-height: 600px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__content {
    position: relative;
    z-index: 1;
    min-height: 600px;
    background: white;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Position: Default - Center-right (40% image, 45% content, 15% image) */
.wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-default .wp-custom-blocks-faq__content {
    margin-left: 40%;
    margin-right: auto;
    width: 45%;
}

/* Position: Left - Content on left side */
.wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-left .wp-custom-blocks-faq__content {
    margin-left: 0;
    margin-right: auto;
    width: 50%;
}

/* Position: Center - Content centered */
.wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-center .wp-custom-blocks-faq__content {
    margin-left: auto;
    margin-right: auto;
    width: 50%;
}

/* Position: Right - Content on right side */
.wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-right .wp-custom-blocks-faq__content {
    margin-left: auto;
    margin-right: 0;
    width: 50%;
}

.wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__header {
    margin-bottom: 2rem;
}

.wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__container {
    flex: 1;
    overflow-y: auto;
}

/* Compact style for featured preset */
.wp-custom-blocks-faq--preset-featured .faq-question {
    padding: 1rem;
    font-size: 1.0625rem;
}

.wp-custom-blocks-faq--preset-featured .faq-answer {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.wp-custom-blocks-faq--preset-featured .faq-item.active .faq-answer,
.wp-custom-blocks-faq--preset-featured .faq-item.expanded .faq-answer {
    max-height: 2000px;
    opacity: 1;
    padding: 0 1rem 1rem 1rem;
}

/* Mobile responsiveness for featured */
@media (max-width: 1024px) {
    /* Default position - slightly wider on tablets */
    .wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-default .wp-custom-blocks-faq__content {
        margin-left: 10%;
        margin-right: 10%;
        width: 55%;
    }

    /* Other positions - slightly wider on tablets */
    .wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-left .wp-custom-blocks-faq__content,
    .wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-center .wp-custom-blocks-faq__content,
    .wp-custom-blocks-faq--preset-featured.wp-custom-blocks-faq--position-right .wp-custom-blocks-faq__content {
        width: 60%;
    }
}

@media (max-width: 768px) {
    .wp-custom-blocks-faq.wp-custom-blocks-faq--preset-featured {
        min-height: auto;
        display: flex;
        flex-direction: column;
    }

    .wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__background {
        position: relative;
        height: 250px;
        order: -1;
    }

    /* All positions - full width on mobile, overlay on background */
    .wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__content {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        min-height: auto;
        padding: 2rem 1.5rem;
        box-shadow: none;
        margin-top: -50px;
        border-radius: 20px 20px 0 0;
        z-index: 2;
    }

    /* Ensure container and items take full width */
    .wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__container {
        width: 100%;
        max-width: 100%;
    }

    .wp-custom-blocks-faq--preset-featured .faq-item,
    .wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq-item {
        width: 100%;
        max-width: 100%;
    }
}

/* ===================================
   CTA Section
   =================================== */
.wp-custom-blocks-faq__cta {
    margin-top: 2rem;
    padding-top: 0;
    border-top: none;
    text-align: center;
}

.wp-custom-blocks-faq__cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--faq-text-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.wp-custom-blocks-faq__cta-description {
    font-size: 1rem;
    color: var(--faq-text-secondary);
    margin: 0 0 1.5rem 0;
    line-height: 1.6;
}

.wp-custom-blocks-faq__cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    background: var(--faq-accent-color);
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 8px;
    transition: var(--faq-transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.wp-custom-blocks-faq__cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.wp-custom-blocks-faq__cta-button:active {
    transform: translateY(0);
}

/* ===================================
   Dark Mode Support
   =================================== */
body.wp-custom-blocks-blocks-dark-mode .wp-custom-blocks-faq {
    --faq-text-color: #ffffff;
    --faq-text-secondary: #6a7184;
    --faq-border-color: #374151;
    --faq-background: #1e2939;
}

body.wp-custom-blocks-blocks-dark-mode .wp-custom-blocks-faq--preset-standard {
    background: #111827;
    border-color: var(--faq-border-color);
}

body.wp-custom-blocks-blocks-dark-mode .wp-custom-blocks-faq .faq-item,
body.wp-custom-blocks-blocks-dark-mode .wp-custom-blocks-faq .wp-custom-blocks-faq-item {
    background: transparent;
    border-bottom-color: var(--faq-border-color);
}

body.wp-custom-blocks-blocks-dark-mode .wp-custom-blocks-faq .faq-item:first-child {
    border-top-color: var(--faq-border-color);
}

body.wp-custom-blocks-blocks-dark-mode .wp-custom-blocks-faq .faq-question:hover {
    background: transparent;
}

body.wp-custom-blocks-blocks-dark-mode .wp-custom-blocks-faq--preset-featured .wp-custom-blocks-faq__content {
    background: #111827;
}
