/* ============================================================
   Texila Category Blogs – Stylesheet
   ============================================================ */

/* ---- Reset / Container ---- */
.tcb-wrapper {
    display: flex;
    gap: 32px;
    background: #f0f6fb;
    border-radius: 16px;
    padding: 32px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ============================================================
   LEFT – Category Buttons
   ============================================================ */
.tcb-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    flex-shrink: 0;
}

.tcb-cat-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 600;
    color: #2d3748;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    outline: none;
    letter-spacing: 0.01em;
}

.tcb-cat-btn:hover {
    background: #e4f2fa;
    color: #0e7aae;
    transform: translateX(4px);
}

.tcb-cat-btn.active {
    background: #1a9fc4;
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(26,159,196,0.35);
}

.tcb-cat-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(26,159,196,0.5);
}

.tcb-cat-num {
    font-size: 13px;
    opacity: 0.75;
    min-width: 26px;
    display: inline-block;
}

.tcb-cat-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   RIGHT – Posts Panel
   ============================================================ */
.tcb-posts-panel {
    flex: 1;
    position: relative;
    min-height: 200px;
}

.tcb-posts-inner {
    transition: opacity 0.25s ease;
}

.tcb-posts-inner.tcb-fading {
    opacity: 0.3;
    pointer-events: none;
}

/* ---- Loading spinner ---- */
.tcb-loading {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(240,246,251,0.6);
    border-radius: 12px;
}

.tcb-loading.active {
    display: flex;
}

.tcb-spinner {
    width: 36px;
    height: 36px;
    border: 4px solid #c9e8f4;
    border-top-color: #1a9fc4;
    border-radius: 50%;
    animation: tcb-spin 0.7s linear infinite;
}

@keyframes tcb-spin {
    to { transform: rotate(360deg); }
}

/* ---- Post List ---- */
.tcb-post-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---- Post Item ---- */
.tcb-post-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.tcb-post-item:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.tcb-post-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    text-decoration: none;
    color: inherit;
}

/* ---- Thumbnail ---- */
.tcb-post-thumb {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 10px;
    overflow: hidden;
    background: #e8f4fb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tcb-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.tcb-thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #1a9fc4;
}

.tcb-thumb-icon svg {
    width: 28px;
    height: 28px;
}

/* ---- Post Info ---- */
.tcb-post-info {
    flex: 1;
    overflow: hidden;
}

.tcb-post-title {
    font-size: 14.5px;
    font-weight: 600;
    color: #1a2e44;
    margin: 0 0 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.tcb-post-link:hover .tcb-post-title {
    color: #1a9fc4;
}

.tcb-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #718096;
}

.tcb-author::before {
    content: "✦ ";
    color: #1a9fc4;
    font-size: 10px;
}

.tcb-date::before {
    content: "· ";
}

/* ---- Empty / Error states ---- */
.tcb-empty,
.tcb-no-data {
    color: #718096;
    font-size: 14px;
    padding: 24px 0;
    text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 768px) {
    .tcb-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    .tcb-categories {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: unset;
        gap: 8px;
    }

    .tcb-cat-btn {
        flex: 1 1 auto;
        min-width: 130px;
        justify-content: center;
        padding: 11px 16px;
        font-size: 14px;
    }

    .tcb-cat-btn:hover {
        transform: none;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .tcb-wrapper {
        padding: 14px;
        border-radius: 10px;
    }

    .tcb-categories {
        gap: 6px;
    }

    .tcb-cat-btn {
        min-width: 100px;
        padding: 9px 12px;
        font-size: 13px;
        border-radius: 40px;
    }

    .tcb-cat-num {
        display: none;
    }

    .tcb-post-link {
        padding: 12px 14px;
        gap: 12px;
    }

    .tcb-post-thumb {
        width: 50px;
        height: 50px;
    }

    .tcb-post-title {
        font-size: 13.5px;
    }
}
