/*---------------------+
|  Copyright (C) 2025  |
|    ATHENAEUP SRL     |
|  By Francesco Adamo  |
+---------------------*/

/* ==================================================
   1. VARIABLES & RESET
   ================================================== */
:root {
    --primary-color: #1a237e;
    --secondary-color: #c59d5f;
    --secondary-light: #e0b97e;
    --text-color: #333;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 5px 15px rgba(0,0,0,0.05);
}

*, *::before, *::after { box-sizing: border-box; }

html { 
    scroll-behavior: smooth;
    background: linear-gradient(to bottom, var(--white) 0%, var(--white) 50%, var(--primary-color) 50%, var(--primary-color) 100%) no-repeat fixed;
}

body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
    line-height: 1.7;
    background-color: var(--white);
    overflow-x: hidden;
}

body.menu-open { overflow: hidden; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }


/* ==================================================
   2. SECTIONS & ANIMATIONS
   ================================================== */
section {
    padding: 40px 0; 
    border-bottom: 1px solid #f0f0f0;
    scroll-margin-top: 80px;
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Headings */
h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    color: var(--primary-color);
}
h2::after {
    content: ''; display: block; width: 80px; height: 3px;
    background-color: var(--secondary-color); margin: 15px auto 0;
}

/* Centered Text Helpers */
.about-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 20px auto;
    font-size: 1.05rem;
}

.section-subtitle {
    text-align: center;
    max-width: 700px;
    margin: -10px auto 40px auto;
    color: #555;
    font-size: 1.1rem;
}


/* ==================================================
   3. HEADER & NAVIGATION
   ================================================== */
.main-header {
    position: sticky; top: 0; z-index: 1000;
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    height: 80px;
}

.nav-container {
    height: 100%; display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.nav-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 25px; }
.nav-links.left { justify-content: flex-end; }
.nav-links.right { justify-content: flex-start; }

.nav-links a {
    text-decoration: none; color: var(--primary-color);
    font-weight: 600; font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 0.5px; transition: color 0.3s;
}
.nav-links a:hover { color: var(--secondary-color); }

.logo-text {
    font-family: 'Montserrat', sans-serif; font-weight: 700; font-size: 1.6rem;
    text-decoration: none; color: var(--primary-color); letter-spacing: 2px;
    padding: 0 30px; justify-self: center;
}


/* ==================================================
   4. HERO SECTION
   ================================================== */
.hero {
    display: flex; flex-direction: column; justify-content: center;
    align-items: center; text-align: center; height: 90vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8eaf6 100%);
}

.hero-logo { 
    max-width: 600px; width: 80%; margin-bottom: 20px; 
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.05)); 
}

.hero .subtitle { 
    font-size: 1.4rem; color: #555; margin: 10px 0; 
    font-weight: 400; letter-spacing: 1px; 
}

.hero .fancy-font {
    font-family: 'Playfair Display', serif; font-size: 2rem;
    font-style: italic; color: var(--secondary-color); margin-bottom: 30px;
}

.cta-button {
    display: inline-block; background-color: var(--secondary-color);
    color: white; padding: 15px 35px; border-radius: 50px;
    text-decoration: none; font-weight: 600; text-transform: uppercase;
    transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 15px rgba(197, 157, 95, 0.4);
}
.cta-button:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(26, 35, 126, 0.3);
}


/* ==================================================
   5. DIVISIONS
   ================================================== */
.division { display: grid; grid-template-columns: 1fr 2fr; gap: 60px; align-items: center; }
.division.reverse { grid-template-columns: 2fr 1fr; }

.division-logo { 
    display: block; max-width: 280px; margin: 0 auto; 
    transition: transform 0.3s; 
}
.division-logo:hover { transform: scale(1.02); }

.division-info h3 { 
    font-size: 1.8rem; margin-bottom: 5px; color: var(--primary-color); 
}

.division-website {
    display: inline-block; margin-bottom: 20px; font-weight: 600;
    color: var(--secondary-color); text-decoration: none;
}

/* Unified Grid List */
.division-info ul {
    list-style: none;
    padding: 0;
    margin-top: 25px;
}

.division-info li {
    display: grid;
    grid-template-columns: 45px 1fr; /* Fixed width for icon column */
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 15px;
    text-align: left;
}

/* Icon Alignment */
.division-info .icon {
    color: var(--secondary-color);
    font-size: 1.3rem;
    margin-top: 3px; 
    width: 100%;
    text-align: center; 
    display: inline-block;
}


/* ==================================================
   6. CARDS GRID
   ================================================== */
.services-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* This centers the orphan card */
    gap: 30px; 
    margin-top: 40px;
}

.service-card {
    /* 1. Grow to fill space, 2. Shrink if needed, 3. Base width 300px */
    flex: 1 1 300px; 
    
    /* Optional: Prevents the orphan card from getting awkwardly wide */
    max-width: 450px; 
    width: 100%; /* Ensures responsiveness */

    background: white; 
    padding: 40px 30px;
    border-radius: 10px; 
    box-shadow: var(--shadow);
    text-align: center; 
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid var(--secondary-color);
}

.service-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.1); 
}

.service-card i {
    font-size: 3rem; 
    color: var(--primary-color); 
    margin-bottom: 20px;
}
.service-card h3 { 
    font-size: 1.4rem; 
    margin-bottom: 15px; 
    color: var(--text-color); 
}
.service-card p { 
    font-size: 0.95rem; 
    color: #666; 
}


/* ==================================================
   7. CONTACTS
   ================================================== */
#contatti { background-color: var(--light-bg); }

.contact-wrapper { 
    max-width: 1000px; 
    margin: 0 auto; 
    
    /* Switched to Flexbox */
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; /* Centers the items if they wrap */
    gap: 40px; 
	
	margin-bottom: 30px;
}

.contact-item { 
    /* Responsive sizing: min 250px, max 350px */
    flex: 1 1 250px; 
    max-width: 350px; 
    
    /* Layout */
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    text-align: center; 
}

.contact-item .icon { 
    font-size: 2.2rem; 
    margin-bottom: 15px; 
    display: block; 
    color: var(--secondary-color); 
}


/* ==================================================
   8. FOOTER & UTILITIES
   ================================================== */
footer { 
    text-align: center; padding: 20px 0; 
    background-color: var(--primary-color); 
    color: rgba(255,255,255,0.8); font-size: 0.9rem; 
}
footer p {
    margin: 5px 0; /* Compact spacing */
}

/* Back to Top */
#back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 50px; height: 50px; background: var(--secondary-color);
    color: white; border: none; border-radius: 50%;
    text-align: center; line-height: 50px; font-size: 1.2rem;
    cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    opacity: 0; visibility: hidden; transition: all 0.4s;
    z-index: 900;
}
#back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }


/* ==================================================
   9. LANGUAGE SWITCHER
   ================================================== */
.language-switcher { 
    position: absolute; right: 20px; top: 50%; 
    transform: translateY(-50%); z-index: 1001; 
}
.language-current {
    background: transparent; border: 1px solid #ddd; border-radius: 5px;
    padding: 5px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.language-dropdown {
    position: absolute; top: 120%; right: 0; background: white;
    border: 1px solid #eee; border-radius: 5px; box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0; visibility: hidden; padding: 5px; min-width: 140px; transition: all 0.3s;
}
.language-switcher.active .language-dropdown { opacity: 1; visibility: visible; top: 110%; }
.language-option { 
    display: flex; align-items: center; gap: 10px; 
    padding: 8px 15px; text-decoration: none; color: #333; 
    transition: background 0.2s; 
}
.language-option:hover { background: var(--light-bg); }


/* ==================================================
   10. MOBILE & RESPONSIVE
   ================================================== */
.hamburger-menu, .mobile-nav, .menu-overlay { display: none; }

@media (max-width: 1200px) {
    /* 1. Header Grid Layout */
    .nav-links { display: none !important; }
    
    .nav-container { 
        display: grid;
        /* 50px for Switcher, 1fr for Logo, 50px for Menu */
        grid-template-columns: 50px 1fr 50px; 
        grid-template-rows: 1fr;
        align-items: center; 
        padding: 0 15px;
        height: 100%;
        width: 100%;
    }

    /* 2. Language Switcher (Left) */
    .language-switcher { 
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        
        position: relative; 
        right: auto; top: auto; 
        transform: none; 
        margin: 0;
        z-index: 1002;
    }

    /* Mobile: Dropdown aligns left */
    .language-dropdown {
        left: 0; 
        right: auto;
        min-width: 140px;
    }
    
    /* 3. Logo (Center) */
    .logo-text { 
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        
        /* Restored to Desktop Size */
        font-size: 1.6rem; 
        letter-spacing: 1px; /* Slight reduction to ensure fit */
        padding: 0; 
        margin: 0;
        white-space: nowrap; 
        z-index: 1002; /* Ensures it's clickable over overlay */
        position: relative;
    }
    
    /* 4. Hamburger (Right) */
    .hamburger-menu {
        display: flex; /* Flexbox handles spacing perfectly */
        flex-direction: column;
        justify-content: space-around; /* Even spacing */
        
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        
        position: relative;
        right: auto; top: auto;
        transform: none;
        
        width: 30px; 
        height: 24px; /* Fixed height for calculation */
        background: none; 
        border: none; 
        cursor: pointer; 
        padding: 0; 
        z-index: 1002;
    }

    /* Original Line Logic */
    .hamburger-menu span { 
        display: block;
        width: 30px; 
        height: 3px; /* Original Thickness */
        background-color: var(--primary-color); 
        border-radius: 10px;
        transition: all 0.3s ease-in-out;
        position: relative;
        transform-origin: center;
    }

    /* Original Animation Logic */
    .hamburger-menu.is-active span:nth-of-type(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger-menu.is-active span:nth-of-type(2) { opacity: 0; }
    .hamburger-menu.is-active span:nth-of-type(3) { transform: translateY(-8px) rotate(-45deg); }


    /* Mobile Menu Drawer */
    .mobile-nav, .menu-overlay { display: block; }
    
    .menu-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(0,0,0,0.5); z-index: 998; opacity: 0; visibility: hidden; transition: 0.3s;
    }
    .menu-overlay.is-visible { opacity: 1; visibility: visible; }
    
    .mobile-nav {
        position: fixed; top: 0; right: 0; width: 80%; max-width: 300px;
        height: 100vh; background: white; z-index: 999;
        transform: translateX(100%); transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 80px 20px; box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    .mobile-nav.is-open { transform: translateX(0); }
    .mobile-nav ul { list-style: none; padding: 0; }
    .mobile-nav li { margin-bottom: 25px; border-bottom: 1px solid #f5f5f5; padding-bottom: 10px; }
    .mobile-nav a { font-size: 1.1rem; color: var(--primary-color); text-decoration: none; font-weight: 600; }

    /* Content Stacking */
    .hero { height: auto; padding: 120px 0 60px; }
    .division, .division.reverse { grid-template-columns: 1fr; text-align: center; gap: 40px; }
    .division.reverse .division-logo { grid-row: 1; } 
    .division-info li { text-align: left; }
}


/* ==================================================
   11. HERO IMMEDIATE ANIMATION
   ================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    /* Runs immediately using CSS, no JS delay */
    animation: fadeInUp 0.8s ease-out forwards;
}