/* Half Image Block Styles */
.half-image-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    background-color: #ffffff;
    border-radius: 0;
    padding: 6rem 0;
}

.half-image-block.half-image-animated {
    opacity: 1;
    transform: translateY(0);
}

.half-image-container {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 3rem;
    align-items: center;
    min-height: 500px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    overflow: visible;
}

/* Image Left Layout */
.half-image-block.media-left .half-image-container {
    grid-template-columns: 2fr 3fr;
}

.half-image-block.media-left .half-image-media {
    order: 1;
}

.half-image-block.media-left .half-image-content {
    order: 2;
}

/* Image Right Layout (default) */
.half-image-block.media-right .half-image-container,
.half-image-block .half-image-container {
    grid-template-columns: 3fr 2fr;
}

.half-image-block.media-right .half-image-content,
.half-image-block .half-image-content {
    order: 1;
}

.half-image-block.media-right .half-image-media,
.half-image-block .half-image-media {
    order: 2;
}

.half-image-content {
    padding: 0;
    color: #333333;
}

.half-image-heading {
    font-size: 3rem;
    font-weight: 400;
    line-height: 1.1;
    margin: 0 0 1.5rem 0;
    color: #333333;
    letter-spacing: -0.02em;
    font-family: 'Open Sans', sans-serif;
}

.half-image-heading span {
    font-weight: 700;
}

.half-image-text {
    font-size: 1.125rem;
    line-height: 1.7;
    margin: 0 0 2rem 0;
    color: #444444;
}

.half-image-text p {
    margin: 0 0 1.5rem 0;
}

.half-image-text p:last-child {
    margin-bottom: 0;
}

.half-image-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.half-image-cta {
    display: inline-block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
    letter-spacing: 0.5px;
}

.half-image-cta--btn-primary {
    background: linear-gradient(135deg, #a02237 0%, #c62d42 100%);
    color: white;
    border-color: #c62d42;
    box-shadow: 0 4px 15px rgba(198, 45, 66, 0.3);
}

.half-image-cta--btn-primary:hover {
    background: linear-gradient(135deg, #c62d42 0%, #a02237 100%);
    color: white;
    text-decoration: none;
}

.half-image-cta--secondary {
    background-color: transparent;
    color: #333333;
    border-color: #333333;
}

.half-image-cta--secondary:hover {
    background-color: #333333;
    border-color: #333333;
    color: #ffffff;
}

.half-image-cta--outline {
    background-color: transparent;
    color: #c62d42;
    border-color: #c62d42;
}

.half-image-cta--outline:hover {
    background-color: #c62d42;
    color: white;
}

.half-image-media {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    position: relative;
}

.half-image-main-image {
    position: relative;
    width: 100%;
    overflow: visible;
}

.half-image-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Second Image Positioning - Always on top */
.half-image-second-image {
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 318px;
    height: 172px;
    overflow: hidden;
    z-index: 2;
}

.half-image-img {
    position: relative;
    z-index: 1;
}

.half-image-img-secondary {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Adjust second image position for image-left layout */
.half-image-block.media-left .half-image-second-image {
    bottom: -30px;
    left: -30px;
    right: auto;
}

.half-image-placeholder,
.half-image-placeholder-img {
    text-align: center;
    padding: 2rem;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    color: #666;
    border-radius: 12px;
}

.half-image-placeholder-img {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-white+.bg-white {
    padding-top: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .half-image-block {
        padding: 3rem 0;
    }

    .half-image-container {
        grid-template-columns: 1fr !important;
        gap: 2.5rem;
        padding: 0 1.5rem;
        min-height: auto;
    }

    /* Reset order for tablet/mobile - content always first */
    .half-image-block.media-left .half-image-content,
    .half-image-block.media-right .half-image-content,
    .half-image-block .half-image-content {
        order: 1 !important;
    }

    .half-image-block.media-left .half-image-media,
    .half-image-block.media-right .half-image-media,
    .half-image-block .half-image-media {
        order: 2 !important;
    }

    .half-image-content {
        padding: 1.5rem;
        text-align: center;
    }

    .half-image-heading {
        font-size: 2.75rem;
    }

    .half-image-text {
        max-width: 100%;
        font-size: 1.125rem;
    }

    .half-image-ctas {
        justify-content: center;
        gap: 1rem;
    }

    .half-image-cta {
        padding: 0.875rem 1.75rem;
        font-size: 1rem;
    }

    .half-image-second-image {
        top: -25px;
        right: -25px;
        width: 150px;
        height: 150px;
    }

    /* Reset second image position for tablet/mobile */
    .half-image-block.media-left .half-image-second-image {
        left: -25px;
        right: auto;
        top: -25px;
    }
}

@media (max-width: 768px) {
    .half-image-block {
        padding: 2rem 0;
    }

    .half-image-container {
        gap: 2rem;
        padding: 0 1rem;
    }

    .half-image-content {
        padding: 1rem;
    }

    .half-image-heading {
        font-size: 2.5rem;
    }

    .half-image-second-image {
        top: -20px;
        right: -20px;
        width: 120px;
        height: 120px;
    }

    /* Reset second image position for mobile */
    .half-image-block.media-left .half-image-second-image {
        left: -20px;
        right: auto;
        top: -20px;
    }
}

@media (max-width: 480px) {
    .half-image-container {
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .half-image-content {
        padding: 0.5rem;
    }

    .half-image-heading {
        font-size: 2rem;
    }

    .half-image-ctas {
        flex-direction: column;
        align-items: stretch;
    }

    .half-image-cta {
        padding: 1rem;
        text-align: center;
    }

    .half-image-second-image {
        top: -15px;
        right: -15px;
        width: 100px;
        height: 100px;
    }

    /* Reset second image position for mobile */
    .half-image-block.media-left .half-image-second-image {
        left: -15px;
        right: auto;
    }
}

/* Alignment Support */
.half-image-block.alignwide {
    width: 100vw;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.half-image-block.alignfull {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.half-image-block.alignfull .half-image-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Background Color Variants */
.half-image-block.bg-white {
    background-color: #ffffff;
}

.half-image-block.bg-white .half-image-content {
    color: #333333;
}

.half-image-block.bg-white .half-image-heading {
    color: #333333;
}

.half-image-block.bg-white .half-image-text {
    color: #444444;
}

.half-image-block.half-image--bg-dark {
    background-color: #1a1a1a;
}

.half-image-block.half-image--bg-dark .half-image-content {
    color: #ffffff;
}

.half-image-block.half-image--bg-dark .half-image-heading {
    color: #ffffff;
}

.half-image-block.half-image--bg-dark .half-image-text {
    color: #d0d0d0;
}

.half-image-block.half-image--bg-dark .half-image-placeholder,
.half-image-block.half-image--bg-dark .half-image-placeholder-img {
    background: #2a2a2a;
    border-color: #555;
    color: #ccc;
}

.half-image-block.half-image--bg-dark .half-image-cta--secondary {
    color: #ffffff;
    border-color: #ffffff;
}

.half-image-block.half-image--bg-dark .half-image-cta--secondary:hover {
    background-color: #ffffff;
    color: #1a1a1a;
}

.half-image-block.bg-dark {
        background-color: #1a1a1a;
    }

    .half-image-block.bg-dark .half-image-content {
        color: #ffffff;
    }

    .half-image-block.bg-dark .half-image-heading {
        color: #ffffff;
    }

    .half-image-block.bg-dark .half-image-text {
        color: #d0d0d0;
    }

    .half-image-block.bg-dark .half-image-placeholder,
    .half-image-block.bg-dark .half-image-placeholder-img {
        background: #2a2a2a;
        border-color: #555;
        color: #ccc;
    }

    .half-image-block.bg-dark .half-image-cta--secondary {
        color: #ffffff;
        border-color: #ffffff;
    }

    .half-image-block.bg-dark .half-image-cta--secondary:hover {
        background-color: #ffffff;
        color: #1a1a1a;
    }

/* Auto dark theme support */
@media (prefers-color-scheme: dark) {
    .half-image-block:not(.bg-white) {
        background-color: #1a1a1a;
    }

    .half-image-block:not(.bg-white) .half-image-content {
        color: #ffffff;
    }

    .half-image-block:not(.bg-white) .half-image-heading {
        color: #ffffff;
    }

    .half-image-block:not(.bg-white) .half-image-text {
        color: #d0d0d0;
    }

    .half-image-block:not(.bg-white) .half-image-placeholder,
    .half-image-block:not(.bg-white) .half-image-placeholder-img {
        background: #2a2a2a;
        border-color: #555;
        color: #ccc;
    }

    .half-image-block:not(.bg-white) .half-image-cta--secondary {
        color: #ffffff;
        border-color: #ffffff;
    }

    .half-image-block:not(.bg-white) .half-image-cta--secondary:hover {
        background-color: #ffffff;
        color: #1a1a1a;
    }
}