/* Reset di base e Stili Globali */
:root {
    --primary-color: #FF0000; /* Rosso dal logo */
    --dark-color: #222222;    /* Nero/Grigio scuro */
    --light-color: #FFFFFF;   /* Bianco */
    --grey-bg: #f8f8f8;
    --text-color: #333333;
    --font-primary: 'Montserrat', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
}

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Open+Sans:wght@400;600&display=swap');

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

body {
    font-family: var(--font-secondary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden; /* Per evitare scroll orizzontale da animazioni */
}

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

h1, h2, h3, h4 {
    font-family: var(--font-primary);
    color: var(--dark-color);
    margin-bottom: 1rem;
}
h1 {font-size: 2.8rem;}
h2 { font-size: 2.2rem; text-align: center; margin-bottom: 2.5rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }


a {
    color: var(--primary-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-color) !important; /* !important per sovrascrivere specificità */
    padding: 12px 25px;
    border-radius: 5px;
    text-transform: uppercase;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
}
.btn:hover {
    background-color: #cc0000; /* Rosso più scuro */
    text-decoration: none;
    transform: translateY(-2px);
}
.btn-outline {
    background-color: transparent;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color);
}
.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--light-color) !important;
}

/* Header */
header {
    background-color: var(--light-color);
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.logo img {
    height: 50px;
    width: auto;
}
nav {
    display: flex;
    align-items: center;
}
nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}
nav ul li {
    margin-left: 25px;
}
nav ul li a {
    color: var(--dark-color);
    font-weight: 600;
    padding-bottom: 8px;
    position: relative;
    transition: color 0.3s ease;
}
nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}
nav ul li a:hover, nav ul li a.active {
    color: var(--primary-color);
}
nav ul li a:hover::after, nav ul li a.active::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.8rem;
    background: none;
    border: none;
    color: var(--dark-color);
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}


/* Hero Section */
#hero {
    background: url('../img/hero-bg.jpg') no-repeat center center/cover; /* Path corretto */
    min-height: 85vh; /* Usa min-height per adattarsi al contenuto */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-color);
    position: relative;
    padding: 40px 20px; /* Padding per mobile */
}
#hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.3)); /* Gradiente per miglior leggibilità */
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px; /* Limita larghezza contenuto */
}
.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem); /* Responsive font size */
    margin-bottom: 1rem;
    color: var(--light-color);
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 2.5rem;
    font-weight: 400;
}

/* Sezioni Generiche */
section {
    padding: 80px 0;
}
section:nth-child(even) {
    background-color: var(--grey-bg);
}

/* Prossimi Eventi */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}
.event-card {
    background: var(--light-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.event-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
.event-card-content {
    padding: 1.8rem;
    flex-grow: 1; /* Fa espandere il contenuto */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Spinge il bottone in basso se necessario */
}
.event-card h3 {
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.event-card .date {
    font-style: italic;
    color: #777;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.event-card p:not(.date) {
    margin-bottom: 1.5rem;
    flex-grow: 1;
}


/* Associazione (Chi Siamo Preview) */
#associazione .columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 3rem;
}
#associazione img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Attività */
.attivita-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: center;
}
.attivita-item {
    padding: 2rem 1.5rem;
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
     transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.attivita-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.attivita-item .icon-placeholder { /* Placeholder per icone SVG/FontAwesome */
    display: inline-block;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--light-color);
    border-radius: 50%;
    line-height: 50px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-primary); /* Per eventuali lettere */
}
.attivita-item h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

/* Galleria Preview */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}
.gallery-grid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, filter 0.3s ease;
    cursor: pointer;
}
.gallery-grid img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}
.text-center { text-align: center; margin-top: 2.5rem; }


/* Footer */
footer {
    background-color: var(--dark-color);
    color: #ccc;
    padding: 50px 0 30px 0;
    text-align: center;
}
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.footer-logo img {
    height: 45px;
    margin-bottom: 1.5rem;
    filter: brightness(0) invert(1);
}
.footer-info p {
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
}
.footer-info a {
    color: #fff;
    transition: color 0.3s ease;
}
.footer-info a:hover {
    color: var(--primary-color);
}
.social-links {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}
.social-links a {
    color: #fff;
    margin: 0 12px;
    font-size: 1.6rem; /* O usa SVG/FontAwesome */
    transition: color 0.3s ease, transform 0.2s ease;
    display: inline-block;
}
.social-links a:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}
.copyright {
    margin-top: 2rem;
    font-size: 0.85rem;
    color: #aaa;
}
.copyright p { margin-bottom: 0.3rem;}
.copyright a {color: #bbb;}
.copyright a:hover {color: var(--primary-color);}

/* Stili per Amministrazione Trasparente */
.page-header {
    background-color: var(--grey-bg);
    padding: 50px 0;
    text-align: center;
    margin-bottom: 50px;
}
.page-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--dark-color);
}

.content-section {
    margin-bottom: 50px;
}
.content-section h2 {
    text-align: left;
    font-size: 1.8rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--grey-bg);
    padding-bottom: 0.8rem;
    margin-bottom: 2rem;
}
.content-section h3 {
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2.5rem;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
th, td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
    vertical-align: top;
}
th {
    background-color: var(--grey-bg);
    font-weight: 600;
    color: var(--dark-color);
}
tbody tr:nth-child(even) {
    background-color: #fdfdfd;
}
tbody tr:hover {
    background-color: #f5f5f5;
}
.total-row td {
    font-weight: bold;
    background-color: #efefef;
}
.info-text {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}
.info-text strong { color: var(--dark-color); }

/* Stili per Pagine Work In Progress */
.wip-section {
    padding: 80px 20px;
    text-align: center;
    min-height: calc(100vh - 150px - 150px); /* Altezza viewport - header - footer approx */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.wip-section .wip-icon {
    margin-bottom: 2rem;
}
.wip-section .wip-icon svg { /* Stile per l'SVG placeholder */
    width: 80px;
    height: 80px;
    fill: var(--primary-color);
}
.wip-section h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 1rem;
}
.wip-section p {
    font-size: 1.2rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 2.5rem auto;
}

/* Scrollbar custom (opzionale, supporto limitato) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: #c5c5c5;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}


/* Responsive */
@media (max-width: 992px) {
    #associazione .columns {
        grid-template-columns: 1fr; /* Colonne in pila */
        text-align: center;
    }
    #associazione .text-content {
        order: 2; /* Testo sotto l'immagine */
    }
    #associazione .image-content {
        order: 1;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .hero-content h1 { font-size: 2.2rem; }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.8rem; margin-bottom: 2rem;}

    .mobile-menu-toggle {
        display: block;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--light-color);
        transition: right 0.3s ease;
        z-index: 1000;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: 100%;
        padding: 2rem;
    }

    nav ul li {
        margin: 1rem 0;
        width: 100%;
        text-align: center;
    }

    nav ul li a {
        display: block;
        padding: 1rem;
        font-size: 1.2rem;
    }

    nav ul li a::after { 
        display: none;
    }

    nav ul li:last-child a {
        margin-bottom: 0;
    }

    nav ul li a:hover, nav ul li a.active {
        color: var(--primary-color);
        background-color: rgba(255, 0, 0, 0.05);
    }

    .event-grid { grid-template-columns: 1fr; } /* Una colonna per eventi su mobile */
    .attivita-grid { grid-template-columns: 1fr; }

    table thead {
        display: none; /* Nasconde l'header della tabella su mobile */
    }
    table, table tbody, table tr, table td {
        display: block;
        width: 100%;
    }
    table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 5px;
        padding: 10px;
        display: flex;
        flex-direction: column;
    }
    table td {
        text-align: right !important;
        padding: 12px 15px 12px 50%;
        position: relative;
        border: none;
        word-wrap: break-word;
        white-space: normal;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: calc(50% - 20px);
        padding-right: 10px;
        font-weight: bold;
        text-align: left;
        white-space: normal;
        word-wrap: break-word;
        display: flex;
        align-items: center;
        min-height: 100%;
    }
    .total-row td::before { content: "";}
    .total-row td:first-child { text-align: right !important; font-weight: bold; }
    .total-row td:nth-child(2) { font-weight: bold; }
}