/**
 * Text Block Styles
 * Prefix: tb-
 *
 * Layout: image is inside .tb-text, floated left on desktop with text wrapping around it.
 * Mobile (<1024px): image stacks above text.
 */

/* ============================================================
   Text content prose styling
   ============================================================ */
.tb-text {
    color: #4b5563;
}

.tb-text p {
    margin-bottom: 1rem;
}

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

.tb-text a {
    color: #2bb446;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tb-text a:hover {
    color: #239038;
}

.tb-text strong {
    color: #111827;
    font-weight: 600;
}

.tb-text ul,
.tb-text ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.tb-text li {
    margin-bottom: 0.5rem;
}

.tb-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 1.5rem 0 0.75rem;
}

.tb-text blockquote {
    display: flex;
    border-left: 4px solid #2bb446;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: #f0fdf4;
    border-radius: 0 8px 8px 0;
    color: #374151;
}

.tb-text blockquote:first-child {
    margin-top: 0;
}

.tb-text blockquote p:last-child {
    margin-bottom: 0;
}

/* ============================================================
   Image wrap — стакается на мобилке, обтекается на десктопе
   ============================================================ */
.tb-image-wrap {
    margin: 0 0 1rem 0;
    border-radius: 16px;
    overflow: hidden;
}

.tb-image-wrap picture,
.tb-image-wrap .tb-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

/* ============================================================
   Desktop layout: image floats left inside text flow
   ============================================================ */
@media (min-width: 1024px) {
    .tb-text {
        line-height: 1.75;
    }

    .tb-text p {
        margin-bottom: 1.25rem;
    }

    /* Card chrome — без border/shadow для article-вида */
    .tb-card {
        border: none;
        box-shadow: none;
        overflow: visible;
        border-radius: 0;
    }

    /* Image floats left inside .tb-text. Text wraps around it. */
    .tb-image-wrap {
        float: left;
        max-width: 50%;
        min-height: 240px;
        margin: 0 48px 16px 0;
        shape-margin: 1rem;
    }

    .tb-image-wrap .tb-image,
    .tb-image-wrap picture .tb-image {
        max-height: 480px;
        object-fit: cover;
    }

    /* Clearfix on .tb-text so floated image doesn't break parent layout */
    .tb-text::after {
        content: '';
        display: block;
        clear: both;
    }
}
