/* 
 * Báo cáo: Sống Đức Tin giữa các Cộng đồng Tôn Giáo tại Việt Nam
 * Custom Styles
 * 
 * Chosen Palette: "Liturgical & Academic" 
 * - Primary: Slate-900 (Academic/Text), Red-900 (Martyrdom/Solemnity)
 * - Accent: Amber-600 (Gold/Glory/Warmth)
 * - Background: Stone-50 (Paper/Scroll)
 * 
 * Typography System:
 * - Body/Sans-serif: Inter (for body text, navigation, tables, content)
 * - Serif/Headings: Source Serif Pro (for headings, hero, quotes, emphasis)
 */

/* CSS Variables for Typography System */
:root {
    /* Font Families */
    --font-sans: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-serif: 'Source Serif Pro', 'Libre Baskerville', 'PT Serif', 'Lora', 'Noto Serif', 'Georgia', 'Times New Roman', 'Times', serif;
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    --line-height-loose: 1.8;
    
    /* Letter Spacing */
    --letter-spacing-tight: -0.01em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.02em;
    --letter-spacing-wider: 0.03em;
}

/* Base Body Typography */
body {
    font-family: var(--font-sans);
    background-color: #f5f5f4;
    color: #1c1917;
    line-height: var(--line-height-relaxed);
    font-feature-settings: "kern" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure proper Vietnamese character rendering */
html[lang="vi"] {
    font-variant-ligatures: common-ligatures;
    font-kerning: normal;
}

/* Headings - All use Serif font */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-wide);
}

h1 {
    font-size: 2.5rem;
    font-weight: var(--font-weight-medium);
}

h2 {
    font-size: 2rem;
    font-weight: var(--font-weight-semibold);
}

h3 {
    font-size: 1.5rem;
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
}

/* Serif font utility class */
.serif-font {
    font-family: var(--font-serif);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 350px;
    margin: 0 auto;
}

.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    height: 350px;
    max-height: 400px;
}

@media (min-width: 768px) {
    .chart-container {
        height: 400px;
    }
}

.chapter-header {
    border-left: 4px solid #7f1d1d;
    /* red-900 */
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.chapter-header h2 {
    font-family: var(--font-serif);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    line-height: var(--line-height-tight);
}


/* Print optimization */
@media print {
    .no-print {
        display: none;
    }

    body {
        background: white;
    }

    .shadow-lg {
        box-shadow: none;
    }
}


/* Custom styles for existing content */
.section-content {
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    font-family: var(--font-sans);
    line-height: var(--line-height-relaxed);
}

.subsection-content {
    background: #fafaf9;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #d6d3d1;
    font-family: var(--font-sans);
    line-height: var(--line-height-relaxed);
}

.subsection-content h3 {
    font-family: var(--font-serif);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
}

.subsection-content p,
.subsection-content li {
    font-family: var(--font-sans);
    line-height: var(--line-height-relaxed);
}


.table-container {
    overflow-x: auto;
    margin: 1.5rem 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.data-table thead {
    background: #7f1d1d;
    color: white;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e7e5e4;
    font-family: var(--font-sans);
    line-height: var(--line-height-normal);
}

.data-table th {
    font-weight: var(--font-weight-semibold);
    font-size: 0.95rem;
}

.data-table td {
    font-weight: var(--font-weight-normal);
}

.data-table tbody tr:hover {
    background: #fafaf9;
}


/* Scroll offset for fixed header */
html {
    scroll-padding-top: 20px;
    scroll-behavior: smooth;
}

/* Mobile menu animation */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

#mobile-menu:not(.hidden) {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling for navigation - Soft colors */
nav::-webkit-scrollbar {
    width: 6px;
}

nav::-webkit-scrollbar-track {
    background: rgba(231, 229, 228, 0.5);
    border-radius: 3px;
}

nav::-webkit-scrollbar-thumb {
    background: rgba(168, 162, 158, 0.4);
    border-radius: 3px;
    transition: background 0.3s ease;
}

nav::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 162, 158, 0.6);
}

/* Navigation Styles */
.nav-btn {
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-sans);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-normal);
}

.nav-btn.nav-active {
    background-color: #FEF3C7;
    /* Light yellow/orange background */
    color: #1c1917;
    font-weight: 600;
    border-top: 2px solid #FCD34D;
    /* Yellow/orange border at top */
}

.nav-btn:hover:not(.nav-active) {
    background-color: rgba(0, 0, 0, 0.05);
}

/* View Section Styles */
.view-section {
    animation: fadeIn 0.5s ease-in;
}

.view-section.animate-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Highlight Box Styles */
.highlight-box {
    background-color: #EFF6FF;
    /* Light blue background */
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: #1e293b;
    /* Dark grey text */
    font-family: var(--font-sans);
    line-height: var(--line-height-loose);
}

.highlight-box h3,
.highlight-box h4 {
    font-family: var(--font-serif);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: 0.75rem;
}

.highlight-box p,
.highlight-box li {
    font-family: var(--font-sans);
    line-height: var(--line-height-relaxed);
}

.highlight-box.border-l-4 {
    border-left-width: 4px;
}

.highlight-box.border-secondary-500 {
    border-left-color: #3b82f6;
    /* Blue border */
}

/* Primary and Secondary Colors for Tailwind */
.text-primary-600 {
    color: #d97706;
}

.hover\:text-primary-600:hover {
    color: #d97706;
}

.hover\:bg-primary-50:hover {
    background-color: #fef9e7;
}

.border-secondary-500 {
    border-color: #3b82f6;
}

.highlight-box p {
    margin-bottom: 1rem;
}

.highlight-box p:last-child {
    margin-bottom: 0;
}


/* Hero Section Styles - Based on image design */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Very subtle gradient from light cream/beige to white - matching image */
    background: linear-gradient(135deg, #FFFEF5 0%, #FFFEF8 25%, #FFFFFF 75%, #FFFFFF 100%);
    z-index: 0;
}

.hero-title {
    color: #8B4513;
    /* Sienna/Brown color - deep rich brown, warm tone matching image */
    font-family: var(--font-serif);
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
    letter-spacing: var(--letter-spacing-wider);
    text-shadow: 0 2px 10px rgba(139, 69, 19, 0.08), 0 1px 4px rgba(139, 69, 19, 0.05);
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin-bottom: 2rem;
    /* Ensure proper Vietnamese character rendering */
    font-variant-ligatures: common-ligatures;
    font-kerning: normal;
    /* Softer spacing for Vietnamese */
    word-spacing: 0.04em;
    /* Improve readability */
    text-align: center;
}

.hero-quote {
    color: #57534e;
    /* Stone-600 */
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-loose);
    letter-spacing: var(--letter-spacing-wider);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Navigation always visible */
nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 9999 !important;
    width: 100%;
    will-change: transform;
}

/* Responsive adjustments for hero section */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
    }
    
    .hero-title {
        margin-bottom: 1.5rem;
        line-height: 1.3;
        letter-spacing: 0.015em;
        font-weight: 500;
    }
    
    .hero-quote {
        font-size: 1rem;
        line-height: 1.7;
        letter-spacing: 0.025em;
    }
}

/* Additional typography improvements for larger screens */
@media (min-width: 1024px) {
    .hero-title {
        letter-spacing: 0.025em;
        line-height: 1.35;
        font-weight: 500;
    }
    
    .hero-quote {
        letter-spacing: 0.035em;
        line-height: 1.85;
    }
}
