/* Text Readability Improvements for Artemis Website */

/* Base text styles */
body {
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 16px;
}

/* Improved heading contrast */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-dark);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1em;
}

/* Text on dark backgrounds */
.hero h1, 
.hero h2, 
.hero p,
footer h3,
footer p,
footer a,
.dark-bg h1,
.dark-bg h2,
.dark-bg h3,
.dark-bg p {
    color: var(--text-light);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hero h1,
.section h1.shimmer-text,
.calculator-intro h2.shimmer-text {
    color: var(--secondary-color);
    font-size: 3.5rem;
    font-weight: 800;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

/* Paragraph text improvements */
p {
    color: var(--text-primary);
    margin-bottom: 1.5em;
}

/* Light sections - adjust text colors for readability */
.features h2, 
.about h2,
.gallery h2,
.contact h2,
.testimonials-section h2,
.location h2 {
    color: var(--primary-dark);
}

/* Ensure headings in js-scroll sections are always visible */
.js-scroll.fade-in h2,
h2.js-scroll.fade-in {
    color: var(--primary-dark); /* Default for light backgrounds */
}

/* When fade-in is within a dark background section */
.dark-bg .js-scroll.fade-in h2,
.dark-bg h2.js-scroll.fade-in,
.calculator-section .js-scroll.fade-in h2,
.calculator-section h2.js-scroll.fade-in {
    color: var(--text-light);
}

/* Section-specific heading adjustments */
.features h2.js-scroll.fade-in {
    color: var(--primary-dark);
}

.gallery h2.js-scroll.fade-in,
.gallery .js-scroll.fade-in h2 {
    color: var(--primary-dark);
}

.testimonials-section h2.js-scroll.fade-in,
.testimonials-section .js-scroll.fade-in h2 {
    color: var(--primary-dark);
}

.location h2.js-scroll.fade-in,
.location .js-scroll.fade-in h2 {
    color: var(--primary-dark);
}

.contact h2.js-scroll.fade-in,
.contact .js-scroll.fade-in h2 {
    color: var(--primary-dark);
}

/* Feature box text */
.feature-box h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-dark);
}

.feature-box p {
    color: rgba(51, 51, 51, 0.8);
    font-size: 1rem;
    line-height: 1.6;
}

/* Dark sections text */
.calculator-section p,
.footer p,
.dark-bg p {
    color: rgba(255, 255, 255, 0.85);
}

/* Improved link readability */
a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover:not(.btn):not(.invest-btn):not(.about-company-btn), 
a:focus:not(.btn):not(.invest-btn):not(.about-company-btn) {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Buttons should never show underlines */
.btn:hover, .btn:focus,
.invest-btn:hover, .invest-btn:focus,
.about-company-btn:hover, .about-company-btn:focus {
    text-decoration: none;
}

/* Dark background links */
.dark-bg a {
    color: var(--secondary-color);
}

/* Navigation links */
nav ul li a {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Footer text */
footer .footer-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
}

footer .footer-section p,
footer .footer-section a {
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

/* Text with icons */
.contact-item i {
    color: var(--secondary-color);
    margin-left: 10px;
    font-size: 1.2rem;
}

/* Button text */
.btn {
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Text highlight for important content */
.text-highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* Text on image backgrounds */
.image-overlay-text {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

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

/* Responsive text sizing */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    p {
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    p {
        font-size: 1rem;
    }
    
    nav ul li a {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero h2 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    p {
        font-size: 0.95rem;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    body {
        color: #000;
        background-color: #fff;
    }
    
    a {
        color: #0000EE;
        text-decoration: underline;
    }
    
    a:visited {
        color: #551A8B;
    }
    
    a:hover, a:focus {
        color: #FF0000;
    }
    
    .btn, button {
        border: 2px solid #000;
    }
}

/* Text Readability Enhancements */

/* Text on dark backgrounds */
.dark-bg {
    color: var(--text-light);
}

.dark-bg h1, 
.dark-bg h2, 
.dark-bg h3, 
.dark-bg h4, 
.dark-bg h5, 
.dark-bg h6 {
    color: var(--text-light);
}

.dark-bg p {
    color: var(--text-secondary);
}

/* Highlighted text */
.highlight-text {
    color: var(--secondary-color);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Form elements */
input, textarea, select {
    color: var(--text-primary);
    background-color: var(--bg-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.5em;
    border-radius: 4px;
}

input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Placeholder text */
::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

/* Error states */
.error {
    color: #dc3545;
    font-weight: 500;
}

/* Success states */
.success {
    color: #28a745;
    font-weight: 500;
}

/* Disabled states */
.disabled {
    color: rgba(0, 0, 0, 0.4);
    cursor: not-allowed;
}

/* Focus styles for keyboard navigation */
:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-blue);
    color: var(--text-light);
    padding: 8px;
    z-index: 100;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
}

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print styles */
@media print {
    body {
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .dark-bg {
        color: #000;
    }
    
    .dark-bg h1, 
    .dark-bg h2, 
    .dark-bg h3, 
    .dark-bg h4, 
    .dark-bg h5, 
    .dark-bg h6 {
        color: #000;
    }
    
    .dark-bg p {
        color: #000;
    }
}

/* Ensure paragraphs in js-scroll sections are always visible */
.js-scroll.fade-in p,
p.js-scroll.fade-in {
    color: var(--text-primary); /* Default for light backgrounds */
}

/* When fade-in is within a dark background section */
.dark-bg .js-scroll.fade-in p,
.dark-bg p.js-scroll.fade-in,
.calculator-section .js-scroll.fade-in p,
.calculator-section p.js-scroll.fade-in {
    color: rgba(255, 255, 255, 0.9);
}

/* Text-center paragraph style for better readability */
.text-center p {
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
}

/* Gallery subtitle specific styling */
.gallery-subtitle {
    color: var(--text-primary);
    font-size: 1.1rem;
    line-height: 1.6;
}
