/* Home Page - Style based on trangchu.html */

/* Variables */
:root {
    --td-title-color: #f3d079;
    --td-content-color: #222222;
    --td-border-color: #f6d97e;
    --td-bg-light: #f7f3ee;
    --td-bg-dark: #181923;
}

/* Outer Wrap */
.td-outer-wrap {
    background: var(--td-bg-light);
    min-height: 100vh;
}

/* Header */
.td-header-wrap {
    background: var(--td-bg-dark);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.td-header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.td-logo img {
    height: 45px;
    width: auto;
}

.td-header-search {
    display: flex;
    align-items: center;
}

.td-header-search form {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border-radius: 5px;
    overflow: hidden;
}

.td-header-search input {
    background: transparent;
    border: none;
    padding: 10px 15px;
    color: #fff;
    font-size: 14px;
    width: 200px;
}

.td-header-search input::placeholder {
    color: rgba(255,255,255,0.6);
}

.td-header-search button {
    background: var(--td-title-color);
    border: none;
    padding: 10px 15px;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.td-header-search button:hover {
    background: #fff;
}

/* Main Content */
.td-main-content-wrap {
    padding: 2rem 0;
}

.td-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.td-hero-section {
    text-align: center;
    padding: 2rem 0 3rem;
}

.td-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--td-title-color);
    margin-bottom: 1rem;
}

.td-hero-desc {
    font-size: 1.1rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

/* Content Row */
.td-content-row {
    display: flex;
    gap: 30px;
}

.td-main-column {
    flex: 1;
    max-width: calc(100% - 330px);
}

.td-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Category Section */
.td-category-section {
    margin-bottom: 3rem;
}

.td-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--td-border-color);
}

.td-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--td-title-color);
    margin: 0;
}

.td-section-title a {
    color: var(--td-title-color);
}

.td-section-title a:hover {
    color: #000;
}

.td-view-all {
    font-size: 13px;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.td-view-all:hover {
    color: var(--td-title-color);
}

/* Posts Row - Category Grid */
.td-posts-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.td-posts-row .td-post-card.td-featured {
    grid-row: span 2;
}

.td-posts-row .td-post-card.td-small {
    grid-column: 2;
}

.td-post-card {
    position: relative;
    overflow: hidden;
    border-radius: 5px;
}

.td-post-card .td-post-thumb {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 150px;
}

.td-post-card.td-featured .td-post-thumb {
    min-height: 310px;
}

.td-post-card .td-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.3s ease;
}

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

.td-post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
}

.td-post-card .td-post-cat {
    display: inline-block;
    background: rgba(243, 208, 121, 0.33);
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    margin-bottom: 8px;
}

.td-post-card .td-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.td-post-card.td-featured .td-post-title {
    font-size: 18px;
    -webkit-line-clamp: 3;
}

.td-post-card .td-post-meta {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    display: flex;
    gap: 10px;
}

/* Posts Grid - Latest Section */
.td-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.td-post-item {
    background: #fff;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.td-post-item .td-post-thumb {
    display: block;
    position: relative;
    width: 100%;
    padding-bottom: 56%;
    overflow: hidden;
}

.td-post-item .td-post-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.td-post-item:hover .td-post-thumb img {
    transform: scale(1.05);
}

.td-post-item .td-post-cat {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: var(--td-title-color);
    color: #000;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    z-index: 1;
}

.td-post-info {
    padding: 15px;
}

.td-post-item .td-post-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.td-post-item .td-post-title a {
    color: #333;
}

.td-post-item .td-post-title a:hover {
    color: var(--td-title-color);
}

.td-post-item .td-post-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 10px;
}

.td-post-item .td-post-meta a {
    color: #666;
}

.td-post-item .td-post-meta a:hover {
    color: var(--td-title-color);
}

/* Sidebar */
.td-sidebar-block {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.td-block-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--td-title-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--td-border-color);
}

/* Popular Posts */
.td-popular-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.td-popular-item:last-child {
    border-bottom: none;
}

.td-popular-number {
    width: 30px;
    height: 30px;
    background: var(--td-title-color);
    color: #000;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    flex-shrink: 0;
}

.td-popular-info {
    flex: 1;
    min-width: 0;
}

.td-popular-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.td-popular-title a {
    color: #333;
}

.td-popular-title a:hover {
    color: var(--td-title-color);
}

.td-popular-date {
    font-size: 12px;
    color: #999;
}

/* Categories List */
.td-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.td-categories-list li {
    border-bottom: 1px solid #eee;
}

.td-categories-list li:last-child {
    border-bottom: none;
}

.td-categories-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    color: #333;
    font-size: 14px;
}

.td-categories-list a:hover {
    color: var(--td-title-color);
}

.td-categories-list .count {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: #666;
}

/* Social Links */
.td-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.td-social-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
}

.td-social-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}

.td-facebook { background: #3b5998; }
.td-youtube { background: #ff0000; }
.td-telegram { background: #0088cc; }
.td-twitter { background: #000; }
.td-instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

/* Footer */
.td-footer-wrap {
    background: var(--td-bg-dark);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.td-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.td-footer-container p {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* Responsive */
@media screen and (max-width: 1024px) {
    .td-content-row {
        flex-direction: column;
    }

    .td-main-column {
        max-width: 100%;
    }

    .td-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }

    .td-sidebar-block {
        margin-bottom: 0;
    }
}

@media screen and (max-width: 768px) {
    .td-header-container {
        padding: 0 15px;
    }

    .td-logo img {
        height: 35px;
    }

    .td-header-search input {
        width: 150px;
    }

    .td-container {
        padding: 0 15px;
    }

    .td-hero-title {
        font-size: 1.5rem;
    }

    .td-hero-desc {
        font-size: 1rem;
    }

    .td-posts-row {
        grid-template-columns: 1fr;
    }

    .td-posts-row .td-post-card.td-featured {
        grid-row: auto;
    }

    .td-posts-row .td-post-card.td-small {
        grid-column: auto;
    }

    .td-post-card .td-post-thumb,
    .td-post-card.td-featured .td-post-thumb {
        min-height: 200px;
    }

    .td-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .td-sidebar {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .td-header-search {
        display: none;
    }

    .td-hero-section {
        padding: 1rem 0 2rem;
    }

    .td-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .td-post-info {
        padding: 12px;
    }

    .td-post-item .td-post-title {
        font-size: 14px;
    }
}
