/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

/* Variabili Colori */
:root {
    --background-color: #F8F8F8;
    --text-color: #1a1a1a;
    --link-color: #888888;
    --link-hover-color: #1a1a1a;
    --border-color: #e0e0e0;
    --overlay-bg: rgba(0, 0, 0, 0.85);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 400;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--link-hover-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

main {
    padding: 1rem 5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Logo del sito (non più fisso) */
.site-logo {
    position: absolute;
    top: 1.5rem;
    left: 2rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-color);
    z-index: 100;
}

/* Footer generico */
footer {
    text-align: center;
    margin-top: 2rem;
    padding: 1.5rem 2rem;
    color: var(--link-color);
    font-size: 0.9rem;
}

/* Stili per il nuovo menu centrato e responsive */
.centered-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 15vh 0;
    transition: padding 0.3s ease;
}

.centered-nav nav ul {
    list-style: none;
    display: flex;
    flex-direction: column; /* Verticale su mobile (default) */
    align-items: center;
    padding: 0;
}

.centered-nav nav li {
    margin: 1rem 0; /* Margine verticale su mobile */
}

.centered-nav nav a {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Stili per Tablet e Desktop */
@media (min-width: 768px) {
    .centered-nav {
        padding: 10vh 0;
    }

    .centered-nav nav ul {
        flex-direction: row; /* Orizzontale su schermi grandi */
    }

    .centered-nav nav li {
        margin: 0 1.5rem; /* Margine orizzontale */
    }

    .centered-nav nav a {
        font-size: 1.2rem;
    }
}


/* Griglia Dinamica per Gallerie */
.grid-galleria-dinamica {
    display: grid;
    gap: 1rem;
    grid-auto-flow: dense;
    grid-template-columns: 1fr; /* Default mobile: 1 colonna */
}

.grid-item {
    overflow: hidden;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.4s ease;
}

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

/* Stili per download link in galleria privata */
.grid-item .download-link {
    font-size: 0.8rem;
    text-align: center;
    margin-top: 0.5rem;
    display: block;
}


/* Tablet Breakpoint */
@media (min-width: 768px) {
    .grid-galleria-dinamica {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-item.landscape,
    .grid-item.portrait,
    .grid-item.square {
        grid-column: span 1;
    }
}

/* Desktop Breakpoint */
@media (min-width: 1024px) {
    .grid-galleria-dinamica {
        grid-template-columns: repeat(3, 1fr);
    }
    .grid-item.landscape {
        grid-column: span 2;
    }
    .grid-item.portrait,
    .grid-item.square {
        grid-column: span 1;
    }
}

/* Lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

#lightbox.visible {
    opacity: 1;
    visibility: visible;
}

#lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

#lightbox .close, #lightbox .next, #lightbox .prev {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
}

#lightbox .close {
    top: 20px;
    right: 30px;
}

#lightbox .next {
    right: 20px;
}

#lightbox .prev {
    left: 20px;
}

/* Password Overlay */
#password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.password-box {
    text-align: center;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
}

#password-form input {
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.5rem;
    min-width: 250px;
}

#password-form button, .button-download {
    padding: 0.8rem 1.5rem;
    border: none;
    background-color: var(--text-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#password-form button:hover, .button-download:hover {
    background-color: #333;
}

.error-message {
    color: red;
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* Pagine di contenuto (Chi sono, Contatti, etc) */
.about-me-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.about-me-image { flex: 1; }
.about-me-text { flex: 2; }

@media (min-width: 768px) {
    .about-me-layout {
        flex-direction: row;
    }
}

.text-center { text-align: center; }
.contact-info .email { font-size: 1.5rem; margin: 2rem 0; }
.social-icons a { margin: 0 1rem; font-weight: bold; }
.gallery-list { list-style: none; padding-left: 0; }
.gallery-list li { margin-bottom: 1rem; }
.gallery-list a { font-size: 1.2rem; }

.private-gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* === STILI GALLERIA MINIMAL === */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 colonna su mobile di default */
    gap: 40px; /* Spazio tra gli elementi della griglia */
    margin-top: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Passa a 2 colonne su schermi più grandi */
@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Stile minimal per ogni elemento, senza cornice */
.gallery-item {
    text-align: center;
    transition: transform 0.3s ease; /* Transizione per l'hover */
}

.gallery-item:hover {
    transform: translateY(-5px); /* Leggero sollevamento all'hover */
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 3 / 4; /* Proporzioni PORTRAIT (verticale) */
    border-radius: 8px; /* Angoli arrotondati per l'immagine */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Ombra molto leggera sull'immagine */
}

/* Stile base del pulsante */
.gallery-button {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 15px; 
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 400; /* Peso del carattere normale */
    transition: border-color 0.3s ease;
}

/* Nuovo stile hover per il pulsante */
.gallery-button:hover {
    border-color: var(--text-color); /* Cambia solo il colore del bordo */
    font-weight: 700; /* Il testo diventa bold */
}

/* Stile per indicare la pagina attiva nel menu (Icona Occhio) */
.centered-nav nav li a.active {
    position: relative;
    font-weight: 700;
}

.centered-nav nav li a.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -12px;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background-color: var(--text-color);
    -webkit-mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z' /%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z' /%3e%3c/svg%3e");
    mask-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z' /%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z' /%3e%3c/svg%3e");
    -webkit-mask-size: contain;
    mask-size: contain;
}
