@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

body,
html {
    font-family: "Montserrat", sans-serif;
    margin: 0;
    padding: 0;
    color: #093344;
    scroll-behavior: smooth;
}

p,
h1,
h2,
h3,
h4,
h5 {
    margin: 0;
}

h1 {
    font-size: 4.5rem;
    font-weight: 800;
}

h2 {
    font-size: 2.625rem;
}

h3 {
    font-weight: 400;
    font-size: 2rem;
}

p{
    line-height: 145%;
}

a{
    text-decoration: none;
}

.text-blue{
    color: #34B3E4;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

section {
    padding: 7rem 1rem;
}

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

.hero-section {
    background: #E8F6FC;
    position: relative;
    padding: 10rem 1rem;
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: baseline;
    flex-direction: column;
    gap: 2rem;
}

.hero-list {
    display: flex;
    align-items: start;
    flex-direction: column;
    gap: 1rem;
}

.hero-list .list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 100%;
}

.hero-section button{
    background: #093344;
    animation-delay: 1.5s !important;
}

.list-item img {
    width: 0.95rem;
}

.list-item b {
    font-weight: 600;
}

.hero-image {
    position: absolute;
    bottom: 0;
    right: 7vw;
    height: 100%;
}

.hero-image-mobile{
    display: none;
}

button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    font-family: "Montserrat", sans-serif;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.25s ease; /* aggiornato */
}

button:hover {
    transform: scale(1.05);
}

.whatsapp-button {
    background: #2AA233;
}

.services-container {
    text-align: center;
}

.service-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin-top: 4rem;
    transition-duration: 300ms;
    gap: 0.5rem;
}

.service-card {
    display: flex;
    transition-duration: 300ms;
    position: relative;
    align-items: flex-start;
    justify-content: flex-end;
    flex-direction: column;
    text-align: left;
    height: 450px;
    padding:0 1.5rem;
    color: #fff;
    background-size: cover;
    box-shadow: inset 0 -100px 100px rgba(9, 51, 68, 0.75);
    background-position: center bottom;
    overflow: hidden;
}

.card-title {
    font-size: 2rem;
    line-height: 105%;
    z-index: 10;
    transition-duration: 300ms;
    margin-bottom: 2rem;
}

.card-list {
  z-index: 10;
  max-height: 0;
  overflow: hidden;
  flex-direction: column;
  display: flex;
  transition:  0.75s ease-out;
  opacity: 0;
  gap: 0.5rem;
  margin-top: -2rem;
  margin-bottom: 2rem;
  overflow: visible;
}

.card-button{
    display: flex;
    width: fit-content;
    margin-top: 2rem;
    background-color: #fff;
    color: #093344;
    font-weight: 500 !important;
}

.bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.bg-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #093344;
    transition: opacity 0.35s linear;
    opacity: 0.2;
}

/* FIX HOVER SAFARI: Aggiunta classe safari-hover al background */
.service-card:hover .bg-wrapper::before,
.service-card.safari-hover .bg-wrapper::before {
    opacity: 1;
    background: #093344;
}

/* FIX HOVER SAFARI: Aggiunta classe safari-hover al contenuto testuale/bottone */
.service-card:hover .card-list,
.service-card.safari-hover .card-list {
   max-height: 100%; /* imposta un valore sufficiente */
   opacity:1;
   margin-top: -0.5rem;
}

.service-cards .service-card:nth-child(1){
    background-image: url('./../img/img-1.jpg')
}

.service-cards .service-card:nth-child(2){
    background-image: url('./../img/img-2.jpg')
}

.service-cards .service-card:nth-child(3){
    background-image: url('./../img/img-3.jpg')
}

.reserve .columns{
    display: grid;
    grid-template-columns: 0.5fr 0.5fr;
    align-items: center;
}

.reserve h2{
    font-weight: 400;
}

.about .columns{
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.about .columns{
    gap: 3rem;
}

.about .columns .col:nth-child(1) img{
    width: 100%;
    height: 100%;
}

.about .links{
    display: flex;
    align-items: center;
    gap: 1rem ;
    margin-top: 2rem;
}

.links img {
    cursor: pointer;
    transition: transform 0.25s ease;
}

.links img:hover {
    transform: scale(1.1);
}

footer{
    background: #093344;
    text-align: center;
    font-size: 1.5rem;
    color: #fff;
    padding: 5rem;
}

.mobile{
    visibility: hidden;
}

/* Animazione bottone WhatsApp hero */
@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-2rem);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* WhatsApp button slide-in + hover effect */
.hero-container .whatsapp-button {
    opacity: 0; 
    animation: slideInLeft 0.5s ease-out forwards;
    animation-delay: 1.5s;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hero-container .whatsapp-button:hover {
    transform: scale(1.05);
    opacity: 1;
}

/* Hero titles slide-in */
.hero-section .title h3,
.hero-section .title h1 {
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInLeft 0.6s ease-out forwards;
}

.hero-section .title h3 {
    animation-delay: 0.3s;
}

.hero-section .title h1 {
    animation-delay: 0.6s;
}

/* Hero list fade-in */
.hero-list .list-item, .hero-section button {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s ease-out forwards;
}

.hero-list .list-item:nth-child(1) { animation-delay: 0.9s; }
.hero-list .list-item:nth-child(2) { animation-delay: 1.1s; }
.hero-list .list-item:nth-child(3) { animation-delay: 1.3s; }

/* WhatsApp button slide-in + pulse on hover */

/* Hero image floating effect */
.hero-image {
    animation: float 4s ease-in-out infinite;
}

/* Animations keyframes */
@keyframes slideInLeft {
    0% { opacity: 0; transform: translateX(-50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Hero image fade-in + floating */
.hero-image:first-of-type {
    opacity: 0;
    animation: heroImageIn 1s ease-out forwards;
    animation-delay: 0.2s; /* apparizione dopo i titoli */
}

/* Keyframes per il fade-in della hero image */
@keyframes heroImageIn {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* About section animations */

/* Titolo slide-in da sinistra */
.about h2 {
    opacity: 0;
    transform: translateX(30px);
    animation: fadeInUp 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

/* Paragrafi fade-in dall’alto */
.about p {
    opacity: 0;
    transform: translateY(-20px);
    animation: fadeInUp 0.6s ease-out forwards;
}

.about p:nth-of-type(1) { animation-delay: 0.5s; }
.about p:nth-of-type(2) { animation-delay: 0.7s; }
.about p:nth-of-type(3) { animation-delay: 0.9s; }

/* Immagine slide-in da destra */
.about .columns .col:nth-child(1) img {
    opacity: 0;
    transform: translateX(30px);
    animation: slideInLeft 0.8s ease-out forwards;
    animation-delay: 0.5s;
}

/* Social icons pop-in */
.about .links img {
    opacity: 0;
    transform: scale(0.8);
    animation: popIn 0.4s ease-out forwards;
}

.about .links img:nth-child(1) { animation-delay: 1.2s; }
.about .links img:nth-child(2) { animation-delay: 1.4s; }
.about .links img:nth-child(3) { animation-delay: 1.6s; }

/* Keyframes */
@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(50px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@media screen and (max-width: 60em) {

    .hero-section{
        padding-bottom: 15rem;
        padding-top: 7rem;
        text-align: center;
    }

    .hero-image {
        display: none;
    }

    .hero-image-mobile {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: 0;
        width: auto; /* l'altezza si adatterà automaticamente */
        height: 15rem; /* fondamentale per mantenere proporzioni */
        display: inline;
    }

    .hero-container, .hero-list{
        justify-content: center;
        align-items: center;
        flex-wrap: nowrap; /* corretto 'no-wrap' in 'nowrap' che è la sintassi esatta CSS */
    }

    .hero-list img{
        display: none;
    }

    .columns, .service-cards{
        grid-template-columns: 1fr !important;
    }

    .reserve{
        text-align: center !important;
    }

    .reserve .columns{
        gap: 3rem;
    }

    .reserve .whatsapp-button{
        margin-inline: auto;
    }

    .desktop{
        display: none;
    }

    .mobile{
        visibility: visible;
    }

    h1 {
        font-size: 2.75rem;
    }

    h2{
        font-size: 2rem;
    }

    .card-title{
        font-size: 1.75rem;
    }
}