/* style.css */

/* Import Khmer Fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Battambang:wght@400;700&family=Siemreap&display=swap');

:root {
    --primary-color: #003366; /* Navy Blue for Academic tone */
    --secondary-color: #8B0000; /* Dark Red for emphasis */
    --bg-color: #f4f4f9;
    --text-color: #333;
    --border-color: #ddd;
    --accent-yellow: #ffc107;
    --accent-blue: #2196f3;
    --accent-green: #4caf50;
}

body {
    font-family: 'Siemreap', 'Battambang', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 20px auto;
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

h1, h2, h3 {
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

h1 {
    font-size: 24px;
    text-align: center;
    font-weight: 700;
}

.metadata {
    background-color: #eef2f5;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Executive Summary Box */
.executive-summary {
    background-color: #fff8e1;
    border-left: 5px solid var(--accent-yellow);
    padding: 15px;
    margin-bottom: 20px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 12px;
    text-align: left;
}

th {
    background-color: var(--primary-color);
    color: #fff;
}

/* Critical Review Box */
.critical-review {
    background-color: #e8f4fd;
    border-left: 5px solid var(--accent-blue);
    padding: 15px;
    margin-top: 20px;
}

/* Roadmap Box */
.roadmap {
    background-color: #e8f5e9;
    border-left: 5px solid var(--accent-green);
    padding: 15px;
}

.glossary-term {
    font-weight: bold;
    color: var(--secondary-color);
}

/* Breadcrumb Navigation */
.breadcrumb-nav {
    background-color: var(--primary-color);
    padding: 10px 20px;
    font-size: 13px;
}

.breadcrumb-nav .container {
    background: transparent;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    color: rgba(255,255,255,0.8);
}

.breadcrumb-nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-family: 'Siemreap', 'Battambang', 'Segoe UI', sans-serif;
}

.breadcrumb-nav a:hover {
    color: #fff;
    text-decoration: underline;
}

.breadcrumb-nav span {
    color: #fff;
    font-family: 'Siemreap', 'Battambang', 'Segoe UI', sans-serif;
}

.disclaimer {
    font-size: 12px;
    color: #777;
    background-color: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px 15px;
    margin-bottom: 24px;
}

ul {
    margin-top: 0;
}

/* English text styling within Khmer text */
span.en {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 'Battambang', 'Siemreap', sans-serif;
    font-weight: 600;
}

/* ========== Index Page Styles ========== */

.category-description {
    text-align: center;
    color: #666;
    margin-bottom: 10px;
}

.article-count {
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
}

/* Category Grid (papers/index.html) */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.category-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.category-card h2 {
    font-size: 18px;
    margin: 0 0 5px 0;
    border-bottom: none;
    padding-bottom: 0;
}

.category-card h2 a {
    color: var(--primary-color);
    text-decoration: none;
}

.category-card h2 a:hover {
    text-decoration: underline;
}

.category-card-en {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px 0;
}

.category-card-count {
    font-size: 14px;
    color: #555;
    margin: 0 0 8px 0;
}

.category-card-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* Article List */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.article-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--accent-blue);
}

.article-card-title {
    font-size: 17px;
    margin: 0 0 6px 0;
    border-bottom: none;
    padding-bottom: 0;
}

.article-card-title a {
    color: var(--primary-color);
    text-decoration: none;
}

.article-card-title a:hover {
    text-decoration: underline;
    color: var(--accent-blue);
}

.article-card-original {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px 0;
}

.article-card-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.article-card-meta a {
    color: var(--accent-blue);
    text-decoration: none;
}

.article-card-meta a:hover {
    text-decoration: underline;
}

.article-card-authors {
    font-size: 13px;
    color: #777;
    margin: 0 0 8px 0;
    font-family: 'Segoe UI', sans-serif;
}

.article-card-desc {
    font-size: 14px;
    color: #444;
    margin: 0 0 10px 0;
    line-height: 1.5;
}

/* Tags */
.article-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    background: #eef2f5;
    color: var(--primary-color);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 12px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
}

/* Further Reading Box */
.further-reading {
    background-color: #f3f0ff;
    border-left: 5px solid #7c3aed;
    padding: 15px;
    margin-top: 20px;
}

.further-reading ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.further-reading li {
    margin-bottom: 6px;
}

.further-reading a {
    color: #5b21b6;
    text-decoration: none;
    font-size: 14px;
}

.further-reading a:hover {
    text-decoration: underline;
    color: #4c1d95;
}

/* ========== Site-wide Navigation ========== */
.site-nav {
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
}
.site-nav.header-hidden {
    transform: translateY(-100%);
}

.site-nav-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
}

.site-nav-logo {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    text-decoration: none;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav-logo-img {
    width: 28px;
    height: 28px;
    border-radius: 5px;
}

.site-nav-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.site-nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    transition: color 0.2s;
    padding: 4px 0;
}

.site-nav-links a:hover {
    color: #2563eb;
}

.site-nav-search {
    color: #2563eb !important;
    font-weight: 600 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ========== Site Footer ========== */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 36px 24px 16px;
    margin-top: 40px;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
}

.site-footer-inner {
    max-width: 980px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    box-sizing: border-box;
}

.footer-section strong {
    display: block;
    color: #e2e8f0;
    font-size: 13px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-section a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 6px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: color 0.2s;
}

.footer-section a:hover {
    color: #fff;
}

.footer-section p {
    line-height: 1.6;
    margin: 0;
}

.footer-copy {
    max-width: 980px;
    margin: 20px auto 0;
    padding-top: 14px;
    border-top: 1px solid #1e293b;
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* ========== Responsive: Nav & Footer ========== */
@media (max-width: 900px) {
    .site-nav-links {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .site-nav-links a { flex: 0 0 auto; }
}

@media (max-width: 640px) {
    /* Nav: compact single row */
    .site-nav-inner {
        padding: 10px 16px;
        gap: 10px;
    }
    .site-nav-logo { font-size: 17px; }
    .site-nav-links { gap: 12px; }
    .site-nav-links a { font-size: 12px; }

    /* Content: tighter container */
    .container { padding: 20px 16px; margin: 10px auto; }
    h1 { font-size: 20px; }

    /* Article cards: compact */
    .article-card { padding: 14px; }
    .article-card-title { font-size: 15px; }
    .article-card-desc { font-size: 13px; }
    .article-card-authors { display: none; }
    .article-card-tags .tag { font-size: 10px; padding: 2px 8px; }

    /* Category grid: 1 col on mobile */
    .category-grid { grid-template-columns: 1fr; gap: 12px; }
    .category-card { padding: 14px; }
    .category-card-desc { display: none; }

    /* Footer: single column */
    .site-footer { padding: 24px 16px 12px; margin-top: 20px; }
    .site-footer-inner { grid-template-columns: 1fr; gap: 16px; }
    .footer-section a { font-size: 12px; }
    .footer-copy { font-size: 11px; margin-top: 12px; padding-top: 10px; }
}