/* LaTeX-inspired Typography and Alignment Improvements */

/* Import Latin Modern (LaTeX-style font) from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap');

/* Computer Modern-like alternative using EB Garamond */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&display=swap');

/* For monospace code blocks - Latin Modern Mono alternative */
@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@300;400;500;600;700&display=swap');

/* Base Typography - LaTeX Style - OPTIMIZED SIZES */
body {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
    font-size: 18px;
    line-height: 1.65;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Headings - LaTeX Style - OPTIMIZED SIZES WITH UNIFORM COLOR */
h1, h2, h3, h4, h5, h6 {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    letter-spacing: -0.02em;
    color: #2c3e50 !important;
}

h1 {
    font-size: 2.25em;
    font-weight: 700;
    margin-top: 0;
    letter-spacing: 0 !important;
    color: #2c3e50 !important;
}

h2 {
    font-size: 1.75em;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.3em;
    margin-bottom: 0.5em;
    color: #2c3e50 !important;
}

h3 {
    font-size: 1.4em;
    font-weight: 600;
    margin-bottom: 0.5em;
    color: #2c3e50 !important;
}

h4 {
    font-size: 1.2em;
    font-weight: 500;
    color: #2c3e50 !important;
}

/* Paragraph Improvements - OPTIMIZED SIZE WITH UNIFORM COLOR */
p {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 1.2em;
    margin-top: 0.5em;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    color: #2c3e50 !important;
}

/* Links - More subtle LaTeX style WITH UNIFORM COLOR */
a {
    color: #2c5aa0 !important;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

a:hover {
    color: #1a3a6e !important;
    border-bottom: 1px solid #2c5aa0;
}

/* Lists - Better spacing and alignment - OPTIMIZED SIZE */
ul, ol {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
    font-size: 1.05em;
    line-height: 1.7;
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    list-style-position: outside;
}

li {
    margin-bottom: 0.5em;
    padding-left: 0.5em;
}

/* Ensure bullets align with text */
ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

/* Fix nested list alignment */
ul ul, ol ol, ul ol, ol ul {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding-left: 2em;
}

/* Section Alignment Improvements - FIXED FOR DESKTOP */
.block-title {
    margin-top: 3em;
    margin-bottom: 0.75em;
    text-align: left;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.block-title h2 {
    font-size: 1.75em;
    font-weight: 600;
    color: #2c3e50 !important;
    margin-bottom: 0.3em !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Content Area Alignment - PRESERVE ORIGINAL PADDING WITH UNIFORM COLOR */
.ci-text {
    text-align: justify;
    max-width: 100%;
    color: #2c3e50 !important;
}

.ci-text p {
    margin-bottom: 1.2em;
    margin-top: 0.5em;
    color: #2c3e50 !important;
}

/* Fix nested sections alignment */
.ci-text .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.ci-text .block-title {
    padding-left: 0 !important;
    margin-left: 0 !important;
}

/* Home Section Improvements */
.home-content {
    padding: 2em 0;
}

.home-text {
    padding: 1.5em;
}

.home-text h1 {
    font-size: 2.5em !important;
    line-height: 1.2 !important;
    margin-bottom: 0.5em;
    font-weight: 700;
    letter-spacing: 0em;
}

.home-text h4 {
    font-size: 1.25em !important;
    line-height: 1.5 !important;
    font-weight: 500;
    color: #555;
    margin-bottom: 1em;
}

.home-text p {
    font-size: 1em;
    line-height: 1.7;
    margin-bottom: 1.5em;
    text-align: left;
}

/* Better spacing for sections */
.row {
    margin-bottom: 1em;
}

.p-10 {
    padding: 10px 0;
}

/* Improve button typography - OPTIMIZED SIZE */
.btn {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 12px 30px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Navigation Menu - OPTIMIZED SIZE */
.site-main-menu {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
    font-size: 1em;
    font-weight: 500;
}

.site-main-menu a {
    letter-spacing: 0.02em;
}

/* Logo Text */
.logo-text {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Improve content container alignment - DESKTOP OPTIMIZED */
.page-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2em 4em;
}

/* Better container width for desktop */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Ensure proper width on desktop */
@media only screen and (min-width: 1200px) {
    .page-content {
        max-width: 1400px;
        padding: 3em 6em;
    }
    
    .content-area {
        max-width: 100%;
    }
    
    .site-content {
        padding: 2em 0;
    }
}

/* Better padding for all content sections */
.single-page-content {
    padding: 2em 1em;
}

@media only screen and (min-width: 768px) {
    .single-page-content {
        padding: 3em 2em;
    }
}

@media only screen and (min-width: 1024px) {
    .single-page-content {
        padding: 3em 3em;
    }
}

/* Better spacing for nested sections */
.info-list-w-icon {
    margin-top: 1em;
}

/* Fix column padding for better desktop layout */
.col-xs-12 {
    padding-left: 15px;
    padding-right: 15px;
}

/* Desktop/Laptop Optimizations - OPTIMIZED SIZES */
@media only screen and (min-width: 1025px) {
    body {
        font-size: 19px;
    }
    
    .page-content {
        padding: 3em 6em;
    }
    
    .home-text {
        padding: 2em 3em;
    }
    
    .block-title h2 {
        font-size: 1.85em;
    }
    
    p {
        font-size: 1.05em;
        line-height: 1.75;
    }
    
    .home-text h1 {
        font-size: 2.75em !important;
    }
    
    .home-text h4 {
        font-size: 1.3em !important;
    }
}

/* Responsive Typography - OPTIMIZED SIZES */
@media only screen and (max-width: 1024px) {
    body {
        font-size: 17px;
    }
    
    h1 {
        font-size: 2.1em;
    }
    
    h2 {
        font-size: 1.65em;
    }
    
    .home-text h1 {
        font-size: 2.2em !important;
    }
    
    .page-content {
        padding: 2em 3em;
    }
}

@media only screen and (max-width: 767px) {
    body {
        font-size: 16px;
    }
    
    p {
        text-align: left;
        font-size: 1em;
    }
    
    .home-text h1 {
        font-size: 1.9em !important;
        text-align: center;
    }
    
    .home-text h4 {
        font-size: 1.15em !important;
        text-align: center;
    }
    
    .home-text p {
        text-align: left;
    }
    
    .block-title {
        text-align: left;
    }
    
    .page-content {
        padding: 1.5em 2em;
    }
}

@media only screen and (max-width: 500px) {
    body {
        font-size: 15px;
    }
    
    .home-text h1 {
        font-size: 1.6em !important;
        line-height: 1.3 !important;
    }
    
    h2 {
        font-size: 1.45em;
    }
    
    h3 {
        font-size: 1.25em;
    }
    
    .page-content {
        padding: 1em 1.5em;
    }
}

/* Professional Activities List Styling */
.ci-text ul li {
    margin-bottom: 1em;
    line-height: 1.7;
}

.ci-text ul li b {
    font-weight: 600;
    color: #2c3e50;
}

/* Project Sections - Better hierarchy */
.ci-text h3 {
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: #34495e;
    font-weight: 600;
}

/* Improve text contrast and readability */
.ci-text {
    color: #2c3e50;
}

/* Better alignment for flex containers */
.flex-v-align {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
}

/* Ensure consistent padding */
.col-sm-12.col-md-7.col-lg-7,
.col-sm-12.col-md-5.col-lg-5 {
    padding: 1em;
}

/* Home photo alignment */
.home-photo {
    margin-bottom: 2em;
}

@media only screen and (min-width: 768px) {
    .home-photo {
        margin-bottom: 0;
    }
}

/* Improve overall content spacing */
.single-page-content {
    padding: 2em 0;
}

/* Better section separation */
.row + .row {
    margin-top: 1.5em;
}

/* Owl carousel text rotation */
.text-rotation h4 {
    font-family: 'EB Garamond', 'Crimson Pro', 'Georgia', serif !important;
}

/* Ensure proper text rendering for all elements */
* {
    text-rendering: optimizeLegibility;
}

/* Fine-tune link styling in paragraphs */
p a, .ci-text a {
    font-weight: 500;
}

/* Better spacing for download button */
.home-buttons {
    margin-top: 2em;
}
