/**
 * Schema Markup Styling
 * Basic styling for FAQ and HowTo structured content
 *
 * @author Next Level Smart
 * @version 1.2.0
 *
 * Shorthand aliases: .faq = .schema-faq, .howto = .schema-howto
 * Both class patterns are fully supported.
 */

/* ==========================================================================
   FAQ STYLING
   ========================================================================== */

.schema-faq,
.faq {
    margin: 2rem 0;
}

.schema-faq-item,
.faq-item {
    margin-bottom: 1rem;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.schema-faq-question,
.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1.05em;
    background: #f8f9fa;
    cursor: pointer;
    position: relative;
    padding-right: 2.5rem;
}

/* Add toggle indicator */
.schema-faq-question::after,
.faq-question::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    font-weight: 300;
    color: #666;
    transition: transform 0.2s ease;
}

.schema-faq-item.is-open .schema-faq-question::after,
.faq-item.is-open .faq-question::after {
    content: '−';
}

.schema-faq-answer,
.faq-answer {
    padding: 1rem 1.25rem;
    line-height: 1.7;
    color: #555;
    border-top: 1px solid #e5e5e5;
}

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

/* Collapsible FAQ (optional - add .schema-faq-collapsible or .faq-collapsible class) */
.schema-faq-collapsible .schema-faq-answer,
.faq-collapsible .faq-answer {
    display: none;
}

.schema-faq-collapsible .schema-faq-item.is-open .schema-faq-answer,
.faq-collapsible .faq-item.is-open .faq-answer {
    display: block;
}

/* ==========================================================================
   HOWTO / GUIDE STYLING
   ========================================================================== */

.schema-howto,
.howto {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    counter-reset: howto-step;
}

.schema-howto > h2,
.schema-howto > h3,
.howto > h2,
.howto > h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light-color-purple, #e8e6f0);
}

.schema-howto-step,
.howto-step {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 3rem;
    counter-increment: howto-step;
}

.schema-howto-step:last-child,
.howto-step:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Step number */
.schema-howto-step::before,
.howto-step::before {
    content: counter(howto-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-color, #b0aa00);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9em;
}

.schema-howto-step-name,
.howto-step-name {
    flex: 1 1 100%;
    font-weight: 600;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 0.25rem;
}

.schema-howto-step-text,
.howto-step-text {
    flex: 1 1 60%;
    line-height: 1.7;
    color: #555;
}

.schema-howto-step-text p:last-child,
.howto-step-text p:last-child {
    margin-bottom: 0;
}

.schema-howto-step-image,
.howto-step-image {
    flex: 0 0 auto;
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Main howto image */
.schema-howto-image,
.howto-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Supplies and Tools lists */
.schema-howto-supplies,
.schema-howto-tools,
.howto-supplies,
.howto-tools {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.schema-howto-supplies h4,
.schema-howto-tools h4,
.howto-supplies h4,
.howto-tools h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9em;
    text-transform: uppercase;
    color: #666;
}

.schema-howto-supplies ul,
.schema-howto-tools ul,
.howto-supplies ul,
.howto-tools ul {
    margin: 0;
    padding-left: 1.25rem;
}

.schema-howto-supplies li,
.schema-howto-tools li,
.howto-supplies li,
.howto-tools li {
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 767px) {
    .schema-howto-step,
    .howto-step {
        padding-left: 2.5rem;
    }

    .schema-howto-step::before,
    .howto-step::before {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.85em;
    }

    .schema-howto-step-image,
    .howto-step-image {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .schema-faq-question,
    .faq-question {
        padding: 0.875rem 1rem;
        padding-right: 2rem;
    }

    .schema-faq-answer,
    .faq-answer {
        padding: 0.875rem 1rem;
    }
}

/* ==========================================================================
   WIDGET COMPATIBILITY
   When schema classes are used inside widgets with their own styling,
   disable the default schema styling to prevent conflicts.
   ========================================================================== */

/* Disable schema styling inside calculator widget */
.mmc-faq.schema-faq {
    margin: 0;
}

.mmc-faq .schema-faq-item {
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

.mmc-faq .schema-faq-question {
    padding: 0;
    font-weight: inherit;
    font-size: inherit;
    background: transparent;
    cursor: inherit;
    position: static;
    padding-right: 0;
}

.mmc-faq .schema-faq-question::after {
    display: none;
}

.mmc-faq .schema-faq-answer {
    padding: 0;
    line-height: inherit;
    color: inherit;
    border-top: none;
}
