/**
 * Content Sections Widget Styles
 *
 * These are base styles that can be overridden by Elementor controls.
 * Using lower specificity so Elementor's {{WRAPPER}} selectors take precedence.
 */

.aiseo-content-sections {
    width: 100%;
}

.aiseo-content-section {
    position: relative;
}

/* Content area typography - these are defaults, Elementor controls override */
.aiseo-section-content {
    line-height: 1.7;
}

.aiseo-section-content p {
    margin: 0 0 1em 0;
}

.aiseo-section-content p:last-child {
    margin-bottom: 0;
}

/* Lists need top margin when following other content */
.aiseo-section-content ul,
.aiseo-section-content ol {
    margin: 1em 0 1em 1.5em;
    padding: 0;
}

/* First list doesn't need top margin if it's the first element */
.aiseo-section-content > ul:first-child,
.aiseo-section-content > ol:first-child {
    margin-top: 0;
}

/* Last list doesn't need bottom margin */
.aiseo-section-content > ul:last-child,
.aiseo-section-content > ol:last-child {
    margin-bottom: 0;
}

.aiseo-section-content li {
    margin-bottom: 0.75em;
    padding-left: 0.25em;
    line-height: 1.6;
}

.aiseo-section-content li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.aiseo-section-content li ul,
.aiseo-section-content li ol {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.aiseo-section-content strong {
    font-weight: 600;
}

/* Strong followed by list should have space */
.aiseo-section-content p strong:last-child {
    display: inline;
}

/* Ensure paragraph before list has bottom margin */
.aiseo-section-content p + ul,
.aiseo-section-content p + ol {
    margin-top: 0.5em;
}

/* Bold text acting as list intro */
.aiseo-section-content p:has(strong:last-child) + ul,
.aiseo-section-content p:has(strong:last-child) + ol {
    margin-top: 0.25em;
}

.aiseo-section-content h3,
.aiseo-section-content h4 {
    margin: 1.5em 0 0.75em 0;
}

.aiseo-section-content h3:first-child,
.aiseo-section-content h4:first-child {
    margin-top: 0;
}

/* Image styles */
.aiseo-section-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Full width layout */
.aiseo-section-layout-full .aiseo-section-image {
    margin-bottom: 20px;
}

/* Image left/right layouts */
.aiseo-section-layout-image-left .aiseo-section-wrapper,
.aiseo-section-layout-image-right .aiseo-section-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 30px;
}

.aiseo-section-layout-image-left .aiseo-section-image,
.aiseo-section-layout-image-right .aiseo-section-image {
    flex-shrink: 0;
}

.aiseo-section-layout-image-left .aiseo-section-text,
.aiseo-section-layout-image-right .aiseo-section-text {
    flex: 1;
    min-width: 200px;
}

/* Responsive - stack on mobile */
@media (max-width: 767px) {
    .aiseo-section-layout-image-left .aiseo-section-wrapper,
    .aiseo-section-layout-image-right .aiseo-section-wrapper {
        flex-direction: column;
    }

    .aiseo-section-layout-image-left .aiseo-section-image,
    .aiseo-section-layout-image-right .aiseo-section-image,
    .aiseo-section-layout-image-left .aiseo-section-text,
    .aiseo-section-layout-image-right .aiseo-section-text {
        width: 100% !important;
    }
}
