/*
 * Studio Be4 - Responsive
 *
 * Caricato dopo style.css. Raccoglie le correzioni per le varie risoluzioni e gli
 * stili che prima erano scritti inline in header.php e footer.php.
 * Il design resta quello di style.css: qui si sistemano sovrapposizioni, tagli e spazi.
 *
 * 1. Contenuti fluidi     2. Testata e titoli    3. Menu
 * 4. Pulsanti circolari   5. Form                6. Blocchi di pagina
 * 7. 404                  8. Footer
 */

/* ------------------------------------------------------------------ 1. Contenuti fluidi */
.testo-studio-be4 img,
.blog-extra img,
.studio-be4-descrizione img,
.single-image img {
    max-width: 100%;
    height: auto;
}

.testo-studio-be4 iframe,
.blog-extra iframe,
.studio-be4-descrizione iframe {
    max-width: 100%;
}

.testo-studio-be4,
.blog-extra,
.studio-be4-descrizione,
h1.articolo-titolo,
h2.articolo-s-titolo,
#breadcrumbs {
    overflow-wrap: break-word;
}

.testo-studio-be4 table,
.blog-extra table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

/* ------------------------------------------------------------------ 2. Testata e titoli */

/* La prima sezione non finisce mai sotto al logo */
#page > .sopra-100:first-of-type,
#content > .sopra-100:first-of-type,
article > .sopra-100:first-of-type {
    margin-top: max(12%, 150px);
}

.project-page-header.style_3 .project-head {
    padding-top: max(10%, 150px);
}

/* Area di tocco dell'hamburger: l'icona non cambia */
.menu-toggle {
    position: absolute;
}

.menu-toggle::before {
    content: "";
    position: absolute;
    top: -12px;
    right: -12px;
    bottom: -12px;
    left: -12px;
}

.menu-toggle:focus-visible {
    outline: 2px solid #e5e40e;
    outline-offset: 12px;
}

@media only screen and (max-width: 900px) {

    body hr,
    body.color-bianco hr,
    body.color-nero hr {
        margin-top: 0;
    }

    h1.big-title.studiobe4-h1,
    h2.big-title,
    h3.big-title {
        line-height: 1.2;
    }

    h1.big-title.studiobe4-h1 {
        margin-top: 0;
        margin-bottom: 30px;
    }

    h3.big-title {
        margin-bottom: 30px !important;
    }
}

@media only screen and (max-width: 680px) {
    .menu-toggle {
        right: 5%;
    }

    #page > .sopra-100:first-of-type,
    #content > .sopra-100:first-of-type,
    article > .sopra-100:first-of-type {
        margin-top: 120px;
    }

    .project-page-header.style_3 .project-head {
        padding-top: 130px;
    }

    h1.big-title.studiobe4-h1 {
        margin-bottom: 20px;
        line-height: 1.15;
    }

    h3.big-title {
        margin-bottom: 15px !important;
    }

    /* gia' distanziato dalla testata */
    article > .sopra-100 h1.articolo-titolo {
        margin-top: 0;
    }

    .settore {
        margin-bottom: 8px;
    }

    h1.big-title.storia {
        margin-top: 0;
    }
}

@media only screen and (max-width: 576px) {
    h1.articolo-titolo {
        font-size: clamp(32px, 11vw, 48px);
        line-height: 1.1;
    }
}

/* ------------------------------------------------------------------ 3. Menu */
ul#nuovi {
    position: absolute;
    bottom: 0;
    left: 25%;
    width: -webkit-fit-content;
    width: -moz-fit-content;
    width: fit-content;
    margin-top: 30px;
    padding: 0;
    --be4-linea: 0;
}

/* Linea larga quanto le due voci: entra ed esce con il menu (js/scripts.js) */
ul#nuovi::before {
    display: block;
    height: 1px;
    background: #ededed;
    content: "";
    -webkit-transform: scaleX(var(--be4-linea));
    transform: scaleX(var(--be4-linea));
    -webkit-transform-origin: left;
    transform-origin: left;
}

ul#nuovi li {
    display: inline-block;
    overflow: hidden;
    padding-bottom: 6px;
    vertical-align: top;
}

ul#nuovi li:not(:last-child) {
    margin-right: 45px;
}

#nuovi li a {
    display: block;
    margin: 0;
    padding: 30px 0 0;
    -webkit-transform: translateY(110%);
    transform: translateY(110%);
    color: #fff;
    font-size: 63px;
    font-weight: 300;
    text-decoration: none;
}

#nuovi li a:hover {
    opacity: .5;
}

/*
 * Fino a 1440px (o su schermi bassi) le voci scorrono una sotto l'altra: prima erano
 * posizionate in percentuale e si tagliavano o si accavallavano.
 * .header-wrapper ha una trasformazione, quindi le altezze partono dal suo bordo alto.
 */
@media only screen and (max-width: 1440px),
only screen and (max-height: 760px) {
    .site-navigation.fullscreen,
    .header-wrapper.menu-opened {
        height: calc(100vh - 90px);
        height: calc(100dvh - 90px);
    }

    .site-navigation.fullscreen .fs-menu-wrapper {
        position: absolute;
        left: 0;
        box-sizing: border-box;
        width: 100%;
        height: 100% !important;
        padding: 0 0 4vh;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
        scrollbar-width: none;
    }

    .site-navigation.fullscreen .fs-menu-wrapper::-webkit-scrollbar {
        display: none;
    }

    .site-navigation.fullscreen.menu-opened .fs-menu-wrapper {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        justify-content: safe center;
    }

    .site-navigation.fullscreen .fs-menu-wrapper > * {
        -ms-flex-negative: 0;
        flex-shrink: 0;
    }

    .site-navigation.fullscreen .menu.main-menu {
        position: static;
        width: auto;
        margin: 0 0 0 25%;
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item {
        margin-left: 0;
        font-size: min(45px, 5.2vh);
        line-height: 1.2;
        text-indent: 0;
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item a {
        font-size: 2em;
        line-height: 1.2;
    }

    ul#nuovi {
        position: static;
        margin: min(30px, 4vh) 0 0 25%;
    }

    ul#nuovi li a {
        padding-top: min(30px, 3.5vh);
        font-size: min(63px, 7vh);
        line-height: 1.2;
    }

    .menu-widget-left {
        bottom: 32%;
        left: 50px;
    }
}

@media only screen and (max-width: 900px),
only screen and (max-height: 520px) {
    .site-navigation.fullscreen .fs-menu-wrapper {
        padding: 75px 5% 40px;
    }

    .site-navigation.fullscreen.menu-opened .fs-menu-wrapper {
        -webkit-box-pack: start;
        -ms-flex-pack: start;
        justify-content: flex-start;
    }

    .site-navigation.fullscreen .menu.main-menu,
    ul#nuovi {
        margin-left: 0;
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item {
        font-size: 29px;
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item a {
        line-height: 1.35;
    }

    ul#nuovi {
        margin-top: 40px;
    }

    ul#nuovi li a {
        padding-top: 24px;
        font-size: 44px;
    }

    .site-navigation.fullscreen .menu-widget-left,
    .menu-widget.menu-widget-left {
        position: static;
        margin-top: 40px;
    }
}

@media only screen and (max-width: 680px) {
    .site-navigation.fullscreen,
    .header-wrapper.menu-opened {
        height: calc(100vh - 35px);
        height: calc(100dvh - 35px);
    }

    .site-navigation.fullscreen .fs-menu-wrapper {
        padding: min(90px, 12.5vh) 9% 20px;
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item {
        font-size: 22px !important;
        line-height: min(42px, 6.2vh);
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item a {
        font-size: 1.2em;
        line-height: min(42px, 6.2vh);
    }

    ul#nuovi {
        margin-top: min(28px, 3vh);
    }

    ul#nuovi li a {
        padding-top: min(20px, 2.6vh);
        line-height: 25px;
    }

    .site-navigation.fullscreen .menu-widget-left,
    .menu-widget.menu-widget-left {
        margin-top: min(45px, 4.5vh);
    }

    .social-list li {
        margin-bottom: 0;
        line-height: min(34px, 5.2vh);
    }
}

/* Telefono in orizzontale: le voci stanno a destra del logo e scorrono */
@media only screen and (max-height: 520px) and (orientation: landscape) {
    .site-navigation.fullscreen,
    .header-wrapper.menu-opened {
        height: calc(100vh - 90px);
        height: calc(100dvh - 90px);
    }

    .site-navigation.fullscreen {
        top: -70px;
        height: calc(100vh - 20px);
        height: calc(100dvh - 20px);
    }

    .site-navigation.fullscreen .fs-menu-wrapper {
        padding: 20px 110px 20px 190px;
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item,
    .site-navigation.fullscreen .menu.main-menu > li.menu-item a,
    .social-list li {
        line-height: 36px;
    }

    .site-navigation.fullscreen .menu.main-menu > li.menu-item {
        font-size: 14px !important;
    }

    ul#nuovi {
        margin-top: 16px;
    }

    ul#nuovi li a {
        padding-top: 14px;
        font-size: 22px;
    }

    .social-list li {
        display: inline-block;
        margin: 0 20px 0 0;
    }
}

/* ------------------------------------------------------------------ 4. Pulsanti circolari */
@media only screen and (max-width: 900px) {
    .box-contatti-info.acs-60 {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        z-index: 2;
        clear: both;
        margin: 0 5% 0 auto;
    }

    .c-col-4 .box-conta {
        margin: 35px 0 0;
    }
}

/* Su mobile i cerchi stanno nel flusso, a destra: prima coprivano testi e titoli */
@media only screen and (max-width: 680px) {
    .box-contatti-info.acs-10,
    .box-contatti-info.acs-10.asso,
    .box-contatti-info.acs-home {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        clear: both;
        margin: 35px 12% 0 auto;
    }

    .box-contatti-info.acs-home {
        margin: 10px 17% 0 auto;
    }
}

/* ------------------------------------------------------------------ 5. Form */

/* Il testo privacy non viene piu' coperto dal cerchio di invio */
form .field-wrap.interno > p {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    line-height: 1.5 !important;
}

form .field-wrap.interno .wpcf7-form-control-wrap {
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

form .field-wrap.interno .wpcf7-list-item {
    margin-left: 0;
}

form button.a-button {
    margin-top: 20px;
}

.sopra-100 form button.a-button,
.contrasto form button.a-button {
    margin-top: 20px;
}

@media only screen and (max-width: 680px) {
    form .field-wrap.interno > p {
        gap: 14px;
    }
}

@media only screen and (max-width: 900px) {
    .cerca-be4 .searchandfilter ul {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -ms-flex-wrap: wrap;
        flex-wrap: wrap;
        gap: 10px 40px;
    }

    .cerca-be4 .searchandfilter ul li,
    .cerca-be4 li.sf-field-submit {
        width: 280px;
        max-width: 100%;
        margin: 0 !important;
    }

    .cerca-be4 .searchandfilter select.sf-input-select,
    .cerca-be4 select {
        width: 100%;
        min-width: 0;
        padding-left: 0;
    }

    .cerca-be4 .searchandfilter label,
    .cerca-be4 form input {
        box-sizing: border-box;
        width: 100%;
    }
}

@media only screen and (max-width: 680px) {
    .cerca-be4 .searchandfilter ul li,
    .cerca-be4 li.sf-field-submit {
        width: 100%;
    }
}

/* ------------------------------------------------------------------ 6. Blocchi di pagina */

/* Categorie progetto lunghe: prima venivano tagliate a 70px */
.recent-works-wrapper .ar-work-cat {
    height: auto;
    min-height: 70px;
}

/* Paginazione articoli */
.posts-navigation a {
    color: #e4e4e4;
    font-size: 17px;
    font-weight: 300;
    text-decoration: none;
}

.posts-navigation a:hover {
    color: #e5e40e;
}

.posts-navigation .nav-links {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 15px 40px;
    padding: 20px 0;
}

.posts-navigation {
    clear: both;
}

/* Titoli delle storie su piu' righe */
@media only screen and (max-width: 900px) {
    h2 a.top,
    .cerca-be4 h2.titolo-s-4 a {
        line-height: 1.12;
    }

    .img-blog-be4 {
        height: auto;
    }
}

/* Blog: miniature leggibili su tablet (stessa griglia del desktop) */
@media only screen and (min-width: 577px) and (max-width: 900px) {
    .blog-studio-be4 .wrapper.no-gap .c-col-9 {
        width: 68%;
    }

    .blog-studio-be4 .wrapper.no-gap .c-col-3 {
        width: 32%;
    }

    /* Dettaglio storia: testo "Who" a tutta larghezza */
    .project-page-header.style_3 .project-meta.project-other {
        display: none;
    }

    .project-page-header.style_3 .project-meta.meta-summary {
        width: 100%;
        padding-left: 0;
    }
}

/* Video a tutta larghezza senza sbordare */
#home-video,
.video-viemo-studio-be4 {
    overflow: hidden;
}

@media only screen and (max-width: 680px) {
    .video-viemo-studio-be4 {
        box-sizing: border-box;
        padding-right: 0;
    }
}

@media only screen and (max-width: 576px) {
    .be4c-head {
        margin-top: 30px;
    }
}

@media only screen and (max-width: 360px) {
    .be4c-sedi .be4c-sede {
        padding: 22px;
    }

    .be4c-mail a {
        font-size: 16px;
    }

    .alioth-services.style_2 .servizio-studio-be4 {
        font-size: 38px;
    }

    h3.dati-storia,
    #call h3.dati-storia {
        font-size: 2.6em;
    }
}

/* ------------------------------------------------------------------ 7. 404 */
@media only screen and (max-width: 1280px) {
    .not-found-wrap {
        left: 50%;
        width: 90%;
        max-width: 640px;
        -webkit-transform: translate(-50%, -50%);
        -ms-transform: translate(-50%, -50%);
        transform: translate(-50%, -50%);
    }

    .not-found-header h1:first-child {
        font-size: clamp(90px, 21vw, 170px);
        line-height: 1;
    }

    .not-found-header h1 {
        font-size: clamp(44px, 10vw, 84px);
        line-height: 1.05;
    }
}

/* ------------------------------------------------------------------ 8. Footer */

/* Copyright 62%, social 38%: da 1200px in su il copyright resta su una riga */
@media only screen and (min-width: 577px) {
    #footer .c-col-6.sinistra {
        width: 62%;
    }

    #footer .c-col-6.destra {
        width: 38%;
    }
}

/* Su mobile i link social sono allineati al copyright */
@media only screen and (max-width: 576px) {
    #footer .footer-social {
        padding-left: 0;
    }
}

/* ------------------------------------------------------------------ Accessibilita' */
@media (prefers-reduced-motion: reduce) {
    #badge-studiobe4,
    .pulse-btn {
        -webkit-animation: none;
        animation: none;
    }
}

/* ------------------------------------------------------------------ Rifiniture */

/* "body" davanti: alcune pagine hanno un line-height fisso inserito dal back-end */
@media only screen and (max-width: 900px) {
    body h1.big-title.studiobe4-h1 {
        line-height: 1.15;
    }
}

@media only screen and (min-width: 901px) and (max-width: 1280px) {
    .be4c-scrivici .be4c-mail a {
        font-size: 16px;
    }
}

/* Margine laterale minimo: a 1024 e 1280px i contenuti arrivavano al bordo */
@media only screen and (min-width: 992px) {
    .wrapper {
        max-width: min(1014px, calc(100% - 80px));
    }
}

@media only screen and (min-width: 1200px) {
    .wrapper {
        max-width: min(1274px, calc(100% - 80px));
    }
}

@media only screen and (min-width: 1600px) {
    .wrapper {
        max-width: min(1500px, calc(100% - 80px));
    }
}

/* Arrivo con tendina: pagina coperta finche' lo script non la apre (al massimo 8s) */
.be4-tendina .alioth-page-transitions {
    visibility: visible;
    -webkit-animation: be4-tendina-fine 1ms 8s forwards;
    animation: be4-tendina-fine 1ms 8s forwards;
}

.be4-tendina .apt-bg {
    top: 0;
    bottom: auto;
    height: 100%;
}

.be4-tendina-menu .apt-bg {
    background: #000;
}

@-webkit-keyframes be4-tendina-fine {
    to {
        visibility: hidden;
    }
}

@keyframes be4-tendina-fine {
    to {
        visibility: hidden;
    }
}
