@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;1,400&family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
    --capri-blue: #005A9C;
    --sea-blue: #008Dcb;
    --lemon-yellow: #FFD700;
    --white: #FFFFFF;
    --off-white: #F8F9FA;
    --text-dark: #2C3E50;
    --text-light: #7F8C8D;
    --font-heading: 'Cormorant Garamond', serif;
    --font-body: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background-color: var(--off-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--capri-blue);
    font-weight: 600;
}

h1 { font-size: 3.5rem; letter-spacing: 2px; text-transform: uppercase; }
h2 { font-size: 2.5rem; margin-bottom: 1.5rem; position: relative; padding-bottom: 10px; }
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--lemon-yellow);
}

p { margin-bottom: 1.5rem; font-size: 1.1rem; color: var(--text-light); font-weight: 300; }

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
    z-index: 1000;
    transition: all var(--transition-speed) ease;
}

.logo a {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--capri-blue);
    text-decoration: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    text-transform: uppercase;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 5px;
    transition: color var(--transition-speed) ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--sea-blue);
    bottom: 0;
    left: 0;
    transition: width var(--transition-speed) ease;
}

.nav-links a:hover { color: var(--sea-blue); }
.nav-links a:hover::after { width: 100%; }

.lang-selector select {
    appearance: none;
    background: transparent;
    border: 1px solid #ccc;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: var(--font-body);
    cursor: pointer;
    text-transform: uppercase;
}
.lang-selector select:focus { outline: none; border-color: var(--capri-blue); }

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

/* Fallback hero background */
.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('images/hero.jpg'); /* We will use one of the downloaded images dynamically */
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0, 90, 156, 0.4), rgba(0, 0, 0, 0.3));
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    padding: 20px;
    animation: fadeIn 1.5s ease;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    font-size: 3.8rem;
    color: var(--white);
    letter-spacing: 1px;
    text-transform: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    color: var(--white);
    font-size: 1.3rem;
    max-width: 600px;
    margin: 20px auto;
}

/* Sections */
section {
    padding: 20px 5%; /* Ridotto ulteriormente per avvicinare il contenuto */
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

#about {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Gallery Grid */
.gallery-container {
    margin-top: 0; /* Rimosso per attaccare la galleria alla descrizione */
    padding-top: 20px; /* Piccolo respiro in alto */
}

.rooms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 15px; /* Ridotto da 30px a 15px */
}

.room-card {
    text-align: left;
    cursor: pointer;
}

.room-card h3 {
    margin-top: 15px;
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.image-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 4/3;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.room-overlay {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.65);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-item:hover img {
    transform: scale(1.05);     
}

/* Footer */
.site-footer {
    background: var(--capri-blue);
    color: var(--white);
    padding: 60px 5% 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 40px;
}

.footer-logo img {
    height: 80px;
    filter: brightness(0) invert(1);
}

.footer-info h4, .footer-contact-info h4 {
    color: var(--lemon-yellow);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.site-footer p {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    margin-bottom: 10px;
}

.site-footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--lemon-yellow);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
}

.footer-bottom p {
    font-size: 0.9rem;
    margin: 0;
}

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

/* Lightbox styles */
#lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightbox img {
    max-width: 90%;
    max-height: 85vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 4px;
}

#lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    text-decoration: none;
    z-index: 2001;
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 60px;
    cursor: pointer;
    user-select: none;
    padding: 20px;
    transition: color 0.3s;
    z-index: 2001;
}
.lb-nav:hover { color: var(--lemon-yellow); }
#lb-prev { left: 5%; }
#lb-next { right: 5%; }

/* Mobile Responsive */
@media (max-width: 1024px) {
    .navbar {
        flex-direction: column;
        padding: 10px 5%;
        gap: 10px;
        position: static; /* Make navbar flow with the document instead of fixed */
        background: var(--white);
    }
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-bottom: 10px;
    }
    .hero {
        height: auto;
        min-height: auto;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        background-color: var(--capri-blue); /* Solid dark blue for text block */
    }
    .hero-bg {
        position: relative;
        width: 100%;
        height: 56.25vw; /* Exactly 16:9 aspect ratio */
        background-size: cover; /* Cover works for 16:9 without cropping too much and avoids gaps */
        background-position: center;
        z-index: 1;
    }
    .hero-overlay {
        display: none; /* Disable overlay so the image is perfectly bright */
    }
    .hero-content {
        position: relative;
        padding: 40px 20px;
        text-align: center;
        max-width: 100%;
        z-index: 2;
    }
    .hero h1 { 
        font-size: 2.3rem; 
        margin-bottom: 15px;
    }
    .hero p { 
        font-size: 1.1rem; 
        margin-bottom: 0;
    }
    
    .lb-nav { font-size: 40px; padding: 10px; }
    #lb-prev { left: 0; }
    #lb-next { right: 0; }
}
