/* Main Wrapper */
.cbb-block-wrapper {
    margin-bottom: 40px;
    border: 1px solid #ddd;
    padding: 0 5px;
    background: #fff;
}

/* Header */
.cbb-block-header {
    margin-bottom: 20px;
    border-bottom: 2px solid #333;
    /* Example styling */
    padding-bottom: 10px;
}

.cbb-block-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Main Display Area */
.cbb-main-display {
    margin-bottom: 20px;
}

.cbb-main-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.cbb-main-image {
    flex: 1 1 50%;
    min-width: 300px;
}

.cbb-main-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 300px;
    /* Constrain height */
}

.cbb-main-content {
    flex: 1 1 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cbb-post-title {
    margin-top: 0;
    font-size: 20px;
    margin-bottom: 15px;
}

.cbb-post-title a {
    text-decoration: none;
    color: #333;
}

.cbb-post-title a:hover {
    color: #4CAF50;
    /* Example accent color */
}

.cbb-post-excerpt {
    margin-bottom: 20px;
    color: #666;
    line-height: 1.6;
}

.cbb-read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    text-decoration: none;
    align-self: flex-start;
    transition: background 0.3s;
}

.cbb-read-more-btn:hover {
    background-color: #4CAF50;
    color: #fff;
}

/* Thumbnails List */
.cbb-thumbnails-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 0 20px;
}

.cbb-thumb-item {
    cursor: pointer;
    transition: opacity 0.3s;
    border: none;
    position: relative;
}

.cbb-thumb-item:hover {
    opacity: 0.8;
}

/* --- Common: Thumb Title Base --- */
.cbb-thumb-title {
    display: none;
    /* Hidden by default */
    align-items: center;
    text-align: center;
    padding: 10px;
    border: 1px solid #ddd;
    background: #f9f9f9;
    font-size: 14px;
    font-weight: 500;
    min-height: 60px;
    height: 100%;
    color: #333;
    transition: background 0.3s, border-color 0.3s;
}

.cbb-thumb-title:hover {
    background: #eee;
    border-color: #999;
}

/* --- Common: Thumb Excerpt --- */
.cbb-thumb-excerpt {
    display: none;
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

/* --- MODE: SLIDER (Modified: Titles on PC, 2 cols) --- */
.cbb-is-slider .cbb-thumb-item {
    border: none;
}

.cbb-is-slider .cbb-thumb-item:hover {
    opacity: 0.8;
}

/* Show images for Slider on PC */
.cbb-is-slider .cbb-thumb-item img,
.cbb-is-slider .cbb-no-thumb {
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide titles for Slider on PC */
.cbb-is-slider .cbb-thumb-title {
    display: none;
}

/* PC Slider Layout: 5 columns, fixed height */
@media (min-width: 769px) {
    .cbb-is-slider .cbb-thumbnails-list {
        grid-template-columns: repeat(5, 1fr);
    }

    .cbb-is-slider .cbb-thumb-item {
        height: 100px;
        /* Fixed height for image uniformity */
    }
}

/* --- MODE: STATIC (No Slider -> Always Titles) --- */
/* Hide images in static mode */
.cbb-is-static .cbb-thumb-item img,
.cbb-is-static .cbb-no-thumb {
    display: none !important;
}

/* Show titles in static mode */
.cbb-is-static .cbb-thumb-title {
    display: flex;
}

/* Responsive */
@media (max-width: 768px) {
    .cbb-main-inner {
        flex-direction: column;
    }

    .cbb-thumbnails-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {

    /* --- FIXED MOBILE LAYOUT: Image Top for Main, Row List for Thumbs --- */

    /* 1. Main Post: Image ALWAYS Top, Content Bottom */
    .cbb-main-inner {
        display: flex !important;
        flex-direction: column !important;
        border-bottom: 2px solid #eee;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    .cbb-main-image {
        order: 1 !important;
        width: 100%;
        margin-bottom: 15px !important;
        /* Force gap to prevent overlap */
        flex: 0 0 auto !important;
    }

    .cbb-main-content {
        order: 2 !important;
        width: 100%;
        margin-top: 0 !important;
        flex: 0 0 auto !important;
    }

    .cbb-post-title {
        margin-top: 0;
        font-size: 18px;
    }

    /* 2. Thumbnails List: Uniform Row Layout (Image Left - Title Right) */
    /* Remove Grid/Cols, use Flex Column for list */
    .cbb-thumbnails-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        grid-template-columns: none !important;
        /* Reset grid */
        padding: 0 !important;
    }

    /* Reset Item to Flex Row */
    .cbb-thumb-item {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        border: none !important;
        border-bottom: 1px solid #eee !important;
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
        height: auto !important;
        aspect-ratio: auto !important;
        background: transparent !important;
    }

    /* Show Images (Fixed Width ~ 80px) */
    .cbb-thumb-item img,
    /* Handle specific selectors from previous rules */
    .cbb-block-wrapper.cbb-is-slider .cbb-thumb-item img,
    .cbb-block-wrapper.cbb-is-slider .cbb-no-thumb,
    .cbb-block-wrapper.cbb-is-static .cbb-thumb-item img,
    .cbb-block-wrapper.cbb-is-static .cbb-no-thumb {
        display: block !important;
        order: 1;
        flex: 0 0 80px;
        width: 80px;
        height: 60px;
        object-fit: cover;
        margin-right: 15px;
        border-radius: 4px;
    }

    /* Title (Rest) */
    .cbb-thumb-title,
    .cbb-block-wrapper.cbb-is-slider .cbb-thumb-title,
    .cbb-block-wrapper.cbb-is-static .cbb-thumb-title {
        display: -webkit-box !important;
        order: 2;
        flex: 1;
        width: auto !important;
        height: auto !important;
        min-height: auto !important;

        text-align: left !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;

        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        border: none !important;

        font-size: 14px;
        font-weight: 500;
        line-height: 1.4;
        color: #333;

        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal !important;
    }

    /* Hide Excerpt in Thumbnails on Mobile */
    .cbb-thumb-excerpt {
        display: none !important;
    }

    /* Hide Read More button in Static Mode to clean up */
    .cbb-is-static .cbb-read-more-btn {
        display: none;
    }
}
}