/* ====== Base Styles ====== */
html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== General Link Styling ====== */
a {
    color: #406463;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

a:hover,
a:focus {
    color: #34495e;
    text-decoration: underline;
}

a:active {
    color: #2c3e50;
}

/* Links within content areas */
main a:not(.cta-button):not(.menu-link):not(.mobile-menu-link):not(.submenu-link) {
    color: #406463;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.3s ease, color 0.3s ease;
}

main a:not(.cta-button):not(.menu-link):not(.mobile-menu-link):not(.submenu-link):hover {
    color: #34495e;
    border-bottom-color: #406463;
    text-decoration: none;
}

/* Specific styling for FAQ and content links */
.faq-content a {
    color: #406463;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px dotted #406463;
}

.faq-content a:hover {
    color: #34495e;
    border-bottom-style: solid;
}

/* ====== Image Optimization ====== */
img {
    max-width: 100%;
    height: auto;
    /* Optimize image rendering */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: optimize-contrast;
}

img[loading="lazy"] {
    /* Smooth loading transition */
    transition: opacity 0.3s;
}

/* Prevent layout shift for lazy loaded images */
.about-image img {
    aspect-ratio: 1/1;
    object-fit: cover;
}

/* Modern CSS containment for better performance */
.about-image {
    contain: layout style paint;
    content-visibility: auto;
    contain-intrinsic-size: 400px 400px;
}

/* Optimize sections with images */
section:has(.about-image) {
    contain: layout;
}

/* Lazy loading fallback styles */
img.lazy {
    opacity: 0.3;
    background: #f0f0f0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy:not([src]) {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
    color: #2c3e50;
    margin-top: 0;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    width: 80px;
    height: 3px;
    background-color: #406463;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 5px;
}

section {
    padding: 2.5rem 2rem 1.5rem 2rem;
    max-width: 1200px;
    margin: auto;
}

/* ====== Header & Navigation ====== */




/* ====== Hero Section ====== */
.hero {
    background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), url('../images/main.webp') no-repeat center center/cover;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #2c3e50;
    padding: 2rem;
    /* Performance optimizations */
    background-attachment: scroll;
    will-change: transform;
    /* Modern image loading */
    contain: layout style paint;
    /* Full viewport width override */
    max-width: none;
    margin: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.about-hero {
    background: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), url('../images/mirela_lavorando.jpg') no-repeat center center/cover !important;
}

@supports (background-image: url('../images/main.webp')) {
    .hero {
        background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), url('../images/main.webp');
    }
}

/* Fallback for browsers that don't support AVIF */
@supports not (background-image: url('../images/main.webp')) {
    .hero {
        background-image: linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)), url('../images/main.jpg');
    }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3rem);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 0 auto 1rem auto;
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 1.5rem auto;
    line-height: 1.6;
}

.hero .cta-button {
    margin-top: 2rem;
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 1.5rem 0;
}

.cta-button {
    background-color: #406463;
    color: #fff;
    padding: 0.75rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


/* ====== CTA Section ====== */
#cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 2rem;
}

#cta .cta-button {
    margin: 2rem auto 0 auto;
    display: inline-block;
    min-width: 220px;
    font-size: 1.15rem;
}

@media (max-width: 800px) {
    #cta {
        padding: 3rem 1rem;
    }

    #cta .cta-button {
        width: 100%;
        min-width: unset;
        font-size: 1rem;
        padding: 1rem 0;
    }
}

.cta-button:hover {
    background-color: #4a6a69;
    transform: translateY(-2px);
}


/* ====== About Section ====== */
.about-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    max-width: 400px;
}

.about-image img {
    width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}


/* ====== Services Section ====== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    text-align: center;
    padding: 0 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.service-card {
    position: relative;
    background-color: #fff;
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.service-card img {
    width: 100%;
    height: 70%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    transition: transform 0.6s ease;
    filter: brightness(1);
}

.service-card:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.service-card:hover img {
    transform: scale(1.03);
    filter: brightness(1.05);
}

.service-card-content {
    position: relative;
    z-index: 2;
    height: 30%;
    padding: 1.5rem 2rem 2rem;
    background: #ffffff;
    color: #2c3e50;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.service-card h3 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.service-card p {
    color: #406463;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    font-weight: 400;
}

/* Services Section Enhancements */
#servizi {
    padding: 4rem 0;
}

#servizi h2 {
    font-size: 2.8rem;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 700;
    letter-spacing: -1px;
    position: relative;
}

#servizi h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #406463, #7ba6a4);
    border-radius: 2px;
}

/* Responsive Design for Services */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 2rem;
        padding: 0 0.5rem;
    }

    .service-card {
        min-height: 320px;
        border-radius: 16px;
    }

    .service-card:hover {
        transform: translateY(-8px) scale(1.01);
    }

    .service-card-content {
        padding: 2rem 1.5rem;
    }

    .service-card h3 {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }

    .service-card p {
        font-size: 0.9rem;
    }

    #servizi {
        padding: 4rem 0;
    }

    #servizi h2 {
        font-size: 2.2rem;
        margin-bottom: 2.5rem;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        min-height: 300px;
    }

    #servizi h2 {
        font-size: 2rem;
    }
}

/* Enhanced hover effects for desktop */
@media (min-width: 769px) {
    .service-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(135deg, rgba(90, 125, 124, 0.1), rgba(123, 166, 164, 0.05));
        opacity: 0;
        transition: opacity 0.4s ease;
        z-index: 1.5;
        pointer-events: none;
    }

    .service-card:hover::before {
        opacity: 1;
    }
}

/* Services CTA Button */
.cta-button.secondary {
    background: transparent;
    color: #406463;
    border: 2px solid #406463;
    padding: 1rem 2.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.cta-button.secondary:hover {
    background: #406463;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(90, 125, 124, 0.3);
}


/* ====== Contact Section ====== */
.contact-content {
    text-align: center;
}

.contact-content p {
    font-size: 1.1rem;
}

.location-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.location {
    background-color: #fff;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.location:hover {
    transform: translateY(-5px);
}

.location h3 {
    color: #406463;
    margin-top: 0;
}


/* ====== Footer ====== */
footer {
    background-color: #406463;
    color: #fff;
    text-align: center;
    padding: 2rem 1.5rem;
    margin-top: 2rem;
}

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

.footer-studios {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.studio-info {
    text-align: center;
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.studio-info h4 {
    color: #b8d4d3;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.studio-info p {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
    margin: 0;
}

.studio-info a {
    color: #b8d4d3;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.studio-info a:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #b8d4d3;
    text-decoration: underline;
}

/* Social media icons */
.social-media {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.social-media a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.social-media a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #b8d4d3;
}

.social-media a[href*="facebook"]:hover {
    background-color: #1877f2;
}

.social-media a[href*="instagram"]:hover {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .footer-studios {
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .studio-info {
        min-width: auto;
        max-width: none;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .social-media {
        gap: 2rem;
    }

    .social-media a {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* ====== Breadcrumb Navigation ====== */
.breadcrumb {
    padding: 1rem 2rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 0;
}

.breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.breadcrumb li:not(:last-child)::after {
    content: "›";
    margin: 0 0.5rem;
    color: #adb5bd;
    font-weight: bold;
}

.breadcrumb a {
    color: #406463;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #2c3e50;
    text-decoration: underline;
}

.breadcrumb li[aria-current="page"] {
    color: #495057;
    font-weight: 500;
}



/* ====== Responsive: About, Location, Hero, Headings ====== */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column;
    }

    .location-grid {
        flex-direction: column;
        gap: 1.5rem;
    }

    .hero {
        height: auto;
        min-height: 100vh;
        /* Reset full-width properties on mobile for better performance */
        width: 100%;
        position: static;
        left: auto;
        right: auto;
        margin-left: 0;
        margin-right: 0;
        padding: 3rem 1rem;
    }

    .hero h1 {
        max-width: 100%;
    }

    .hero p {
        max-width: 100%;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }
}

/* Enhanced styling for very wide screens */
@media (min-width: 1400px) {
    .hero {
        padding: 2rem 4rem;
    }

    .hero h1 {
        font-size: clamp(3rem, 4vw, 4rem);
        max-width: 1400px;
    }

    .hero p {
        font-size: 1.4rem;
        max-width: 900px;
    }
}


.footer-studios .address-link,
.footer-studios .phone-link {
    color: #fff;
    text-decoration: none;
}

.footer-studios .address-link:hover,
.footer-studios .phone-link:hover {
    text-decoration: underline;
}

.footer-studios .studio-address,
.footer-studios .studio-phone {
    margin: 0 0 .5rem 0;
    font-style: normal;
}

.footer-studios .studio-info {
    margin-bottom: 1.2rem;
}