/* --- 1. VARIABILI (DESIGN SYSTEM) --- */
:root {
    --primary: #8B5CF6;
    --primary-dark: #7C3AED;
    --primary-light: #A78BFA;
    --secondary: #06B6D4;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --background: #0F172A;
    --background-light: #1E293B;
    --surface: #1E293B;
    --surface-light: #334155;
    --card-bg: #1E293B; /* Aggiunta variabile mancante */
    --text: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;
    --text-dim: #64748B;
    --border: #334155;
}

/* --- 2. REGOLE BASE E RESET --- */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--background);
}

body {
    overflow-y: auto; 
    overflow-x: hidden;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

/* --- 3. REGOLE SPECIFICHE APP (SOLO SE ESISTE #root) --- */
#root {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important; 
    position: fixed; 
}

#root:empty {
    display: none;
    position: relative;
}

/* --- 4. LAYOUT E NAVBAR --- */
.container {
    max-width: 1100px; /* Leggermente più largo per la Home */
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
    font-weight: 500;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* --- 5. COMPONENTI CONTENUTO --- */
.page-content {
    padding: 60px 20px;
    max-width: 900px; /* Bilanciato per le policy e About Us */
    margin: 0 auto;
}

/* Hero Section per Home */
.hero {
    text-align: center;
    padding: 100px 20px;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Griglia Blog (Home e Blog Page) */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.article-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: transform 0.2s, border-color 0.2s;
}

.article-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.article-card h3 {
    margin-top: 0;
    color: var(--text);
}

.read-more {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 15px;
}

article img {
    max-width: 100%;    /* Impedisce all'immagine di uscire dal contenitore */
    height: auto;       
    display: block;     
    margin: 30px auto;  
    border-radius: 12px; 
    border: 1px solid var(--border); 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3); 
}

/* Opzionale: se vuoi aggiungere una didascalia sotto le foto */
.image-caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin-top: -20px;
    margin-bottom: 30px;
    font-style: italic;
}

.image-row {
    display: flex;
    gap: 20px;          /* Spazio tra le due immagini */
    margin: 30px 0;
    align-items: flex-start;
}

.image-row .image-container {
    flex: 1;
    text-align: center;
}

/* Rimuoviamo il margine margin-top/bottom dalle immagini dentro la riga 
   perché lo gestisce già il contenitore .image-row */
.image-row img {
    margin: 0 0 20px 0 !important; 
}

/* Box & Note (Usati nelle Policy e Articoli) */
.box {
    margin: 30px 0;
    padding: 25px;
    border-radius: 12px;
    background: var(--background-light);
    border-left: 4px solid var(--primary);
}

.warning-box { border-left-color: var(--warning); background: rgba(245, 158, 11, 0.05); }

.bold { font-weight: bold; color: var(--text); }

/* --- 6. BOTTONI --- */
.btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* --- 7. FOOTER --- */
footer {
    padding: 60px 0;
    border-top: 1px solid var(--border);
    background: #0a0f1d;
    text-align: center;
    margin-top: 80px;
}

.footer-links {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 13px;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-text {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 30px;
}

/* --- 8. RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-links { 
        gap: 10px; 
    }

    .nav-links a { 
        font-size: 12px; 
    }

    .hero h1 {
        font-size: 2.2rem; 
    }

    h1 { 
        font-size: 2rem; 
    }
    
    .image-row {
        flex-direction: column;
    }
}