/* Enhanced Styling for LFPR Blogpost */
/* Link this file after styles.css in your HTML: <link rel="stylesheet" href="enhancements.css"> */

/* Import Google Fonts for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;700&display=swap');

/* Color palette */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Enhanced body styling */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--light-bg) 0%, #ffffff 100%);
    min-height: 100vh;
}

/* Justify all text content except references */
p, li, figcaption, h1, h2, h3, h4, h5, h6 {
    text-align: justify;
}

h1 {
    text-align: center !important;
}

header p {
    text-align: center !important;
}

section.references p, section.references li, section.references h1, section.references h2 {
    text-align: left !important;
}

/* Enhanced header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 2rem;
    margin: -2rem -2rem 2rem -2rem;
    border-radius: 0 0 2rem 2rem;
    box-shadow: 0 4px 20px var(--shadow);
    text-align: center;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Enhanced section styling */
section {
    background: white;
    margin: 2rem 0;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 15px var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 25px rgba(0,0,0,0.15);
}

section h2 {
    color: var(--primary-color);
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 2px;
}

/* Enhanced paragraph styling */
section p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

/* Enhanced formula styling */
.formula-container {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--secondary-color);
    margin: 2rem 0;
}

.formula {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.fraction {
    display: flex;
    flex-direction: column;
    text-align: center;
    margin: 0 5px;
    align-items: center;
    min-height: 3rem;
    justify-content: center;
}

.fraction .numerator {
    border-bottom: 2px solid var(--primary-color);
    padding: 0 4px 2px 4px;
    font-weight: 600;
}

.fraction .denominator {
    padding: 2px 4px 0 4px;
    font-weight: 600;
}

/* Enhanced figure styling */
.center-figure {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 15px var(--shadow);
    margin: 3rem auto;
    border: 1px solid var(--border-color);
}

.center-figure img {
    max-width: 90%;
    border-radius: 0.5rem;
    transition: transform 0.3s ease;
}

.center-figure img:hover {
    transform: scale(1.02);
}

.center-figure figcaption {
    margin-top: 1rem;
    font-style: italic;
    color: #666;
    font-size: 0.9rem;
}

/* Enhanced references styling */
.references {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid var(--border-color);
}

.references h2 {
    color: var(--primary-color);
    text-align: center;
}

.references ul {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.references li {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.6;
}

.references li:last-child {
    border-bottom: none;
}

.references a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.references a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Enhanced link styling throughout */
a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Add some visual flair */
section::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 20px;
    width: 40px;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 2px;
    opacity: 0.7;
}

/* Responsive improvements */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header {
        padding: 2rem 1rem;
        margin: -1rem -1rem 1rem -1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    section {
        padding: 1.5rem;
        margin: 1rem 0;
    }

    .formula-container {
        padding: 1rem;
    }

    .center-figure {
        margin: 2rem auto;
        padding: 1rem;
    }
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Enhanced blockquote for any quotes */
blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
    background: var(--light-bg);
    padding: 1rem 1rem 1rem 2rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

/* Add focus states for accessibility */
a:focus,
button:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}