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

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* Prevent page-level horizontal scroll */
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9fafb;
    overflow-x: hidden; /* Prevent page-level horizontal scroll */
    max-width: 100%;
}

/* Layout */
.min-h-screen {
    min-height: 100vh;
}

.bg-white {
    background-color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.p-4 {
    padding: 1rem;
}

/* Typography */
.prose {
    max-width: 65ch;
    color: #374151;
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: #111827;
    margin-top: 2em;
    margin-bottom: 1em;
    line-height: 1.3;
}

.prose p {
    margin-bottom: 1.25em;
}

.prose-gray {
    color: #4b5563;
}

.max-w-none {
    max-width: none;
}

.text-4xl {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.text-gray-900 {
    color: #111827;
}

.text-gray-800 {
    color: #1f2937;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-500 {
    color: #6b7280;
}

.text-blue-600 {
    color: #2563eb;
}

.text-center {
    text-align: center;
}

/* Spacing */
.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

/* Backgrounds and borders */
.bg-gray-50 {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
}

.rounded-lg {
    border-radius: 0.5rem;
}

/* Lists */
ul, ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25em;
}

li {
    margin-bottom: 0.5rem;
}

/* Links */
a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.hover\:text-blue-800:hover {
    color: #1e40af;
}

.hover\:underline:hover {
    text-decoration: underline;
}

/* Tables */
table {
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    display: block; /* enable element-level scrolling on mobile */
    overflow-x: auto; /* horizontal scroll within the table only */
    -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */
    width: max-content; /* let the table grow to fit its columns */
    min-width: 100%; /* but never smaller than the viewport */
}

th, td {
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    text-align: left;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
}

.overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Additional enhancements */
b, strong {
    font-weight: 600;
    color: #111827;
}

i, em {
    font-style: italic;
}

section {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

h1:first-child, h2:first-child, h3:first-child, h4:first-child {
    margin-top: 0;
}

/* Smooth anchor links */
html {
    scroll-padding-top: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .py-8 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    .text-4xl {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
        line-height: 1.5rem;
    }
    
    table {
        font-size: 0.875rem;
    }
}

/* Print styles */
@media print {
    body {
        background-color: white;
        color: black;
    }
    
    .bg-white {
        box-shadow: none;
    }
    
    a {
        color: #2563eb !important;
        text-decoration: underline;
    }
}