/* TVFL Post Filter Widget */

.tvfl-post-filter {
    width: 100%;
    --tvfl-thumb-size: 110px;
}

/* ── TABS ───────────────────────────────────────────────────────────── */

.tvfl-pf-tabs-wrap {
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
}

.tvfl-pf-tabs-wrap::-webkit-scrollbar {
    display: none;
}

.tvfl-pf-tabs {
    display: inline-flex;
    gap: 0;
    white-space: nowrap;
    min-width: 100%;
}

.tvfl-pf-tab {
    background: none;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
    line-height: 1.5;
}

.tvfl-pf-tab:hover {
    background-color: var(--e-global-color-primary);
    color: #ffffff;
}

.tvfl-pf-tab.active {
    color: #ffffff;
    background-color: var(--e-global-color-primary);
}

/* ── LOADING STATE ───────────────────────────────────────────────────── */

.tvfl-pf-posts-wrap {
    position: relative;
    min-height: 80px;
}

.tvfl-pf-posts-wrap.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 5px;
    z-index: 10;
}

.tvfl-pf-posts-wrap.is-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 11;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: tvfl-spin 0.7s linear infinite;
}

@keyframes tvfl-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── POSTS GRID ─────────────────────────────────────────────────────── */

.tvfl-pf-posts {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.tvfl-pf-empty {
    padding: 24px 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
}

/* ── FEATURED POST (left ~52%) ──────────────────────────────────────── */

.tvfl-pf-featured {
    flex: 0 0 52%;
    min-width: 0;
    border: 1px solid var(--e-global-color-c31cee6);
    border-radius: 5px;
    overflow: hidden;
}

.tvfl-pf-featured-link {
    display: block;
    text-decoration: none;
}

.tvfl-pf-featured-img-wrap {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 5px;
}

.tvfl-pf-featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.tvfl-pf-featured-link:hover .tvfl-pf-featured-img {
    transform: scale(1.03);
}

.tvfl-pf-featured-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.65) 40%,
        rgba(0, 0, 0, 0.15) 70%,
        transparent 100%
    );
    z-index: 1;
    pointer-events: none;
}

.tvfl-pf-featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 50%;
}

.tvfl-pf-cat-badge {
    display: inline-block;
    align-self: flex-start;
    background-color: var(--e-global-color-primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    line-height: 1.4;
}

.tvfl-pf-featured-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.tvfl-pf-featured-excerpt {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.55;
}

.tvfl-pf-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 20px;
}

.tvfl-pf-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tvfl-pf-author-name {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.tvfl-pf-dot {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
}

.tvfl-pf-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* ── LIST POSTS (right ~48%) ─────────────────────────────────────────── */

.tvfl-pf-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tvfl-pf-list-item {
    display: flex;
    align-items: stretch;
    gap: 15px;
    padding: 0 8px 0 0;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    margin-bottom: 10px;
    text-decoration: none;
    transition: opacity 0.2s;
    overflow: hidden;
}

.tvfl-pf-list-item:hover {
    opacity: 0.8;
}


.tvfl-pf-list-thumb {
    flex-shrink: 0;
    width: var(--tvfl-thumb-size) !important;
    height: var(--tvfl-thumb-size) !important;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.tvfl-pf-list-thumb--empty {
    flex-shrink: 0;
    width: var(--tvfl-thumb-size) !important;
    height: var(--tvfl-thumb-size) !important;
    border-radius: 0;
    background-color: rgba(255, 255, 255, 0.06);
}

.tvfl-pf-list-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 8px 0;
}

.tvfl-pf-list-cat {
    display: inline-block;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffffff;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 3px;
}

.tvfl-pf-list-item:nth-child(5n+1) .tvfl-pf-list-cat { background-color: var(--e-global-color-primary); }
.tvfl-pf-list-item:nth-child(5n+2) .tvfl-pf-list-cat { background-color: #074A96; }
.tvfl-pf-list-item:nth-child(5n+3) .tvfl-pf-list-cat { background-color: #04462C; }
.tvfl-pf-list-item:nth-child(5n+4) .tvfl-pf-list-cat { background-color: #532376; }
.tvfl-pf-list-item:nth-child(5n+5) .tvfl-pf-list-cat { background-color: #A05806; }

.tvfl-pf-list-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--e-global-color-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tvfl-pf-list-date {
    display: block;
    font-size: 11px;
    color: rgba(224, 224, 224, 0.45);
    margin-top: 8px;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────── */

/* Tablet: featured fills the full height of the list beside it */
@media (min-width: 768px) and (max-width: 1024px) {
    .tvfl-pf-featured-link {
        height: 100%;
    }

    .tvfl-pf-featured-img-wrap {
        aspect-ratio: unset;
        height: 100%;
    }

    .tvfl-pf-list-thumb,
    .tvfl-pf-list-thumb--empty {
        width: 30% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
}

/* Tablet + Mobile: overlay spans full image width */
@media (max-width: 1024px) {
    .tvfl-pf-featured-overlay {
        width: 100%;
    }
}

@media (max-width: 767px) {
    .tvfl-post-filter {
        --tvfl-thumb-size: 64px;
    }

    .tvfl-pf-posts {
        flex-direction: column;
    }

    .tvfl-pf-featured {
        flex: none;
        width: 100%;
    }

    .tvfl-pf-featured-title {
        font-size: 16px;
    }

    .tvfl-pf-list-thumb,
    .tvfl-pf-list-thumb--empty {
        width: var(--tvfl-thumb-size) !important;
        height: 100% !important;
    }
}
