/* =========================================================
   RESET E CONFIGURAZIONE BASE
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background-color: var(--sfondo);
    color: var(--testo);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--bordeaux);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--bordeaux-scuro);
    text-decoration: underline;
}


/* =========================================================
   PALETTE ISTITUZIONALE & FORMALE (Confraternita)
   ========================================================= */

:root {
    --blu-istituzionale: #0a253e;
    --blu-scuro: #061726;
    
    --bordeaux: #7a1824;
    --bordeaux-scuro: #5c111b;
    
    --oro: #c59b27;
    --oro-chiaro: #f4ecd0;

    --sfondo: #f4f5f7;
    --bianco: #ffffff;
    --testo: #22252a;
    --testo-secondario: #505864;
    
    --verde-ist: #235c43;
    --rosso-ist: #8f3333;

    --ombra-leggera: 0 1px 3px rgba(0, 0, 0, 0.08);
    --ombra: 0 4px 10px rgba(0, 0, 0, 0.08);
    --raggio: 4px;
}


/* =========================================================
   CONTENITORE GENERALE (Invariato orizzontalmente)
   ========================================================= */

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}


/* =========================================================
   HEADER SOLENNE / ISTITUZIONALE (Logo bilanciato)
   ========================================================= */

.header-colore {
    width: 100%;
    height: 95px;
    background: linear-gradient(135deg, var(--blu-scuro), var(--blu-istituzionale));
    color: white;
    border-bottom: 4px solid var(--oro);
}

.header-container {
    position: relative;
    width: 96%;
    max-width: 1250px;
    height: 95px;
    margin: 0 auto;
}

.area-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 66px; /* Misura intermedia calibrata */
}

.area-logo img {
    display: block;
    width: 50px; /* Logo proporzionato e non troppo grande */
    height: auto;
}

.gruppo-testi {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    white-space: nowrap;
}

.titolo-sito {
    margin: 0;
    color: var(--oro);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.8px;
}

.sottotitolo {
    margin-top: 2px;
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}


/* =========================================================
   MENU PRINCIPALE (Più compatto in verticale)
   ========================================================= */

#menu {
    width: 100%;
    background-color: var(--blu-scuro);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

#menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#menu > ul > li {
    display: inline-block;
    position: relative;
}

#menu a {
    display: block;
    padding: 10px 18px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: 0.3px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#menu > ul > li > a:hover {
    color: var(--oro);
    background-color: rgba(255, 255, 255, 0.05);
}


/* =========================================================
   SOTTOMENU
   ========================================================= */

#menu li .hidden {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 100%;
    width: max-content;
    background-color: var(--blu-scuro);
    visibility: hidden;
    opacity: 0;
    border-top: 2px solid var(--oro);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#menu li:hover .hidden {
    visibility: visible;
    opacity: 1;
}

#menu li .hidden li {
    display: block;
}

#menu li .hidden a {
    padding: 8px 14px;
    font-size: 13px;
    text-align: left;
    white-space: nowrap;
}

#menu li .hidden a:hover {
    color: var(--oro);
    background-color: rgba(255, 255, 255, 0.08);
}


/* =========================================================
   MENU MOBILE
   ========================================================= */

.showMenu {
    display: none;
}

#menuToggle {
    display: none;
}


/* =========================================================
   RICHIAMO SOSTIENI (Compatto verticalmente)
   ========================================================= */

.richiamo-sostieni {
    padding: 10px 20px;
    background-color: var(--oro-chiaro);
    border-bottom: 1px solid #ebd9a2;
}

.richiamo-sostieni-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px 20px;
    background-color: var(--bianco);
    border-left: 4px solid var(--oro);
    border-radius: var(--raggio);
    box-shadow: var(--ombra-leggera);
}

.richiamo-sostieni-testo h2 {
    margin-bottom: 2px;
    color: var(--bordeaux);
    font-size: 16px;
    font-family: Georgia, serif;
}

.richiamo-sostieni-testo p {
    color: var(--testo-secondario);
    font-size: 13px;
}

.richiamo-sostieni-link a {
    display: inline-block;
    padding: 6px 14px;
    background-color: var(--bordeaux);
    color: white;
    border-radius: var(--raggio);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.richiamo-sostieni-link a:hover {
    background-color: var(--bordeaux-scuro);
    color: white;
}


/* =========================================================
   HERO SECTION (Meno sviluppata in altezza)
   ========================================================= */

.hero {
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-scuro));
    color: white;
    padding: 25px 20px;
    text-align: center;
    border-bottom: 3px solid var(--oro);
}

.hero .icon img {
    display: block;
    width: 90px;
    height: auto;
    margin: 0 auto 6px auto;
}

.hero h1 {
    margin-bottom: 4px;
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 700;
}

.hero p {
    max-width: 760px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.4;
    opacity: 0.95;
}


/* =========================================================
   INTRO ISTITUZIONALE (Più raccolta)
   ========================================================= */

.intro {
    background-color: var(--bianco);
    padding: 22px 20px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.intro h2 {
    color: var(--bordeaux);
    font-family: Georgia, serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.intro p {
    max-width: 850px;
    margin: 0 auto 6px auto;
    color: var(--testo);
    font-size: 16px;
    line-height: 1.5;
}


/* =========================================================
   SERVIZI (Griglia orizzontale inalterata, box più bassi)
   ========================================================= */

.services {
    padding: 25px 20px;
    background-color: var(--sfondo);
}

.section-title {
    color: var(--blu-istituzionale);
    text-align: center;
    font-family: Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 18px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.service-card {
    display: flex;
    flex-direction: column;
    background-color: var(--bianco);
    border-radius: var(--raggio);
    padding: 18px;
    border-top: 4px solid var(--bordeaux);
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: var(--ombra-leggera);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--ombra);
}

.service-card h3 {
    color: var(--bordeaux);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.service-card p {
    color: var(--testo-secondario);
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 10px;
}

.service-card p:last-child {
    margin-top: auto;
    margin-bottom: 0;
}

.service-card a {
    color: var(--bordeaux);
    font-weight: 600;
    font-size: 13px;
}


/* =========================================================
   BOX INFORMAZIONI E COMUNITÀ
   ========================================================= */

.info {
    padding: 25px 20px;
    background-color: var(--bianco);
}

.info-box {
    max-width: 900px;
    margin: 0 auto;
    background-color: #faf7f2;
    border-radius: var(--raggio);
    padding: 20px 24px;
    text-align: center;
    border: 1px solid #e6ded1;
    border-left: 4px solid var(--oro);
    box-shadow: var(--ombra-leggera);
}

.info-box h2 {
    color: var(--bordeaux);
    font-family: Georgia, serif;
    font-size: 20px;
    margin-bottom: 6px;
}

.info-box p {
    color: var(--testo);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 6px;
}


/* =========================================================
   ORARI / SCHEDULE
   ========================================================= */

.schedule {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 14px 0 0;
}

.schedule-item {
    flex: 0 1 200px;
    background-color: white;
    padding: 10px 14px;
    border-radius: var(--raggio);
    min-width: 170px;
    border: 1px solid #e2e8f0;
    border-top: 3px solid var(--blu-istituzionale);
    box-shadow: var(--ombra-leggera);
}

.schedule-item strong {
    display: block;
    color: var(--bordeaux);
    font-size: 15px;
    margin-bottom: 2px;
}


/* =========================================================
   SEZIONE CONTATTI / SUPPORTO
   ========================================================= */

.appointment {
    background: linear-gradient(135deg, var(--blu-istituzionale), var(--blu-scuro));
    color: white;
    padding: 28px 20px;
    text-align: center;
    border-top: 4px solid var(--oro);
}

.appointment h2 {
    font-family: Georgia, serif;
    font-size: 22px;
    margin-bottom: 6px;
}

.appointment p {
    max-width: 800px;
    margin: 0 auto 14px;
    font-size: 15px;
    line-height: 1.45;
    opacity: 0.95;
}

.contact-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.contact {
    display: block;
    background-color: white;
    color: var(--blu-istituzionale);
    padding: 10px 20px;
    border-radius: var(--raggio);
    min-width: 200px;
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.contact:hover {
    background-color: var(--oro-chiaro);
    color: var(--bordeaux);
}


/* =========================================================
   TESTO PAGINE INTERNE
   ========================================================= */

.testo-pagina {
    width: 100%;
    max-width: 850px;
    margin: 25px auto;
    text-align: left;
    font-size: 15px;
    line-height: 1.6;
    color: var(--testo);
    padding: 0 20px;
}

.testo-pagina p {
    margin: 0 0 12px 0;
}


/* =========================================================
   FARMACI / REGOLE DONAZIONE
   ========================================================= */

.farmaci-regole {
    padding: 25px 20px;
    background-color: var(--sfondo);
}

.farmaci-liste {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 1000px;
    margin: 0 auto;
    align-items: start;
}

.farmaci-liste > div {
    padding: 20px;
    background-color: white;
    border-radius: var(--raggio);
    border: 1px solid #e2e8f0;
    box-shadow: var(--ombra-leggera);
}

.lista-donare {
    border-left: 4px solid var(--verde-ist);
}

.lista-non-donare {
    border-left: 4px solid var(--rosso-ist);
}

.farmaci-liste h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-family: Georgia, serif;
}

.lista-donare h3 {
    color: var(--verde-ist);
}

.lista-non-donare h3 {
    color: var(--rosso-ist);
}

.farmaci-liste ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.farmaci-liste li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 6px;
    line-height: 1.45;
    font-size: 13px;
}

.farmaci-liste .si {
    color: var(--verde-ist);
    font-weight: bold;
}

.farmaci-liste .no {
    color: var(--rosso-ist);
    font-weight: bold;
}


/* =========================================================
   TIMELINE STORICA
   ========================================================= */

.history-section {
    padding: 30px 20px;
    background-color: var(--sfondo);
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 25px auto 0;
    padding: 10px 0;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--bordeaux);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 10px 35px;
    box-sizing: border-box;
    margin-bottom: 20px;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

.timeline-year {
    position: absolute;
    top: 14px;
    width: 90px;
    min-height: 38px;
    padding: 4px;
    background-color: var(--bordeaux);
    color: white;
    border-radius: var(--raggio);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 13px;
    font-weight: 700;
    z-index: 10;
    box-shadow: var(--ombra-leggera);
}

.timeline-item:nth-child(odd) .timeline-year {
    right: -45px;
}

.timeline-item:nth-child(even) .timeline-year {
    left: -45px;
}

.timeline-year span {
    font-size: 10px;
    font-weight: normal;
}

.timeline-content {
    background-color: white;
    padding: 18px;
    border-radius: var(--raggio);
    border: 1px solid #e2e8f0;
    box-shadow: var(--ombra);
    border-top: 3px solid var(--bordeaux);
}

.timeline-content h3 {
    margin-top: 0;
    margin-bottom: 6px;
    color: var(--bordeaux);
    font-family: Georgia, serif;
    font-size: 17px;
}

.timeline-content p {
    line-height: 1.5;
    margin-bottom: 6px;
    font-size: 13px;
}

.timeline-final .timeline-content {
    border-top-color: var(--oro);
}

.timeline-final .timeline-year {
    background-color: var(--oro);
    color: var(--blu-scuro);
}


/* =========================================================
   FOOTER ISTITUZIONALE
   ========================================================= */

footer {
    width: 100%;
    height: 95px;
    background: linear-gradient(135deg, var(--blu-scuro), var(--blu-istituzionale));
    color: white;
    border-top: 4px solid var(--oro);
}

.pfondo1 {
    width: 100%;
    padding: 18px 10px;
    text-align: center;
    font-size: 13px;
    line-height: 1.5;
}

.pfondo1 a {
    color: var(--oro);
    text-decoration: none;
}

.pfondo1 a:hover {
    text-decoration: underline;
}


/* =========================================================
   MEDIA QUERIES (RESPONSIVE)
   ========================================================= */

@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {
    .header-colore {
        height: 80px;
    }

    .header-container {
        height: 80px;
        width: 94%;
    }

    .area-logo {
        width: 44px; /* Logo leggermente ridotto anche su mobile */
    }

    .area-logo img {
        width: 35px;
    }

    .gruppo-testi {
        left: 58%;
        max-width: 70%;
        white-space: normal;
    }

    .titolo-sito {
        font-size: 18px;
    }

    .sottotitolo {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .showMenu {
        display: block;
        width: 40px;
        margin: 4px auto;
        padding: 2px 0;
        border: 1px solid var(--blu-scuro);
        border-radius: var(--raggio);
        background-color: var(--blu-scuro);
        color: white;
        text-align: center;
        font-size: 18px;
        cursor: pointer;
    }

    #menu {
        display: none;
    }

    #menuToggle:checked ~ #menu {
        display: block;
    }

    #menu > ul > li {
        display: block;
    }

    #menu a {
        width: 100%;
        padding: 8px;
        text-align: center;
    }

    #menu li .hidden {
        position: static;
        width: 100%;
        visibility: visible;
        opacity: 1;
        background-color: #061726;
        box-shadow: none;
    }

    #menu li .hidden li {
        display: block;
    }

    .services-grid,
    .farmaci-liste {
        grid-template-columns: 1fr;
    }

    .richiamo-sostieni-box {
        flex-direction: column;
        text-align: center;
    }

    .timeline::before {
        left: 20px;
        transform: none;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        width: 100%;
        left: 0;
        padding: 8px 10px 16px 45px;
        text-align: left;
    }

    .timeline-item:nth-child(odd) .timeline-year,
    .timeline-item:nth-child(even) .timeline-year {
        left: -10px;
        right: auto;
        top: 10px;
        width: 55px;
        min-height: 34px;
        font-size: 11px;
    }
}
/* =========================================================
   LOGO NUTRIZIONISTA
   ========================================================= */

.logo-nutrizionista {
    display: block;
    width: 250px;
    max-width: 80%;
    height: auto;
    margin: 0 auto;
}

@media (max-width: 800px) {

    .logo-nutrizionista {
        width: 200px;
        max-width: 75%;
    }
}

@media (max-width: 500px) {

    .logo-nutrizionista {
        width: 160px;
        max-width: 70%;
    }
}

@media (max-width: 400px) {

    .logo-nutrizionista {
        width: 140px;
        max-width: 70%;
    }
}
/* =========================================================
   PROTEZIONE CIVILE - FOTO + TESTO AFFIANCATI
   ========================================================= */

.transport-service {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 25px;
    margin-bottom: 20px;
}

/* Contenitore della foto */
.transport-service .service-image {
    flex: 0 0 35%;
}

/* Foto */
.transport-service .service-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--raggio);
}

/* Contenitore del testo */
.transport-service .service-content {
    flex: 1;
}

/* Titolo */
.transport-service .service-content h3 {
    margin-bottom: 8px;
}

/* Paragrafi */
.transport-service .service-content p {
    margin-bottom: 10px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 800px) {

    .transport-service {
        flex-direction: column;
        align-items: stretch;
    }

    .transport-service .service-image {
        flex: none;
        width: 100%;
    }

    .transport-service .service-image img {
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .transport-service .service-content {
        width: 100%;
    }
}
