/* -------------------- STILE GENERALE -------------------- */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
}

/* -------------------- GRIGLIA PRINCIPALE -------------------- */
#page {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 260px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header header"
        "left   middle right"
        "footer footer footer";
    gap: 12px;
    padding: 10px;
}

/* -------------------- HEADER -------------------- */
#header {
    grid-area: header;
    background: #ffffff;
    padding: 8px 20px;
    border-bottom: 2px solid #ccc;
    border-radius: 8px;
}

/* Logo + titolo + Home nella stessa riga */
.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between; /* logo a sx, home a dx */
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    max-width: 110px;
}

.header-title {
    font-size: 28px;
    margin: 0;
    color: #003366;
}

/* Pulsante Home */
nav a {
    text-decoration: none;
    color: #003366;
    font-size: 18px;
    padding: 16px 14px;
    border: 2px solid #003366;
    border-radius: 6px;
    transition: 0.3s;
}

nav a:hover {
    background: #003366;
    color: white;
}

/* -------------------- COLONNE LATERALI -------------------- */
#left, #right {
    background: #ffffff;
    border: 2px solid #ccc;
    border-radius: 8px;
    text-align: center;
    padding-top: 20px;
}

.side-img {
    max-width: 90%;
}

/* -------------------- COLONNA CENTRALE -------------------- */
#middle {
    grid-area: middle;
    background: #ffffff;
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 20px;
}

#middle h2 {
    text-align: center;
    margin-top: 0;
    color: #003366;
}

/* Cards 2×3 */
.cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Link sempre sopra l'immagine */
.card {
    background: #fafafa;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    transition: 0.3s;
    display: flex;
    flex-direction: column; /* forza link sopra immagine */
    gap: 10px;
}

.card:hover {
    transform: scale(1.03);
    border-color: #003366;
}

.card a {
    text-decoration: none;
    color: #003366;
    font-size: 18px;
}

.card {
    display: flex;
    flex-direction: column;
    align-items: center;   /* <--- centra orizzontalmente */
    gap: 10px;
}
.card img {
    max-width: 90%;
    height: auto;
}

/* -------------------- FOOTER -------------------- */
footer {
    grid-area: footer;
    background: #003366;
    color: white;
    text-align: center;
    padding: 20px;
    border-radius: 8px;
}

/* -------------------- RESPONSIVE -------------------- */
@media (max-width: 900px) {
    #page {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "middle"
            "left"
            "right"
            "footer";
    }

    .cards {
        grid-template-columns: 1fr;
    }

    .header-flex {
        flex-direction: column;
        gap: 10px;
    }
}


