*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #dd3333;
    --primary-dark: #b22222;
    --primary-darker: #8B1A1A;

    /* Accent - Vàng highlight */
    --accent: #f3e121;
    --accent-warm: #D4A017;

    /* Footer - Xanh đậm */
    --footer-bg: #0a3d6d;
    --footer-dark: #062a4a;

    /* Text & Ink */
    --ink: #1a1a2e;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-light: #cccccc;

    /* Backgrounds */
    --bg: #f4f4f4;
    --bg-white: #ffffff;
    --bg-light: #f9f9f9;

    /* Borders */
    --border: #e0e0e0;
    --border-light: #eeeeee;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);

    /* Layout */
    --container-width: 1400px;
    --sidebar-width: 300px;
    --gap: 24px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;

    /* Transition */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --duration: 200ms;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Quicksand', 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--ink);
    line-height: 1.3;
    font-weight: 700;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.4rem;
}

h3 {
    font-size: 1.15rem;
}

h4 {
    font-size: 1rem;
}

p {
    margin-bottom: 12px;
}

a {
    color: var(--ink);
    text-decoration: none;
    transition: color var(--duration) var(--ease);
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Two-column Layout --- */
.layout-2col {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--gap);
    align-items: start;
}

@media (max-width: 960px) {
    .layout-2col {
        grid-template-columns: 1fr;
    }
}

/* --- Content Box (white background card) --- */
.content-box {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--gap);
    overflow: hidden;
}

/* --- Section Header (đỏ) --- */
.section-label {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 5px 16px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

/* --- Category Tag (overlay on images) --- */
.cat-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 3px;
    z-index: 2;
}

/* Category tags in detail pages (inline, not overlay) */
.cat-tags .cat-tag {
    position: static;
    text-decoration: none;
}

.cat-tags .cat-tag:hover {
    background: var(--primary-dark);
    color: #fff;
}

/* --- Meta (author · date) --- */
.meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.meta span+span::before {
    content: ' • ';
    margin: 0 4px;
}

/* --- Filter Pills --- */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.filter-pill {
    padding: 6px 16px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: var(--bg-white);
    color: var(--text);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    text-decoration: none;
}

.filter-pill:hover,
.filter-pill.active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

/* --- Search Bar --- */
.search-bar {
    position: relative;
    max-width: 400px;
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
    background: var(--bg-white);
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-bar .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* --- Breadcrumb --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .sep {
    color: var(--text-light);
}

/* --- Back Button --- */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--duration) var(--ease);
}

.btn-back:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff5f5;
}

.btn-back i {
    font-size: 0.75rem;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    color: var(--text);
}

.pagination a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination .active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* --- Form elements --- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Quicksand', sans-serif;
    font-size: 0.9rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* --- Badges --- */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
}

.badge-published {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-draft {
    background: #fff3e0;
    color: #e65100;
}

/* --- Alert --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 12px;
    }
}