/* ======================================== */
/* CSS VARIABLES - TIMESBULL CORE */
/* ======================================== */
:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --primary-light: #fee2e2;
    --text-dark: #222;
    --text: #333;
    --text-light: #666;
    --text-lighter: #999;
    --bg-light: #f5f5f5;
    --bg-white: #fff;
    --border: #eee;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --radius: 8px;
    --container: 1280px;
}

/* ======================================== */
/* RESET & BASE */
/* ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-light);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.tb-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ======================================== */
/* HEADER */
/* ======================================== */
.tb-header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.tb-header-top {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.tb-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.tb-logo img {
    max-height: 40px;
    width: auto;
    display: block;
}

.tb-site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.tb-nav-desktop ul {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.tb-nav-desktop a {
    color: var(--text);
    font-weight: 500;
    padding: 8px 0;
}

.tb-nav-desktop a:hover {
    color: var(--primary);
}

.tb-nav-desktop .sub-menu {
    position: absolute;
    background: var(--bg-white);
    min-width: 200px;
    box-shadow: var(--shadow-md);
    border-radius: 5px;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tb-nav-desktop li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
}

.tb-header-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tb-search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: var(--text);
}

.tb-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.tb-mobile-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
}

/* ======================================== */
/* SCROLL MENU */
/* ======================================== */
.tb-scroll-menu {
    background: var(--primary);
    padding: 8px 0;
    position: sticky;
    top: 60px;
    z-index: 99;
    transition: transform 0.3s ease;
}

.tb-scroll-menu.tb-hidden {
    transform: translateY(-100%);
}

.tb-scroll-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.tb-scroll-wrapper {
    flex: 1;
    overflow: hidden;
}

.tb-scroll-items {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 2px 0;
}

.tb-scroll-items::-webkit-scrollbar {
    display: none;
}

.tb-scroll-items a {
    flex: 0 0 auto;
    padding: 6px 18px;
    background: var(--bg-white);
    color: var(--primary);
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.tb-scroll-items .current-menu-item a,
.tb-scroll-items .active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.tb-scroll-arrow {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.3);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}

/* ======================================== */
/* SEARCH OVERLAY */
/* ======================================== */
.tb-search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tb-search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tb-search-container {
    width: 90%;
    max-width: 600px;
    position: relative;
}

.tb-search-container input {
    width: 100%;
    height: 60px;
    padding: 0 70px 0 20px;
    font-size: 18px;
    border: none;
    border-radius: 30px;
    outline: none;
}

.tb-search-container button {
    position: absolute;
    right: 5px;
    top: 5px;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    cursor: pointer;
}

.tb-search-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

/* ======================================== */
/* MOBILE MENU */
/* ======================================== */
.tb-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: var(--bg-white);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.tb-mobile-menu.active {
    right: 0;
}

.tb-mobile-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tb-mobile-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.tb-mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.tb-mobile-nav {
    list-style: none;
}

.tb-mobile-nav li {
    border-bottom: 1px solid var(--border);
}

.tb-mobile-nav a {
    display: block;
    padding: 12px 20px;
    color: var(--text);
}

.tb-mobile-nav .sub-menu {
    list-style: none;
    background: #fafafa;
}

.tb-mobile-nav .sub-menu a {
    padding-left: 35px;
}

.tb-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tb-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.tb-mobile-menu-open {
    overflow: hidden;
}

/* ======================================== */
/* HOMEPAGE LAYOUT */
/* ======================================== */
.tb-row-1 {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.tb-col {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.tb-col-header {
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.tb-col-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
}

/* Stack Card */
.tb-stack-card {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.tb-stack-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.tb-stack-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tb-stack-card:hover .tb-stack-image img {
    transform: scale(1.03);
}

.tb-stack-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

/* Horizontal Card */
.tb-horizontal-card {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}

.tb-horizontal-card:last-child {
    border-bottom: none;
}

.tb-horizontal-image {
    flex: 0 0 110px;
    height: 75px;
    overflow: hidden;
    border-radius: 4px;
}

.tb-horizontal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.tb-horizontal-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category Sections */
.tb-section {
    padding: 25px;
    margin-bottom: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tb-section-green { background: #e3f4e9; border-left: 4px solid #27ae60; }
.tb-section-blue { background: #e7f0fd; border-left: 4px solid #3498db; }
.tb-section-purple { background: #f3e8ff; border-left: 4px solid #9b59b6; }
.tb-section-red { background: #fee9e7; border-left: 4px solid #e74c3c; }
.tb-section-orange { background: #ffefe3; border-left: 4px solid #f39c12; }
.tb-section-yellow { background: #fef7e0; border-left: 4px solid #f1c40f; }
.tb-section-teal { background: #e0f7fa; border-left: 4px solid #008080; }

.tb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.08);
}

.tb-section-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
}

.tb-view-all {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    padding: 5px 12px;
    background: rgba(231,76,60,0.1);
    border-radius: 20px;
}

.tb-view-all:hover {
    background: var(--primary);
    color: white;
}

/* Grid Layouts */
.tb-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.tb-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tb-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 40px 0;
}

/* Category Cards */
.tb-cat-card {
    background: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.tb-cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.tb-cat-image {
    height: 150px;
    overflow: hidden;
}

.tb-cat-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.tb-cat-content {
    padding: 15px;
}

.tb-cat-title-full {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.tb-cat-date {
    color: var(--text-lighter);
    font-size: 12px;
}

/* Post Cards */
.tb-post-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tb-post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.tb-card-img {
    height: 180px;
    overflow: hidden;
}

.tb-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.tb-card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tb-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.tb-card-meta {
    font-size: 13px;
    color: var(--text-lighter);
    margin-bottom: 12px;
}

.tb-card-excerpt {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.tb-read-more {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
}

/* ======================================== */
/* SINGLE POST */
/* ======================================== */
.tb-single-post {
    background: var(--bg-light);
    padding: 10px 0;
}

.tb-post-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.tb-post-main {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.tb-post-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tb-category-badge {
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    border-radius: 20px;
}

.tb-post-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.tb-post-meta {
    background: #f9f9f9;
    border-radius: 30px;
    padding: 10px 15px;
    margin-bottom: 20px;
}

.tb-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.tb-meta-author-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tb-author-avatar-mini {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
}

.tb-author-name-link {
    font-weight: 600;
    color: var(--primary);
}

.tb-share-compact {
    display: flex;
    gap: 5px;
}

.tb-share-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.tb-share-fb { background: #4267B2; }
.tb-share-tw { background: #1DA1F2; }
.tb-share-li { background: #0077b5; }

.tb-published-badge,
.tb-update-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.tb-published-badge {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
    color: white;
}

.tb-update-badge {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
}

.tb-post-featured {
    margin: 20px 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.tb-featured-image {
    width: 100%;
    height: auto;
    display: block;
}

.tb-featured-caption {
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 8px 12px;
    font-size: 12px;
    text-align: center;
}

.tb-post-content {
    font-size: 17px;
    line-height: 1.8;
}

.tb-post-content p {
    margin-bottom: 20px;
}

.tb-post-content h2 {
    font-size: 26px;
    margin: 30px 0 15px;
}

.tb-post-content h3 {
    font-size: 22px;
    margin: 25px 0 12px;
}

.tb-post-content img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: var(--radius);
}

/* Author Box */
.tb-author-compact {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: var(--radius);
    margin: 30px 0;
    align-items: center;
}

.tb-author-img-sm {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.tb-author-name-sm {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.tb-author-bio-sm {
    color: var(--text-light);
    font-size: 14px;
}

/* Related Posts */
.tb-related-grid-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.tb-related-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.tb-related-link {
    display: flex;
    gap: 10px;
    padding: 10px;
}

.tb-related-image-sm {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.tb-related-image-sm img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tb-related-title-sm {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* Popular Posts */
.tb-popular-list-compact {
    list-style: none;
    margin: 20px 0;
}

.tb-popular-list-compact li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.tb-popular-number {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

/* Navigation */
.tb-nav-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
}

.tb-nav-prev, .tb-nav-next {
    flex: 1;
}

.tb-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f9f9f9;
    border-radius: 30px;
    font-size: 13px;
}

.tb-home-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ======================================== */
/* SIDEBAR */
/* ======================================== */
.tb-sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.tb-widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.tb-latest-posts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tb-latest-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.tb-latest-item:last-child {
    border-bottom: none;
}

.tb-latest-link {
    display: flex;
    gap: 12px;
    text-decoration: none;
}

.tb-latest-thumb {
    flex: 0 0 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
}

.tb-latest-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tb-latest-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ======================================== */
/* ARCHIVE PAGES */
/* ======================================== */
.tb-archive-header {
    padding: 40px 0;
    text-align: center;
}

.tb-archive-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}

.tb-archive-desc {
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.tb-author-box {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 30px;
    background: var(--bg-white);
    border-radius: var(--radius);
    margin-bottom: 30px;
}

.tb-author-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.tb-author-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

/* Pagination */
.tb-pagination {
    text-align: center;
    margin: 50px 0;
}

.tb-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: var(--bg-white);
    color: var(--text);
    border-radius: 5px;
    margin: 0 3px;
}

.tb-pagination .current {
    background: var(--primary);
    color: white;
}

/* ======================================== */
/* FOOTER */
/* ======================================== */
.tb-site-footer {
    background: var(--bg-white);
    text-align: center;
    padding: 40px 0 30px;
    margin-top: 50px;
    border-top: 2px solid var(--primary);
}

.tb-footer-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 20px;
}

.tb-footer-menu a {
    color: var(--text-light);
    font-size: 14px;
}

.tb-footer-menu a:hover {
    color: var(--primary);
}

.tb-footer-copyright {
    color: var(--text-lighter);
    font-size: 13px;
}

/* ======================================== */
/* RESPONSIVE */
/* ======================================== */
@media (max-width: 1200px) {
    .tb-container { max-width: 960px; }
    .tb-grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
    .tb-container { max-width: 720px; }
    .tb-row-1 { grid-template-columns: 1fr; }
    .tb-grid-3col, .tb-posts-grid, .tb-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .tb-post-layout { grid-template-columns: 1fr; }
    .tb-nav-desktop { display: none; }
    .tb-mobile-toggle { display: flex; }
}

@media (max-width: 768px) {
    .tb-container { padding: 0 15px; }
    .tb-grid-3col, .tb-posts-grid, .tb-grid-4, .tb-related-grid-compact { grid-template-columns: 1fr; }
    .tb-stack-image { height: 180px; }
    .tb-horizontal-image { flex: 0 0 90px; height: 65px; }
    .tb-post-title { font-size: 26px; }
    .tb-post-main { padding: 20px; }
    .tb-sidebar-widget { display: none; }
}

@media (max-width: 576px) {
    .tb-post-title { font-size: 22px; }
    .tb-horizontal-title { font-size: 14px; }
    .tb-stack-title { font-size: 18px; }
}