/* Module Container */
.tb-posts-module {
    font-family: 'IBM Plex Sans', sans-serif;
}

/* -------------------------------------------------------------------------- */
/* Featured Post */
/* -------------------------------------------------------------------------- */
.tb-posts-featured-wrapper {
    padding: 0;
    border-bottom: 1px solid #F0F0F0;
}

.tb-posts-featured {
    display: flex;
    background-color: #FFFEFC;
    border: 1px solid #D8D1C1;
    border-radius: 12px;
    overflow: hidden;
    padding: 24px;
    padding-right: 80px;
    gap: 60px;
    align-items: center;
}

.tb-posts-featured-image {
    flex: 1 0 0;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    align-self: stretch;
}

.tb-posts-featured-content {
    flex: 1 0 0;
    padding: 36px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.tb-posts-featured-info {
    display: flex;
    flex-direction: column;
    gap: 36px;
    width: 100%;
}

.tb-posts-category-badge {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
    letter-spacing: 0.48px;
    text-transform: uppercase;
    color: #07121C;
}

.tb-posts-featured-title-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: black;
}

.tb-posts-featured-title {
    font-family: 'Mongoose', sans-serif;
    font-weight: 700;
    font-size: 80px;
    line-height: 0.8;
    text-transform: uppercase;
    color: #000005;
    margin: 0;
}

.tb-posts-featured-excerpt {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 19px;
    line-height: 1.45;
    color: black;
}

.tb-posts-buttons {
    display: flex;
    gap: 12px;
}

/* -------------------------------------------------------------------------- */
/* Grid Section Wrapper */
/* -------------------------------------------------------------------------- */
.tb-posts-grid-section {
    background-color: #F6F3EC;
    padding: 80px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
}

/* -------------------------------------------------------------------------- */
/* Filter Bar */
/* -------------------------------------------------------------------------- */
.tb-posts-filters {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.tb-posts-filter-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 19px;
    color: #000005;
    white-space: nowrap;
}

.tb-posts-filter-buttons {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    justify-content: center;
}

.tb-posts-filter-btn {
    cursor: pointer;
}

/* -------------------------------------------------------------------------- */
/* Grid Layout */
/* -------------------------------------------------------------------------- */
.tb-posts-grid {
    display: grid;
    gap: 80px 24px;
    width: 100%;
}

.tb-posts-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.tb-posts-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tb-posts-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* -------------------------------------------------------------------------- */
/* Card Element */
/* -------------------------------------------------------------------------- */
.tb-posts-card {
    display: flex;
    flex-direction: column;
    gap: 30px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.tb-posts-card:hover .tb-posts-card-title {
    text-decoration: underline;
}

/* Card Image */
.tb-posts-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 362 / 389;
    border-radius: 9px;
    background-color: #D8D1C1;
    padding: 12px;
    overflow: hidden;
}

.tb-posts-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-out;
}

.tb-posts-card:hover .tb-posts-card-img {
    transform: scale(1.05);
}

/* Gradient overlay on image */
.tb-posts-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 9px;
    background: linear-gradient(170deg, rgba(0, 0, 0, 0.5) 12.6%, rgba(0, 0, 0, 0) 40.8%);
    pointer-events: none;
}

/* Category badge on image */
.tb-posts-card-category {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: 0.78px;
    text-transform: uppercase;
    color: #FFFEFC;
    padding: 6px 12px;
    border-radius: 3px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Card Content */
.tb-posts-card-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tb-posts-card-title {
    font-family: 'IBM Plex Sans Condensed', 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    font-size: 28px;
    text-transform: inherit;
    line-height: 1.15;
    color: #07121C;
    margin: 0;
}

.tb-posts-card-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    color: #07121C;
    white-space: nowrap;
}

.tb-posts-card-author {
    font-size: 17px;
    line-height: 1.45;
}

.tb-posts-card-separator {
    font-size: 17px;
    line-height: 1.45;
}

.tb-posts-card-date {
    font-size: 13px;
    line-height: 1.3;
}

/* -------------------------------------------------------------------------- */
/* Pagination */
/* -------------------------------------------------------------------------- */
.tb-posts-pagination-container {
    display: flex;
    justify-content: center;
}

.tb-posts-pagination {
    display: flex;
    gap: 6px;
    align-items: center;
}

.tb-posts-pagination a,
.tb-posts-pagination span {
    font-family: 'PP Neue Montreal', 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 19px;
    color: #000005;
    opacity: 0.5;
    text-decoration: none;
    padding: 0 4px;
    min-width: 24px;
    text-align: center;
    border-bottom: 1px solid transparent;
}

.tb-posts-pagination span.current,
.tb-posts-pagination a:hover {
    opacity: 1;
    border-bottom: 1px solid #000005;
}

.tb-posts-pagination .dots {
    border: none;
}

/* Loading Indicator */
.tb-posts-loader {
    text-align: center;
    padding: 20px;
    color: #07121C;
    font-family: 'IBM Plex Sans', sans-serif;
}

.tb-posts-no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 20px;
    padding: 40px;
}

/* -------------------------------------------------------------------------- */
/* Responsive */
/* -------------------------------------------------------------------------- */

@media (max-width: 1199px) {

    .tb-posts-grid.tb-posts-cols-3,
    .tb-posts-grid.tb-posts-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 24px;
    }

    .tb-posts-featured {
        padding-right: 24px;
        gap: 30px;
    }

    .tb-posts-grid-section {
        padding: 60px 0px;
    }
}

@media (max-width: 768px) {
    .tb-posts-featured {
        flex-direction: column;
        padding: 16px;
        gap: 24px;
    }

    .tb-posts-featured-image {
        width: 100%;
        min-height: 250px;
    }

    .tb-posts-featured-content {
        padding: 12px 0;
        gap: 24px;
    }

    .tb-posts-featured-title {
        font-size: 50px;
    }

    .tb-posts-grid-section {
        padding: 40px 0;
        gap: 24px;
    }

    .tb-posts-filters {
        flex-wrap: wrap;
        gap: 12px;
    }

    .tb-posts-filter-label {
        width: 100%;
        text-align: center;
    }

    .tb-posts-filter-buttons {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .tb-posts-grid,
    .tb-posts-grid.tb-posts-cols-2,
    .tb-posts-grid.tb-posts-cols-3,
    .tb-posts-grid.tb-posts-cols-4 {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}