/* Base Styles */
html {
    scroll-behavior: smooth;
    font-size: 100%; /* Ensures consistent base font size */
    -webkit-text-size-adjust: 100%; /* Prevent font size adjustment on mobile */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8fafc; /* Corresponds to Tailwind's bg-slate-50 */
    color: #334155; /* Corresponds to Tailwind's text-slate-800 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6; /* Default line height for body text */
}

/* Container for main content, mimics max-w-4xl, mx-auto, px-4, sm:px-6, lg:px-8 */
.container {
    max-width: 56rem; /* Equivalent to Tailwind's max-w-4xl (896px) */
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem; /* px-4 */
    padding-right: 1rem; /* px-4 */
}

@media (min-width: 640px) { /* Corresponds to Tailwind's sm: */
    .container {
        padding-left: 1.5rem; /* sm:px-6 */
        padding-right: 1.5rem; /* sm:px-6 */
    }
}

@media (min-width: 1024px) { /* Corresponds to Tailwind's lg: */
    .container {
        padding-left: 2rem; /* lg:px-8 */
        padding-right: 2rem; /* lg:px-8 */
    }
}

/* Vertical Spacing for Main Article Sections */
.article-sections > section:not(:first-child),
.article-sections > .conclusion-section:not(:first-child) {
    margin-top: 3rem; /* space-y-12 from original */
}

/* Vertical Spacing within Sections */
.section-content > *:not(:first-child) {
    margin-top: 1.5rem; /* space-y-6 from original */
}

/* Padding for main and footer */
.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.sm-py-16 {
    padding-top: 4rem;
    padding-bottom: 4rem;
}


/* Header & Navigation */
.site-header {
    background-color: rgba(255, 255, 255, 0.8); /* bg-white/80 */
    backdrop-filter: blur(8px); /* backdrop-blur-md */
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #e2e8f0; /* border-slate-200 */
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem; /* h-16 */
}

.site-logo {
    flex-shrink: 0;
}

.site-logo a {
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700;
    color: #0f172a; /* text-slate-900 */
    text-decoration: none; /* Remove underline from link */
}

.site-logo a:hover {
    color: #475569; /* hover:text-slate-700 */
}

.nav-menu {
    display: none; /* hidden */
}

@media (min-width: 768px) { /* md:block */
    .nav-menu {
        display: block;
    }
}

.nav-menu ul {
    list-style: none; /* Remove bullet points */
    margin: 0;
    padding: 0;
    margin-left: 2.5rem; /* ml-10 */
    display: flex;
    align-items: baseline;
    gap: 1rem; /* space-x-4 */
}

.nav-menu a {
    color: #475569; /* text-slate-700 */
    padding: 0.5rem 0.75rem; /* px-3 py-2 */
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    text-decoration: none; /* Remove underline */
    display: block; /* Make the whole padding area clickable */
}

.nav-menu a:hover {
    background-color: #e2e8f0; /* hover:bg-slate-200 */
}

.nav-menu a[aria-current="page"] {
    /* Optional: Style for the active link if desired */
    /* background-color: #e2e8f0; */
    /* color: #0f172a; */
}


/* Article Header */
.article-header {
    text-align: center;
    border-bottom: 1px solid #e2e8f0; /* border-slate-200 */
    padding-bottom: 2rem; /* pb-8 */
}

.article-header h1 {
    font-size: 2.25rem; /* text-4xl */
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em; /* tracking-tight */
    color: #0f172a; /* text-slate-900 */
    margin-top: 0; /* Remove default margin */
    margin-bottom: 0;
}

@media (min-width: 768px) { /* md:text-5xl */
    .article-header h1 {
        font-size: 3rem; /* 48px */
        line-height: 1;
    }
}

.article-header p {
    margin-top: 1rem; /* mt-4 */
    font-size: 1.125rem; /* text-lg */
    line-height: 1.75rem; /* leading-8 */
    color: #475569; /* text-slate-600 */
    margin-bottom: 0; /* Remove default margin */
}

@media (min-width: 768px) { /* md:text-xl */
    .article-header p {
        font-size: 1.25rem; /* 20px */
    }
}


/* Table of Contents */
.toc-navigation {
    background-color: #f1f5f9; /* bg-slate-100 */
    padding: 1.5rem; /* p-6 */
    border-radius: 0.5rem; /* rounded-lg */
}

.toc-navigation h2 {
    font-size: 1.25rem; /* text-xl */
    font-weight: 700;
    color: #334155; /* text-slate-800 */
    margin-bottom: 0.75rem; /* mb-3 */
    margin-top: 0; /* Remove default margin */
}

.toc-navigation ol {
    list-style-type: decimal;
    list-style-position: inside;
    margin: 0;
    padding: 0;
}

.toc-navigation ol li {
    margin-bottom: 0.5rem; /* space-y-2 */
}

.toc-navigation ol li:last-child {
    margin-bottom: 0;
}

.toc-navigation ol a {
    color: #1d4ed8; /* text-blue-700 */
    text-decoration: none;
}

.toc-navigation ol a:hover {
    text-decoration: underline;
}

/* General Section Styling */
section h2 {
    font-size: 1.875rem; /* text-3xl */
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em; /* tracking-tight */
    color: #0f172a; /* text-slate-900 */
    margin-top: 0; /* Remove default margin */
    margin-bottom: 1.5rem; /* mb-6 */
}

section h3 {
    font-size: 1.5rem; /* text-2xl */
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.025em; /* tracking-tight */
    color: #334155; /* text-slate-800 */
    margin-top: 1rem; /* pt-4 combined with margin-bottom */
    margin-bottom: 0.75rem; /* Adjust for desired spacing relative to text below */
}

/* Paragraphs and Lists within content sections */
.section-content p,
.section-content ul,
.section-content ol {
    font-size: 1.125rem; /* text-lg */
    line-height: 1.625; /* leading-relaxed */
    color: #475569; /* text-slate-700 */
}

.section-content ul {
    list-style-type: disc;
    list-style-position: inside;
    padding-left: 1rem; /* pl-4 */
}

.section-content ul li,
.section-content ol li {
    margin-bottom: 0.5rem; /* space-y-2 */
}

.section-content ul li:last-child,
.section-content ol li:last-child {
    margin-bottom: 0;
}


/* Blockquotes */
blockquote {
    border-left: 4px solid #d1d5db; /* border-l-4 border-gray-300 */
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: #4b5563; /* text-gray-600 */
    margin-top: 1.5rem; /* Matches section-content space-y-6 */
    margin-bottom: 1.5rem; /* Matches section-content space-y-6 */
}

/* Tables */
.data-table-container {
    overflow-x: auto;
    background-color: #ffffff; /* bg-white */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); /* shadow */
    margin-top: 2rem; /* mt-8 */
}

.data-table {
    width: 100%; /* min-w-full */
    font-size: 0.875rem; /* text-sm */
    border-collapse: collapse; /* For clean table borders */
}

.data-table caption {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600;
    padding: 1rem; /* p-4 */
    background-color: #f1f5f9; /* bg-slate-100 */
    color: #334155; /* text-slate-800 */
    text-align: left;
    caption-side: top; /* Standard way to place caption above table */
}

.data-table thead {
    background-color: #e2e8f0; /* bg-slate-200 */
}

.data-table th {
    text-align: left;
    padding: 0.75rem; /* p-3 */
    font-weight: 600;
}

.data-table tbody td {
    padding: 0.75rem; /* p-3 */
    vertical-align: top; /* Align content to the top */
}

.data-table tbody tr {
    border-bottom: 1px solid #e2e8f0; /* divide-y divide-slate-200 */
}

.data-table tbody tr:last-child {
    border-bottom: none; /* No border for the last row */
}

.data-table tbody td:first-child {
    font-weight: 500;
    color: #475569; /* text-slate-600 */
}

/* Superscripts (References) */
sup a {
    text-decoration: none;
    color: #2563eb; /* text-blue-600 */
}

sup a:hover {
    text-decoration: underline;
}

/* References Section */
.references-section {
    border-top: 1px solid #e2e8f0; /* border-t border-slate-200 */
    padding-top: 2rem; /* pt-8 */
    margin-top: 3rem; /* mt-12 */
}

.references-section h2 {
    font-size: 1.875rem; /* text-3xl */
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em; /* tracking-tight */
    color: #0f172a; /* text-slate-900 */
    margin-bottom: 1.5rem; /* mb-6 */
    margin-top: 0; /* Remove default margin */
}

.references-section ol {
    list-style-type: decimal;
    list-style-position: inside;
    margin: 0;
    padding: 0;
}

.references-section ol li {
    margin-bottom: 1rem; /* space-y-4 */
    font-size: 1.125rem; /* text-lg */
    color: #475569; /* text-slate-700 */
}

.references-section ol li:last-child {
    margin-bottom: 0;
}

.references-section ol a {
    color: #1d4ed8; /* text-blue-800 */
    text-decoration: underline;
}

.references-section ol a:hover {
    color: #1e40af; /* hover:text-blue-900 */
}


/* Footer */
.site-footer {
    border-top: 1px solid #e2e8f0; /* border-t border-slate-200 */
}

.site-footer-content {
    padding-top: 2rem; /* py-8 */
    padding-bottom: 2rem; /* py-8 */
    text-align: center;
    font-size: 0.875rem; /* text-sm */
    color: #64748b; /* text-slate-500 */
}

/* Add these styles to your existing style.css file */

/* Hero Section */
.hero-section {
    text-align: center;
    padding-bottom: 2rem; /* Consistent spacing with article header */
    border-bottom: 1px solid #e2e8f0; /* Consistent with article header */
    margin-bottom: 3rem; /* Space before next section */
}

.hero-section h1 {
    font-size: 2.5rem; /* Slightly smaller than article title for homepage hero */
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .hero-section h1 {
        font-size: 3.5rem; /* Larger on md screens */
    }
}

.hero-section p {
    font-size: 1.125rem; /* text-lg */
    line-height: 1.625; /* leading-relaxed */
    color: #475569; /* text-slate-700 */
    max-width: 48rem; /* Constrain width for readability */
    margin-left: auto;
    margin-right: auto;
}

/* Recent Articles Section */
.recent-articles-section h2 {
    font-size: 1.875rem; /* Matches section-heading */
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0; /* Optional: adds a subtle line */
    padding-bottom: 0.75rem;
}

.recent-articles-list {
    display: grid; /* Use grid for layout */
    gap: 2rem; /* Space between articles */
    grid-template-columns: 1fr; /* Single column by default */
}

@media (min-width: 640px) { /* sm: */
    .recent-articles-list {
        grid-template-columns: repeat(auto-fit, minmax(calc(50% - 1rem), 1fr)); /* Two columns on small screens, adjusts to content */
    }
}

@media (min-width: 1024px) { /* lg: */
    .recent-articles-list {
        grid-template-columns: repeat(auto-fit, minmax(calc(33.333% - 1.333rem), 1fr)); /* Three columns on large screens */
    }
}


.article-preview {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.article-preview:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.article-preview h3 {
    font-size: 1.25rem; /* text-xl */
    font-weight: 600;
    line-height: 1.4;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.article-preview h3 a {
    text-decoration: none;
    color: inherit; /* Inherit color from h3 */
}

.article-preview h3 a:hover {
    text-decoration: underline;
    color: #1d4ed8; /* blue-700 on hover */
}

.article-preview p {
    font-size: 1rem; /* text-base */
    color: #475569;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.article-preview .article-meta {
    font-size: 0.875rem; /* text-sm */
    color: #64748b; /* text-slate-500 */
    margin-top: 0.5rem;
    font-style: italic;
}