/* --- VARIABILI E RESET --- */
:root {
    --primary-color: #2d5a27; /* Verde natura fresco */
    --accent-color: #e67e22;  /* Arancio energico */
    --bg-light: #f8fafc;
    --text-dark: #1e293b;
    --card-bg: #ffffff;
    --radius: 10px;
    --shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.08), 0 1px 3px -1px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.25;
    -webkit-font-smoothing: antialiased;
}

h1, h2, .playfair {
    font-family: Georgia, serif;
}

.container {
    max-width: 1680px;
    width: 98%;
    margin: 0 auto;
    padding: 0 6px;
}

/* --- HEADER COMPATTO --- */
header {
    background: white;
    padding: 4px 0;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.user-welcome {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
    margin-top: 2px;
    display: inline-block;
}

.welcome-banner {
    font-size: 0.82rem;
    display: inline-block;
    margin-right: 6px;
}

.menu-user-link {
    color: inherit;
    text-decoration: underline;
}

.menu-user-link:hover {
    opacity: 0.8;
}

.menu-logout-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
}

.menu-logout-link:hover {
    text-decoration: underline;
}

/* --- BOTTONI --- */
.btn-filosofia {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.72rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-filosofia:hover {
    opacity: 0.9;
}

/* --- BARRA DI NAVIGAZIONE SALVASPAZIO (Stile Menu Superiore) --- */
.dash-container {
    padding-top: 4px;
    padding-bottom: 4px;
}

.nav-bar-salvaspazio {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 4px auto;
    background: #ffffff;
    padding: 5px 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
    max-width: 100%;
}

.nav-inline-form {
    display: inline-block;
    margin: 0;
}

.nav-item-btn {
    cursor: pointer;
    font-family: inherit;
}

.nav-item {
    background: #f8fafc;
    color: var(--primary-color);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 0.84rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    display: inline-block;
    text-align: center;
}

.nav-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.highlight-item {
    background: #fffbf0;
    color: var(--accent-color);
    border-color: #fde68a;
}

.highlight-item:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.nav-item-static {
    cursor: default;
}

.nav-item-static:hover {
    background: #fffbf0;
    color: var(--accent-color);
    border-color: #fde68a;
    transform: none;
}

/* --- SEZIONI EXTRA --- */
.extra-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 4px;
}

.preview-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 6px 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
    border: 1px solid #e2e8f0;
}

.preview-card:hover {
    transform: translateY(-1px);
}

.preview-card h3 {
    color: var(--primary-color);
    margin-bottom: 2px;
    font-size: 0.95rem;
}

.preview-card p {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 4px;
}

.media-preview {
    width: 100%;
    height: 185px;
    object-fit: cover;
    border-radius: 7px;
    background: #eee;
}

/* --- FOOTER --- */
.site-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 4px 0;
    margin-top: 4px;
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.site-footer-copy {
    font-size: 0.8rem;
    color: #64748b;
}

.btn-contattaci {
    display: inline-block;
    background: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-contattaci:hover {
    opacity: 0.9;
}

/* --- OVERLAY FILOSOFIA E MODALI --- */
.overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.overlay-content {
    background: white;
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    padding: 20px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
}

.scroll-box {
    overflow-y: auto;
    margin: 12px 0;
    font-size: 0.9rem;
    padding-right: 10px;
    text-align: left;
    line-height: 1.55;
    color: #334155;
}

.scroll-box h3 {
    color: var(--primary-color);
    margin-top: 12px;
    margin-bottom: 4px;
    font-size: 1.05rem;
}

.scroll-box p {
    margin-bottom: 8px;
}

/* --- MODALE COOKIE TECNICI --- */
.cookie-overlay {
    z-index: 2100;
}

.cookie-content {
    max-width: 540px;
    border-top: 4px solid var(--primary-color);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.cookie-title {
    color: var(--primary-color);
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.cookie-subtitle {
    font-style: italic;
    color: #64748b;
    font-size: 0.85rem;
}

.cookie-box {
    margin: 10px 0;
    padding-right: 6px;
}

.cookie-actions {
    text-align: center;
    margin-top: 8px;
}

/* --- MEDIA QUERIES PER DESKTOP --- */
@media (min-width: 992px) {
    .extra-sections {
        grid-template-columns: 1fr 1fr; /* 2 colonne per le anteprime su PC */
    }
}

/* Utility Scrollbar */
.scroll-box::-webkit-scrollbar {
    width: 6px;
}
.scroll-box::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}
