/**
 * Text Teaser Module Styles
 * 
 * @package Gustoso Child Theme
 * @since 1.0
 */

.text-teaser-section {
    max-width: 1200px;
    margin: 15em auto !important;
    display: flex;
    justify-content: center;
    align-items: stretch; /* Equal height columns */
    width: 100%;
}

/* =====================================================
   EQUAL HEIGHT TEXT TEASERS
   Target any row containing text teasers
   ===================================================== */

/* Make any row containing text teasers use flexbox with stretch */
.vc_row:has(.gustoso-text-teaser),
.vc_section:has(.gustoso-text-teaser) .vc_row,
.wpb_row:has(.gustoso-text-teaser),
.text-teaser-section .vc_row,
.text-teaser-section > .vc_row {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch !important;
}

/* Make columns stretch to fill row height */
.vc_row:has(.gustoso-text-teaser) > .wpb_column,
.vc_row:has(.gustoso-text-teaser) > .vc_column_container,
.text-teaser-section .vc_column_container,
.text-teaser-section .wpb_column {
    display: flex !important;
    flex-direction: column;
}

/* Make inner containers stretch */
.vc_row:has(.gustoso-text-teaser) .vc_column-inner,
.vc_row:has(.gustoso-text-teaser) .wpb_wrapper,
.text-teaser-section .vc_column-inner,
.text-teaser-section .wpb_wrapper {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

/* Fallback for browsers without :has() support - add this class to parent row */
.equal-height-teasers,
.equal-height-teasers .vc_row {
    display: flex !important;
    flex-wrap: wrap;
    align-items: stretch !important;
}

.equal-height-teasers > .wpb_column,
.equal-height-teasers > .vc_column_container,
.equal-height-teasers .vc_column_container {
    display: flex !important;
    flex-direction: column;
}

.equal-height-teasers .vc_column-inner,
.equal-height-teasers .wpb_wrapper {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    height: 100%;
}

/* Container */
.gustoso-text-teaser {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Inner Container (Card) */
.gustoso-text-teaser__container {
    background-color: #ffffff;
    border: 1px solid var(--border-color, #92A9CD);
    border-radius: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    box-sizing: border-box;
    margin: 10px auto 20px !important;
    width: 100%;
    max-width: 100%;
    height: 100%; /* Fill available height */
    flex: 1;
}

/* Equal height: Push CTA to bottom */
.gustoso-text-teaser {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gustoso-text-teaser__container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Title */
.gustoso-text-teaser__title {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 40px 0;
    text-align: left;
}

/* Divider */
.gustoso-text-teaser__divider {
    width: var(--divider-width, 50%);
    max-width: 300px;
    height: 1px;
    background-color: var(--divider-color, #92A9CD);
    margin: 0 0 30px 0;
}

/* Description */
.gustoso-text-teaser__description {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    margin: 0 0 30px 0;
    max-width: 600px;
    text-align: left;
    /* Limit to 2 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gustoso-text-teaser__description p {
    margin: 0;
    /* Inherit line-clamp from parent */
    display: inline;
}

.gustoso-text-teaser__description p + p {
    margin-top: 0;
}

/* Optional: Remove line-clamp if you want full text */
.gustoso-text-teaser--full-text .gustoso-text-teaser__description {
    -webkit-line-clamp: unset;
    display: block;
    overflow: visible;
}

/* CTA Link */
.gustoso-text-teaser__cta {
    margin-top: auto !important; /* Push CTA to bottom for equal height */
    text-align: left;
}

.gustoso-text-teaser__cta-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 15px;
    text-decoration: none;
    color: var(--text-color, #2d3748);
    transition: all 0.3s ease;
}

/* CTA Button (Circle with Arrow) */
.gustoso-text-teaser__cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #324158;
    flex-shrink: 0;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #324158 !important;
}

.gustoso-text-teaser__cta-button::before {
    content: "→";
    font-size: 18px;
    line-height: 1;
    color: #ffffff;
    display: block;
}

.gustoso-text-teaser__cta-button svg {
    display: none;
}

.gustoso-text-teaser__cta-link:hover .gustoso-text-teaser__cta-button {
    background: transparent !important;
    color: #324158 !important;
}

.gustoso-text-teaser__cta-link:hover .gustoso-text-teaser__cta-button::before {
    color: #324158 !important;
}

/* CTA Text */
.gustoso-text-teaser__cta-text {
    font-family: 'Ysabeau Infant', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 18px;
    font-weight: 600;
    font-style: normal;
    line-height: 1.5;
    color: var(--text-color, #2d3748);
    padding-left: 0;
    border-bottom: 1px dotted transparent;
    transition: border-color 0.3s ease;
}

.gustoso-text-teaser__cta-link:hover .gustoso-text-teaser__cta-text {
    border-bottom: 1px dotted currentColor;
}

/* Remove any pseudo-elements from CTA text */
.gustoso-text-teaser__cta-text::before,
.gustoso-text-teaser__cta-text::after {
    display: none !important;
    content: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gustoso-text-teaser__title {
        font-size: 32px;
        margin-bottom: 30px;
    }
    
    .gustoso-text-teaser__divider {
        margin-bottom: 25px;
    }
    
    .gustoso-text-teaser__description {
        font-size: 15px;
        margin-bottom: 25px;
    }
    
    .gustoso-text-teaser__cta-text {
        font-size: 16px;
    }
    
    .gustoso-text-teaser__cta-button {
        width: 40px;
        height: 40px;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 1024px) {
    .gustoso-text-teaser__container {
        max-width: 85% !important;
    }
}

@media (max-width: 480px) {
    .gustoso-text-teaser__title {
        font-size: 28px;
        margin-bottom: 25px;
    }
    
    .gustoso-text-teaser__divider {
        margin-bottom: 20px;
    }
    
    .gustoso-text-teaser__description {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .gustoso-text-teaser__cta-text {
        font-size: 15px;
    }
    
    .gustoso-text-teaser__cta-button {
        width: 40px;
        height: 40px;
    }
    
    .gustoso-text-teaser__cta-button::before {
        font-size: 16px;
    }
    .gustoso-text-teaser__container {
        max-width: 300px;
        padding: 20px !important;
    }
    .text-teaser-section {
        margin: 3em auto !important;
    }
}

/* Accessibility */
.gustoso-text-teaser:focus-within {
    outline: 2px solid var(--text-color, #324158);
    outline-offset: 2px;
}

.gustoso-text-teaser__cta:focus {
    outline: 2px solid var(--text-color, #324158);
    outline-offset: 2px;
    border-radius: 4px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gustoso-text-teaser__divider {
        height: 2px;
    }
    
    .gustoso-text-teaser__container {
        border-width: 2px;
    }
}

