/* ============================================================================
   Accademia di Belle Arti di Bari - struttura del sito pubblico
   (font, header, menu, ricerca, footer). Caricato solo da _Layout.cshtml.
   Lo stile dei contenuti (titoli, card, sezioni, avvisi) è nell'Aspetto "CSS"
   del database, modificabile dall'area admin.
   ============================================================================ */

@font-face { font-family: 'Heebo'; src: url('../fonts/Heebo-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Heebo'; src: url('../fonts/Heebo-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Heebo'; src: url('../fonts/Heebo-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Heebo'; src: url('../fonts/Heebo-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Heebo'; src: url('../fonts/Heebo-Black.ttf') format('truetype'); font-weight: 900; font-display: swap; }

:root {
    --ab-bg: #ececec;
    --ab-bg-alt: #d2d2d2;
    --ab-text: #373737;
    --ab-muted: #6f6f6f;
    --ab-pink: #e94e7f;
    --ab-orange: #f39200;
    --ab-blue: #0b6297;
    --ab-plum: #9b0d54;
    --ab-footer: #3b3b3b;
    --ab-gutter: clamp(16px, 5.2vw, 75px);
    --ab-max: 1440px;
    /* ABABA_home.pdf / ABABA_menù opacità.pdf: barra alta 107px, staccata di 39px dal bordo superiore */
    --ab-header-top: 39px;
    --ab-header-h: 107px;
    --ab-radius: 10px;
}

html {
    scroll-padding-top: calc(var(--ab-header-top) + var(--ab-header-h) + 10px);
}

body.ab-body {
    font-family: 'Heebo', system-ui, sans-serif;
    background-color: var(--ab-bg);
    color: var(--ab-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ab-container {
    width: 100%;
    max-width: var(--ab-max);
    margin-inline: auto;
    padding-inline: var(--ab-gutter);
}

.ab-main {
    flex: 1 0 auto;
    padding-bottom: 95px;
    /* le fasce a tutta larghezza (.ab-bleed) usano 100vw: evita lo scroll orizzontale */
    overflow-x: clip;
}

/* ---------------------------------------------------------------- header -- */

.ab-header {
    position: sticky;
    top: var(--ab-header-top);
    margin-top: var(--ab-header-top);
    z-index: 1030;
    /* #ececec all'88% di opacità, senza sfocatura: il contenuto scorre visibile sotto la barra */
    background-color: rgba(236, 236, 236, .88);
    transition: box-shadow .2s ease;
}

    .ab-header.is-scrolled {
        box-shadow: 0 1px 0 rgba(55, 55, 55, .12);
    }

.ab-header__bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: var(--ab-header-h);
}

.ab-header__logo {
    display: block;
    flex: 0 0 auto;
}

    .ab-header__logo img {
        display: block;
        height: 74px;
        width: auto;
    }

.ab-header__nav {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 3vw, 3.4rem);
    margin-left: auto;
    font-size: 1rem;
    font-weight: 500;
}

    .ab-header__nav a,
    .ab-header__search {
        color: var(--ab-text);
        text-decoration: none;
        white-space: nowrap;
        padding: .25rem 0;
        border-bottom: 2px solid transparent;
        transition: color .15s ease, border-color .15s ease;
    }

        .ab-header__nav a:hover,
        .ab-header__nav a.is-active,
        .ab-header__search:hover,
        .ab-header__search[aria-expanded="true"] {
            color: var(--ab-pink);
            border-bottom-color: var(--ab-pink);
        }

.ab-header__search {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: none;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

.ab-header__actions {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 3vw, 3.4rem);
}

/* hamburger a tre linee colorate (da ABABA_home.pdf: linee 34px, spessore 4px, estremi
   squadrati, interasse ~10px; la prima e la seconda volutamente inclinate, la terza dritta) */
.ab-burger {
    width: 34px;
    height: 32px;
    padding: 4px 0;
    background: none;
    border: 0;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

    .ab-burger span {
        display: block;
        height: 4px;
        transition: transform .25s ease, opacity .2s ease;
    }

        .ab-burger span:nth-child(1) { background: var(--ab-pink); transform: rotate(-3deg); }
        .ab-burger span:nth-child(2) { background: var(--ab-blue); transform: rotate(4deg); }
        .ab-burger span:nth-child(3) { background: var(--ab-plum); }

    .ab-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
    .ab-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .ab-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ------------------------------------------------------------------ menu -- */

.ab-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background-color: rgba(236, 236, 236, .96);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--ab-pink);
    box-shadow: 0 20px 30px rgba(0, 0, 0, .08);
    max-height: calc(100vh - var(--ab-header-top) - var(--ab-header-h));
    overflow-y: auto;
}

    .ab-menu[hidden] {
        display: none;
    }

.ab-menu__list,
.ab-menu__list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ab-menu__list {
    columns: 3 260px;
    column-gap: 3rem;
    padding: 3rem 0 4rem;
}

    .ab-menu__list > li {
        break-inside: avoid;
        padding: .35rem 0;
    }

    .ab-menu__list a {
        color: var(--ab-text);
        text-decoration: none;
        font-size: 1.5rem;
        font-weight: 700;
        letter-spacing: -.02em;
        line-height: 1.2;
    }

        .ab-menu__list a:hover,
        .ab-menu__list a.is-active {
            color: var(--ab-pink);
        }

    .ab-menu__list ul {
        padding: .25rem 0 .25rem 1rem;
    }

        .ab-menu__list ul a {
            font-size: 1.05rem;
            font-weight: 500;
        }

.ab-menu__quick {
    display: none;
}

    .ab-menu__quick a {
        display: block;
        padding: .35rem 0;
    }

/* --------------------------------------------------------------- ricerca -- */

.ab-search {
    position: fixed;
    inset: 0 0 0 0;
    z-index: 1040;
    background-color: rgba(236, 236, 236, .9);
    /* pannello centrato nello spazio sotto l'header, senza scroll dell'overlay:
       se i risultati sono molti scorre solo l'elenco dentro il pannello */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: clamp(16px, 3vw, 40px) var(--ab-gutter);
}

    .ab-search[hidden] {
        display: none;
    }

.ab-search__panel {
    width: 100%;
    max-width: 1000px;
    background-color: var(--ab-blue);
    color: #fff;
    border-radius: var(--ab-radius);
    padding: 33px 55px;
    /* altezza fissa: il pannello non cresce quando arrivano i risultati */
    height: min(810px, 100%);
    display: flex;
    flex-direction: column;
}

.ab-search__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: clamp(24px, 5vw, 60px);
}

.ab-search__title {
    color: #fff;
    margin: 0;
    font-size: clamp(2rem, 1.4rem + 1.6vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1;
}

    .ab-search__title::before {
        content: "";
        display: inline-block;
        width: 1.05em;
        height: .09em;
        margin-right: .05em;
        background: #fff;
        vertical-align: baseline;
    }

.ab-search__close {
    background: none;
    border: 0;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    padding: 0 .25rem;
    cursor: pointer;
}

    .ab-search__close:hover {
        color: var(--ab-orange);
    }

.ab-search__form {
    position: relative;
}

.ab-search__input {
    width: 100%;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: var(--ab-text);
    font: inherit;
    font-size: 1rem;
    padding: .7rem 3rem .7rem 1.25rem;
    outline: none;
}

/*
    .ab-search__input:focus-visible {
        box-shadow: 0 0 0 3px var(--ab-orange);
    }
*/

.ab-search__submit {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--ab-text);
    padding: .35rem;
    cursor: pointer;
}

.ab-search__results {
    margin-top: clamp(28px, 5vw, 60px);
    padding-inline: clamp(0px, 3vw, 40px);
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: none;
}

    .ab-search__results::-webkit-scrollbar {
        display: none;
    }

.ab-search__item {
    display: block;
    margin-bottom: 1.6rem;
    color: #fff;
    text-decoration: none;
}

.ab-search__cat {
    display: block;
    font-size: .9rem;
    font-weight: 500;
}

.ab-search__link {
    display: inline;
    font-size: 1.05rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ab-search__item:hover .ab-search__link {
    color: var(--ab-orange);
}

.ab-search__date {
    display: block;
    font-size: .78rem;
    margin-top: .2rem;
}

.ab-search__item mark {
    background-color: var(--ab-orange);
    color: var(--ab-text);
    padding: 0 .1em;
}

.ab-search__empty {
    font-size: 1rem;
}

/* "..." di attesa mentre si carica la pagina successiva/precedente */
.ab-search__list {
    position: relative;
    /* contiene il margine dell'ultimo risultato, così il riquadro coincide con l'elenco */
    display: flow-root;
}

    .ab-search__list.is-loading > .ab-search__item {
        visibility: hidden;
    }

/* copre esattamente il riquadro dei risultati, con i puntini al centro */
.ab-search__loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .15em;
}

    .ab-search__loading span {
        animation: ab-search-dot 1.2s infinite both;
    }

        .ab-search__loading span:nth-child(2) {
            animation-delay: .2s;
        }

        .ab-search__loading span:nth-child(3) {
            animation-delay: .4s;
        }

@keyframes ab-search-dot {
    0%, 80%, 100% { opacity: .2; }
    40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .ab-search__loading span {
        animation: none;
    }
}

.ab-search__nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.ab-search__all {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

    .ab-search__all:hover {
        color: var(--ab-orange);
    }

.ab-search__pager {
    display: flex;
    align-items: center;
    gap: 49px;
}

/* frecce < > come da ABABA_ricerca - risultati.pdf: sagome piene 35x40px distanti 49px,
   arancio se attive, bianco al 38% sul blu (grigio-azzurro) se disabilitate */
.ab-search__page {
    display: inline-flex;
    padding: 0;
    background: none;
    border: 0;
    color: var(--ab-orange);
    cursor: pointer;
    line-height: 0;
    transition: color .15s ease;
}

    .ab-search__page svg {
        display: block;
        width: 35px;
        height: 40px;
    }

    .ab-search__page:hover:not(:disabled) {
        color: #fff;
    }

    .ab-search__page:disabled {
        color: rgba(255, 255, 255, .38);
        cursor: default;
    }

    .ab-search__page:focus-visible {
        outline: 2px solid #fff;
        outline-offset: 4px;
    }

/* ---------------------------------------------------------------- footer -- */

.ab-footer {
    flex-shrink: 0;
    background-color: var(--ab-footer);
    color: #fff;
    padding: 94px 0 85px;
    font-size: 1.15rem;
    line-height: 1.35;
}

    .ab-footer a {
        color: #fff;
        text-decoration: none;
    }

        .ab-footer a:hover {
            color: var(--ab-pink);
        }

    /* il footer è una pagina del page builder: annulla gli stili del builder */
    .ab-footer .cms-page-builder > div {
        margin: 0;
    }

/* La pagina "Footer" è composta da tre Contenitori (classe CSS ab-footer__top / __mid / __bottom),
   ognuno con una Griglia le cui celle contengono un Editor di testo:
   top 2x1 (logo | istituzioni), mid 2x2 (sede | email / sede | social),
   bottom 5x1 (copyright | amministrazione | URP | privacy | note legali).
   La griglia imposta colonne e gap inline: gli override qui sotto usano !important. */

.ab-footer .cms-grid {
    gap: 1.4rem 2rem !important;
}

/* i widget hanno width:100% inline: senza questo non si allineano a destra nelle celle flex */
.ab-footer .cms-grid-cell > div {
    width: auto !important;
}

.ab-footer p {
    margin: 0;
}

.ab-footer .cms-page-builder > .ab-footer__top,
.ab-footer .cms-page-builder > .ab-footer__mid {
    margin-bottom: 94px;
}

.ab-footer__top .cms-grid {
    align-items: center;
}

.ab-footer__top .cms-grid-cell:nth-child(2) {
    display: flex;
    justify-content: flex-end;
}

.ab-footer__logo img {
    height: 64px;
    width: auto;
    filter: brightness(0) invert(1);
}

.ab-footer__institutions img {
    height: 72px;
    width: auto;
    filter: brightness(0) invert(1);
}

.ab-footer__address strong {
    font-weight: 700;
}

/* colonna destra (email, social): allineata a destra, social in basso */
.ab-footer__mid .cms-grid-cell:nth-child(even) {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    text-align: right;
}

.ab-footer__mid .cms-grid-cell:nth-child(2) {
    justify-content: flex-start;
}

.ab-footer__social {
    display: flex;
    gap: 1.6rem;
    align-items: center;
}

    .ab-footer__social img {
        display: block;
        height: 38px;
        width: auto;
    }

.ab-footer__bottom .cms-grid {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}


/* ------------------------------------------------------------ responsive -- */

@media (max-width: 991.98px) {
    :root {
        --ab-header-top: 0px;
        --ab-header-h: 96px;
    }

    .ab-header__nav {
        display: none;
    }

    .ab-header__actions {
        margin-left: auto;
    }

    .ab-header__logo img {
        height: 52px;
    }

    .ab-menu__quick {
        display: block;
        border-bottom: 1px solid rgba(55, 55, 55, .15);
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .ab-menu__list {
        padding-top: 2rem;
    }
}

@media (max-width: 767.98px) {
    .ab-header__search {
        font-size: 1.1rem;
    }

    .ab-menu__list a {
        font-size: 1.3rem;
    }

    .ab-footer {
        padding: 60px 0 40px;
        font-size: .9rem;
    }

    .ab-footer .cms-page-builder > .ab-footer__top,
    .ab-footer .cms-page-builder > .ab-footer__mid {
        margin-bottom: 50px;
    }

    .ab-footer__logo img {
        height: 52px;
    }

    .ab-footer__institutions img {
        height: 44px;
    }

    /* mid su una colonna: sede, sede, email, social */
    .ab-footer__mid .cms-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .ab-footer__mid .cms-grid-cell:nth-child(1) { order: 1; }
    .ab-footer__mid .cms-grid-cell:nth-child(3) { order: 2; }
    .ab-footer__mid .cms-grid-cell:nth-child(2) { order: 3; }
    .ab-footer__mid .cms-grid-cell:nth-child(4) { order: 4; }

    .ab-footer__mid .cms-grid-cell:nth-child(even) {
        align-items: flex-start;
        text-align: left;
    }

    .ab-footer__social img {
        height: 30px;
    }

    .ab-footer__bottom {
        text-align: center;
        font-size: .8rem;
    }

        .ab-footer__bottom .cms-grid {
            justify-content: center;
            gap: .6rem 1.4rem !important;
        }

        .ab-footer__bottom .cms-grid-cell:first-child {
            flex-basis: 100%;
            margin: 1rem 0 .4rem;
        }
}
