/* FIX FOR MOTORCYCLE ARTICLE - Float ads with text, center between sections */
.td-post-content.tagdiv-type figure.wp-caption {
    display: block !important;
    clear: both !important;
    margin: 0 auto 1em !important;
    width: 100% !important;
    max-width: 696px;
}

/* Allow ads to float right when they're between text paragraphs */
.td-post-content.tagdiv-type .code-block {
    float: right !important;
    margin: 8px 0px 8px 20px !important;
    padding-left: 0 !important;
    width: 300px !important;
    max-width: 100%; /* Important for mobile */
}

/* BUT: When an ad comes AFTER a figure (before next motorcycle), center it */
.td-post-content.tagdiv-type figure + .code-block {
    float: none !important;
    clear: both !important;
    margin: 20px auto !important;
    display: block !important;
    text-align: center;
}

/* Ensure motorcycle titles start fresh after centered ads */
.td-post-content.tagdiv-type figure + .code-block + p > strong {
    clear: both !important;
    display: block;
    margin-top: 2em;
    margin-bottom: 1em;
}

/* For the intro text after the main picture - allow floating */
.td-post-content.tagdiv-type > .code-block:first-of-type {
    float: right !important;
    margin: 8px 0px 8px 20px !important;
}

/* Keep the main featured image caption clear */
.td-post-featured-image figure {
    clear: both !important;
    margin-bottom: 2em !important;
}

/* =========================================== */
/* MOBILE RESPONSIVE FIXES (Below 768px width) */
/* =========================================== */
@media screen and (max-width: 767px) {
    /* On mobile, remove ALL floats and center everything */
    .td-post-content.tagdiv-type .code-block {
        float: none !important;
        clear: both !important;
        margin: 20px auto !important;
        width: 100% !important;
        max-width: 300px !important;
        padding-left: 0 !important;
        display: block !important;
        text-align: center;
    }
    
    /* Center ads that come after figures on mobile */
    .td-post-content.tagdiv-type figure + .code-block {
        margin: 20px auto !important;
        width: 100% !important;
        max-width: 300px !important;
    }
    
    /* Center the first ad after main picture on mobile */
    .td-post-content.tagdiv-type > .code-block:first-of-type {
        float: none !important;
        margin: 20px auto !important;
        width: 100% !important;
        max-width: 300px !important;
    }
    
    /* Adjust spacing for motorcycle titles on mobile */
    .td-post-content.tagdiv-type figure + .code-block + p > strong {
        margin-top: 1.5em !important;
        margin-bottom: 0.5em !important;
    }
    
    /* Make images fit mobile screens better */
    .td-post-content.tagdiv-type figure.wp-caption {
        max-width: 100% !important;
        margin: 0 auto 1em !important;
    }
    
    /* Adjust iframe sizes for mobile */
    .td-post-content.tagdiv-type .code-block iframe {
        max-width: 100% !important;
        height: auto !important;
    }
}

/* =========================================== */
/* TABLET RESPONSIVE (768px - 1024px) */
/* =========================================== */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .td-post-content.tagdiv-type .code-block {
        width: 250px !important;
        margin: 8px 0px 8px 15px !important;
    }
    
    .td-post-content.tagdiv-type figure + .code-block {
        width: 250px !important;
    }
}

/* Version: 20260207-01 */