/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800&family=Montserrat:wght@300;400;500;600;700&family=Cormorant+Garamond:wght@300;400;500;600;700&family=Lato:wght@300;400;700&display=swap');

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

:root {
    /* New Color Palette - Blu navy, Grigio ardesia, Bianco crema, Bordeaux */
    --primary-color: #1a2942; /* Navy Blue */
    --secondary-color: #6b1f3a; /* Bordeaux */
    --accent-color: #4a5c6a; /* Slate Gray */
    --text-color: #2c3e50;
    --light-bg: #f5f3ed; /* Cream White */
    --white: #ffffff;
    --cream: #f5f3ed;
    --gray: #6c7a89;
    --transition: all 0.3s ease;
    --transition-normal: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Lato', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    overflow-x: hidden;
}

/* Navigation */
nav {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

nav.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

nav.nav-hidden {
    transform: translateY(-100%);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    text-decoration: none;
}

.logo span {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--primary-color);
    transition: var(--transition);
}

/* Logo image in navigation */
.logo-img {
    height: 50px;
    width: auto;
    display: block;
    object-fit: contain;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    height: 100vh;
    background: url('./matilde_serao.jpeg') no-repeat center center fixed;
    background-size: cover;
                
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    padding: 2rem;
    margin-top: 70px;
    position: relative;
    overflow: hidden;

}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 15, 35, 0.55);
    z-index: 0;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
    
}


.highlight {
    background-image: linear-gradient(120deg, rgba(255, 255, 0, 0.6) 0%, rgba(255, 255, 0, 0.6) 100%);
    padding: 0 0.2em;
}


.hero h1 {
    font-size: 3.5rem;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.3rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(107, 31, 58, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(107, 31, 58, 0.4);
    background: #7d2b50;
}

.hero-buttons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1.2s ease;
}

/* Sections */
section {
    padding: 5rem 2rem;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-header .underline {
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    margin: 0 auto;
}

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

/* About Section */
.about-section {
    background: var(--white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    opacity: 0;
}

.about-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: var(--transition);
    transform: scale(1.04);
}

.about-image:hover img {
    transform: scale(1.06);
}

.about-text h3 {
    font-size: 2rem;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.about-text p {
    margin-bottom: 1rem;
    font-family: 'Lato', sans-serif;
    color: var(--gray);
    line-height: 1.8;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Center the third card when it wraps to second row on desktop */
@media (min-width: 598px) and (max-width: 1100px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .feature-card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: calc(50% - 1rem);
        margin: 0 auto;
    }

    .feature-card:nth-child(6) {
        grid-column: 1 / -1;
        max-width: calc(50% - 1rem);
        margin: 0 auto;
    }
}

.feature-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    text-align: center;
    opacity: 0;
    
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

.feature-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card p {
    font-family: 'Lato', sans-serif;
    color: var(--gray);
}

/* Timeline Section */
.timeline-section {
    background: var(--light-bg);
    position: relative;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 99%;
    background: var(--secondary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    opacity: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    order: 2;
}

.timeline-item:nth-child(even) .timeline-image {
    order: 1;
}

.timeline-year {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.timeline-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.timeline-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.timeline-content p {
    font-family: 'Lato', sans-serif;
    color: var(--gray);
    line-height: 1.8;
}

.timeline-image {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.timeline-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: var(--transition);
    transform: scale(1.04);
}

.time:hover img {
    transform: scale(1.06);
}
/* Gallery Section */
.gallery-section {
    background: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background: var(--primary-color);
    opacity: 0;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay span {
    color: var(--white);
    font-size: 1.2rem;
    font-weight: bold;
}

/* ========================================
   CONTACTS SECTION - STESSO COMPORTAMENTO FEATURES
   ======================================== */

.contacts-section {
    background: var(--cream);
}

.contacts-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* comportamento identico a .features-grid tra 598px e 1100px */
@media (min-width: 598px) and (max-width: 1100px) {

    .contacts-content {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-item:nth-child(3) {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 520px;   /* stesso ingombro visivo delle prime due */
        margin: 0 auto;
    }
}


/* Card stile identico a feature-card */
.contact-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
    text-align: center;

    /* per renderla identica a feature-card */
    text-decoration: none;
    color: inherit;
    display: block;
}

.contact-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.contact-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    color: var(--secondary-color);
}

.contact-icon svg {
    width: 100%;
    height: 100%;
}

.contact-item h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.contact-item p {
    font-family: 'Lato', sans-serif;
    color: var(--gray);
    transition: var(--transition);
}

.contact-item:hover p {
    color: var(--secondary-color);
}


/* Timeline Foundation Year */
.timeline-foundation {
    text-align: center;
    padding-top: 1rem;
    margin-top: 1rem;
    position: relative;
    z-index: 5;
}

.timeline-foundation .timeline-year {
    position: relative;
    left: auto;
    transform: none;
    display: inline-block;
    text-align: center;
    line-height: 1.6;
}

/* Map / Dove Trovarci Section */
.map-section {
    background: var(--white);
}

.map-container {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 450px;
    border: 0;
}

.map-address {
    text-align: center;
    margin-top: 1.5rem;
    font-family: 'Lato', sans-serif;
    color: var(--gray);
    font-size: 1.05rem;
}


footer {
    background: #4f0024;
    color: var(--white);
    padding: 3rem 2rem 1rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--white);
}

.footer-section p,
.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    line-height: 2;
    transition: var(--transition);
}

.footer-section a:hover {
    color: #000;
}

.social-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 2rem;
}

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

.fade-in {
    animation: fadeInUp 1.5s ease forwards;
}
@media (min-width: 768px) {
   
    @keyframes fadeInFromLeft {
        from {
            opacity: 1;
            transform: translateX(-150px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .fade-in-left {
        animation: fadeInFromLeft 5s ease forwards;
    }

    @keyframes fadeInFromRight {
        from {
            opacity: 1;
            transform: translateX(150px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .fade-in-right {
        animation: fadeInFromRight 5s ease forwards;
    }

}


/* ========================================
   HERO - DOUBLE ARROW SCROLL INDICATOR
   ======================================== */
.hero-scroll {
    display: block;
    width: 70px;
    height: 60px;
    position: absolute;
    bottom: 13rem;
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;
    z-index: 2;
    opacity: 1;
    visibility: visible;
    transition: opacity var(--transition-normal),
                visibility var(--transition-normal);
}

.hero-scroll.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hero-scroll .arrow {
    opacity: 0;
    position: absolute;
    left: 27%;
    top: 50%;
    transform-origin: 50% 50%;
    transform: translate3d(-50%, -50%, 0);
}

.hero-scroll .arrow-first {
    animation: arrow-movement 2s ease-in-out infinite;
}

.hero-scroll .arrow-second {
    animation: arrow-movement 2s 1s ease-in-out infinite;
}

.hero-scroll .arrow::before,
.hero-scroll .arrow::after {
    background: #ffffff;
    content: '';
    display: block;
    height: 3px;
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
}

.hero-scroll .arrow::before {
    transform: rotate(45deg) translateX(-23%);
    transform-origin: top left;
}

.hero-scroll .arrow::after {
    transform: rotate(-45deg) translateX(23%);
    transform-origin: top right;
}

@keyframes arrow-movement {
    0% {
        opacity: 0;
        transform: translate3d(-50%, calc(-50% - 12px), 0);
    }
    70%{ 
        opacity: 1; 
    }
    100% {
        opacity: 0;
        transform: translate3d(-50%, calc(-50% + 12px), 0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-links.active {
        right: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-content {
        margin-top: -250px;
    }
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    /* cta button "scopri i nostri premiati" nella pagina storia .html  */
    .cta-button {
        margin-left: 1.2rem;
    }

    .hero-buttons .cta-button {
        margin-left: 0;
    }

    /* Mobile Timeline - center the line */
    .timeline::before {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        grid-template-columns: 1fr;
        padding-left: 0;
        margin-bottom: 3rem;
    }

    .timeline-item:nth-child(even) .timeline-content,
    .timeline-item:nth-child(even) .timeline-image {
        order: initial;
    }

    /* Position year above content on mobile */
    .timeline-year {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        margin-bottom: 1.5rem;
        display: block;
        width: 35%;
        text-align: center;

    }

    .timeline-content {
        margin-bottom: 1rem;
    }

    .timeline-image {
        margin-bottom: 1rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .contact-item a {
        font-size: 13px;
    }

    .timeline-foundation .timeline-year {
        left: auto;
        transform: none;
        width: auto;
    }

    .map-container iframe {
        height: 320px;
    }
}

@media (max-width: 500px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .nav-container {
        padding: 1rem;
    }

    .hero-buttons {
        flex-wrap: nowrap;
        gap: 0.8rem;
    }

    .hero-buttons .cta-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.8rem;
    }
}


/* Tablet / laptop range: swap hero background to matilde_serao_hero.png */
@media (min-width: 768px) and (max-width: 1499px) {
    .hero {
        background-image: url('./matilde_serao_hero.png');
    }
}

/* Wide screen / landscape: swap hero background to matilde_serao_hero.png */
@media (min-width: 1500px), (min-height: 1000px) and (min-width: 768px) {
    .hero {
        background-image: url('./matilde_serao_hero.png');
    }
}