/* ========== ARCHITRAVE THEME BASE ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Lora:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    --bg: #0a0a0a;
    --text: #e0e0e0;
    --border: #222;
    --accent: #c9a87b;
    --accent-muted: #7b9ac9;
    --sidebar-width: 300px;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: var(--accent, #c9a87b) !important;
    text-decoration: none !important;
}        

a:hover {
    color: #ece8e1 !important;
    text-decoration: none !important;
}

a:visited {
    color: var(--accent, #c9a87b) !important;
}

/* ========== SIDEBAR & HEADER ========== */
.sidebar {
    width: var(--sidebar-width);
    background: #0d0d0d;
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; height: 100vh;
    overflow-y: auto; 
    padding: 1rem 1.5rem;
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* --- Scrollbar coerente col tema (prima: default bianca del browser).
       Valori ripresi da architrave.css, il file del tema che le definiva
       ma che nessuna pagina carica. --- */
html {
    scrollbar-width: thin;
    scrollbar-color: #444 #0d0d0d;
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: #0d0d0d; }
html::-webkit-scrollbar-thumb { background: #444; border-radius: 5px; }
html::-webkit-scrollbar-thumb:hover { background: #5a5a5a; }

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: #444 #0d0d0d;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: #0d0d0d; }
.sidebar::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: #5a5a5a; }

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #555;
    margin-bottom: 1rem;
    display: block;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    color: var(--accent);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: #666;
}

.sidebar-footer a {
    color: #888;
    text-decoration: none;
}

.lang-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.sidebar.open { left: 0; }
.sidebar-logo { text-align: center; margin-bottom: 2rem; }
.sidebar-logo img { max-width: 220px; height: auto; }

.hamburger {
    display: none; /* Nascosto su desktop */
    position: fixed; top: 1rem; left: 1rem;
    z-index: 1001; background: #1a1a1a;
    border: 1px solid var(--border); border-radius: 8px;
    padding: 0.5rem; cursor: pointer;
    width: 44px; height: 44px;
    flex-direction: column;
    align-items: center; justify-content: center; gap: 5px;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text); transition: all 0.3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 999; }
.sidebar-overlay.active { display: block; }

/* --- Modifica .main-content per gestire lo spazio della sidebar --- */
.main-content {
    max-width: 900px;
    margin: 0 auto;
    margin-left: calc(var(--sidebar-width) + 2rem); /* Spazio per la sidebar fissa */
    padding: 3rem 2rem 3rem;
}

/* --- Modifica la Media Query (max-width: 768px) --- */
@media (max-width: 768px) {
    .hamburger { 
        display: flex; /* Visibile solo su mobile */
    }
    .sidebar { 
        left: calc(-1 * var(--sidebar-width)); /* Nascosta di default su mobile */
    }
    .sidebar.open {
        left: 0 !important; /* Forza l'apertura tramite JS */
    }
    .main-content { 
        margin-left: 0; /* Rimuove il margine su mobile */
        padding: 5rem 1.5rem 2rem; 
    }
}

.page-title {
    font-size: 2.8rem;
    font-weight: 500;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    color: #c9a87b;
}

.btn {
    display: inline-block;
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text);
    font-family: 'Lora', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
}
/* NOTA: le regole globali 'a { color: ... !important }' e 'a:hover { color: ... !important }'
   (righe ~26 e ~31) battono i colori di .btn, che e' un <a>. Senza !important il testo del
   pulsante restava chiaro (#ece8e1) su fondo chiaro (var(--text)) => testo illeggibile in hover.
   Qui si ripristina la leggibilita' dando priorita' alle regole del pulsante. */
/* Hover morbido: niente riempimento bianco pieno (troppo forte sul tema scuro).
   Fondo appena piu' chiaro del body (#222) + testo e bordo in oro (accent). */
.btn:hover {
    background-color: var(--border) !important;
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}
.btn-disabled { opacity: 0.4; cursor: not-allowed; }
.btn-disabled:hover {
    background: transparent !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* ========== RELATED GRID ========== */
.related-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.related-title { font-size: 1.5rem; margin-bottom: 1.5rem; color: var(--accent); }
.buttons-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 2rem; }

@media (max-width: 768px) {
    .hamburger { display: flex; }
    .buttons-grid { grid-template-columns: 1fr; }
    .page-title, .article-title { font-size: 2rem; }
    .main-content { margin-left: 0; padding: 5rem 1.5rem 2rem; }
    .sidebar { left: calc(-1 * var(--sidebar-width)); }
}

.swiper-button-next,
.swiper-button-prev {
    color: #ffffff !important;  /* Bianco invece di crema */
    background: rgba(0,0,0,0.4);
    width: 30px !important;     /* Ridotto del 50% (era 60px) */
    height: 30px !important;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 14px !important;  /* Icona più piccola */
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(0,0,0,0.7);
    color: var(--accent) !important;
}

.swiper-pagination-bullet {
    background: #ffffff !important;  /* Bianco */
    opacity: 0.5;
}

.swiper-pagination-bullet-active {
    background: #ffffff !important;  /* Bianco */
    opacity: 1;
}
/* blockquote markdown ">" — base.css azzera i margin con "* { margin:0 }" */
.article-content blockquote,
.opinion-content blockquote,
.chat-message-content blockquote,
.message-content blockquote,
.step-content blockquote {
    border-left: 3px solid var(--accent, #c9a87b);
    margin: 1.5rem 0 1.5rem 1.5rem;
    padding: 0 0.5rem 0 1.5rem;
    font-style: italic;
    color: #ccc;
}
.article-content blockquote p:last-child,
.opinion-content blockquote p:last-child,
.chat-message-content blockquote p:last-child,
.message-content blockquote p:last-child,
.step-content blockquote p:last-child {
    margin-bottom: 0;
}
