/* ---------- RESET & BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #F4EFE6;  /* warm paper */
    color: #2B2622;
    font-family: system-ui, 'Segoe UI', 'Georgia', 'Times New Roman', serif;
    line-height: 1.5;
    scroll-behavior: smooth;
}

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

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

a {
    color: #355C52;
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: #7A4B2A;
}

/* ---------- HEADER ---------- */
.site-header {
    background: #FBF8F2;
    border-bottom: 1px solid #D8CFC3;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(4px);
    background-color: rgba(251, 248, 242, 0.95);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.brand-link {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: -0.3px;
}
.brand-mark {
    font-size: 1.8rem;
}
.brand-name {
    font-size: 1.4rem;
    color: #7A4B2A;
}
.brand-tagline {
    font-size: 0.85rem;
    color: #6E655C;
    font-weight: normal;
    letter-spacing: 0.2px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}
.nav-link {
    font-weight: 500;
    color: #2B2622;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}
.nav-link:hover {
    border-bottom-color: #A88B5A;
    color: #7A4B2A;
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}
.toggle-line {
    width: 24px;
    height: 2px;
    background: #7A4B2A;
    transition: all 0.2s;
}

/* ---------- BUTTONS ---------- */
.btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    border-radius: 40px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn-primary {
    background: #7A4B2A;
    color: #FBF8F2;
}
.btn-primary:hover {
    background: #5E3A20;
    transform: translateY(-2px);
}
.btn-outline {
    border-color: #355C52;
    color: #355C52;
    background: transparent;
}
.btn-outline:hover {
    background: #355C52;
    color: #FBF8F2;
}

/* ---------- HERO SECTION (index) ---------- */
.hero-section {
    background: linear-gradient(120deg, #EADBCE 0%, #F4EFE6 100%);
    padding: 4rem 0 5rem;
    border-bottom: 1px solid #D8CFC3;
}
.hero-container {
    text-align: center;
}
.hero-sup {
    display: inline-block;
    background: #A88B5A20;
    color: #7A4B2A;
    padding: 0.3rem 1rem;
    border-radius: 40px;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #2B2622;
}
.hero-sub {
    font-size: 1.2rem;
    color: #6E655C;
    max-width: 600px;
    margin: 0 auto 2rem;
}
.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- SECTION HEADINGS ---------- */
.section-head {
    text-align: center;
    margin-bottom: 3rem;
}
.section-tag {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: #EADBCE;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    color: #7A4B2A;
}
.section-head h2 {
    font-size: 2.2rem;
    margin-top: 0.5rem;
    color: #2B2622;
}
.section-intro {
    max-width: 46rem;
    margin: 0.9rem auto 0;
    color: #5A5149;
    font-size: 1rem;
    line-height: 1.7;
}

/* Chrono grid */
.chrono-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}
.chrono-card {
    background: #FBF8F2;
    padding: 1.8rem;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.02);
    border: 1px solid #D8CFC3;
    transition: transform 0.2s;
}
.chrono-card:hover {
    transform: translateY(-5px);
}
.chrono-year {
    font-family: monospace;
    font-weight: 700;
    font-size: 1.2rem;
    color: #A88B5A;
    margin-bottom: 0.5rem;
}

/* Featured articles */
.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}
.featured-card {
    background: #FBF8F2;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #D8CFC3;
    transition: all 0.2s;
}
.featured-media img {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
}
.featured-content {
    padding: 1.5rem;
}
.post-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #355C52;
    background: #E9E1D7;
    padding: 0.2rem 0.6rem;
    border-radius: 30px;
}
.read-more {
    font-weight: 500;
    margin-top: 0.8rem;
    display: inline-block;
}

/* Vault */
.vault-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}
.vault-item {
    background: #FBF8F2;
    padding: 2rem;
    border-radius: 32px;
    text-align: center;
    flex: 1;
    min-width: 200px;
    border: 1px solid #D8CFC3;
}
.vault-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Quote & latest */
.quote-latest .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    background: #FBF8F2;
    padding: 2.5rem;
    border-radius: 32px;
    margin-top: 2rem;
    border: 1px solid #D8CFC3;
}
.editorial-quote p {
    font-size: 1.5rem;
    font-style: italic;
    color: #2B2622;
    line-height: 1.3;
    margin-bottom: 1rem;
}
.latest-list {
    list-style: none;
}
.latest-intro {
    color: #4A4038;
    font-size: 1rem;
    line-height: 1.65;
    margin-bottom: 1.1rem;
    max-width: 34rem;
}
.latest-list li {
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed #D8CFC3;
    padding-bottom: 0.5rem;
}
.date {
    color: #6E655C;
    font-size: 0.8rem;
}

/* Post grid (list pages) */
.post-grid, .blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}
.post-card, .blog-card {
    background: #FBF8F2;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #D8CFC3;
    transition: all 0.2s;
}
.card-media img, .blog-card-media img {
    aspect-ratio: 16/9;
    object-fit: cover;
}
.card-content, .blog-card-content {
    padding: 1.4rem;
}
.card-date {
    font-size: 0.75rem;
    color: #6E655C;
    text-transform: uppercase;
}
.card-title a {
    color: #2B2622;
    font-size: 1.3rem;
    display: block;
    margin: 0.5rem 0;
}
.card-summary {
    color: #3A322C;
    font-size: 0.95rem;
}
.card-link {
    font-weight: 500;
}

/* Single article */
.single-article {
    padding: 2rem 0 4rem;
}
.article-title {
    font-size: 2.8rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.article-meta {
    color: #6E655C;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}
.article-hero {
    margin: 2rem 0;
    border-radius: 24px;
    overflow: hidden;
}
.markdown-body {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2B2622;
}
.markdown-body h2, .markdown-body h3 {
    margin-top: 2rem;
    color: #7A4B2A;
}

/* Tables */
.article-content table,
.markdown-body table,
.responsive-table {
    width: 100%;
    margin: 1.75rem 0;
    border-collapse: collapse;
    border-spacing: 0;
    background: #FBF8F2;
    border: 1px solid #D8CFC3;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(43, 38, 34, 0.05);
    table-layout: fixed;
}
.article-content thead,
.markdown-body thead,
.responsive-table thead {
    background: #EADBCE;
}
.article-content th,
.article-content td,
.markdown-body th,
.markdown-body td,
.responsive-table th,
.responsive-table td {
    padding: 0.95rem 1rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #D8CFC3;
    word-break: break-word;
}
.article-content th,
.markdown-body th,
.responsive-table th {
    color: #7A4B2A;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
}
.article-content td,
.markdown-body td,
.responsive-table td {
    color: #2B2622;
    font-size: 0.98rem;
    line-height: 1.6;
}
.article-content tbody tr:nth-child(even),
.markdown-body tbody tr:nth-child(even),
.responsive-table tbody tr:nth-child(even) {
    background: #F8F4ED;
}
.article-content tbody tr:hover,
.markdown-body tbody tr:hover,
.responsive-table tbody tr:hover {
    background: #F1E7DA;
}
.article-content tbody tr:last-child td,
.markdown-body tbody tr:last-child td,
.responsive-table tbody tr:last-child td {
    border-bottom: none;
}
.tags-list {
    margin: 2rem 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: baseline;
}
.tag {
    background: #EADBCE;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
}

/* Related articles */
.related-section {
    margin: 3rem 0;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}
.related-card {
    background: #FBF8F2;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #D8CFC3;
}
.related-content {
    padding: 1rem;
}
.related-date {
    font-size: 0.7rem;
    color: #6E655C;
}

/* Pagination */
.pagination-wrapper, .pagination-block {
    margin: 3rem 0;
    text-align: center;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
}
.page-item a, .page-item span {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 30px;
    background: #FBF8F2;
    border: 1px solid #D8CFC3;
    color: #355C52;
}
.page-item.active span {
    background: #7A4B2A;
    color: white;
    border-color: #7A4B2A;
}

/* Footer */
.site-footer {
    background: #2B2622;
    color: #D8CFC3;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}
.footer-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
}
.footer-logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: #F4EFE6;
}
.footer-links ul {
    list-style: none;
}
.footer-links a {
    color: #D8CFC3;
}
.footer-links a:hover {
    color: #A88B5A;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #FBF8F2;
        padding: 1rem;
        margin-top: 1rem;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-toggle {
        display: flex;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .quote-latest .container {
        grid-template-columns: 1fr;
    }
    .brand-tagline {
        display: none;
    }

    .article-content table,
    .markdown-body table,
    .responsive-table {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        border-radius: 14px;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
    }
    .article-content th,
    .article-content td,
    .markdown-body th,
    .markdown-body td,
    .responsive-table th,
    .responsive-table td {
        padding: 0.8rem 0.85rem;
        font-size: 0.92rem;
        white-space: normal;
    }
}
