:root {
    --primary: #662222;
    --secondary: #842A3B;
    --accent: #A3485A;
    --light: #F5DAA7;
    --dark: #1a0a0a;
    --text: #2d1515;
    --text-light: #5a3535;
    --bg: #faf6f0;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(102, 34, 34, 0.12);
    --shadow-hover: 0 8px 30px rgba(102, 34, 34, 0.18);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}

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

a {
    color: var(--secondary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary);
}

/* Header */
.site-header {
    background: var(--primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--light);
    font-weight: 700;
    font-size: 1.2rem;
}

.logo img {
    width: 48px;
    height: 48px;
}

.logo:hover {
    color: var(--white);
}

.main-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.main-nav a {
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.15);
    color: var(--white);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--light);
    transition: all 0.3s;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 80px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: 1200px;
    margin: 40px auto;
    border-radius: 24px;
}

.hero-content {
    max-width: 520px;
}

.hero h1 {
    font-size: 2.8rem;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-illustration img {
    max-width: 450px;
    height: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--light);
    color: var(--primary);
}

.btn-primary:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.5);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--white);
    color: var(--white);
}

/* Carousel Section */
.carousel-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.carousel-section h2 {
    font-size: 2rem;
    color: var(--white);
    text-align: center;
    margin-bottom: 40px;
}

.carousel-wrapper {
    overflow: hidden;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 24px;
    transition: transform 0.4s ease;
}

.carousel-card {
    flex: 0 0 350px;
    background: var(--white);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-hover);
}

.carousel-card h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 16px;
    text-transform: capitalize;
}

.carousel-content {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
    max-height: 200px;
    overflow: hidden;
}

.carousel-content h1,
.carousel-content h2,
.carousel-content h3 {
    font-size: 1.1rem;
    color: var(--secondary);
    margin: 12px 0 8px;
}

.carousel-content p {
    margin-bottom: 10px;
}

.carousel-content ul,
.carousel-content ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.carousel-prev,
.carousel-next {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--light);
    border: none;
    color: var(--primary);
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: var(--white);
    transform: scale(1.1);
}

/* 3-Row Auto-scrolling Carousel */
.carousel-row {
    overflow: hidden;
    padding: 12px 0;
}

.carousel-row .carousel-track {
    display: flex;
    gap: 16px;
    animation: scroll var(--duration, 240s) linear infinite;
    width: max-content;
}

.carousel-row.reverse .carousel-track {
    animation-direction: reverse;
}

.carousel-item {
    flex-shrink: 0;
}

.keyword-tag {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.keyword-tag:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.05);
}

/* Keyword Modal */
.keyword-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.keyword-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    cursor: pointer;
}

.modal-container {
    position: relative;
    background: var(--white);
    border-radius: 16px;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--primary);
    color: var(--white);
}

#modalTitle {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 24px;
    padding-right: 40px;
    text-transform: capitalize;
}

.modal-content {
    color: var(--text);
    line-height: 1.7;
}

.modal-content h1,
.modal-content h2 {
    font-size: 1.4rem;
    color: var(--primary);
    margin: 24px 0 12px;
}

.modal-content h3 {
    font-size: 1.2rem;
    color: var(--secondary);
    margin: 20px 0 10px;
}

.modal-content p {
    margin-bottom: 14px;
}

.modal-content ul,
.modal-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.modal-content li {
    margin-bottom: 8px;
}

.modal-content figure {
    margin: 20px 0;
    text-align: center;
}

.modal-content figcaption {
    font-size: 0.9rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 8px;
}

.modal-loading {
    text-align: center;
    padding: 60px;
    color: var(--text-light);
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* SEO Text Sections */
.seo-text {
    padding: 60px 0;
    background: var(--white);
    margin: 40px 0;
    border-radius: 16px;
}

.seo-text .container {
    max-width: 900px;
}

.seo-text h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.seo-text p {
    color: var(--text-light);
    margin-bottom: 16px;
}

/* Categories Grid */
.categories-grid {
    padding: 60px 0;
}

.categories-grid h2 {
    font-size: 2rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 40px;
}

.cat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.cat-card {
    background: var(--white);
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.cat-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-icon svg {
    width: 32px;
    height: 32px;
    color: var(--white);
}

.cat-card h3 {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.cat-count {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Latest Articles */
.latest-articles {
    padding: 60px 0;
    background: linear-gradient(to bottom, transparent, rgba(102,34,34,0.03));
}

.latest-articles h2 {
    font-size: 2rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 40px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.articles-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.article-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.article-card a {
    display: block;
    padding: 24px;
}

.article-card h3,
.article-card h2 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.4;
}

.read-more {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Category/Subcategory Headers */
.category-header,
.subcategory-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 60px 0;
    color: var(--white);
}

.category-header h1,
.subcategory-header h1 {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.cat-intro,
.subcat-count {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
    margin-bottom: 20px;
    opacity: 0.8;
}

.breadcrumb a {
    color: inherit;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Subcategories */
.subcategories {
    padding: 60px 0;
}

.subcategories h2 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 32px;
}

.subcat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.subcat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--accent);
}

.subcat-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.subcat-card h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 4px;
}

.subcat-card span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Articles List */
.articles-list {
    padding: 60px 0;
}

.no-articles {
    text-align: center;
    color: var(--text-light);
    padding: 40px;
}

.back-link {
    padding: 0 0 60px;
    text-align: center;
}

/* Article Single */
.article-single {
    padding: 40px 0 60px;
}

.article-single .container {
    max-width: 900px;
}

.article-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(102,34,34,0.1);
}

.article-header h1 {
    font-size: 2.2rem;
    color: var(--primary);
    line-height: 1.3;
}

.article-content {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.article-content h2 {
    font-size: 1.6rem;
    color: var(--primary);
    margin: 32px 0 16px;
}

.article-content h3 {
    font-size: 1.3rem;
    color: var(--secondary);
    margin: 24px 0 12px;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.article-content th,
.article-content td {
    padding: 12px;
    border: 1px solid rgba(102,34,34,0.15);
    text-align: left;
}

.article-content th {
    background: var(--primary);
    color: var(--white);
}

/* Related Articles */
.related-articles {
    padding: 60px 0;
    background: rgba(102,34,34,0.03);
}

.related-articles h2 {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 32px;
    text-align: center;
}

/* Error Page */
.error-page {
    padding: 100px 0;
    text-align: center;
}

.error-content h1 {
    font-size: 8rem;
    color: var(--primary);
    line-height: 1;
    opacity: 0.3;
}

.error-content h2 {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.error-content p {
    color: var(--text-light);
    margin-bottom: 32px;
}

.error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-actions .btn-secondary {
    border-color: var(--accent);
    color: var(--accent);
}

/* Tags Section */
.tags-section {
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(102,34,34,0.05), rgba(132,42,59,0.08));
}

.tags-section h2 {
    font-size: 2rem;
    color: var(--primary);
    text-align: center;
    margin-bottom: 40px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    color: var(--text);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tag-item:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.tag-item:hover .tag-count {
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

.tag-count {
    background: var(--bg);
    color: var(--text-light);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Article Tags */
.article-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(102,34,34,0.1);
}

.article-tags-title {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.article-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.article-tag {
    display: inline-block;
    background: var(--bg);
    color: var(--secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.article-tag:hover {
    background: var(--primary);
    color: var(--white);
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.7);
    padding: 60px 0 0;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
}

.footer-brand img {
    width: 50px;
    margin-bottom: 16px;
}

.footer-brand p {
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-links h4,
.footer-info h4 {
    color: var(--light);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--light);
}

.footer-info p {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-bottom {
    margin-top: 48px;
    padding: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        text-align: center;
        padding: 60px 24px;
        margin: 24px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-illustration img {
        max-width: 340px;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

body.menu-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        z-index: 102;
    }

    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 16px;
        display: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        z-index: 101;
        overflow-y: auto;
    }

    .main-nav.active {
        display: flex;
    }

    .main-nav a {
        padding: 12px 16px;
    }

    .nav-overlay {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 100;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .category-header h1,
    .subcategory-header h1 {
        font-size: 1.8rem;
    }

    .article-header h1 {
        font-size: 1.6rem;
    }

    .article-content {
        padding: 24px;
    }

    .seo-text h2 {
        font-size: 1.5rem;
    }
}
