/* TBS Helper OS - v2.0 Styles */

/* --- Grid System --- */
.tbs-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Mobile */
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .tbs-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .tbs-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .tbs-grid.cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {

    /* Default desktop behavior if no class is set, though widget should set it */
    .tbs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Media Card --- */
.tbs-media-card {
    display: block;
    text-decoration: none !important;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid transparent;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.tbs-media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.05);
}

/* Thumb */
.tbs-media-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background-color: #f1f5f9;
}

.tbs-media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.tbs-media-card:hover .tbs-media-thumb img {
    transform: scale(1.05);
}

/* Badge */
.tbs-media-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 50px;
    backdrop-filter: blur(4px);
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Content */
.tbs-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tbs-meta {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.tbs-media-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.4;
    color: #0f172a;
}



/* --- Widget Header --- */
.tbs-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1rem;
}

.tbs-widget-title-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tbs-subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: #64748b;
}

.tbs-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.2;
}

.tbs-view-all {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.tbs-view-all:hover {
    color: #2563eb;
}

/* --- Video Card (Podcast Style) --- */
.tbs-video-card {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-decoration: none !important;
}

.tbs-video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.tbs-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: transform 0.5s ease, opacity 0.5s;
}

.tbs-video-card:hover .tbs-video-thumb img {
    transform: scale(1.05);
    opacity: 0.7;
}

/* Play Icon Overlay */
.tbs-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, background 0.3s;
}

.tbs-play-icon {
    width: 0;
    height: 0;
    border-left: 14px solid #0f172a;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    margin-left: 4px;
    /* Optical center */
}

.tbs-video-card:hover .tbs-play-overlay {
    transform: translate(-50%, -50%) scale(1.1);
    background: #ffffff;
}

/* Content */
.tbs-video-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tbs-video-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: #64748b;
}

.tbs-video-title {
    font-family: 'Playfair Display', serif;
    /* Or fallback */
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: #0f172a;
    margin: 0;
    transition: color 0.3s;
}


/* --- Product/Post Card --- */
.tbs-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.tbs-product-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #cbd5e1;
}

.tbs-product-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    /* Square for products usually, or 4/3 */
    background: #f8fafc;
    overflow: hidden;
}

.tbs-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tbs-product-card:hover .tbs-product-thumb img {
    transform: scale(1.05);
}

.tbs-product-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.5rem;
}

.tbs-product-cat {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.tbs-product-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
}

.tbs-product-price {
    font-size: 1rem;
    font-weight: 600;
    color: #2563eb;
    margin-top: auto;
    padding-top: 0.5rem;
}

.tbs-product-btn {
    margin-top: 1rem;
    width: 100%;
    padding: 0.75rem;
    background: #f1f5f9;
    color: #0f172a;
    text-align: center;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.tbs-product-btn:hover {
    background: #0f172a;
    color: #fff;
}

/* --- Pagination --- */
.tbs-pagination {
    margin-top: 3rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.tbs-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    /* Safe for mobile */
    justify-content: center;
    gap: 0.5rem;
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.tbs-pagination ul.page-numbers li {
    margin: 0;
    padding: 0;
}

/* Target the actual links/spans, explicitly excluding the ul container */
.tbs-pagination ul.page-numbers li a.page-numbers,
.tbs-pagination ul.page-numbers li span.page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
    font-size: 1rem;
}

/* Current Page & Hover State */
.tbs-pagination ul.page-numbers li span.current,
.tbs-pagination ul.page-numbers li a.page-numbers:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

/* Dots */
.tbs-pagination ul.page-numbers li span.dots {
    border: none;
    background: transparent;
    color: #94a3b8;
    width: auto;
    padding: 0 0.5rem;
}