/* ============================================================
   Text Image Secondary Block Styles
   Unified component for text-and-image block variations
   ============================================================ */

.text-image-secondary-block {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* ----- Teal PT Serif Highlight (from main styles.css) ----- */
.serif-teal {
    font-family: 'PT Serif', serif;
    font-weight: 700;
    color: #0097a7;
}

/* ----- Base Section ----- */
.text-and-image-secondary {
    position: relative;
    width: 100%;
}

.text-and-image-secondary__wrapper {
    max-width: 1280px;
    margin: 0 auto;
}

/* ----- Header Variant ----- */
.text-and-image-secondary--with-header {
    display: flex;
    flex-direction: column;
    padding: 80px var(--page-padding) 100px;
    gap: 48px;
}

.text-and-image-secondary--with-header.text-and-image-secondary--simple {
    padding: 80px var(--page-padding) 100px;
}

.text-and-image-secondary--with-header.text-and-image-secondary--simple.text-and-image-secondary--with-footer {
    gap: 0;
}

.text-and-image-secondary--with-header.text-and-image-secondary--simple.text-and-image-secondary--with-footer .text-and-image-secondary__wrapper {
    display: flex;
    flex-direction: column;
    gap: 64px;
    max-width: 1280px;
    margin: 48px auto 0;
}

/* ----- Simple Variant ----- */
.text-and-image-secondary--simple {
    padding: 60px 80px 100px;
}

/* ----- Footer Variant ----- */
.text-and-image-secondary--with-footer {
    padding: 60px 80px 100px;
}

/* ----- Light Background ----- */
.text-and-image-secondary--light-bg {
    background-color: #f0f9fa;
}

/* ----- Container ----- */
.text-and-image-secondary__container {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 64px;
    max-width: 1280px;
    margin: 0 auto;
}

.text-and-image-secondary--with-header .text-and-image-secondary__container {
    margin: 0;
    max-width: none;
}

.text-and-image-secondary--with-header.text-and-image-secondary--simple .text-and-image-secondary__container {
    max-width: 1280px;
    margin: 0 auto;
}

/* ----- Watermark Backgrounds ----- */
.text-and-image-secondary__watermark-bg {
    position: absolute;
    bottom: 54px;
    left: 0;
    width: 490px;
    height: 293px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.text-and-image-secondary__watermark-bg--right {
    left: auto;
    right: 0;
}

/* ----- Header ----- */
.text-and-image-secondary__header {
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Header title styling (centered) */
.text-and-image-secondary__header .es-section-title {
    font-weight: 800;
    font-size: 40px;
    text-align: center;
    margin: 0 0 24px;
}

/* ----- Label ----- */
.text-and-image-secondary__label {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.5;
    text-transform: uppercase;
    color: #0097a7;
    margin-bottom: 16px;
}

.text-and-image-secondary__label span {
    white-space: nowrap;
}

/* Note: --stacked only applies on mobile (see media query below) */
/* Desktop: label is always inline (flex-direction: row from base) */

.text-and-image-secondary__label--inline {
    justify-content: flex-start;
    margin-bottom: 8px;
}

.text-and-image-secondary--simple .text-and-image-secondary__label,
.text-and-image-secondary--with-footer .text-and-image-secondary__label {
    justify-content: flex-start;
}

/* Label crown: theme .es-icon-titles */

/* ----- Title ----- */
.text-and-image-secondary .es-section-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 800;
    font-size: 40px;
    line-height: 1.2;
    color: var(--smith-grey);
    margin: 0 0 24px;
}

.text-and-image-secondary--simple .es-section-title,
.text-and-image-secondary--with-footer .es-section-title {
    font-weight: 700;
    font-size: 38px;
    margin: 0;
}

/* ----- Subtitle ----- */
.text-and-image-secondary .es-section-subtitle {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.5;
    color: var(--smith-grey);
    margin: 0 0 24px;
}

/* ----- Media (Image side) ----- */
.text-and-image-secondary__media {
    flex: 1 1 0;
    min-width: 0;
}

.text-and-image-secondary__media--left {
    flex: 1 1 0;
}

.text-and-image-secondary__image {
    display: block;
    width: 100%;
    height: auto;
}

/* ----- Content ----- */
.text-and-image-secondary__content {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.text-and-image-secondary--simple .text-and-image-secondary__content,
.text-and-image-secondary--with-footer .text-and-image-secondary__content {
    gap: 24px;
}

/* ----- Text/Body ----- */
.text-and-image-secondary__text {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.text-and-image-secondary__text p {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.5;
    color: var(--smith-grey);
    margin: 0;
}

/* ----- Closing Text ----- */
.text-and-image-secondary__closing {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700 !important;
    font-size: 18px;
    line-height: 1.5;
    color: var(--smith-grey);
    margin-top: 8px;
}

/* ----- Optional three feature cards (below body text) ----- */
.text-and-image-secondary__feature-cards {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 24px;
    width: 100%;
    align-items: stretch;
}

/* ----- Mobile/Title Reordering Helpers (Desktop defaults) ----- */
/* For Small Header variation: hide mobile title, show desktop title by default on desktop */
/* Using doubled class for high specificity to allow mobile media query to override */
.text-and-image-secondary__mobile-title.text-and-image-secondary__mobile-title {
    display: none !important;
}

.text-and-image-secondary__desktop-title.text-and-image-secondary__desktop-title {
    display: block !important;
}

.text-and-image-secondary__feature-card {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 40px 24px;
    box-sizing: border-box;
}

.text-and-image-secondary__feature-card-icon {
    display: flex;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.text-and-image-secondary__feature-card-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.text-and-image-secondary__feature-card-icon:first-child {
    /* styles */
    width: auto !important;
}
.text-and-image-secondary__feature-card-icon > :first-child {
    /* styles */
    width: auto !important;
}

.text-and-image-secondary__feature-card-text {
    margin: 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.5;
    color: var(--smith-grey);
}

/* ----- CTA Button ----- */
.text-and-image-secondary__cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 8px 32px;
    border-radius: 8px;
    background-color: var(--btn-primary-rest);
    color: #fff;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    text-decoration: none;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 8px;
    transition: background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.text-and-image-secondary__cta-btn:hover {
    background-color: var(--btn-primary-hover);
    box-shadow: 0px 6px 14px rgba(1, 13, 20, 0.1);
}

.text-and-image-secondary__cta-btn:active {
    background-color: var(--btn-primary-pressed);
    box-shadow: none;
}

.text-and-image-secondary__cta-btn:focus-visible {
    outline: 2px solid var(--btn-primary-pressed);
    outline-offset: 2px;
}

/* ----- CTA Link ----- */
.text-and-image-secondary__cta-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 600;
    font-size: 18px;
    line-height: 1.5;
    color: var(--link-light-rest);
    text-decoration: none;
    margin-top: 8px;
    transition: color var(--transition-fast);
}

.text-and-image-secondary__cta-link .link-label {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.text-and-image-secondary__cta-link:hover {
    color: var(--link-light-hover);
}

.text-and-image-secondary__cta-link::after {
    content: "→";
    display: inline-block;
    margin-left: 4px;
    transition: transform var(--transition-fast);
}

.text-and-image-secondary__cta-link:hover::after {
    transform: translateX(2px);
}

/* ----- Footer with Lists ----- */
.text-and-image-secondary__footer {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 50px;
}

.text-and-image-secondary__footer .es-card-title {
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.5;
    color: var(--smith-grey);
    margin: 0;
}

.text-and-image-secondary__lists {
    display: flex;
    gap: 48px;
}

.text-and-image-secondary__list {
    flex: 1 1 50%;
    margin: 0;
    padding-left: 20px;
    font-family: 'Inter', system-ui, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: var(--smith-grey);
}

.text-and-image-secondary__list li {
    margin-bottom: 12px;
}

.text-and-image-secondary__list li:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Tablet Styles (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .text-and-image-secondary--with-header {
        padding: 64px 32px 56px;
        gap: 40px;
    }

    .text-and-image-secondary--with-header.text-and-image-secondary--simple {
        padding: 64px 32px 56px;
    }

    .text-and-image-secondary--with-header.text-and-image-secondary--simple.text-and-image-secondary--with-footer .text-and-image-secondary__wrapper {
        gap: 48px;
        margin-top: 40px;
    }

    .text-and-image-secondary--simple,
    .text-and-image-secondary--with-footer {
        padding: 64px 32px;
    }

    .text-and-image-secondary__container {
        flex-direction: column;
        gap: 40px;
    }

    /* ----- Tablet Reordering: Title -> Image -> Content (Small Header only) ----- */
    /* ONLY for Small Header (no --with-header class): reorder to Title -> Image -> Content */

    /* TABLET: Show the mobile title (outside content div) FIRST - using doubled class for specificity */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__mobile-title.text-and-image-secondary__mobile-title {
        display: block !important;
        order: -2;
        margin: 0 0 16px 0;
        width: 100%;
    }

    /* TABLET: Hide the desktop title (inside content div) - using doubled class for specificity */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__desktop-title.text-and-image-secondary__desktop-title {
        display: none !important;
    }

    /* Image comes second (after mobile title) */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__media {
        order: -1;
        width: 100%;
    }

    /* Content comes third (after image) */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__content {
        order: 0;
        width: 100%;
    }

    .text-and-image-secondary__media--left,
    .text-and-image-secondary__content {
        flex: 1 1 100%;
        min-width: auto;
    }

    .text-and-image-secondary .es-section-title {
        font-size: 32px;
    }

    .text-and-image-secondary__header .es-section-title {
        font-size: 32px;
    }

    .text-and-image-secondary--simple .es-section-title,
    .text-and-image-secondary--with-footer .es-section-title {
        font-size: 32px;
    }

    .text-and-image-secondary__watermark-bg {
        bottom: 54px;
        left: 0;
        width: 490px;
        height: 293px;
        transform: none;
    }

    .text-and-image-secondary__watermark-bg--right {
        display: none;
    }

    .text-and-image-secondary__footer {
        padding: 0 60px;
    }

    .text-and-image-secondary__lists {
        flex-direction: column;
        gap: 16px;
    }

    .text-and-image-secondary__feature-cards {
        flex-wrap: wrap;
    }

    .text-and-image-secondary__feature-card {
        flex: 1 1 calc(50% - 12px);
        min-width: 140px;
    }
}

/* ============================================================
   Mobile Styles (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
    .text-and-image-secondary--with-header {
        padding: 48px 20px 40px;
    }

    .text-and-image-secondary--with-header.text-and-image-secondary--simple {
        padding: 48px 20px 40px;
    }

    .text-and-image-secondary--with-header.text-and-image-secondary--simple.text-and-image-secondary--with-footer .text-and-image-secondary__wrapper {
        gap: 32px;
        margin-top: 32px;
    }

    .text-and-image-secondary--simple,
    .text-and-image-secondary--with-footer {
        padding: 48px 20px;
    }

    /* ----- Mobile Reordering: Title -> Image -> Content (Small Header only) ----- */
    /* ONLY for Small Header (no --with-header class): reorder to Title -> Image -> Content */

    /* The container becomes flex column for reordering */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__container {
        display: flex;
        flex-direction: column;
    }

    /* MOBILE: Show the mobile title (outside content div) FIRST - using ID-like specificity */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__mobile-title.text-and-image-secondary__mobile-title {
        display: block !important;
        order: -2;
        margin: 0 0 16px 0;
        width: 100%;
    }

    /* MOBILE: Hide the desktop title (inside content div) - using ID-like specificity */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__desktop-title.text-and-image-secondary__desktop-title {
        display: none !important;
    }

    /* Image comes second (after mobile title) */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__media {
        order: -1;
        width: 100%;
    }

    /* Content comes third (after image) */
    .text-and-image-secondary--simple:not(.text-and-image-secondary--with-header) .text-and-image-secondary__content {
        order: 0;
        width: 100%;
    }

    .text-and-image-secondary__watermark-bg {
        display: none;
    }

    .text-and-image-secondary .es-section-title {
        font-size: 28px;
    }

    .text-and-image-secondary__header .es-section-title {
        font-size: 28px;
    }

    .text-and-image-secondary--simple .es-section-title,
    .text-and-image-secondary--with-footer .es-section-title {
        font-size: 28px;
    }

    .text-and-image-secondary__text p {
        font-size: 16px;
    }

    .text-and-image-secondary__footer {
        padding: 0;
        gap: 16px;
    }

    .text-and-image-secondary__footer .es-card-title {
        font-size: 14px;
    }

    .text-and-image-secondary__list {
        flex: none;
        width: 100%;
        font-size: 14px;
    }

    .text-and-image-secondary__cta-link {
        font-size: 16px;
        white-space: normal;
    }

    .text-and-image-secondary__cta-link .link-label {
        white-space: normal;
    }

    /* Mobile label adjustments */
    .text-and-image-secondary__label {
        flex-direction: row;
        gap: 8px;
    }

    .text-and-image-secondary__label--stacked {
        flex-direction: column;
        gap: 4px;
    }

    .text-and-image-secondary__label--stacked span {
        white-space: normal;
        text-align: center;
    }

    .text-and-image-secondary__feature-cards {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 16px;
    }

    .text-and-image-secondary__feature-card {
        flex: 1 1 auto;
        width: 100%;
        padding: 24px 16px;
    }
}