/* Base styles for the book presentation */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Custom styling for the content */
.prose {
    line-height: 1.7;
    color: #333;
}

.prose h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #111;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.prose h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #1a202c;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

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

.prose ul, .prose ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose blockquote {
    border-left: 4px solid #e2e8f0;
    padding-left: 1rem;
    font-style: italic;
    margin: 1.5rem 0;
    color: #4a5568;
}

/* Styles for images within .prose, complementing Tailwind's figure img styles */
.prose img {
    max-width: 100%;
    height: auto;
    max-height: 70vh; /* Limit max height for very tall images */
    border-radius: 0.375rem; /* Equivalent to Tailwind's rounded-md */
    margin: 1.5rem auto; /* Center image and provide vertical spacing */
    display: block; /* Needed for auto margins to center */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* Subtle shadow */
}

/* Styles for figures processed by JS, these are primarily controlled by Tailwind config */
.prose .figure {
    margin: 2rem auto; /* Centering figure */
    text-align: center; /* Centering caption text */
    /* Tailwind config in index.html controls specific figure styling like background, padding */
}

.prose .figure img {
    /* This is mostly controlled by Tailwind's 'figure img' config in index.html for consistency */
    /* Properties like max-height: 70vh, object-fit: contain are set there */
    margin-bottom: 0.5rem; /* Space between image and caption if not already handled */
}

.prose .figure-caption {
    font-size: 0.875rem; /* Tailwind's text-sm */
    color: #4a5568; /* Tailwind's gray-700 or stone color */
    max-width: 85%; /* Prevent caption from being too wide */
    margin: 0 auto; /* Center caption text block */
    /* Font style (italic) is set in Tailwind config or JS directly */
}

/* General table styles for .prose context */
/* These are basic fallbacks; Tailwind config in index.html provides more specific styling for prose tables. */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9em; /* Slightly smaller font for tables to fit more content */
}

.prose table th {
    background-color: #f8fafc; /* Tailwind's gray-50 / bg-slate-50 */
    font-weight: 600;
    text-align: left;
    border: 1px solid #e2e8f0; /* Tailwind's gray-200 / slate-200 */
    padding: 0.75rem; /* Tailwind's p-3 */
}

.prose table td {
    border: 1px solid #e2e8f0; /* Tailwind's gray-200 / slate-200 */
    padding: 0.75rem; /* Tailwind's p-3 */
}

.prose table tr:nth-child(even) {
    background-color: #f8fafc; /* Tailwind's gray-50 / bg-slate-50 */
}
/* Enhanced table styles for appendix are primarily driven by Tailwind config in index.html */


/* Additional styling for specific elements */
.image-placeholder {
    background-color: #fef2f2; /* Tailwind's red-50 */
    border: 1px dashed #f87171; /* Tailwind's red-400 */
    border-radius: 0.375rem; /* Tailwind's rounded-md */
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
    color: #b91c1c; /* Tailwind's red-700 */
}

/* Active navigation styling */
.nav-item.active, .toc-item.active {
    background-color: rgba(0, 0, 0, 0.1); /* Generic active state, Tailwind config might override */
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .prose h1 {
        font-size: 1.75rem;
    }

    .prose h2 {
        font-size: 1.5rem;
    }

    .prose h3 {
        font-size: 1.25rem;
    }
}

/* Styles for error status messages */
.image-error-placeholder {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
}





