:root {
    --primary: #e63946;
    --primary-dark: #bf2f3a;
    --accent: #1d3557;
    --text: #333;
    --text-light: #666;
    --bg: #f5f5f8;
    --bg-white: #fff;
    --border: #e0e0e0;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --max-width: 1100px;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --transition: 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-primary);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--accent); line-height: 1.25; }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: 10px 16px;
    z-index: 1000;
}
.skip-link:focus { left: 0; }

/* === HEADER === */
.site-header {
    background: var(--bg-white);
    border-bottom: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.header-mid {
    padding: 30px 0 24px;
    text-align: center;
}

.site-title-link { display: inline-block; text-decoration: none; }

.site-title {
    font-family: var(--font-heading);
    font-size: 3.4rem;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: -1px;
    line-height: 1;
    display: inline-block;
    transition: color var(--transition);
}
.site-title-link:hover .site-title { color: var(--primary-dark); }

.site-tagline {
    margin-top: 8px;
    color: var(--text-light);
    font-size: 0.95rem;
    font-style: italic;
}

.header-nav {
    background: var(--accent);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.main-nav {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

.main-nav li a {
    display: block;
    padding: 14px 22px;
    color: #fff;
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background var(--transition);
}
.main-nav li a:hover { background: var(--primary); color: #fff; }

.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 14px 16px;
    flex-direction: column;
    gap: 5px;
}
.menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: transform var(--transition), opacity var(--transition);
}
.menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* === HERO === */
.hero-section {
    padding: 40px 0;
    background: linear-gradient(135deg, var(--bg) 0%, #ececf5 100%);
}
.hero-card {
    display: flex;
    background: var(--bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition), box-shadow var(--transition);
}
.hero-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.hero-image { flex: 0 0 50%; overflow: hidden; }
.hero-image img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; transition: transform 0.4s; }
.hero-card:hover .hero-image img { transform: scale(1.04); }
.hero-body { flex: 1; padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.hero-cat {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    align-self: flex-start;
}
.hero-title { font-size: 2rem; margin-bottom: 14px; color: var(--accent); }
.hero-excerpt { color: var(--text-light); margin-bottom: 18px; font-size: 1.05rem; }
.hero-cta { color: var(--primary); font-weight: 600; font-size: 0.95rem; }

/* === MAIN CONTENT === */
.site-main { min-height: 60vh; }

.site-content { padding: 40px 0; }

.content-with-sidebar {
    display: flex;
    gap: 36px;
    align-items: flex-start;
}
.content-area { flex: 1; min-width: 0; }
.sidebar { flex: 0 0 300px; }

/* === SECTIONS === */
.section-title {
    font-size: 1.8rem;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
}
.cat-section, .featured-section, .related-section { margin-bottom: 50px; }
.cat-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 12px;
}
.cat-section-header .section-title { border: 0; padding: 0; margin: 0; }
.see-all { color: var(--primary); font-weight: 600; font-size: 0.95rem; }

/* === POST GRID === */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}
.post-grid-3 { grid-template-columns: repeat(3, 1fr); }

.grid-card {
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.grid-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.grid-card-link { display: block; color: inherit; text-decoration: none; }
.grid-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #eee;
}
.grid-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.grid-card:hover .grid-card-image img { transform: scale(1.06); }
.grid-card-body { padding: 16px; }
.grid-card-cat {
    display: inline-block;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.grid-card-title {
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--accent);
    font-family: var(--font-heading);
    font-weight: 700;
}

/* === POST CARD (category list) === */
.post-list { display: flex; flex-direction: column; gap: 24px; }
.post-card {
    display: flex;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post-card-image { flex: 0 0 280px; overflow: hidden; background: #eee; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.post-card:hover .post-card-image img { transform: scale(1.05); }
.post-card-body { flex: 1; padding: 22px 24px; display: flex; flex-direction: column; }
.post-card-cat {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.post-card-title { font-size: 1.4rem; margin-bottom: 10px; }
.post-card-title a { color: var(--accent); }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { color: var(--text-light); margin-bottom: 14px; flex: 1; }
.post-card-link { color: var(--primary); font-weight: 600; font-size: 0.95rem; align-self: flex-start; }

/* === SIDEBAR === */
.widget {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.widget-title {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}
.widget-list { list-style: none; }
.widget-item {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.widget-item:last-child { border-bottom: 0; }
.widget-thumb {
    flex: 0 0 70px;
    width: 70px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    background: #eee;
}
.widget-thumb img { width: 100%; height: 100%; object-fit: cover; }
.widget-content { flex: 1; min-width: 0; }
.widget-link {
    display: block;
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
    margin-bottom: 4px;
}
.widget-link:hover { color: var(--primary); }
.widget-cat {
    font-size: 0.72rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.widget-cat-list { list-style: none; }
.widget-cat-list li { border-bottom: 1px solid var(--border); }
.widget-cat-list li:last-child { border-bottom: 0; }
.widget-cat-list a {
    display: block;
    padding: 10px 0;
    color: var(--accent);
    font-weight: 500;
}
.widget-cat-list a:hover { color: var(--primary); padding-left: 6px; }

/* === BREADCRUMB === */
.breadcrumb {
    margin-bottom: 22px;
    font-size: 0.9rem;
    color: var(--text-light);
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { margin: 0 6px; }
.breadcrumb .current { color: var(--accent); font-weight: 500; }

/* === SINGLE ARTICLE === */
.single-article {
    background: var(--bg-white);
    border-radius: 10px;
    padding: 36px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 36px;
}
.article-header { margin-bottom: 24px; }
.article-cat {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}
.article-title { font-size: 2.3rem; line-height: 1.2; margin-bottom: 8px; }
.article-featured-image {
    margin: 24px -36px;
    overflow: hidden;
}
.article-featured-image img { width: 100%; height: auto; }
.entry-content { font-size: 1.05rem; line-height: 1.75; color: var(--text); }
.entry-content p { margin-bottom: 18px; }
.entry-content h2 {
    font-size: 1.7rem;
    margin: 30px 0 16px;
    color: var(--accent);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--bg);
}
.entry-content h3 { font-size: 1.3rem; margin: 24px 0 12px; color: var(--accent); }
.entry-content h4 { font-size: 1.1rem; margin: 20px 0 10px; color: var(--accent); }
.entry-content ul, .entry-content ol { margin: 0 0 18px 24px; }
.entry-content li { margin-bottom: 8px; }
.entry-content img { border-radius: 6px; margin: 18px 0; }
.entry-content a { color: var(--primary); text-decoration: underline; }
.entry-content a:hover { color: var(--primary-dark); }
.entry-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 14px 22px;
    margin: 22px 0;
    background: var(--bg);
    font-style: italic;
    color: var(--text-light);
}

/* === CATEGORY PAGE === */
.category-header {
    background: var(--bg-white);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary);
    box-shadow: var(--shadow-sm);
}
.category-title { font-size: 2.2rem; margin-bottom: 8px; }
.category-description { color: var(--text-light); font-size: 1.05rem; }

/* === PAGINATION === */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 36px;
}
.pagination a, .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 8px 14px;
    background: var(--bg-white);
    border-radius: 6px;
    color: var(--accent);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.pagination a:hover { background: var(--primary); color: #fff; }
.pagination .current { background: var(--primary); color: #fff; }

/* === ERROR PAGE === */
.error-page { text-align: center; padding: 60px 20px; }
.error-code {
    font-size: 6rem;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 10px;
}
.error-title { font-size: 1.8rem; margin-bottom: 14px; }
.error-text { color: var(--text-light); margin-bottom: 24px; }
.btn-primary {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    transition: background var(--transition);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* === FOOTER === */
.site-footer {
    background: var(--accent);
    color: #cbd5e1;
    margin-top: 60px;
}
.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding: 50px 20px 30px;
}
.footer-title {
    color: #fff;
    font-size: 1.15rem;
    margin-bottom: 14px;
}
.footer-list { list-style: none; }
.footer-list li { margin-bottom: 8px; }
.footer-list a { color: #cbd5e1; }
.footer-list a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 18px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #94a3b8;
}

/* === BACK TO TOP === */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 46px;
    height: 46px;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition);
    z-index: 100;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); }

.no-results {
    text-align: center;
    padding: 40px;
    background: var(--bg-white);
    border-radius: 8px;
    color: var(--text-light);
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .post-grid { grid-template-columns: repeat(2, 1fr); }
    .post-grid-3 { grid-template-columns: repeat(2, 1fr); }
    .content-with-sidebar { flex-direction: column; }
    .sidebar { flex: 1 1 auto; width: 100%; }
    .hero-card { flex-direction: column; }
    .hero-image { flex: 0 0 auto; }
    .hero-image img { min-height: 240px; }
    .hero-body { padding: 28px; }
    .hero-title { font-size: 1.6rem; }
    .footer-container { grid-template-columns: 1fr 1fr; }
    .article-title { font-size: 1.8rem; }
    .single-article { padding: 24px; }
    .article-featured-image { margin: 20px -24px; }
}

@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--accent);
        z-index: 50;
    }
    .main-nav.open { display: flex; }
    .main-nav li { width: 100%; }
    .main-nav li a {
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .nav-container { justify-content: flex-start; }
    .site-title { font-size: 2.6rem; }
    .post-card { flex-direction: column; }
    .post-card-image { flex: 0 0 auto; aspect-ratio: 16/10; }
    .footer-container { grid-template-columns: 1fr; padding: 36px 20px 20px; }
    .section-title { font-size: 1.4rem; }
    .category-title { font-size: 1.7rem; }
    .article-title { font-size: 1.6rem; }
    .header-mid { padding: 22px 0 16px; }
}

@media (max-width: 480px) {
    .post-grid { grid-template-columns: 1fr; }
    .post-grid-3 { grid-template-columns: 1fr; }
    .site-title { font-size: 2.2rem; }
    .container { padding: 0 14px; }
    .hero-section { padding: 24px 0; }
    .hero-body { padding: 20px; }
    .single-article { padding: 18px; }
    .article-featured-image { margin: 16px -18px; }
    .entry-content { font-size: 1rem; }
    .error-code { font-size: 4.5rem; }
    .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}
