.th-v2-posts-grid {
    padding-bottom: 160px;
    background-color: #0D0D0D;
}

.th-v2-posts-grid__container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 20px;
}

.th-v2-posts-grid__filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 35px;
    padding: 25px 0;
    border-bottom: 1px solid rgb(242 238 230 / 12%);
}

.th-v2-posts-grid__categories {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.th-v2-posts-grid__category-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: rgb(242 238 230 / 50%);
    cursor: pointer;
    font-family: var(--font-secondary);
    font-size: 15px;
    font-weight: 400;
    line-height: 140%;
    text-transform: uppercase;
    transition: color .3s ease;
}

.th-v2-posts-grid__category-button.is-active,
.th-v2-posts-grid__category-button:hover {
    color: #F2EEE6;
    text-decoration: underline;
}

.th-v2-posts-grid__count {
    color: #F2EEE6;
    font-family: var(--font-secondary);
    font-size: 15px;
    font-weight: 400;
    line-height: 140%;
}

.th-v2-posts-grid__items {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 160px;
}

.th-v2-posts-grid__card:nth-child(8n + 1) { grid-column: 1 / span 5; }
.th-v2-posts-grid__card:nth-child(8n + 2) { grid-column: 7 / span 3; }
.th-v2-posts-grid__card:nth-child(8n + 3) { grid-column: 10 / span 3; }
.th-v2-posts-grid__card:nth-child(8n + 4) { grid-column: 4 / span 6; }
.th-v2-posts-grid__card:nth-child(8n + 5) { grid-column: 1 / span 3; }
.th-v2-posts-grid__card:nth-child(8n + 6) { grid-column: 4 / span 3; }
.th-v2-posts-grid__card:nth-child(8n + 7) { grid-column: 8 / span 5; }
.th-v2-posts-grid__card:nth-child(8n) { grid-column: 4 / span 6; }

.th-v2-posts-grid__thumb-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.th-v2-posts-grid__thumb {
    position: relative;
    height: 480px;
    margin-bottom: 20px;
    overflow: hidden;
}

.th-v2-posts-grid__card:nth-child(8n + 2) .th-v2-posts-grid__thumb,
.th-v2-posts-grid__card:nth-child(8n + 3) .th-v2-posts-grid__thumb { height: 400px; }

.th-v2-posts-grid__card:nth-child(8n + 1) .th-v2-posts-grid__thumb,
.th-v2-posts-grid__card:nth-child(8n + 7) .th-v2-posts-grid__thumb { height: 658px; }

.th-v2-posts-grid__thumb img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s;
}

.th-v2-posts-grid__category {
    position: relative;
    z-index: 2;
    display: inline-block;
    left: 50%;
    height: 20px;
    padding: 0 15px;
    transform: translateX(-50%);
}

.th-v2-posts-grid__category span {
    position: relative;
    display: inline-block;
    z-index: 1;
    height: 20px;
    padding: 0 2px;
    background-color: #0D0D0D;
    color: #F2EEE6;
    font-family: var(--font-secondary);
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    text-transform: uppercase;
    vertical-align: super;
}

.th-v2-posts-grid__category::before,
.th-v2-posts-grid__category::after {
    position: absolute;
    top: 0;
    z-index: 0;
    width: 15px;
    height: 100%;
    background-color: #0D0D0D;
    content: '';
    pointer-events: none;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 15px 100%;
    mask-size: 15px 100%;
    -webkit-mask-position: center;
    mask-position: center;
}

.th-v2-posts-grid__category::before {
    left: 2px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='20' viewBox='0 0 15 20'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M0 0H15V20H7.8C7.6 20 7.4 19.8 7.4 19.6V15C7.4 12.2 5.2 10 2.5 10H0V0Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='20' viewBox='0 0 15 20'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M0 0H15V20H7.8C7.6 20 7.4 19.8 7.4 19.6V15C7.4 12.2 5.2 10 2.5 10H0V0Z'/%3E%3C/svg%3E");
}

.th-v2-posts-grid__category::after {
    right: 2px;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='20' viewBox='0 0 15 20'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M0 0H14V9.5C14 9.8 13.8 10 13.5 10H12.5C9.8 10 7.6 12.2 7.6 15V19.6C7.6 19.8 7.4 20 7.2 20H0V0Z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='20' viewBox='0 0 15 20'%3E%3Cpath fill='%23000' fill-rule='evenodd' d='M0 0H14V9.5C14 9.8 13.8 10 13.5 10H12.5C9.8 10 7.6 12.2 7.6 15V19.6C7.6 19.8 7.4 20 7.2 20H0V0Z'/%3E%3C/svg%3E");
}

.th-v2-posts-grid__title {
    margin: 0 0 10px;
    color: #F2EEE6;
    font-family: var(--font-primary);
    font-size: 28px;
    font-weight: 400;
    line-height: 90%;
    text-transform: uppercase;
}

.th-v2-posts-grid__link {
    --th-v2-posts-grid-link-color: #F2EEE6;
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
    overflow: hidden;
    color: var(--th-v2-posts-grid-link-color);
    font-family: var(--font-secondary);
    font-size: 14px;
    line-height: 140%;
    text-decoration: none;
    text-transform: uppercase;
}

.th-v2-posts-grid__link::before,
.th-v2-posts-grid__link::after {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--th-v2-posts-grid-link-color);
    content: '';
    pointer-events: none;
    transition: transform .735s cubic-bezier(.625, .05, 0, 1);
}

.th-v2-posts-grid__link::before { transform: translateX(0) scaleX(1); transform-origin: left; }
.th-v2-posts-grid__link:hover::before { transform: translateX(100%) scaleX(0); transform-origin: right; }
.th-v2-posts-grid__link::after { transform: translateX(-100%) scaleX(0); transform-origin: left; transition-delay: .02s; }
.th-v2-posts-grid__link:hover::after { transform: translateX(0) scaleX(1); }

.th-v2-posts-grid__load-more {
    display: flex;
    justify-content: center;
    margin-top: 80px;
}

.th-v2-posts-grid__load-more-button[hidden] { display: none; }
.th-v2-posts-grid__load-more-button:disabled { cursor: wait; opacity: .55; }

.th-v2-posts-grid.is-loading { cursor: wait; }
.th-v2-posts-grid.is-loading .th-v2-posts-grid__items { opacity: .55; }
.th-v2-posts-grid.has-error .th-v2-posts-grid__count { color: #F28B82; }

@media (max-width: 1024px) {
    .th-v2-posts-grid { padding-bottom: 150px; }
    .th-v2-posts-grid__filter { flex-direction: column; gap: 30px; padding: 20px 0; border-bottom: 0; margin-bottom: 20px; }
    .th-v2-posts-grid__categories { width: 100%; flex-wrap: wrap; justify-content: center; padding-bottom: 20px; border-bottom: 1px solid rgb(242 238 230 / 12%); }
    .th-v2-posts-grid__items { grid-template-columns: 1fr; row-gap: 60px; }
    .th-v2-posts-grid__card { grid-column: auto !important; }
    .th-v2-posts-grid__title { margin-bottom: 20px; }
    .th-v2-posts-grid__thumb,
    .th-v2-posts-grid__card:nth-child(8n + 2) .th-v2-posts-grid__thumb,
    .th-v2-posts-grid__card:nth-child(8n + 3) .th-v2-posts-grid__thumb,
    .th-v2-posts-grid__card:nth-child(8n + 1) .th-v2-posts-grid__thumb,
    .th-v2-posts-grid__card:nth-child(8n + 7) .th-v2-posts-grid__thumb { height: 410px; }
    .th-v2-posts-grid__load-more { margin-top: 60px; }
}
