/* Layout mobile-first con flex per corpo pagina */
:root {
    --font-size: 15px;
    --fontfamily-primary: Nunito;
    --fontfamily-headers: Poppins;
    --fontfamily-nav: RobotoCondensed;
    --primary-color: rgb(1, 67, 145);
    --primary-transparent: rgb(1, 67, 145, 0.9);
    --highlight-color: rgb(252, 285, 0);
    --text-color: #222;
}
@font-face {
    font-family: "RobotoCondensed";
    src:
        url("./fonts/RobotoCondensed-Medium.woff2") format("woff2"),
        url("./fonts/RobotoCondensed-Medium.ttf") format("ttf");
    font-weight: 500;
    font-style: normal;
}
@font-face {
    font-family: "Poppins";
    src:
        url("./fonts/Poppins-ExtraBoldItalic.woff2") format("woff2"),
        url("./fonts/Poppins-ExtraBoldItalic.ttf") format("ttf");
    font-weight: 800;
    font-style: italic;
}
@font-face {
    font-family: "Nunito";
    src:
        url("./fonts/Nunito-Regular.woff2") format("woff2"),
        url("./fonts/Nunito-Regular.ttf") format("ttf");
    font-weight: 400;
    font-style: normal;
}
@font-face {
    font-family: "Nunito";
    src:
        url("./fonts/Nunito-Bold.woff2") format("woff2"),
        url("./fonts/Nunito-Bold.ttf") format("ttf");
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: "Nunito";
    src:
        url("./fonts/Nunito-Italic.woff2") format("woff2"),
        url("./fonts/Nunito-Italic.ttf") format("ttf");
    font-weight: 400;
    font-style: italic;
}
@font-face {
    font-family: "Nunito";
    src:
        url("./fonts/Nunito-BoldItalic.woff2") format("woff2"),
        url("./fonts/Nunito-BoldItalic.ttf") format("ttf");
    font-weight: 700;
    font-style: italic;
}
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 150px; /* dimensione minima pagina */
    font-family:
        var(--fontfamily-primary), "Segoe UI", "Helvetica Neue", Arial,
        "Noto Sans", "Liberation Sans", sans-serif;
    font-size: var(--font-size);
}

a,
a:visited {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4 {
    font-family: var(--fontfamily-headers);
    color: var(--primary-color);
}

main {
    flex: 1;
    padding: 1rem;
    box-sizing: border-box;
    max-width: 100%;
}
.hosth {
    display: none;
}
header {
    display: flex;
    min-height: 32px;
    overflow: visible;
    align-items: center;
    justify-content: space-between; /* logo a sinistra, hamburger a destra */
    background: var(--primary-color);
    color: #fff;
    padding: 0.5rem 1rem;
    position: relative;
}
.logo {
    position: relative;
    width: 20%;
    color: #fff;
    user-select: none;
}

.logo img {
    position: absolute;
    top: -20px;
    left: -10px;
    max-width: 150px;
    max-height: 150px;
    width: 100%;
    height: auto;
    display: block;
}
/* Nascondo checkbox */
.menu-btn {
    display: none;
}

/* Icona hamburger */
.menu-icon {
    display: none;
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    position: relative;
    flex-shrink: 0;
}
.menu-icon span,
.menu-icon span::before,
.menu-icon span::after {
    display: block;
    position: absolute;
    height: 4px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s;
    left: 0;
}
.menu-icon span {
    top: 50%;
    transform: translateY(-50%);
}
.menu-icon span::before {
    content: "";
    top: -10px;
}
.menu-icon span::after {
    content: "";
    top: 10px;
}

/* Menu di navigazione */
nav {
    margin-left: 1rem;
}
.menu {
    display: flex;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.menu li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 0.2rem;
    transition: color 0.2s;
    user-select: none;
    font-family: var(--fontfamily-nav);
    font-weight: 500;
    text-transform: uppercase;
}
.menu li a:hover,
.menu li a:focus {
    text-decoration: underline;
    color: var(--highlight-color);
}

/* MOBILE STYLES */
@media (max-width: 600px) {
    nav {
        margin-left: 0;
        position: absolute;
        top: 3.5rem;
        left: 0;
        width: 100%;
        background: var(--primary-transparent);
        z-index: 10;
    }
    .menu {
        display: none;
        flex-direction: column;
        gap: 0;
    }
    .menu li {
        text-align: center;
        margin: 0.5rem 0;
    }
    /* Mostro menu se checkbox checked */
    .menu-btn:checked ~ nav .menu {
        display: flex;
    }
    /* Mostro hamburger */
    .menu-icon {
        display: block;
    }
    /* Animazione hamburger quando aperto */
    .menu-btn:checked + .menu-icon span {
        background: transparent;
    }
    .menu-btn:checked + .menu-icon span::before {
        top: 0;
        transform: rotate(45deg);
    }
    .menu-btn:checked + .menu-icon span::after {
        top: 0;
        transform: rotate(-45deg);
    }
}

/* Footer */
footer {
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

footer ::selection {
    background: var(--text-color);
}

/* --- Contenuto principale --- */

/* Sezione principale a tutta larghezza */
.hero-section {
    width: 100%;
    background: transparent;
    padding: 3rem 1rem 2rem 1rem;
    box-sizing: border-box;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}
.hero-section h1 {
    margin: 0 0 1rem;
    font-family: var(--fontfamily-headers);
    text-transform: uppercase;
    font-size: 2rem;
    color: var(--primary-color);
}
.hero-section p {
    margin: 0;
    font-size: 1.1rem;
    color: #555;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}
.full-viewport-width {
    width: 100vw;
    object-fit: scale-down;
    display: block;
}

/* Container per i blocchi */
.blocks-container {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center; /* centra i blocchi se c’è spazio */
}

/* Singolo blocco */
.block {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    max-width: 512px;
    width: 100%; /* mobile full width */
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    user-select: none;
    transition: transform 0.2s ease;
}
.block:hover,
.block:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    outline: none;
}

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

/* Immagine nel blocco */
.block img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Descrizione */
.block-description {
    padding: 1rem;
    color: #333;
    font-size: 1rem;
    line-height: 1.4;
}

/* Su schermi più larghi, blocchi affiancati */
@media (min-width: 600px) {
    .block {
        width: calc(50% - 0.5rem); /* due per riga con gap */
    }
}
@media (min-width: 1024px) {
    .block {
        width: calc(33.33% - 0.66rem); /* tre per riga */
    }
}
article p,
article li {
    color: var(--text-color);
    line-height: 150%;
}
