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

/* Corpo pagina come flex verticale */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: "Segoe UI", Roboto, sans-serif;
    background: #000;
    color: #333;
}

/* ------------------------------------------------------------------- */
/* STILI HEADER (ADATTATI PER BOOTSTRAP) */
/* ------------------------------------------------------------------- */

/* Definizione delle variabili CSS per una gestione più semplice (riprese dall'HTML) */
:root {
    --header-bg: #2e7d32;
    --header-link-color: #fff;
    --header-link-hover: #c8e6c9;
    --header-active-color: #ffd54f;
    --dropdown-bg: #4caf50; /* Sfondo per il dropdown */
}

/* L'header sticky ora è gestito solo parzialmente da questo CSS, 
    ma l'importante è la navbar-custom */
.navbar-custom {
    background-color: var(--header-bg) !important; /* Forza il colore di sfondo */
}

.navbar-custom .nav-link,
.navbar-custom .navbar-brand,
.navbar-custom .dropdown-toggle {
    color: var(--header-link-color) !important;
}

.navbar-custom .nav-link:hover,
.navbar-custom .dropdown-toggle:hover {
    color: var(--header-link-hover) !important;
}

.navbar-custom .nav-link.active,
.navbar-custom .dropdown-toggle.active {
    color: var(--header-active-color) !important;
    font-weight: bold;
}

/* Stili per il menu a tendina */
.navbar-custom .dropdown-menu {
    background-color: var(--dropdown-bg);
    border: none;
}

.navbar-custom .dropdown-item {
    color: var(--header-link-color) !important;
}

.navbar-custom .dropdown-item:hover,
.navbar-custom .dropdown-item.active {
    background-color: var(--header-bg);
    color: var(--header-active-color) !important;
}

/* Assicuriamo che l'header sia sticky, anche se la navbar lo è meno */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Regola aggiornata per l'ombra forte */
.shadow-strong {
    /* Parametri: offset-x | offset-y | blur-radius | spread-radius | color */
    /* Aumento significativo di Y, blur e opacità per massima visibilità */
    box-shadow: 0 1rem 2rem 0.5rem rgba(0, 0, 0, 0.60) !important;
}
/* ------------------------------------------------------------------- */
/* LAYOUT BASE E CARD (INVARIATO) */
/* ------------------------------------------------------------------- */

/* Main occupa tutto lo spazio rimasto */
main.container {
    flex: 1 0 auto;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* Griglia per le card delle notizie */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 card su desktop */
    gap: 1.5rem;
}

/* Card Generica */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 1rem;
    transition: transform 0.2s;
}

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

.card img, 
.card video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

/* Titolo, sottotitolo, descrizione */
.card h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}
.card h4 {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: #555;
}
.card p {
    font-size: 0.95rem;
    color: #333;
}

/* News Card (Formato Articolo Singolo) */
.news-card {
    display: flex;
    gap: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    padding: 1.5rem;
    flex-wrap: wrap;
}

.news-card .media {
    flex: 1 1 300px;
}

.news-card .media img,
.news-card .media video {
    width: 100%;
    border-radius: 8px;
}

.news-card .content {
    flex: 2 1 400px;
}

.news-card .content h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.news-card .content h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #555;
}

.news-card .content p {
    font-size: 1rem;
    color: #000;
    line-height: 1.6;
}

/* ------------------------------------------------------------------- */
/* FORM E DASHBOARD (INVARIATO) */
/* ------------------------------------------------------------------- */

/* Form Admin - Gestione Notizie */
form#newsForm {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 800px;
    margin-bottom: 2rem;
}

/* Etichette */
form#newsForm label {
    display: block;
    margin-top: 1rem;
    font-weight: 600;
    color: #333;
}

/* Input, textarea, file */
form#newsForm input[type="text"],
form#newsForm textarea,
form#newsForm input[type="file"] {
    width: 100%;
    padding: 0.7rem;
    margin-top: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

/* Pulsante salva */
form#newsForm button {
    margin-top: 1.2rem;
    background: #2a6a3b;
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

form#newsForm button:hover {
    background: #1e4528;
}

/* Feedback messaggi */
#feedback {
    font-weight: 600;
}

/* Lista notizie (cards) */
#newsList .card {
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background: #fff;
    transition: transform 0.2s;
}

#newsList .card:hover {
    transform: translateY(-3px);
}

#newsList .card img,
#newsList .card video {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

#newsList .card h3 {
    margin-bottom: 0.2rem;
    font-size: 1.1rem;
}

#newsList .card h4 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: #555;
}

#newsList .card p {
    font-size: 0.95rem;
    color: #333;
}

/* Form con shadow e arrotondamenti (Generico) */
form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-bottom: 1.5rem;
}

form input,
form textarea,
form button {
    width: 100%;
    margin: 0.5rem 0;
    padding: 0.7rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
}

form button {
    background: #2a6a3b;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

form button:hover {
    background: #1e4528;
}

/* Footer sempre in basso */
footer {
    background: #2a6a3b;
    color: #fff;
    text-align: center;
    padding: 1rem;
    flex-shrink: 0;
}
/* ... (Il resto del tuo style.css) ... */

/* NUOVO STILE BANNER HERO */
.banner-hero {
    /* Imposta l'altezza massima richiesta */
    height: 20px; 
    width: 100%;
    
    /* Usa l'immagine come sfondo del div per l'effetto cover */
    background-image: url('../img/immagine_banner.jpeg'); /* <<< RICORDA DI CAMBIARE IL PERCORSO */
    background-size: cover; 
    background-position: center center; 
    background-repeat: no-repeat;
    
    /* Altezza minima per schermi molto piccoli */
    min-height: 150px; 
}
/* ------------------------------------------------------------------- */
/* RESPONSIVE DESIGN (ADATTATO) */
/* ------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr); /* 2 card per riga su tablet */
    }
}

@media (max-width: 768px) {
    /* News Card (Mobile: media sopra il testo) */
    .news-card {
        flex-direction: column;
    }
    .news-card .media, .news-card .content {
        flex: 1 1 100%;
    }

    /* Card */
    .grid {
        grid-template-columns: 1fr; /* 1 card per riga su mobile */
        gap: 1rem;
    }

    /* Header e Navbar: Bootstrap gestisce la maggior parte di questo, ma manteniamo i form. */
    
    /* Form Admin responsive */
    form#newsForm {
        width: 100%;        /* occupa tutta la larghezza */
        padding: 1rem;      /* padding leggermente ridotto su mobile */
    }

    form#newsForm input[type="text"],
    form#newsForm textarea,
    form#newsForm input[type="file"],
    form#newsForm button {
        font-size: 0.95rem; /* leggermente più piccolo su mobile */
    }

    form#newsForm button {
        padding: 0.7rem 1.2rem; /* pulsante più compatto */
    }

    #newsList .grid {
        grid-template-columns: 1fr; /* una card per riga su mobile */
        gap: 1rem;
    }
    
}