/* --- Cài đặt chung --- */
:root {
    --primary-color: #007bff;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --text-color: #555;
    --container-width: 1100px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #fff;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
}

img {
    max-width: 100%;
}

.container {
    max-width: var(--container-width);
    margin: auto;
    overflow: hidden;
    padding: 0 2rem;
}

/* --- Header & Navigation --- */
.main-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.main-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
}

.main-header .main-menu ul {
    display: flex;
    list-style: none;
}

.main-header .main-menu ul li {
    margin-left: 1.5rem;
}

.main-header .main-menu ul li a {
    font-weight: 500;
    color: var(--dark-color);
    transition: color 0.3s ease;
}

.main-header .main-menu ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.search-icon {
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero {
    background: var(--light-color);
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero .btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 1.8rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    transition: background 0.3s ease;
}

.hero .btn:hover {
    background: #0056b3;
    text-decoration: none;
}

/* --- Sections --- */
.section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 2rem;
}

/* --- Featured Posts --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.post-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-card .card-content {
    padding: 1.5rem;
}

.post-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* --- Latest Posts --- */
.latest-posts-list ul {
    list-style: none;
}

.latest-posts-list li {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.latest-posts-list li:last-child {
    border-bottom: none;
}

.latest-posts-list img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 1rem;
}

.latest-posts-list h4 {
    font-size: 1.1rem;
    color: var(--dark-color);
}

.view-all-link {
    display: block;
    text-align: center;
    margin-top: 2rem;
    font-weight: bold;
}

/* --- Categories --- */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
}

.category-item {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 8px;
}

.category-item h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.category-item ul {
    list-style: none;
    margin-top: 1rem;
}

.category-item li {
    margin-bottom: 0.5rem;
}

/* --- Footer --- */
.main-footer {
    background: var(--dark-color);
    color: #fff;
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.footer-grid h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #fff;
}

.footer-grid ul {
    list-style: none;
}

.footer-grid a {
    color: #ccc;
}

.footer-grid a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #555;
    font-size: 0.9rem;
}

/* --- Responsive Design --- */
@media(max-width: 768px) {
    .main-header .main-menu {
        display: none; /* Simplification for this example. A real site would use a hamburger menu. */
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .posts-grid, .categories-grid, .footer-grid {
        grid-template-columns: 1fr;
    }
}
