* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    min-height: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Nunito Sans', sans-serif;
    background: #fff;
}

.site-header,
#header {
    flex-shrink: 0;
}

.site-content {
    flex: 1 0 auto;
    width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

.full-width {
    width: 100%;
}

a {
    color: inherit;
}

#header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    border-bottom: 1px solid #333;
}

#header .logo {
    background-color: #000;
}

#header .logo img {
    height: 100%;
}

#current-section {
    text-transform: uppercase;
    padding: 25px;
}

#current-section .title {
    font-size: 22px;
}

#current-section h1 {
    font-weight: bold;
    font-size: 38px;
    line-height: .8;
    margin-top: 4px;
}

.main-menu {
    text-transform: uppercase;
    font-size: 18px;
    text-align: center;
    border-left: 1px solid #000;
    display: grid;
    grid-column-start: 1;
    grid-column-end: 3;
}

.main-menu li:not(:last-child) {
    border-bottom: 1px solid #000;
}

.main-menu a {
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: all .3s;
    padding: 10px 0;
}


.main-menu a:hover, .main-menu a:focus, .main-menu li.active a {
    background-color: #000;
    color: #fff;
}


#header .languages {
    text-align: right;
    margin: 0;
    display: flex;
    align-items: center;
}

#header .languages a {
    text-decoration: none;
}

#header .languages a.active {
    text-decoration: underline;
}

#breadcrumbs {
    padding: 15px;
    color: #333;
}

.section-blog #breadcrumbs {
    border-bottom: 1px solid #333;
}

#breadcrumbs a {
    padding: 0 5px;
    display: inline-block;
    text-decoration: none;
}

#breadcrumbs .current {
    padding: 0 5px;
    font-weight: bold;
}

#breadcrumbs > a:hover {
    text-decoration: underline;
}

#breadcrumbs #share {
    position: absolute;
    top: 0;
    right: 0;
}

#board {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.square.desktop, .square.mobile {
    display: none;
}

.block span[style] {
    color: #000 !important;
}

.block.text[style] {
    background-color: #fff !important;
}

.block {
    outline: 1px solid #333;
    line-height: 1.55;
    background-color: #fff;
    position: relative;
    min-width: 0;
    height: auto;
    min-height: 0;
}

.block.spacer {
    outline: none;
    background: transparent;
    padding: 0;
    border: 0;
    pointer-events: none;
}

.block.text {
    padding: 1.15rem 1.25rem;
}

.block > a {
    display: block;
}

.block > a > h2 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 22px;
    line-height: 1;
    font-weight: bold;
    padding: 5px 10px;
}

.block > a > h2.mostra-title {
    bottom: 50%;
}

.block > a > h2.title-right {
    text-align: right;
}

.block.image h2 {
    color: #000;
    background: rgba(255,255,255,.5);
}

.block.image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

.block.image.cover img {
    object-fit: cover;
    width: 100%;
    aspect-ratio: 4 / 3;
}

.block.contain.image img {
    object-fit: contain;
    display: block;
    margin: 0 auto;
}


.block h2, .block .title {
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: bold;
    margin: 0 0 0.5rem;
}

.block .uppercase {
    text-transform: uppercase;
}

.block.arrow {
    padding: 1.25rem;
    min-height: 4.5rem;
}

.block.arrow a,
.block.arrow > span {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 3rem;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
}

.block .arrow a .chevron {
    position: absolute;
}
.block .arrow a .chevron.down {
    bottom: 0;
}
.block .arrow a .chevron.up {
    top: 0;
}
.block .arrow a .chevron.right {
    right: 10px;
}
.block .arrow a .chevron.left {
    left: 10px;
}


 



/* FRECCE */

.block.prev, .block.next {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    line-height: 1;
    min-height: 4.5rem;
}

.block.prev a, .block.next a {
    width: 100%;
    min-height: 4.5rem;
    align-items: center;
    display: flex;
    text-decoration: none;
    justify-content: center;
    transition: all .3s;
}

.block.prev a:hover, .block.next a:hover, .block.prev a:focus, .block.next a:focus {
    background: #000;
    color: #fff;
}

#footer {
    border-top: 1px solid #333;
}

#footer .logo {
    display: none;
    align-items: center;
    justify-content: center;
}

#footer .logo img {
    width: 40%;
}

#footer .contacts {
    font-size: 16px;
    line-height: 1.3;
    text-align: center;
    padding: 25px;
}

#footer .contacts h2 {
    text-transform: uppercase;
}

#footer .socials {
    margin: 30px 0;
}

/*
 * BLOG
 */

.section-blog .picture, .section-blog .post {
    border-top: 1px solid #333;
    border-right: 1px solid #333;
}

.section-blog .picture:nth-child(-n+4), .section-blog .post:nth-child(-n+4) {
    border-top: none;
}


.section-blog .picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.section-blog .post {
    padding: 20px;
    overflow: scroll;
}

.section-blog .post h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

.section-blog .post .date {
    text-transform: uppercase;
    color: #666;
    margin-bottom: 10px;
    font-size: 14px;
}

.section-blog .post .text {
    line-height: 1.3;
}

.section-blog .post .text p {
    margin-bottom: .8em;
}

#blog-post {
    display: flex;
    height: 50vw;
}

#blog-post .picture, #blog-post .post {
    width: 50%;
}

/*
 * END BLOG
 */


/*
 * MOBILE: stack full-width, altezza dal contenuto
 */

@media (max-width: 699px) {
    #board {
        grid-template-columns: 1fr 1fr;
        gap: 1.15rem;
        padding: 0 0 1.5rem;
    }

    #board > .block {
        width: 100% !important;
        grid-column: 1 / -1 !important;
        height: auto !important;
        min-height: 0 !important;
    }

    #board > .block.hide-mobile,
    #board > .block.height-mobile-0 {
        display: none !important;
    }

    .block.text {
        padding: 1.25rem 1.15rem;
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* Frecce prec/succ sulla stessa riga */
    #board > .block.prev,
    #board > .block.next {
        width: auto !important;
        font-size: 2rem;
        min-height: 3.75rem;
    }

    #board > .block.prev {
        grid-column: 1 / 2 !important;
    }

    #board > .block.next {
        grid-column: 2 / 3 !important;
    }

    .block.prev a,
    .block.next a {
        min-height: 3.75rem;
    }
}

/* START desktop style */

@media (min-width: 700px) {

    #header {
        grid-template-columns: 1fr 2fr 1fr;
        align-items: center;
    }

    .main-menu {
        grid-column-start: auto;
        grid-column-end: auto;
    }

    #board {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: auto;
        gap: 1rem;
        padding: 0 1rem 2rem;
        max-width: 80rem;
        margin: 0 auto;
        /* Stessa altezza per gli elementi sulla stessa riga */
        align-items: stretch;
    }

    #board > .block {
        height: auto;
        min-height: 0;
        align-self: stretch;
    }

    #footer {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
    }

    #footer .contacts {
        display: flex;
        align-items: center;
    }

    #footer .logo {
        display: flex;
    }

    .block.width-1 {
        grid-column: span 1;
    }
    .block.width-2 {
        grid-column: span 2;
    }
    .block.width-3 {
        grid-column: span 3;
    }
    .block.width-4 {
        grid-column: span 4;
    }

    /* Altezze fisse disattivate: restano no-op per classi legacy */
    .block.height-1,
    .block.height-2,
    .block.height-3,
    .block.height-4 {
        height: auto;
        grid-row-end: auto;
    }

    .block.fullpage {
        grid-column: 2 / span 2;
    }

    /* Immagini: riempiono l'altezza della riga */
    #board .block.image {
        display: flex;
        flex-direction: column;
        padding: 0;
        overflow: hidden;
    }

    #board .block.image > a {
        flex: 1 1 auto;
        display: flex;
        min-height: 0;
        height: 100%;
    }

    #board .block.image img {
        width: 100%;
        height: 100%;
        flex: 1 1 auto;
        min-height: 12rem;
        aspect-ratio: auto;
        object-fit: cover;
    }

    #board .block.image.contain img {
        object-fit: contain;
    }

    #board .block.text {
        display: flex;
        flex-direction: column;
    }

    #board .block.prev,
    #board .block.next {
        align-self: stretch;
    }

} /* End desktop style */


/*
 * Form
 */

.block label {
    display: block;
    text-transform: uppercase;
}

.block input[type=text], .block input[type=email] {
    width: 100%;
    font-size: 18px;
    font-weight: bold;
    padding: 5px;
    border: none;
    border-bottom: 2px dashed #333;
    font-family: inherit;
}

.block textarea {
    width: 100%;
    font-size: 18px;
    font-weight: bold;
    padding: 5px;
    border: none;
    background: #eee;
    font-family: inherit;
}


.block input[type=submit] {
    height: 20%;
    width: 100%;
    font-size: 18px;
    padding: 5px 20px;
    border: none;
    background: #eee;
    font-family: inherit;
    text-transform: uppercase;
    cursor: pointer;
    transition: all .3s;
}

.block input[type=submit]:focus, .block input[type=submit]:hover {
    background: #000;
    color: #fff;
}