:root {
    --primary-color: #00acc1; /* Mare */
    --secondary-color: #fdd835; /* Sole */
    --accent-color: #ff7043; /* Tramonto/Calore */
    --text-color: #333;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --dark-overlay: rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Header & Nav */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 600;
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
#home {
    height: 100vh;
    background: linear-gradient(var(--dark-overlay), var(--dark-overlay)), url('../images/1.jpg') no-repeat center center/cover;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding: 0 1rem;
    margin-top: 60px; /* Offset for fixed header */
}

#home h1 {
    font-size: 3rem;
    color: var(--secondary-color);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}

#home p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border-radius: 50px;
    font-weight: 700;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--accent-color);
    color: var(--white);
    transform: translateY(-3px);
}

/* Sections General */
section {
    padding: 4rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    display: inline-block;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: 0.5rem;
}

/* Chi Siamo */
#chi-siamo {
    background-color: var(--white);
    text-align: center;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.about-text {
    max-width: 800px;
    font-size: 1.1rem;
}

/* Gallery */
#galleria {
    background-color: var(--light-bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    height: 200px; /* Fixed height for uniformity */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    user-select: none;
    transition: 0.3s ease;
    z-index: 2001;
    background-color: rgba(0,0,0,0.3);
    border-radius: 5px;
}

.lightbox-nav:hover {
    background-color: rgba(0,0,0,0.8);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        font-size: 30px;
        padding: 10px;
    }
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
}

/* Info / Location */
#dove-siamo {
    text-align: center;
}

.info-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 2rem;
    margin-top: 2rem;
}

.info-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    flex: 1;
    min-width: 250px;
    text-align: center;
}

.info-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Contact Form */
#contatti {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 4rem 1rem;
    max-width: 100%; /* Full width background */
}

#contatti .section-title h2 {
    color: var(--white);
    border-color: var(--secondary-color);
}

.contact-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: none;
    border-radius: 5px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: 2px solid var(--secondary-color);
}

.antispam-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.antispam-group input {
    width: auto;
    flex: 1;
}

button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button[type="submit"]:hover {
    background-color: var(--white);
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
}

/* Footer */
footer {
    background-color: #222;
    color: #aaa;
    text-align: center;
    padding: 2rem 1rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer i {
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 0px; /* Adjusted to cover full height */
        background-color: var(--white);
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 60%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        padding-top: 5rem;
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        transform: translateX(0%);
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    #home h1 {
        font-size: 2.2rem;
    }
}
