/* Chrome sito: header/footer compatti (sovrascrive grid.css) */

.site-header {
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    height: auto !important;
    min-height: 0 !important;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #333;
    background: #fff;
}

.site-header .site-logo {
    display: flex;
    align-items: center;
    justify-self: start;
    background: #000;
    padding: 0.35rem 0.55rem;
}

.site-header .site-logo img {
    display: block;
    height: 2rem;
    width: auto;
    max-height: none;
}

.site-nav {
    justify-self: center;
    min-width: 0;
}

.site-header .main-menu {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.15rem 0.35rem;
    border: 0 !important;
    grid-column: auto !important;
    text-align: center;
    font-size: 0.85rem;
}

.site-header .languages {
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: flex-end;
    justify-self: end;
    gap: 0.35rem;
    margin: 0 !important;
    height: 100%;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    line-height: 1;
}

.site-header .languages a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    padding: 0.4rem 0.35rem;
    line-height: 1;
}

.site-header .languages a.active,
.site-header .languages a:hover,
.site-header .languages a:focus {
    text-decoration: underline;
    color: #000;
}

.site-header .main-menu li {
    border: 0 !important;
}

.site-header .main-menu a {
    display: inline-flex;
    align-items: center;
    height: auto;
    padding: 0.4rem 0.65rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.site-header .main-menu a:hover,
.site-header .main-menu a:focus,
.site-header .main-menu li.active a {
    background: #000;
    color: #fff;
}

.page-heading {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 0.25rem;
}

.page-heading h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
}

#breadcrumbs {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.75rem 1.25rem 0;
    font-size: 0.9rem;
}

.site-footer {
    height: auto !important;
    display: block !important;
    flex-shrink: 0;
    margin-top: auto;
    border-top: 1px solid #333;
    background: #111;
    color: #f4f4f4;
}

.site-footer .footer-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.25rem 2rem;
    align-items: center;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem 1.25rem;
}

.site-footer .footer-brand {
    display: flex !important;
    align-items: center;
}

.site-footer .footer-brand img {
    width: 7rem;
    height: auto;
    max-height: none;
}

.site-footer .footer-meta {
    font-size: 0.9rem;
    line-height: 1.5;
}

.site-footer .footer-meta p {
    margin: 0;
}

.site-footer .footer-socials {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.85rem;
    font-size: 1.35rem;
}

.site-footer .footer-socials a,
.site-footer .footer-links a,
.site-footer .footer-meta a {
    color: inherit;
    text-decoration: none;
}

.site-footer .footer-socials a:hover,
.site-footer .footer-socials a:focus {
    opacity: 0.75;
}

.site-footer .footer-links a:hover,
.site-footer .footer-links a:focus,
.site-footer .footer-meta a:hover {
    text-decoration: underline;
}

.site-footer .footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    text-align: right;
}

@media (max-width: 48rem) {
    .site-header {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "logo langs"
            "nav nav";
        padding: 0.75rem;
        gap: 0.65rem;
    }

    .site-header .site-logo {
        grid-area: logo;
    }

    .site-nav {
        grid-area: nav;
        justify-self: center;
    }

    .site-header .languages {
        grid-area: langs;
    }

    .site-header .main-menu {
        justify-content: center;
        font-size: 0.8rem;
    }

    .site-header .main-menu a {
        padding: 0.35rem 0.5rem;
    }

    .page-heading {
        padding: 1rem 1.15rem 0.15rem;
    }

    .site-footer .footer-inner {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: left;
    }

    .site-footer .footer-links {
        text-align: left;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }
}

/* Integrazioni griglia + liste (blog/mostre) */

/* Frecce prec/succ: sempre ultima riga, sinistra / destra */
.block.prev {
    grid-column-start: 1;
}

.block.next {
    grid-column: -2 / -1;
}

/* Tipografia board: testo leggibile */
#board .block.text .pagetext,
#board .block .pagetext {
    font-size: 1.05rem;
    line-height: 1.65;
}

#board .block.text .pagetext p,
#board .block .pagetext p {
    margin: 0 0 0.9em;
}

#board .block.text .pagetext p:last-child,
#board .block .pagetext p:last-child {
    margin-bottom: 0;
}

#board .block.text .pagetext ul,
#board .block.text .pagetext ol {
    margin: 0 0 0.9em;
    padding-left: 1.25em;
    list-style: revert;
}

#board .block.image {
    padding: 0;
    overflow: hidden;
}

/* Pagine editoriali (cookie, privacy, …): non applicare hide-mobile della board */
.page-content #board > .block.hide-mobile,
.page-content #board > .block.height-mobile-0 {
    display: block !important;
}

@media (min-width: 700px) {
    /* Allinea i bordi inferiori sulla stessa riga della board */
    #board {
        align-items: stretch;
    }

    #board .block.image.cover img,
    #board .block.image img {
        aspect-ratio: auto;
        height: 100%;
        min-height: 12rem;
    }
}

.blog-list,
.mostre-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 2.75rem 2rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 4rem;
    list-style: none;
}

.mostra-card a,
.blog-item a {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid #d8d8d8;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.mostra-card a:hover,
.mostra-card a:focus,
.blog-item a:hover,
.blog-item a:focus {
    border-color: #bdbdbd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 10px 24px rgba(0, 0, 0, 0.1);
}

.mostra-card h2,
.blog-item h2 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.3;
    padding: 1rem 1rem 1.1rem;
}

.mostra-card img,
.blog-item img,
.blog-hero img {
    display: block;
    width: 100%;
    height: auto;
}

.mostra-card img,
.blog-item img {
    margin: 0;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eee;
    border-bottom: 1px solid #ececec;
}

.page-list {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
}

.blog-intro,
.home-fallback {
    max-width: 46rem;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 0.5rem;
    line-height: 1.65;
}

.page-blog-index,
.page-blog-post {
    background: #fff;
}

.page-blog-index .page-heading {
    padding-bottom: 0.5rem;
}

.blog-post {
    max-width: 42rem;
    margin: 0 auto;
    padding: 0.5rem 1.5rem 4rem;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #111;
    background: #fff;
}

.blog-post .post-title {
    font-size: clamp(1.6rem, 3.5vw, 2.35rem);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.blog-post time,
.blog-item time {
    display: block;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.blog-item time {
    order: 2;
    margin: 0;
    padding: 0.9rem 1rem 0.35rem;
}

.blog-item h2 {
    order: 3;
}

.blog-item img {
    order: 1;
}

.blog-hero {
    margin: 0 0 1.75rem;
}

.blog-post .section-body,
.blog-intro {
    line-height: 1.7;
}

.blog-post .section-body p,
.blog-intro p {
    margin: 0 0 1.15em;
}

.blog-post .section-body h2,
.blog-post .section-body h3,
.blog-post .section-body h4 {
    font-weight: 700;
    line-height: 1.25;
    margin: 1.6em 0 0.6em;
}

.blog-post .section-body h2 {
    font-size: 1.45rem;
}

.blog-post .section-body h3 {
    font-size: 1.2rem;
}

.blog-post .section-body ul,
.blog-post .section-body ol {
    margin: 0 0 1.15em;
    padding-left: 1.35em;
    list-style: revert;
}

.blog-post .section-body li {
    margin-bottom: 0.4em;
}

.blog-post .section-body li + li {
    margin-top: 0.25em;
}

.blog-post .section-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.25em 0;
}

.blog-post .section-body a {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.blog-post .section-body blockquote {
    margin: 1.25em 0;
    padding: 0.25em 0 0.25em 1em;
    border-left: 3px solid #333;
    line-height: 1.65;
}

.blog-post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 3rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    color: #111;
}

.blog-post-nav a {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.blog-post-nav a:hover .blog-post-nav__title,
.blog-post-nav a:focus .blog-post-nav__title {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.blog-post-nav__next {
    text-align: right;
    justify-self: end;
}

.blog-post-nav__label {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.65;
}

.blog-post-nav__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.blog-post-nav__empty {
    display: none;
}

@media (max-width: 30rem) {
    .blog-post-nav {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .blog-post-nav__next {
        text-align: left;
        justify-self: stretch;
    }
}

@media (max-width: 699px) {
    #board > .block.prev {
        grid-column: 1 / 2 !important;
        width: auto !important;
    }

    #board > .block.next {
        grid-column: 2 / 3 !important;
        width: auto !important;
    }
}

@media (max-width: 48rem) {
    #board > .block.hide-mobile,
    #board > .block.height-mobile-0 {
        display: none !important;
    }

    #board .block.text .pagetext,
    #board .block .pagetext {
        font-size: 1.0625rem;
        line-height: 1.75;
    }

    .blog-list,
    .mostre-list {
        gap: 2.25rem;
        padding: 1.25rem 1.15rem 3.5rem;
        grid-template-columns: 1fr;
    }

    .blog-post {
        max-width: none;
        padding: 1.25rem 1.15rem 3rem;
        font-size: 1.0625rem;
        line-height: 1.75;
    }

    .blog-post .section-body p,
    .blog-intro p {
        margin-bottom: 1.25em;
    }

    .blog-hero {
        margin-bottom: 1.5rem;
        margin-left: -1.15rem;
        margin-right: -1.15rem;
    }

    .blog-hero img {
        width: 100%;
    }
}

/* 404 / errori */
.template-404 {
    background: #fff;
}

.error-page {
    max-width: 36rem;
    margin: 0 auto;
    padding: 4rem 1.5rem 5rem;
    text-align: center;
    color: #111;
}

.error-page__code {
    margin: 0 0 0.75rem;
    font-size: clamp(3.5rem, 12vw, 5.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
}

.error-page h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

.error-page__text {
    margin: 0 0 2rem;
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.75;
}

.error-page__home {
    display: inline-block;
    padding: 0.7rem 1.25rem;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.error-page__home:hover,
.error-page__home:focus {
    background: #333;
}
