/**
 * OASA Style Sheet
 * Styles for prose/paper content areas, typography, and layout
 */

/* ============================================
   Typography & Base Styles
   ============================================ */

:root {
    --primary: #4DDB9F;
    --primary-light: #7EE8C0;
    --primary-dark: #2BC87A;
    --accent: #d4a574;
    --accent-light: #e6c08f;
    --accent-dark: #b8945f;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

/* ============================================
   Prose/Paper Content Area Styles
   ============================================ */

/* Main prose container */
.prose {
    color: var(--gray-800);
    max-width: 65ch;
    font-size: 1.125rem;
    line-height: 1.75;
}

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

.prose-slate {
    color: var(--gray-800);
}

.prose-slate h1,
.prose-slate h2,
.prose-slate h3,
.prose-slate h4 {
    color: var(--gray-900);
}

/* Headings */
.prose h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: 1rem;
    font-family: 'Playfair Display', serif;
}

.prose h2 {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2.5em;
    margin-bottom: 1em;
    font-family: 'Playfair Display', serif;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
    font-family: 'Playfair Display', serif;
}

.prose h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* Paragraphs */
.prose p {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    line-height: 1.75;
}

.prose p:first-of-type {
    margin-top: 0;
}

.prose p:last-of-type {
    margin-bottom: 0;
}

/* Links */
.prose a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.prose a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.prose a.text-primary {
    color: var(--primary);
}

.prose a.text-primary:hover {
    color: var(--primary-dark);
}

/* Lists */
.prose ul,
.prose ol {
    margin-top: 1.25em;
    margin-bottom: 1.25em;
    padding-left: 1.625em;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 0.375em;
}

.prose li > p {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

.prose li > *:first-child {
    margin-top: 0;
}

.prose li > *:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

/* Blockquotes */
.prose blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5em 0;
    font-style: italic;
    color: var(--gray-700);
}

.prose blockquote p {
    margin-top: 0.75em;
    margin-bottom: 0.75em;
}

.prose blockquote p:first-of-type {
    margin-top: 0;
}

/* Code */
.prose code {
    background-color: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
}

.prose pre {
    background-color: var(--gray-900);
    color: var(--gray-100);
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5em 0;
}

.prose pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.875rem;
}

/* Images */
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Cover images inside .not-prose should not inherit prose img styles */
.prose .not-prose img {
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    margin: 0;
}

.prose figure {
    margin: 2em 0;
}

.prose figcaption {
    margin-top: 0.75em;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}

.prose th,
.prose td {
    border: 1px solid var(--gray-200);
    padding: 0.75rem;
    text-align: left;
}

.prose th {
    background-color: var(--gray-100);
    font-weight: 600;
    color: var(--gray-900);
}

.prose tr:nth-child(even) {
    background-color: var(--gray-50);
}

/* Horizontal rules */
.prose hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 2em 0;
}

/* Strong and emphasis */
.prose strong {
    font-weight: 600;
    color: var(--gray-900);
}

.prose em {
    font-style: italic;
}

/* ============================================
   Paper/Article Container Styles
   ============================================ */

/* Main article container */
.paper-container {
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
}

.paper-article {
    background-color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0.125rem;
    padding: 2rem;
}

@media (min-width: 768px) {
    .paper-article {
        padding: 3rem;
    }
}

@media (min-width: 1024px) {
    .paper-article {
        padding: 4rem;
    }
}

/* Paper header */
.paper-header {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--gray-200);
}

.paper-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--gray-900);
    font-family: 'Playfair Display', serif;
}

@media (min-width: 768px) {
    .paper-title {
        font-size: 2.5rem;
    }
}

.paper-intro {
    color: var(--gray-600);
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Cover image */
.paper-cover-image {
    margin-top: -2rem;
    margin-bottom: 3rem;
    margin-left: -2rem;
    margin-right: -2rem;
}

@media (min-width: 768px) {
    .paper-cover-image {
        margin-top: -4rem;
        margin-left: -3rem;
        margin-right: -3rem;
    }
}

@media (min-width: 1024px) {
    .paper-cover-image {
        margin-left: -4rem;
        margin-right: -4rem;
    }
}

.paper-cover-image img {
    width: 100%;
    height: 16rem;
    object-fit: cover;
    border-top-left-radius: 0.125rem;
    border-top-right-radius: 0.125rem;
}

/* ============================================
   Utility Classes
   ============================================ */

/* Not-prose: Remove prose styling from specific elements */
.not-prose {
    max-width: none;
}

.not-prose * {
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* Max width utilities */
.max-w-prose {
    max-width: 65ch;
}

/* Text colors */
.text-primary {
    color: var(--primary);
}

.text-primary-dark {
    color: var(--primary-dark);
}

.text-primary-light {
    color: var(--primary-light);
}

.text-gray-600 {
    color: var(--gray-600);
}

.text-gray-700 {
    color: var(--gray-700);
}

.text-gray-900 {
    color: var(--gray-900);
}

/* Background colors */
.bg-primary\/10 {
    background-color: rgba(77, 219, 159, 0.1);
}

/* Border utilities */
.border-primary {
    border-color: var(--primary);
}

.border-gray-200 {
    border-color: var(--gray-200);
}

/* Hover transitions */
.hover\:text-primary-dark:hover {
    color: var(--primary-dark);
}

.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* ============================================
   Responsive Typography
   ============================================ */

@media (max-width: 640px) {
    .prose {
        font-size: 1rem;
    }
    
    .prose h1 {
        font-size: 1.875rem;
    }
    
    .prose h2 {
        font-size: 1.5rem;
    }
    
    .prose h3 {
        font-size: 1.25rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .paper-article {
        box-shadow: none;
        padding: 0;
    }
    
    .paper-cover-image {
        margin: 0;
        page-break-inside: avoid;
    }
    
    .prose a {
        color: var(--gray-900);
        text-decoration: underline;
    }
    
    .prose a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.875em;
        color: var(--gray-600);
    }
}

