/* Reset and Base Styles */
:root {
    --primary: #007bff;
    --primary-dark: #0056b3;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --white: #ffffff;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --card-bg: #ffffff;
    --background: #ffffff;
    --text-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

.container {
    width: min(95%, 1400px);
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    max-width: 120px;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
                url("/static/images/cielo.6060fe28aa37.avif") no-repeat center center/cover;
    position: relative;
    color: var(--white);
    text-align: center;
    padding: clamp(120px, 20vh, 200px) 0;
    min-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: calc(-1 * var(--navbar-height));
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 123, 255, 0.4),
        rgba(0, 0, 0, 0.6)
    );
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-logo {
    width: 120px;
    height: auto;
    margin-bottom: 2rem;
    animation: fadeInDown 1s ease-out;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 1s ease-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
}

.hero-content p {
    font-size: clamp(1.1rem, 2vw, 1.3rem);
    margin-bottom: 2.5rem;
    line-height: 1.6;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    border-radius: 50px;
    text-decoration: none;
    transition: var(--transition);
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.cta-button.secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Suicide Prevention Item in Mission Section */
.suicide-prevention-item {
    background: #e8f4fc; /* Light blue background for emphasis */
}

/* You may want to adjust the hover effects for all mission items for consistency */
.mission-item:hover {
    transform: translateY(-5px);
    transition: transform 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Chi Siamo Section Styles */
.about-intro {
    font-size: 18px;
    margin-bottom: 20px;
    color: #666;
}

.about-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    text-align: center;
    margin-top: 30px;
}

.about-mission, .about-vision {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.icon {
    color: #007bff;
    margin-bottom: 15px;
}

.instagram-widget {
    margin-top: 20px;
}

.instagram-follow-button {
    background-color: #E1306C; /* Instagram brand color */
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.instagram-follow-button:hover {
    background-color: #C13584; /* Darker shade on hover */
}

/* Info Section - General Style for all sections */
.info-section {
    background: #fff;
    margin: 20px 0;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.info-section h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.info-section p {
    font-size: 18px;
    color: #666;
}

/* Mission Section Styling */
.mission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    text-align: center;
}

.mission-item {
    padding: 20px;
    background: #f8f8f8;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.mission-item:hover {
    transform: translateY(-10px);
}

.event-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.307);
    padding: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}

.event-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.icon {
    margin-bottom: 0.5rem;
    color: #007bff;
}

/* Contact Section Styling */
.contact-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.contact-form {
    flex-basis: 60%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-form input,
.contact-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.contact-form button {
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.contact-info {
    flex-basis: 35%;
    background: #f8f8f8;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contact-info p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.form-button {
    background-color: #007bff; /* Success color for submit button */
    color: white;
    font-size: 16px;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.form-button:hover {
    background-color: #4cae4c; /* Darker shade on hover */
}

/* Instagram Section */
.instagram-widget {
    margin-top: 20px;
}

.instagram-follow-button {
    background-color: #833AB4;  /* Instagram color */
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
}

/* Footer Styles */
.site-footer {
    background-color: #1f2937;
    color: #f3f4f6;
    padding: 40px 0 20px;
    font-size: 0.95rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

/* Organization Info */
.org-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.footer-logo {
    width: 50px;
    height: auto;
}

.org-details h3 {
    color: #60a5fa;
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.org-meta {
    color: #9ca3af;
    font-size: 0.9rem;
}

.footer-address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #9ca3af;
    font-style: normal;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-address i {
    color: #60a5fa;
    margin-top: 3px;
}

/* Quick Links */
.footer-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.links-column h4 {
    color: #e5e7eb;
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.links-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-column li {
    margin-bottom: 10px;
}

.links-column a {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.2s ease;
}

.links-column a:hover {
    color: #60a5fa;
}

/* Contact & Social */
.contact-methods {
    margin-bottom: 25px;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #9ca3af;
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s ease;
}

.contact-method:hover {
    color: #60a5fa;
}

.contact-method i {
    color: #60a5fa;
    width: 16px;
    text-align: center;
}

.social-links h4 {
    color: #e5e7eb;
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    color: #9ca3af;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.social-icon:hover {
    color: #60a5fa;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #374151;
}

.footer-bottom p {
    color: #9ca3af;
    font-size: 0.85rem;
    margin: 0;
}

/* Footer Section Headers */
.footer-section h3 {
    color: #60a5fa;
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .footer-section:last-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section:last-child {
        grid-column: auto;
    }
    
    .footer-links-grid {
        gap: 20px;
    }
    
    .org-info {
        justify-content: center;
    }
    
    .footer-address {
        justify-content: center;
        text-align: center;
    }
    
    .contact-methods {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .social-links {
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
}

/* Improved section spacing */
section {
    padding: clamp(3rem, 8vh, 6rem) 0;
    position: relative;
    overflow: hidden;
}

section:not(.hero) {
    background: var(--white);
}

section:nth-child(even) {
    background: var(--light);
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
    font-size: 16px; /* CRITICAL: Explicit font size prevents zoom issues */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh;
        padding: clamp(100px, 15vh, 150px) 0;
        margin-top: calc(-1 * var(--navbar-height-mobile));
    }

    .hero-content {
        padding: 2rem;
        margin: 0 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }

    .cta-button {
        width: 100%;
        min-width: unset;
        padding: 1rem 2rem;
    }

    .section-header h2::after {
        width: 60px;
    }

    .info-section h2 {
        font-size: 24px;
    }

    .info-section p, .mission-item strong {
        font-size: 16px;
    }

    /* Adjust layout for mission grid */
    .mission-grid {
        grid-template-columns: 1fr; /* Stack items on smaller screens */
    }

    /* Instagram Section */
    .instagram-follow-button {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Footer */
    footer {
        padding: 10px 0;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 8px; /* Even smaller padding for mobile devices */
        font-size: 0.9rem; /* Slightly smaller font size for mobile devices */
    }
    .contact-info {
        flex-basis: 100%;
        margin-top: 20px;
    }
    .contact-info p {
        font-size: smaller; /* You may adjust the font size for smaller screens */
    }
    .event-item, .contact-form, .contact-info {
        width: 100%; /* Ensure full width */
        margin: 0 auto; /* Center align */
    }

    .container {
        width: 100%;
        padding: 0 15px;
    }
    .past-events-section {
        padding: 20px 15px; /* Reduced padding to give more space */
    }

    .event-item {
        padding: 20px; /* Reduced padding for event items */
        margin-bottom: 30px; /* Smaller margin between events */
    }

    .event-info p {
        font-size: 16px; /* Ensure readability but not too large */
        margin-bottom: 20px; /* Reduce space between paragraphs */
    }

    .photo-item {
        max-width: 100%; /* Full width on smaller screens */
        margin: 10px 0; /* Reduced margin */
    }

    .large-photo {
        max-width: 100%;
        margin-top: 20px;
    }

    .event-photo {
        max-width: 100%; /* Ensure photos take full width */
        max-height: 250px; /* Maintain a reasonable height */
    }

    section {
        padding: 3rem 0;
    }
}

/* Z-index management */
:root {
    --z-navbar: 1000;
    --z-modal: 1002;
    --z-hero-overlay: 1;
    --z-hero-content: 2;
}

.navbar {
    z-index: var(--z-navbar);
}

.modal {
    z-index: var(--z-modal);
}

.hero::before {
    z-index: var(--z-hero-overlay);
}

.hero .container {
    z-index: var(--z-hero-content);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    color: var(--dark);
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Improved Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .hero::before {
        display: none;
    }

    .hero-content {
        background: none;
        color: black;
    }
}

/* Enhanced section styles */
.info-section.full-width {
    width: 100%;
    max-width: 100%;
    padding: 4rem 0;
    background-color: var(--background);
    position: relative;
    overflow: visible;
}

/* Events group container */
.events-group {
    width: 100%;
    max-width: 1400px; /* Increased from 1200px */
    margin: 0 auto;
    padding: 0 1rem;
    background-color: var(--background);
}

.event-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    width: 100%;
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #1a1a1a;
        --text-color: #ffffff;
        --card-bg: #ffffff; /* Keep cards white even in dark mode */
    }

    .info-section.full-width {
        background-color: var(--background);
    }

    .events-group {
        background-color: var(--background);
    }

    .event-item {
        background-color: var(--card-bg);
        color: var(--dark); /* Keep text dark for white cards */
    }

    .event-item h3,
    .event-item p {
        color: var(--dark);
    }

    .section-title {
        color: var(--text-color);
    }
}

/* Mobile and responsive improvements */
@media (max-width: 768px) {
    .events-group {
        padding: 0 10px;
    }

    .info-section.full-width {
        padding: 2rem 0;
        width: 100vw;
        overflow-x: hidden;
    }

    .event-item {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        background-color: var(--card-bg);
    }
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    .info-section.full-width {
        background-color: var(--background);
        -webkit-transform: translateZ(0);
    }

    .events-group {
        background-color: var(--background);
        -webkit-transform: translateZ(0);
    }

    .event-item {
        background-color: var(--card-bg) !important;
        color: var(--dark) !important;
        -webkit-transform: translateZ(0);
    }

    .event-item h3,
    .event-item p {
        color: var(--dark) !important;
    }

    /* Ensure white background in dark mode */
    @media (prefers-color-scheme: dark) {
        .event-item {
            background-color: var(--card-bg) !important;
        }
    }
}

/* Additional width improvements */
@media (min-width: 1400px) {
    .container,
    .events-group,
    .event-item {
        max-width: 1600px; /* Even wider for large screens */
    }
}

/* Ensure consistent spacing */
.section-title-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 2.5rem;
    padding: 0 1rem;
}

/* Fix potential overflow issues */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Enhanced Events Section Styles */
.info-section {
    width: 100%;
    max-width: 100%;
    padding: 4rem 0;
    background-color: var(--background);
}

.info-section .container {
    width: min(95%, 1600px);
    margin: 0 auto;
}

/* Enhanced Event Title Styles */
.info-section h2 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-section h2 i {
    font-size: 0.9em;
    color: var(--primary);
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0.5rem;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 123, 255, 0.2);
}

.info-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg,
        var(--primary) 0%,
        var(--primary-dark) 50%,
        transparent 100%
    );
    border-radius: 2px;
}

/* Section spacing */
.events-section-divider {
    width: 100%;
    height: 2px;
    margin: 4rem 0;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 123, 255, 0.1) 25%,
        rgba(0, 123, 255, 0.1) 75%,
        transparent 100%
    );
    border: none;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .info-section h2 {
        color: var(--primary);
    }

    .info-section h2::after {
        background: linear-gradient(90deg,
            var(--primary) 0%,
            var(--primary-dark) 50%,
            transparent 100%
        );
    }

    .events-section-divider {
        background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 123, 255, 0.2) 25%,
            rgba(0, 123, 255, 0.2) 75%,
            transparent 100%
        );
    }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .info-section {
        padding: 2rem 0;
    }

    .info-section .container {
        padding: 0 1rem;
    }

    .info-section h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
        padding-bottom: 0.75rem;
    }

    .events-section-divider {
        margin: 3rem 0;
    }
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {
    .info-section h2 i {
        -webkit-transform: translateZ(0);
    }
}