/* --- VARIABILI E BASE --- */
:root {
    --primary: #c63d32;   /* Rosso unificato (più elegante) */
    --secondary: #28a745; /* Verde unificato */
    --dark: #1a1a1b;      /* Nero Testo */
    --light: #ffffff;
    --gray-bg: #f8f9fa;   /* Sfondo sezioni */
    --border: #e9ecef;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: 'Inter', -apple-system, sans-serif; 
    color: var(--dark); 
    line-height: 1.6; 
    scroll-behavior: smooth;
    background-color: var(--light);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 25px; }

/* --- HEADER E NAVBAR (Coerente su tutte le pagine) --- */
header { 
    background: rgba(255, 255, 255, 0.98);
    padding: 15px 0; 
    border-bottom: 1px solid var(--border); 
    position: sticky; 
    top: 0; 
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar { display: flex; justify-content: space-between; align-items: center; }

.logo-box, .logo-area { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--dark); }

.logo-stemma, .stemma, .stemma-toscana {
    width: 50px;       
    height: 50px;      
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-stemma img, .stemma, .stemma-toscana {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
}

.logo-text b { font-size: 1.1rem; display: block; line-height: 1.1; }
.logo-text span { font-size: 0.85rem; letter-spacing: 1px; color: #555; }
.logo-box div strong { font-size: 1.1rem; display: block; line-height: 1.1; }
.logo-box div small { font-size: 0.85rem; letter-spacing: 1px; color: #555; }

nav ul { display: flex; list-style: none; gap: 25px; }
nav a { 
    text-decoration: none; color: var(--dark); font-weight: 700; 
    font-size: 0.95rem; transition: 0.3s; 
}
nav a:hover { color: var(--secondary); } /* Verde al passaggio */

/* --- PULSANTI --- */
.back-btn { 
    text-decoration: none; color: var(--primary); font-weight: 800; 
    text-transform: uppercase; font-size: 0.9rem; border: 2px solid var(--primary); 
    padding: 8px 20px; border-radius: 50px; transition: 0.3s; 
}
.back-btn:hover { background: var(--primary); color: white; }

/* --- BANNER PRINCIPALE (HERO - index.html) --- */
.hero {
    height: 85vh;
    min-height: 600px;
    background-image: url('antonella russo banner.jpg'); 
    background-size: cover;
    background-position: center 20%;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding-bottom: 100px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
}

.hero .container { position: relative; z-index: 2; color: white; }

.hero-text h1 { 
    font-size: 4.5rem; font-weight: 900; line-height: 1; 
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
    margin-bottom: 15px;
}

.hero-text p { font-size: 1.6rem; font-weight: 300; opacity: 0.95; max-width: 700px; }

/* --- SEZIONI GENERALI --- */
section { padding: 100px 0; }
.section-title { font-size: 2.8rem; font-weight: 800; text-align: center; margin-bottom: 60px; position: relative; }
.section-title::after { 
    content: ''; display: block; width: 60px; height: 5px; 
    background: var(--primary); margin: 15px auto; border-radius: 10px;
}

/* Intestazione pagine interne */
.main-header { text-align: center; padding: 60px 0 40px; }
.main-title { font-size: 3rem; font-weight: 800; margin-bottom: 10px; }
.red-line { width: 50px; height: 4px; background: var(--primary); margin: 0 auto 20px; }
.subtitle { color: #666; font-size: 1.1rem; }
.section-label { text-align: center; font-weight: 800; margin: 40px 0; font-size: 1.5rem; text-transform: uppercase; }

/* --- LOGHI COALIZIONE --- */
.logo-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 40px; }
.logo-item { 
    width: 150px; height: 150px; 
    background: white; border: 1px solid var(--border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 15px; 
    box-shadow: var(--shadow);
    transition: 0.4s;
}
.logo-item:hover { transform: scale(1.08); border-color: var(--secondary); box-shadow: 0 0 20px rgba(40, 167, 69, 0.2); }
.logo-item img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* --- PROGRAMMA --- */
.prog-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.prog-card { background: white; padding: 40px; border-radius: 15px; border: 1px solid var(--border); transition: 0.3s; }
.prog-card:hover { transform: translateY(-10px); box-shadow: var(--shadow); border-color: var(--secondary); }
.prog-card h3 { color: var(--primary); font-size: 1.5rem; margin-bottom: 15px; }

/* --- CANDIDATI E QUARTIERI (Griglie e Card unificate) --- */
.cand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; margin-bottom: 60px; }
.president-box { display: flex; justify-content: center; margin-bottom: 60px; }
.large-card { width: 100%; max-width: 450px; }

.cand-card {
    text-decoration: none !important;
    color: inherit !important;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.cand-card:hover {
    transform: translateY(-5px);
    border-color: var(--secondary);
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.3); /* Aura verde */
}

/* LA MAGIA PER LE IMMAGINI DEI VOLTI: Non taglia più le teste */
.cand-img img { 
    width: 100%; 
    aspect-ratio: 4 / 5; /* Imposta il rettangolo in proporzione */
    object-fit: cover; 
    object-position: center top; 
    background-color: #f9f9f9; 
}

.cand-info { padding: 25px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: center;}
.cand-number {
    background: var(--primary); color: white; width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 6px; margin: 0 auto 15px; font-weight: bold;
}
.cand-info h4 { font-size: 1.3rem; font-weight: 800; margin-bottom: 10px; }
.cand-info p { color: #666; font-size: 0.9rem; margin: 0; }

/* --- NAVIGAZIONE QUARTIERI (Pulsanti Home) --- */
.quartieri-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.q-btn {
    background: white; padding: 25px; border-radius: 12px; text-decoration: none;
    color: var(--dark); font-weight: 700; border: 1px solid var(--border);
    display: flex; align-items: center; gap: 15px; transition: 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.q-btn span {
    background: var(--primary); color: white; width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 0.9rem;
}
.q-btn:hover { transform: translateY(-5px); border-color: var(--secondary); box-shadow: var(--shadow); color: var(--secondary); }
.q-btn:hover span { background: var(--secondary); }

/* --- PAGINA PROFILO --- */
.profile-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; padding: 60px 0; align-items: start; }
.santini-side { display: flex; flex-direction: column; gap: 20px; }

.santino-card { background: white; border: 1px solid var(--border); border-radius: 15px; overflow: hidden; transition: all 0.3s ease; cursor: pointer; }
.santino-card:hover { transform: scale(1.02); border-color: var(--secondary); box-shadow: 0 0 25px rgba(40, 167, 69, 0.3); }
/* Per i santini usiamo contain per non tagliare il testo */
.santino-card img { width: 100%; display: block; object-fit: contain; background: var(--gray-bg); }
.label-santino { text-align: center; padding: 10px; background: #f9f9f9; font-size: 0.8rem; font-weight: bold; color: #666; text-transform: uppercase; }

.info-side { position: sticky; top: 120px; }
.candidato-nome { font-size: 3.5rem; font-weight: 800; line-height: 1; margin-bottom: 10px; }
.candidato-ruolo { color: var(--primary); font-weight: 700; font-size: 1.2rem; text-transform: uppercase; margin-bottom: 25px; display: block; }
.info-side .red-line { margin: 0 0 30px 0; }
.bio-text { font-size: 1.1rem; color: #444; margin-bottom: 30px; text-align: justify; }

.programma-box { background: #f4fbf6; border-left: 5px solid var(--secondary); padding: 30px; border-radius: 0 15px 15px 0; }
.programma-box h3 { margin-bottom: 15px; font-weight: 800; color: #1a5e2b; }
.programma-list { list-style: none; }
.programma-list li { margin-bottom: 12px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.programma-list li::before { content: '✓'; color: var(--secondary); font-weight: 900; }

/* --- FOOTER --- */
footer { background: var(--dark); color: white; padding: 40px 0; text-align: center; margin-top: auto; }
footer p { margin-bottom: 5px; }

/* --- RESPONSIVE --- */
@media (max-width: 992px) { 
    .cand-grid { grid-template-columns: repeat(2, 1fr); } 
    .profile-wrapper { grid-template-columns: 1fr; }
    .info-side { position: relative; top: 0; }
}
@media (max-width: 850px) {
    .hero-text h1 { font-size: 3rem; }
    nav { display: none; }
}
@media (max-width: 650px) { 
    .cand-grid { grid-template-columns: 1fr; }
    .main-title { font-size: 2.2rem; }
    .candidato-nome { font-size: 2.5rem; }
}


.pdf-viewer-wrapper {
    margin-top: 2rem;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden; /* Arrotonda gli angoli anche del PDF */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    background: #f9f9f9;
}

/* Fix per lo scroll fluido su iOS/Android */
object {
    display: block;
    -webkit-overflow-scrolling: touch;
}

.pdf-fallback {
    padding: 40px;
    text-align: center;
}

.download-btn {
    display: inline-block;
    background-color: #d90429; /* Un rosso istituzionale */
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
}