/* --- VARIABILI --- */
:root {
    --primary-color: #2c3e50; /* Blu del logo Leonori */
    --accent-color: #c0a16b;  /* Oro Leonori */
    --text-dark: #333;
    --text-light: #fff;
    --bg-light: #f9f9f9;
    --bg-section-grey: #f4f4f4; /* Grigio sezione Umanità */
    --footer-bg: #0a0e14;    /* Nero Byte Soluzioni Informatiche */
    --cyan-accent: #00d1ff;  /* Azzurro Byte */
    --footer-text: #adb5bd;  /* Grigio testi footer */
    --transition: 0.3s ease-in-out;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    line-height: 1.6; 
    color: var(--text-dark); 
    overflow-x: hidden; 
}

/* FIX LINK: Impedisce il blu/viola su tutti i link e numeri di telefono */
a, a:visited, a:hover, a:active, [href^="tel:"] {
    color: inherit !important;
    text-decoration: none !important;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
img { max-width: 100%; height: auto; }

/* --- TOP BAR --- */
.top-bar { background: var(--primary-color); color: var(--text-light); padding: 8px 0; font-size: 14px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.top-bar a { color: #fff !important; text-decoration: none; margin-left: 15px; }

/* --- HEADER & NAVIGATION --- */
.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.header-flex { display: flex; justify-content: space-between; align-items: center; }
.logo img { height: 55px; width: auto; display: block; }

.nav-list { display: flex; list-style: none; align-items: center; margin: 0; padding: 0; }
.nav-list li a {
    padding: 10px 15px;
    text-decoration: none;
    color: var(--primary-color) !important;
    font-weight: 600;
    transition: var(--transition);
}
.nav-list li a:hover, .nav-list li a.active { color: var(--accent-color) !important; }

/* --- PULSANTI ORO (BORDATURA E TESTO) --- */
/* Questa regola forza il testo e il bordo oro su TUTTI i pulsanti di azione */
.btn-cta, 
.contact-form-wrapper button, 
button[type="submit"], 
.wpcf7-submit,
.richiedi-info-btn {
    background-color: transparent !important;
    color: var(--accent-color) !important;
    border: 2px solid var(--accent-color) !important;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    transition: var(--transition);
    display: inline-block;
    cursor: pointer;
}

.btn-cta:hover, button:hover {
    background-color: var(--accent-color) !important;
    color: #fff !important;
}

/* Visibilità */
.pc-only { display: block; }
.mobile-only { display: none; }

/* --- HEROES --- */
.hero {background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('../images/home_header.jpg'); background-size: cover; background-position: center; height: 60vh; display: flex; align-items: center; color: #fff; text-align: center; }
.hero h1 { font-size: 3rem; width: 100%; text-shadow: 2px 2px 5px rgba(0,0,0,0.3); }

.hero-small {
    padding: 100px 0; 
    color: #fff; 
    text-align: center; 
    background-size: contain; 
    background-repeat: no-repeat; 
    background-position: center; 
    background-color: #000; 
    height: 70vh; 
    display: flex; 
    align-items: center;
    justify-content: center;
}
.hero-small h1 { font-size: 3rem; text-shadow: 2px 2px 8px rgba(0,0,0,0.8); }

/* --- SEZIONI --- */
.py-5 { padding: 80px 0; }
.bg-light { background-color: var(--bg-light); }
.text-center { text-align: center; }
.divider { width: 60px; height: 3px; background: var(--accent-color); margin: 20px auto; }
.section-title { font-size: 2rem; color: var(--primary-color); margin-bottom: 10px; }

/* --- VALORI --- */
.values-section { background-color: var(--bg-section-grey); padding: 80px 0; }
.values-grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-top: 40px; }
.value-item { text-align: center; padding: 20px; }
.value-item i { color: var(--accent-color) !important; font-size: 2.8rem; margin-bottom: 20px; display: block; }
.value-item h3 { color: var(--primary-color); margin-bottom: 15px; }

/* --- SERVIZI --- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin-top: 40px; }
.service-card { background: #fff; border: 1px solid #eee; padding: 40px 20px; border-radius: 8px; text-align: center; transition: var(--transition); }
.service-card i { color: var(--primary-color); font-size: 2.5rem; margin-bottom: 15px; display: block; }
.service-card h3 { margin-bottom: 15px; color: var(--primary-color); }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.05); }

/* --- CONTATTI --- */
.contact-page-content { padding: 80px 0; background-color: var(--bg-light); }
.contact-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 40px; align-items: start; }
.contact-info-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.info-item { display: flex; gap: 20px; margin-bottom: 30px; align-items: flex-start; }
.info-item i { color: var(--accent-color); font-size: 1.5rem; margin-top: 5px; }
.contact-form-wrapper { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form-wrapper input, .contact-form-wrapper textarea { width: 100%; padding: 15px; margin-bottom: 20px; border: 1px solid #ddd; border-radius: 4px; font-family: inherit; }

/* --- FOOTER --- */
.main-footer { background: var(--footer-bg); color: var(--text-light); padding: 80px 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.5fr; gap: 60px; }
.footer-column h3 { color: #fff; text-transform: uppercase; margin-bottom: 25px; font-size: 1rem; letter-spacing: 1px;}
.footer-column p { color: var(--footer-text); font-size: 15px; margin-bottom: 15px; }
.main-footer input, .main-footer textarea { width: 100%; background: #fff !important; color: #333 !important; border: none; padding: 12px; margin-bottom: 12px; border-radius: 4px; font-family: inherit; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a, .footer-column a { color: var(--footer-text) !important; text-decoration: none; transition: var(--transition); }
.footer-links a:hover, .footer-column a:hover { color: var(--cyan-accent) !important; }
.footer-bottom { margin-top: 60px; border-top: 1px solid #1a1a1a; padding-top: 20px; text-align: center; font-size: 12px; color: #adb5bd; }

/* --- GRIGLIA NECROLOGI RESPONSIVE (Byte Protocol) --- */
.manifesti-grid {display: flex; flex-wrap: wrap; margin-right: -15px; margin-left: -15px; }
.pagination-container {display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 50px; margin-bottom: 50px; width: 100%; }

/* Opzionale: stile specifico per i pulsanti della paginazione se vuoi differenziarli */
.pagination-container .btn-cta {min-width: 150px; text-align: center; }

/* 1. PC: 3 Colonne (Larghezza sopra i 992px) */
.manifesto-card-wrapper {flex: 0 0 33.333333%; max-width: 33.333333%; padding: 15px; box-sizing: border-box; }

/* 2. TABLET: 2 Colonne (Larghezza tra 601px e 991px) */
@media (max-width: 991px) {
    .manifesto-card-wrapper {flex: 0 0 50%; max-width: 50%; }
}

/* 3. SMARTPHONE: 1 Colonna (Larghezza sotto i 600px) */
@media (max-width: 600px) {
    .manifesto-card-wrapper {flex: 0 0 100%; max-width: 100%; }
    
    /* Ottimizzazione per la ricerca su mobile */
    .search-form input {width: 100% !important; margin-bottom: 10px; }
}

/* --- STILE DELLE CARD (Coerente con Leonori) --- */

.card-necrologio {background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border-bottom: 4px solid #c0a16b; height: 100%; display: flex; flex-direction: column; transition: transform 0.3s ease; }

.card-necrologio:hover {transform: translateY(-5px); }
.card-necrologio img {width: 100%; height: auto; display: block; }
.card-body {padding: 20px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-body h4 {margin: 0 0 10px; color: #1a1a1a; font-size: 1.2rem; text-transform: uppercase; }
.card-buttons {margin-top: 15px; display: flex; flex-direction: column; gap: 10px; }
.btn-card-gold {background-color: #c0a16b; color: #fff; padding: 10px; text-decoration: none; border-radius: 4px; font-size: 0.85rem; font-weight: bold; transition: background 0.3s; }
.btn-card-dark {background-color: #444; color: #ffffff !important; padding: 10px; text-decoration: none; border-radius: 4px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; transition: background 0.3s; display: block; text-align: center; }

.btn-card-gold:hover, .btn-card-dark:hover {opacity: 0.9; }

/* --- MOBILE RESPONSIVE --- */
.menu-toggle { display: none; cursor: pointer; flex-direction: column; gap: 6px; }
.menu-toggle span { width: 30px; height: 3px; background: var(--primary-color); border-radius: 3px; }

@media (max-width: 992px) {
    .pc-only { display: none !important; }
    .mobile-only { display: block !important; }
    .services-grid, .contact-grid, .footer-grid, .form-row { grid-template-columns: 1fr; }
    .menu-toggle { display: flex; }
    .main-nav { position: absolute; top: 100%; left: -100%; width: 100%; background: #fff; transition: 0.4s; z-index: 999; }
    .main-nav.active { left: 0; }
    .nav-list { flex-direction: column; padding: 20px; }
}

@media (max-width: 992px) {
	.manifesto-item { flex: 0 0 50% !important; }
}
@media (max-width: 600px) {
	.manifesto-item { flex: 0 0 100% !important; }
    .search-form input { min-width: 100% !important; margin-bottom: 10px; }
}