:root {
    --primary: #6366f1;
    --secondary: #f43f5e;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-body: #020617;
    --bg-card: #0f172a;
    --bg-header: rgba(2, 6, 23, 0.8);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    transition: var(--transition);
    line-height: 1.6;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

button,
a {
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* --- 2. HEADER SECTION (TÙY CHỈNH MENU) --- */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 72px;
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 30px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Menu điều hướng chính trên Desktop */
.main-nav {
    display: none;
    gap: 25px;
    align-items: center;
}

@media (min-width: 1024px) {
    .main-nav {
        display: flex;
    }
}

.nav-link {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.search-bar {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: none;
}

@media (min-width: 768px) {
    .search-bar {
        display: block;
    }
}

.search-bar input {
    width: 100%;
    padding: 10px 20px 10px 45px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-body);
    color: var(--text-main);
}

.search-bar i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-write {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
}

.btn-write:hover {
    background: var(--primary);
    color: white;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* --- 3. MAIN SECTION (GIỮ NGUYÊN CSS) --- */
main {
    padding: 30px 0;
    min-height: 80vh;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .grid-layout {
        grid-template-columns: 1fr 320px;
    }
}

.hero-bento {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 180px 180px;
    gap: 15px;
    margin-bottom: 40px;
    margin-top: 50px;
}

.bento-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border);
}

.bento-1 {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 4px;
}

.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.story-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.story-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.card-cover {
    position: relative;
    background: var(--border);
    padding: 5px;
}
.card-cover img{
    height: 190px;
}
.card-info {
    padding: 12px;
}

.card-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

/* --- 4. FOOTER (GIỮ NGUYÊN) --- */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 60px 0 20px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer-col h4 {
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary);
}

.footer-links li {
    list-style: none;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

/* --- 5. MOBILE BOTTOM NAV (TÙY CHỈNH) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
}

@media (min-width: 1024px) {
    .bottom-nav {
        display: none;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    gap: 4px;
}

.nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

.nav-item i {
    font-size: 1.2rem;
}