/* --- RESET E BASI --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body { 
    font-family: 'Lato', sans-serif; 
    line-height: 1.6;
    background-color: #fffaf5; 
    color: #333;
}

h1, h2, h3, .tagline, .portfolio-info strong, #caption { 
    font-family: 'Playfair Display', serif; 
}

/* --- HEADER & NAV --- */
header { 
    background: #fff; 
    padding: 3rem 1rem; 
    text-align: center; 
    border-bottom: 1px solid #e2d1c3; 
}

header h1 { 
    font-size: 3rem; 
    letter-spacing: 5px; 
    color: #5d4a37; 
    text-transform: uppercase;
}

.tagline { 
    font-style: italic; 
    color: #8d775f; 
    margin-bottom: 1.5rem; 
    font-size: 1.1rem;
}

nav { margin-top: 20px; }

nav a { 
    text-decoration: none; 
    color: #5d4a37; 
    text-transform: uppercase; 
    font-size: 0.8rem; 
    letter-spacing: 2px; 
    margin: 0 15px;
    transition: color 0.3s;
    font-weight: bold;
}

nav a:hover { color: #d4af37; }

/* --- SEZIONE HERO (HOME) --- */
.hero {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
    text-align: center;
}

.hero h2 { font-size: 2.5rem; color: #5d4a37; margin-bottom: 2rem; }

.hero p { 
    font-size: 1.1rem; 
    color: #555; 
    margin-bottom: 1.5rem; 
    text-align: justify; 
    hyphens: auto;
}

.home-actions { margin-top: 3rem; }

/* --- BOTTONI --- */
.btn { 
    display: inline-block;
    padding: 15px 30px; 
    background: #8d775f; 
    color: #fff; 
    text-decoration: none;
    border-radius: 2px;
    margin: 10px;
    transition: all 0.3s ease;
    border: 1px solid #8d775f;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.btn-outline {
    background: transparent;
    color: #8d775f;
}

.btn:hover { 
    background: #5d4a37; 
    border-color: #5d4a37;
    color: #fff; 
}

/* --- PORTFOLIO (MASONRY LAYOUT) --- */
.portfolio-container {
    padding: 2rem;
    max-width: 1200px;
    margin: auto;
}

.portfolio-grid { 
    column-count: 3;
    column-gap: 20px;
}

.portfolio-item { 
    background: #fff; 
    margin-bottom: 20px;
    break-inside: avoid;
    border-radius: 4px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border: 1px solid #eee;
    cursor: pointer; /* Indica che è cliccabile */
}

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

.portfolio-item img { 
    width: 100%; 
    height: auto;
    display: block; 
    transition: opacity 0.3s;
}

.portfolio-item:hover img {
    opacity: 0.85;
}

.portfolio-info { 
    padding: 15px; 
    font-size: 0.9rem; 
    text-align: center; 
    background: #fff;
    color: #5d4a37;
}

/* --- LIGHTBOX (INGRANDIMENTO) --- */
.lightbox {
    display: none; /* Nascosto di default via JS */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 250, 245, 0.97); /* Sfondo panna quasi coprente */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    cursor: zoom-out;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    box-shadow: 0 10px 50px rgba(0,0,0,0.15);
    border: 8px solid white;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

#caption {
    margin-top: 20px;
    color: #5d4a37;
    font-size: 1.4rem;
    font-weight: bold;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #8d775f;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
}

/* --- FORM CONTATTI --- */
.form-container { 
    max-width: 600px; 
    margin: 4rem auto; 
    padding: 2rem; 
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.form-container h2 { text-align: center; margin-bottom: 2rem; color: #5d4a37; }

input, select, textarea { 
    width: 100%; 
    padding: 12px; 
    margin: 10px 0; 
    border: 1px solid #e2d1c3; 
    border-radius: 2px; 
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #8d775f;
}

/* --- ADMIN PANEL --- */
.admin-table-container { padding: 2rem; max-width: 1000px; margin: auto; }

table { 
    width: 100%; 
    border-collapse: collapse; 
    background: white; 
    margin-top: 2rem;
}

th { background: #8d775f; color: white; padding: 15px; text-align: left; }

td { padding: 15px; border-bottom: 1px solid #eee; font-size: 0.9rem; }

tr:hover { background: #fffcf9; cursor: pointer; }

.messaggio-full { 
    display: none; 
    padding: 20px; 
    background: #fdf2e9; 
    border-left: 4px solid #8d775f;
}

.secret-link { 
    color: #fffaf5; 
    font-size: 10px; 
    text-decoration: none; 
}

/* --- FOOTER --- */
footer { 
    text-align: center; 
    padding: 4rem 2rem; 
    font-size: 0.8rem; 
    color: #aaa; 
    letter-spacing: 1px;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .portfolio-grid { column-count: 2; }
}

@media (max-width: 600px) {
    header h1 { font-size: 2rem; }
    nav a { display: inline-block; margin: 5px 10px; }
    .portfolio-grid { column-count: 1; }
    .hero h2 { font-size: 1.8rem; }
    .close { right: 20px; top: 10px; }
}