/**
 * Image Title Text Button Section Block Styles
 *
 * Full-width two-column section: text content (title, subtitle, 4px accent
 * line, description, button) alongside an image. The image column can sit left
 * or right and the section background colour is configurable (default grey).
 *
 * Reference design: child-theme-sections-screenshots/image-title-text-button-section.png
 *
 * @package ACF Child Theme
 */

:root {
    --color-grey: #f3f3f3;
    --color-navy: #0d1e3b;
    --color-teal: #17abc1;
    --color-text: #252525;
    --color-blue: #004e95;
    --color-white: #ffffff;
    --font-primary: 'Montserrat', sans-serif;
}

/* Section wrapper - full width, background set inline (default grey)
   ========================================================================== */
.ittb-section {
    width: 100%;
    margin: 0;
    padding: 70px 0;
    /* Clip the off-screen columns during the slide-in animation. */
    overflow: hidden;
    font-family: var(--font-primary), 'Montserrat', sans-serif;
}

.ittb-section__container {
    max-width: var(--theme-normal-container-max-width, 1290px);
    width: var(--theme-container-width, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

/* Two-column grid
   ========================================================================== */
.ittb-section__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

/* Image on the left: place image column first. */
.ittb-section--image-left .ittb-section__col--image {
    order: -1;
}

/* Scroll-triggered slide-in
   ==========================================================================
   Columns start offset + transparent, then slide into place when the section
   gets the .is-visible class (added by JS via IntersectionObserver).
   Default layout (image right): image slides from the right, text from the
   left. Image-left layout: image from the left, text from the right. */
.ittb-section__col {
    opacity: 0;
    transition: transform 0.8s ease, opacity 0.8s ease;
    will-change: transform, opacity;
}

.ittb-section__col--content {
    transform: translateX(-60px);
}

.ittb-section__col--image {
    transform: translateX(60px);
}

.ittb-section--image-left .ittb-section__col--content {
    transform: translateX(60px);
}

.ittb-section--image-left .ittb-section__col--image {
    transform: translateX(-60px);
}

.ittb-section.is-visible .ittb-section__col {
    opacity: 1;
    transform: translateX(0);
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
    .ittb-section__col {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Content column
   ========================================================================== */
.ittb-section__title {
    margin: 0 0 8px 0;
    font-family: var(--font-primary), 'Montserrat', sans-serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-navy, #0d1e3b);
}

.ittb-section__subtitle {
    margin: 0 0 18px 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-navy, #0d1e3b);
}

.ittb-section__line {
    display: block;
    width: 60px;
    height: 4px;
    margin: 0 0 26px 0;
    background-color: var(--color-teal, #17abc1);
}

.ittb-section__description {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-text, #252525);
}

.ittb-section__description p {
    margin: 0 0 18px 0;
}

.ittb-section__description p:last-child {
    margin-bottom: 0;
}

/* Button (matches the theme standard .btn gradient button)
   ========================================================================== */
.ittb-section__button {
    display: inline-block;
    margin-top: 28px;
    padding: 16px 30px;
    font-family: var(--font-primary), 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    color: var(--color-white, #ffffff);
    background: linear-gradient(to right, var(--color-teal, #17abc1), var(--color-blue, #004e95));
    border: none;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.ittb-section__button:hover,
.ittb-section__button:focus-visible {
    color: var(--color-white, #ffffff);
    background: var(--color-navy, #0d1e3b);
    outline: none;
}

/* Image column
   ========================================================================== */
.ittb-section__col--image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ittb-section__image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Responsive - Tablet
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1023px) {
    .ittb-section {
        padding: 60px 0;
    }

    .ittb-section__grid {
        gap: 36px;
    }

    .ittb-section__title {
        font-size: 28px;
    }

    .ittb-section__subtitle {
        font-size: 18px;
    }
}

/* Responsive - Mobile (stack columns, image first)
   ========================================================================== */
@media (max-width: 768px) {
    .ittb-section {
        padding: 45px 0;
    }

    .ittb-section__grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Always show the image above the text on mobile for both layouts. */
    .ittb-section__col--image {
        order: -1;
    }

    .ittb-section__title {
        font-size: 26px;
    }

    .ittb-section__subtitle {
        font-size: 17px;
    }

    .ittb-section__button {
        margin-top: 24px;
    }
}
