/* ===============================
   RONZINO FONT
================================ */
@font-face {
    font-family: "Ronzino";
    src: url("../fonts/Ronzino-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 300 400;
    font-display: swap;
}
@font-face {
    font-family: "Ronzino";
    src: url("../fonts/Ronzino-Medium.woff2") format("woff2");
    font-style: normal;
    font-weight: 500;
    font-display: swap;
}
@font-face {
    font-family: "Ronzino";
    src: url("../fonts/Ronzino-Bold.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Ronzino";
    src: url("../fonts/Ronzino-Oblique.woff2") format("woff2");
    font-style: italic;
    font-weight: 300 400;
    font-display: swap;
}


/* ===============================
   SCROLLBARS — ALWAYS HIDDEN
   =============================== */
html,
body,
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* =============================== */
/* GENERALE */
/* =============================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: white;
    overflow: hidden;
    /*font-family: "Ronzino", sans-serif;*/
    font-family: "Ronzino", sans-serif;
    transition: background 0.3s, color 0.3s;
}

body.night {
    background: #111;
    color: white;
}

canvas {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* =============================== */
/* UI / MENU */
/* =============================== */
.ui {
    position: relative;
    z-index: 5;
    display: grid;
    /* Layout desktop calibrato sulla viewport di riferimento 1466px:
       menu a sinistra e blocco delle 3 colonne agganciato al bordo destro. */
    grid-template-columns: 192px minmax(0, 925px);
    height: 100vh;
    padding: 48px 0 48px 44px;
    gap: 0;
    justify-content: space-between;
}

.menu {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.menu h1 {
    font-size: 1rem;
    margin-bottom: 0.9rem;
    letter-spacing: 1px;
    cursor: pointer;
}

.menu a {
    text-decoration: none;
    color: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.menu a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.menu a.active {
    text-decoration: underline;
}
.menu-item {
    cursor: pointer;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    margin-left: 0.75rem;
    transition: max-height 0.35s ease, opacity 0.35s ease;
    opacity: 0;
}

.menu-item.open .submenu {
    max-height: 200px;
    opacity: 1;
}

.submenu a {
    display: block;
    font-size: 0.75rem;
    font-weight: 300;
    opacity: 0.6;
    margin-top: 0.35rem;
}

.submenu a.active,
.submenu a:hover {
    opacity: 1;
    text-decoration: underline;
}


/* =============================== */
/* CONTENT AREA */
/* =============================== */
.content {
    display: flex;
    justify-content: flex-start;
    height: 100%;
    min-width: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.content.visible {
    opacity: 1;
    pointer-events: auto;
}

.project {
    width: 100%;
    min-width: 0;
    height: calc(100vh - 96px);
    padding-right: 0;
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    opacity: 1;
    transition: opacity 0.28s ease;
    display: grid;
    /* Proporzioni identiche allo screenshot: 146 / 346 / 360 con 36px tra le colonne.
       Le percentuali mantengono le stesse proporzioni quando il desktop cambia misura. */
    grid-template-columns: 15.78% 37.41% 38.92%;
    column-gap: 2%;
    align-items: start;
}

/* la griglia a 3 colonne vale SOLO per una pagina progetto normale;
   la galleria "Show All Projects" (desktop e mobile) deve restare a blocco pieno */
#content.content-full,
#content.gallery-active {
    display: block;
}

.project.content-fade-out {
    opacity: 0;
}

/* Titolo a sinistra, allineato visivamente al menu */
.project > h2 {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0.35rem;
}

.project > .project-set-switch {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin-top: 0;
    margin-bottom: 0;
}

/* colonna testo: scorre in verticale in modo indipendente */
.project-text-col {
    grid-column: 2;
    grid-row: 1;
    height: calc(100vh - 96px);
    overflow-y: auto;
    padding-right: 0;
    scrollbar-gutter: auto;
}

/* colonna immagini: scorre in verticale in modo indipendente dal testo */
.project-media-col {
    grid-column: 3;
    grid-row: 1;
    height: calc(100vh - 96px);
    overflow-y: auto;
    padding-right: 0;
    scrollbar-gutter: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}


/* BODY COPY – stessa font e stesso grigio dei sottocapitoli nel menu */
.project p,
.project li,
.project figcaption {
    font-family: "Ronzino", sans-serif;
    font-weight: 300;
    font-style: normal;
    opacity: 0.6;
}




.project h2 {
    font-size: 1rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.project p {
    font-size: 1rem;
    line-height: 1.5;
    margin: 0 0 0.35rem 0;
    text-align: justify;
    text-indent: 0;
}

.project p.first-lang-paragraph {
    text-indent: 1.4em;
}

.project img {
    width: 100%;
    display: block;
}

.en {
    color: #5e8dbb;
}


/* =============================== */
/* PROJECT METADATA */
/* =============================== */
.project-meta {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-top: 4.5rem;
}

.project-meta-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.project-meta .meta-label {
    font-family: "Ronzino", sans-serif;
    font-size: 0.68rem;
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: 0.5px;
    opacity: 0.62;
}

.project-meta .meta-value {
    font-family: "Ronzino", sans-serif;
    font-size: 0.75rem;
    line-height: 1.15;
    font-weight: 400;
    opacity: 0.78;
    text-transform: lowercase;
}

/* =============================== */
/* ABOUT PAGE — scoped only to About */
/* =============================== */
.project.about-page {
    display: grid;
    grid-template-columns: 15.78% 37.41% 38.92%;
    column-gap: 2%;
    align-items: start;
    align-content: start;
    overflow: hidden;
}

/* All About content stays inside the normal text column. */
.project.about-page > .about-text-col {
    grid-column: 2;
    grid-row: 1;
    height: calc(100vh - 96px);
    overflow-y: auto;
    padding-right: 0;
    scrollbar-gutter: auto;
}

.project.about-page .about-label .lang-it { display: inline; }
.project.about-page .about-label .lang-en { display: none; }
body.lang-en .project.about-page .about-label .lang-it { display: none; }
body.lang-en .project.about-page .about-label .lang-en { display: inline; }

.project.about-page > .about-text-col > h2 {
    margin: 0 0 0.7rem 0;
    padding: 0;
    line-height: 1.1;
    font-size: 1rem;
    letter-spacing: 1px;
    opacity: 0.7;
    text-align: left;
}

.project.about-page > .about-text-col > .about-section-content {
    margin: 0 0 2.5rem 0;
    padding: 0;
}

.project.about-page > .about-text-col > .about-section-content p {
    text-align: left;
    text-indent: 0;
}

.project.about-page .about-role {
    font-variant-caps: all-small-caps;
    font-variant: small-caps;
    text-transform: none;
    letter-spacing: inherit;
    font-size: 1em;
}

.project.about-page .about-period {
    white-space: nowrap;
    text-transform: none;
    opacity: 0.55;
}

@media (max-width: 768px) {
    .project.about-page {
        display: block;
        overflow-y: auto;
    }

    .project.about-page > .about-text-col {
        height: auto;
        overflow-y: visible;
    }

    .project.about-page > .about-text-col > h2 {
        margin-bottom: 0.75rem;
    }

    .project.about-page > .about-text-col > .about-section-content {
        margin-bottom: 2rem;
    }
}

/* =============================== */
/* SWITCH LINGUA IT/EN */
/* I testi sono marcati esplicitamente come italiano o inglese. */
/* Language-specific project titles */
.project h2.lang-it { display: block; }
.project h2.lang-en { display: none; }
body.lang-en .project h2.lang-it { display: none; }
body.lang-en .project h2.lang-en { display: block; }

.project p.lang-en { display: none; }
body.lang-en .project p.lang-it { display: none; }
body.lang-en .project p.lang-en { display: block; }

.lang-corner {

    position: fixed;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 9999;
}

.lang-btn {
    font-family: "Ronzino", sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.lang-btn:hover {
    opacity: 0.85;
}

.lang-btn.active {
    opacity: 0.6;
    text-decoration: underline;
}

/* =============================== */
/* NAV – "SHOW ALL PROJECTS" */
/* =============================== */

#content.content-full {
    width: 100%;
    max-width: none;
}

#content.gallery-active {
    overflow: visible;
}

.menu a.show-all-nav-link {
    text-decoration: none;
    font-size: 0.95rem;
    color: #d6362c;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.menu a.show-all-nav-link:hover {
    opacity: 0.75;
}

body.night .menu a.show-all-nav-link {
    color: #ff5c4d;
}

/* =============================== */
/* GALLERIA FOTO SPARPAGLIATE */
/* =============================== */

.scatter-gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.scatter-photo {
    position: absolute;
    cursor: grab;
    border-radius: 2px;
    overflow: hidden;
    background: #eee;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
    user-select: none;
    touch-action: none;
    will-change: transform;
}

.scatter-photo.dragging {
    cursor: grabbing;
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
}

.scatter-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

.scatter-photo .fallback-label {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 1rem;
    text-align: center;
    font-family: "Ronzino", sans-serif;
    font-size: 0.8rem;
    color: #999;
}

.scatter-photo.img-missing {
    background: linear-gradient(135deg, #f1f1f1, #dedede);
}

.scatter-photo.img-missing .fallback-label {
    display: flex;
}

body.night .scatter-photo.img-missing {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

body.night .scatter-photo.img-missing .fallback-label {
    color: #888;
}

/* =============================== */
/* CAROSELLO MOBILE (SWIPE) */
/* =============================== */

.mobile-carousel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.carousel-track {
    display: flex;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    text-decoration: none;
    color: inherit;
}

.carousel-slide img {
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
    display: block;
    -webkit-user-drag: none;
    pointer-events: none;
}

.carousel-slide.img-missing {
    width: 100%;
    height: 55vh;
    border-radius: 2px;
    background: linear-gradient(135deg, #f1f1f1, #dedede);
}

.carousel-slide.img-missing .fallback-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 1rem;
    font-family: "Ronzino", sans-serif;
    font-size: 0.85rem;
    color: #999;
}

body.night .carousel-slide.img-missing {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

body.night .carousel-slide.img-missing .fallback-label {
    color: #888;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.dot.active {
    background: rgba(0, 0, 0, 0.75);
    transform: scale(1.3);
}

body.night .dot {
    background: rgba(255, 255, 255, 0.3);
}

body.night .dot.active {
    background: rgba(255, 255, 255, 0.9);
}

/* =============================== */
/* CONTATTI (SUBMENU VISIBILE SEMPRE, ALLINEATO A SINISTRA) */
/* =============================== */
.contact-submenu {
    max-height: none;      /* sempre visibile */
    opacity: 1;
    margin-left: 0;        /* allineamento al bordo menu principale */
    padding-left: 0;
    transition: none;      /* disabilita solo per contatti */
}

.contact-submenu a {
    display: block;
    font-size: 0.75rem;
    font-weight: 300;
    opacity: 0.8;
    margin-top: 0.35rem; 
    text-decoration: none;
    text-align: left;      /* allineamento perfetto a sinistra */
    padding-left: 0;
}

.contact-submenu a:hover {
    opacity: 1;
    text-decoration: underline;
}
/* =============================== */
/* DAY/NIGHT BUTTON BASSO SINISTRA */
/* =============================== */

#nightDayWrapper {
    position: fixed;
    bottom: 1.2rem;
    left: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    z-index: 20;
    font-size: 0.7rem;
}

#nightDayButton {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #000;
}

body.night #nightDayButton {
    background: #fff;
}

.day-night-corner {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    z-index: 9999;
}

.toggle-circle {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 0px solid #444;
    flex-shrink: 0;
    transition: background 0.3s, border 0.3s;
}

/* Colore Day/Night */
body:not(.night) .toggle-circle {
    background-color: #444; /* pallino chiaro per Day */
    border-color: #444;
}

body.night .toggle-circle {
    background-color: #fff; /* pallino scuro per Night */
    border-color: #fff;
}

#nightDayLabel {
    font-size: 0.8rem;
    user-select: none;
}


/* ===============================
   PROJECT SET SWITCH
   Selettore leggero sotto il titolo per pagine con più raccolte.
================================ */
.project-set-switch {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    align-items: flex-start;
    justify-content: flex-start;
    z-index: 2;
}
.project-set-btn {
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    color: inherit;
    font-family: "Ronzino", sans-serif;
    font-size: 0.68rem;
    line-height: 1.1;
    font-weight: 300;
    letter-spacing: 0.15px;
    opacity: 0.48;
    cursor: pointer;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.project-set-btn:hover,
.project-set-btn:focus-visible {
    opacity: 0.75;
    outline: none;
}
.project-set-btn.active {
    opacity: 0.72;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.project-media-col [data-gallery-set] {
    display: none;
}
.project-media-col [data-gallery-set].is-set-active {
    display: block;
}

@media (max-width: 768px) {
    .project-set-switch {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: max-content;
        margin: -1.85rem 0 1.5rem;
        gap: 0.3rem;
    }
    .project-set-btn {
        font-size: 0.68rem;
    }
}

/* =====================================================
   RESPONSIVE
===================================================== */

/* ---------- TABLET (<= 1024px) ---------- */
@media (min-width: 769px) and (max-width: 1200px) {

    /* Fascia tablet / laptop stretta: il layout resta a 3 colonne,
       ma si comprime fluidamente senza entrare nella versione smartphone. */
    .ui {
        grid-template-columns: 170px minmax(0, 1fr);
        padding: 32px 0 32px 32px;
        column-gap: 48px;
        justify-content: normal;
    }

    .project {
        height: calc(100vh - 64px);
        max-width: none;
        border-right: none;
    }

    .project-text-col,
    .project-media-col {
        height: calc(100vh - 64px);
    }
}

/* ---------- MOBILE (<= 768px) ---------- */
@media (max-width: 768px) {

    body {
        overflow: auto;
    }

    .ui {
        grid-template-columns: 1fr;
        height: auto;
        padding: 1.5rem;
    }

    /* MENU */
    .menu {
        position: relative;
        width: 100%;
    }

    /* CONTENUTO DESTRA → SOTTO */
    .content {
        opacity: 1;
        pointer-events: auto;
        margin-top: 2rem;
    }

    .project {
        display: block;
        max-width: 100%;
        height: auto;
        padding-right: 0;
    }

    .project > h2 {
        position: static;
    }

    .project-text-col,
    .project-media-col {
        height: auto;
        overflow: visible;
        padding-right: 0;
    }

    /* HOME GRID */
    .home-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---------- MOBILE PICCOLO (<= 480px) ---------- */
@media (max-width: 480px) {
    .content {
        /* opacity: 1;        <-- TOGLI */
        /* pointer-events: auto; <-- TOGLI */
        margin-top: 2rem;
    }
}

/* =========================
   MOBILE – NIGHT/DAY SWITCH
   ========================= */
@media (max-width: 768px) {
    /* Day/Night + lingua: stessa linea, angolo in basso a sinistra */
    #nightDayWrapper {
        top: auto;
        right: auto;
        bottom: 20px;
        left: 19px;
    }

    .lang-corner {
        top: auto;
        right: auto;
        bottom: 20px;
        left: 104px;
    }
}

/* per Firefox */
}

body.night .project,
body.night .project-text-col,
body.night .project-media-col {
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}

/* ===============================
   SHOW ALL — MENU / CARD QUEUE
================================ */
.gallery-menu {
    display: none;
    margin-top: -0.35rem;
    margin-left: 0.75rem;
}
.gallery-menu.visible {
    display: block;
    animation: galleryMenuIn 260ms ease both;
}
.gallery-project-list {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
}
.gallery-project-link,
.gallery-sort {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: #d6362c;
    font: 300 0.75rem/1.2 "Ronzino", sans-serif;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.72;
    transition: opacity 180ms ease, transform 180ms ease;
}
.gallery-project-link:hover,
.gallery-sort:hover,
.gallery-project-link:focus-visible,
.gallery-sort:focus-visible {
    opacity: 1;
    transform: translateX(2px);
    outline: none;
    text-decoration: underline;
}
.gallery-sort {
    margin-top: 0.6rem;
    text-transform: lowercase;
}
body.night .gallery-project-link,
body.night .gallery-sort {
    color: #ff5c4d;
}
@keyframes galleryMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===============================
   SHOW ALL — SCATTER / ORDERED
================================ */
.scatter-gallery {
    transition: opacity 260ms ease;
}
.scatter-gallery.is-ordering {
    height: auto;
    min-height: calc(100vh - 96px);
    display: flex;
    align-items: center;
    gap: 2.1rem;
    padding: 3.5rem 3rem 3.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-behavior: smooth;
}
.scatter-gallery.is-ordering::-webkit-scrollbar { display: none; }
.scatter-gallery.is-ordering .scatter-photo {
    position: relative;
    left: auto !important;
    top: auto !important;
    flex: 0 0 auto;
    width: clamp(220px, 22vw, 330px);
    height: clamp(310px, 58vh, 560px);
    transform: rotate(0deg) scale(1);
    opacity: 1;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(0,0,0,0.2);
    transition: transform 220ms ease, box-shadow 220ms ease;
}
.scatter-gallery.is-ordering .scatter-photo:hover {
    transform: scale(1.045) !important;
    box-shadow: 0 22px 46px rgba(0,0,0,0.28);
    z-index: 20 !important;
}
.scatter-gallery.is-ordering .scatter-photo:first-child {
    margin-left: 1rem;
}

/* ===============================
   IMAGE LIGHTBOX — GLASS
================================ */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7vh 7vw;
    background: rgba(245,245,245,0.34);
    backdrop-filter: blur(18px) saturate(105%);
    -webkit-backdrop-filter: blur(18px) saturate(105%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
}
.image-lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
body.night .image-lightbox {
    background: rgba(10,10,10,0.44);
}
.image-lightbox__glass {
    position: relative;
    width: min(70vw, 1100px);
    height: min(78vh, 820px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    border: 1px solid rgba(255,255,255,0.52);
    background: rgba(255,255,255,0.16);
    box-shadow: 0 24px 80px rgba(0,0,0,0.22);
    border-radius: 4px;
}
body.night .image-lightbox__glass {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
}
.image-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.18));
}
.image-lightbox__close,
.image-lightbox__nav {
    position: absolute;
    appearance: none;
    border: 0;
    background: rgba(255,255,255,0.34);
    color: #111;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    cursor: pointer;
    font: 400 20px/1 "Ronzino", sans-serif;
    transition: transform 160ms ease, background 160ms ease;
    z-index: 2;
}
.image-lightbox__close { top: -17px; right: -17px; }
.image-lightbox__prev { left: -52px; top: 50%; transform: translateY(-50%); }
.image-lightbox__next { right: -52px; top: 50%; transform: translateY(-50%); }
.image-lightbox__close:hover,
.image-lightbox__nav:hover {
    background: rgba(255,255,255,0.75);
    transform: scale(1.08);
}
.image-lightbox__prev:hover,
.image-lightbox__next:hover { transform: translateY(-50%) scale(1.08); }
body.night .image-lightbox__close,
body.night .image-lightbox__nav {
    background: rgba(20,20,20,0.58);
    color: white;
}
.image-lightbox__counter {
    position: absolute;
    bottom: -2.1rem;
    left: 50%;
    transform: translateX(-50%);
    font: 300 0.72rem/1 "Ronzino", sans-serif;
    opacity: 0.65;
    white-space: nowrap;
}
.image-lightbox__hint {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font: 300 0.68rem/1 "Ronzino", sans-serif;
    opacity: 0.5;
    white-space: nowrap;
}
body.lightbox-open { overflow: hidden; }

.project-media-col img,
.project-media-col video,
.project-media-col figure img {
    cursor: zoom-in;
}

@media (max-width: 768px) {
    .gallery-menu { margin-left: 0; }
    .gallery-project-list { gap: 0.42rem; }
    .scatter-gallery.is-ordering {
        min-height: 62vh;
        padding: 2rem 1rem 2rem 0;
        gap: 1.2rem;
    }
    .scatter-gallery.is-ordering .scatter-photo {
        width: min(72vw, 320px) !important;
        height: min(62vh, 520px) !important;
    }
    .image-lightbox { padding: 8vh 4vw; }
    .image-lightbox__glass {
        width: 92vw;
        height: 76vh;
        padding: 0.6rem;
    }
    .image-lightbox__prev { left: 8px; }
    .image-lightbox__next { right: 8px; }
    .image-lightbox__close { top: 8px; right: 8px; }
    .image-lightbox__hint { display: none; }
}

/* ===============================
   SHOW ALL — SOLO "ORDINA"
================================ */
.gallery-menu {
    margin-left: 0;
}
.gallery-project-list {
    display: none !important;
}
.gallery-sort {
    display: block;
    margin-top: 0;
    font-size: 0.75rem;
    line-height: 1.2;
    color: #d6362c;
    opacity: 0.72;
}
.gallery-sort:hover,
.gallery-sort:focus-visible {
    color: #d6362c;
}
body.night .gallery-sort,
body.night .gallery-sort:hover,
body.night .gallery-sort:focus-visible {
    color: #ff5c4d;
}

/* ===============================
   SHOW ALL — CODA INFINITA
================================ */
.scatter-gallery.is-ordering {
    display: block;
    position: relative;
    width: 100%;
    height: calc(100vh - 96px);
    min-height: 0;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    scroll-behavior: auto;
    overscroll-behavior-x: contain;
    cursor: grab;
}
.scatter-gallery.is-ordering:active {
    cursor: grabbing;
}
.scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
}
.scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scatter-gallery.is-ordering .ordered-track {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    width: max-content;
    min-width: max-content;
    height: 100%;
    padding: 1rem 8vw 1rem 0;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo {
    position: relative !important;
    flex: 0 0 auto;
    left: auto !important;
    top: auto !important;
    width: clamp(230px, 23vw, 350px) !important;
    height: min(62vh, 570px) !important;
    margin: 0 !important;
    border-radius: 0;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    transform: translateY(0) scale(1) !important;
    transition: transform 220ms ease, box-shadow 220ms ease, opacity 300ms ease !important;
    cursor: pointer;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo:hover {
    transform: translateY(0) scale(1.045) !important;
    box-shadow: 0 20px 44px rgba(0,0,0,0.25);
    z-index: 20 !important;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===============================
   IMAGE LIGHTBOX — GLASS SENZA CORNICE
================================ */
.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    background: rgba(245,245,245,0.30);
    backdrop-filter: blur(20px) saturate(105%);
    -webkit-backdrop-filter: blur(20px) saturate(105%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 220ms ease, visibility 220ms ease;
}
.image-lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
body.night .image-lightbox {
    background: rgba(10,10,10,0.42);
}
.image-lightbox__glass {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.image-lightbox__image {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    max-width: 70vw;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    filter: none;
}
.image-lightbox__close {
    position: fixed;
    top: 1.35rem;
    right: 1.45rem;
    appearance: none;
    border: 0;
    background: transparent;
    color: #111;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    cursor: pointer;
    font: 300 30px/1 "Ronzino", sans-serif;
    z-index: 2;
    transition: opacity 160ms ease, transform 160ms ease;
}
.image-lightbox__close:hover {
    opacity: 0.62;
    transform: scale(1.08);
}
body.night .image-lightbox__close {
    color: white;
}
.image-lightbox__counter {
    position: fixed;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    font: 300 0.72rem/1 "Ronzino", sans-serif;
    color: inherit;
    opacity: 0.65;
    white-space: nowrap;
}
.image-lightbox__nav,
.image-lightbox__hint {
    display: none !important;
}

@media (max-width: 768px) {
    .scatter-gallery.is-ordering {
        height: 70vh;
    }
    .scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scatter-gallery.is-ordering .ordered-track {
        gap: 1.2rem;
        padding-right: 7vw;
    }
    .scatter-gallery.is-ordering .scatter-photo.ordered-photo {
        width: min(72vw, 320px) !important;
        height: min(62vh, 520px) !important;
    }
    .image-lightbox__image {
        max-width: 88vw;
        max-height: 78vh;
    }
    .image-lightbox__close {
        top: 0.8rem;
        right: 0.8rem;
    }
}


@media (max-width: 768px) {
    .project.about-page {
        display: block;
        height: calc(100vh - 96px);
        overflow-y: auto;
    }

    .project.about-page > h2,
    .project.about-page > .about-label {
        margin-bottom: 0.75rem;
    }

    .project.about-page > .about-section-content {
        margin-bottom: 2rem;
    }

    .project-meta {
        margin-top: 1.25rem;
        margin-bottom: 1.5rem;
    }
}

/* =========================================================
   MOBILE REFERENCE LAYOUT — 2 FIXED COLUMNS
   ========================================================= */
@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    body {
        background: white;
    }

    body.night {
        background: #111;
        color: white;
    }

    .ui {
        position: relative;
        width: 100%;
        height: 100vh;
        min-height: 100vh;
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        column-gap: 32px;
        padding: 28px 49px 16px 50px;
        overflow: hidden;
        justify-content: initial;
    }

    /* Il menu resta completamente fermo mentre scorre solo la colonna destra. */
    .menu {
        position: relative;
        width: 300px;
        height: calc(100vh - 44px);
        min-width: 0;
        overflow: hidden;
        z-index: 6;
    }

    .menu h1 {
        font-size: 1.25rem;
        line-height: 1;
        letter-spacing: 0.7px;
        margin-bottom: 1.15rem;
        white-space: nowrap;
    }

    .menu a {
        font-size: 1rem;
        line-height: 1.15;
    }

    .menu {
        gap: 1.25rem;
    }

    .submenu {
        margin-left: 1.15rem;
    }

    .submenu a,
    .contact-submenu a {
        font-size: 0.95rem;
        line-height: 1.15;
        margin-top: 0.55rem;
    }

    .contact-submenu {
        margin-left: 0;
    }

    .content {
        grid-column: 2;
        grid-row: 1;
        align-self: stretch;
        width: 100%;
        height: calc(100vh - 44px);
        min-width: 0;
        min-height: 0;
        margin: 0;
        opacity: 1;
        pointer-events: auto;
        overflow: hidden;
    }

    /* -------------------------
       PROJECT PAGE
       ------------------------- */
    .project {
        display: block;
        width: 100%;
        max-width: none;
        height: 100%;
        min-height: 0;
        padding: 0 0 2rem;
        border-right: 0;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .project::-webkit-scrollbar {
        display: none;
    }

    .project > h2 {
        display: block;
        margin: 0 0 2.35rem;
        padding: 0;
        font-size: 1.25rem;
        line-height: 1;
        font-weight: 700;
        letter-spacing: 0.7px;
        color: inherit;
        opacity: 1;
        cursor: pointer;
        user-select: none;
    }

    .project > h2:focus-visible {
        outline: 1px solid currentColor;
        outline-offset: 5px;
    }

    .project-text-col {
        display: block;
        width: 100%;
        height: auto;
        overflow: visible;
        padding: 0;
        margin: 0;
    }

    .project-copy {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .project-copy.is-collapsed {
        overflow: hidden;
    }

    .project p,
    .project li,
    .project figcaption {
        font-size: 1rem;
        line-height: 1.18;
        font-weight: 400;
        color: #aaa;
        opacity: 1;
        text-align: left;
        text-indent: 0;
        margin: 0 0 0.65rem;
    }

    /* Il testo parte sulla stessa linea verticale di “Show All Projects”. */
    .project-text-col {
        padding-top: 0.1rem;
    }

    .project-copy-toggle {
        appearance: none;
        display: block;
        border: 0;
        padding: 0;
        margin: 0.35rem 0 1.5rem;
        background: transparent;
        color: #aaa;
        font: 400 0.72rem/1 "Ronzino", sans-serif;
        text-decoration: underline;
        cursor: pointer;
    }

    .project-copy-toggle[hidden] {
        display: none;
    }

    /* Meta nascosto: compare con un click sul titolo. */
    .project-meta {
        display: block;
        height: 0;
        max-height: 0;
        margin: 0;
        padding: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-8px);
        transition: max-height 260ms ease, opacity 220ms ease, transform 260ms ease, margin 260ms ease;
    }

    .project.meta-open .project-meta {
        height: auto;
        max-height: 180px;
        margin: 0 0 0.8rem;
        opacity: 1;
        transform: translateY(0);
    }

    .project-meta-item {
        display: block;
        margin: 0 0 0.55rem;
    }

    .project-meta .meta-label {
        display: block;
        font-size: 0.68rem;
        line-height: 1.1;
        font-weight: 500;
        letter-spacing: 0.5px;
        opacity: 0.62;
    }

    .project-meta .meta-value {
        display: block;
        font-size: 0.75rem;
        line-height: 1.15;
        font-weight: 400;
        opacity: 0.78;
        text-transform: lowercase;
    }

    .project-media-col {
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
        overflow: visible;
        gap: 1.25rem;
        padding: 0;
        margin: 0;
    }

    .project-media-col img,
    .project-media-col video,
    .project-media-col figure {
        width: 100%;
        height: auto;
        display: block;
        margin: 0;
    }

    /* -------------------------
       SHOW ALL — RIGHT COLUMN
       ------------------------- */
    .ui.mobile-gallery-open {
        grid-template-columns: 267px 400px;
        column-gap: 32px;
        padding-left: 20px;
        padding-right: 17px;
    }

    .ui.mobile-gallery-open .menu {
        width: auto;
    }

    .mobile-column-gallery {
        width: 100%;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        padding: 0 0 2rem;
    }

    .mobile-column-gallery::-webkit-scrollbar {
        display: none;
    }

    .mobile-column-gallery__track {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
    }

    .mobile-gallery-card {
        position: relative;
        display: block;
        width: 100%;
        flex: 0 0 auto;
        overflow: hidden;
        text-decoration: none;
        color: inherit;
        opacity: 0;
        transform: translateY(140px);
        transition:
            opacity 360ms ease var(--gallery-delay),
            transform 520ms cubic-bezier(.16,.84,.24,1) var(--gallery-delay);
    }

    .mobile-column-gallery.is-ready .mobile-gallery-card {
        opacity: 1;
        transform: translateY(0);
    }

    .mobile-column-gallery.is-closing .mobile-gallery-card {
        opacity: 0;
        transform: translateY(90px);
        transition-delay: 0ms;
    }

    .mobile-gallery-card img {
        display: block;
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: contain;
        pointer-events: none;
        -webkit-user-drag: none;
    }

    .mobile-gallery-card.img-missing {
        min-height: 60vh;
        background: linear-gradient(135deg, #f1f1f1, #dedede);
    }

    body.night .mobile-gallery-card.img-missing {
        background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    }

    .mobile-gallery-card .fallback-label {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 60vh;
        padding: 1rem;
        font-size: 0.9rem;
        color: #888;
    }

    /* -------------------------
       NIGHT + LANGUAGE — BOTTOM LEFT
       ------------------------- */
    #nightDayWrapper {
        position: fixed;
        left: 19px;
        bottom: 20px;
        top: auto;
        right: auto;
        z-index: 9999;
        display: flex;
        align-items: center;
        gap: 0.55rem;
        font-size: 0.85rem;
        cursor: pointer;
    }

    #nightDayButton,
    .toggle-circle {
        width: 15px;
        height: 15px;
        flex: 0 0 15px;
    }

    .lang-corner {
        position: fixed;
        left: 19px;
        bottom: 20px;
        top: auto;
        right: auto;
        z-index: 9999;
        display: flex;
        align-items: center;
        gap: 0.55rem;
    }

    .lang-btn {
        font-size: 0.85rem;
    }
}

/* Smartphone stretto: conserva la gerarchia della reference senza
   comprimere la colonna destra sotto una soglia leggibile. */
@media (max-width: 700px) {
    .ui {
        grid-template-columns: minmax(245px, 1fr) minmax(0, 1fr);
        column-gap: 24px;
        padding-left: 20px;
        padding-right: 12px;
    }

    .menu {
        width: 100%;
    }

    .ui.mobile-gallery-open {
        grid-template-columns: minmax(245px, 0.95fr) minmax(0, 1.55fr);
        column-gap: 24px;
        padding-left: 20px;
        padding-right: 12px;
    }
}


/* Mobile project text: source is hidden only on small screens; desktop shows the real source. */
.project-copy { display: none; }
@media (max-width: 768px) {
    .project-copy-source { display: none !important; }
    .project-copy { display: block; }
    .project-copy p.lang-en { display: none; }
    body.lang-en .project-copy p.lang-it { display: none; }
    body.lang-en .project-copy p.lang-en { display: block; }
}


.project-media-col .project-gallery-set {
    display: none;
    flex-direction: column;
    gap: 1rem;
}
.project-media-col .project-gallery-set.is-set-active {
    display: flex;
}


/* FINAL: raccolte sempre immediatamente sotto il titolo */
@media (min-width: 769px) {
  .project { position: relative; }
  .project > h2 { position: relative; z-index: 3; margin-bottom: 0; }
  .project > .project-set-switch {
    position: absolute;
    left: 0;
    top: 1.45rem;
    margin: 0 !important;
    z-index: 5;
  }
}
@media (max-width: 768px) {
  .project > h2 {
    margin-bottom: .55rem !important;
    color: inherit;
    opacity: 0.6;
  }
  .project > .project-set-switch {
    position: static;
    margin: 0 0 1.5rem !important;
  }
}


/* Raccolte: alla fine dell'articolo, dentro la colonna del corpo testo. */
.project-text-col > .project-set-switch {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    width: max-content;
    margin: 1.5rem 0 0;
    padding: 0;
    position: static !important;
    z-index: auto;
}
.project-text-col > .project-set-switch .project-set-btn {
    display: block;
}
@media (max-width: 768px) {
    .project-text-col > .project-set-switch {
        margin: 1.5rem 0 1.5rem;
    }
}


/* ===============================
   SHOW ALL — ORDINA IN GRIGLIA
   Override finale: niente carosello orizzontale.
================================ */
.scatter-gallery.is-ordering {
    display: block;
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 2rem 2.5rem 5rem 0;
    overflow: visible;
}
.scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scatter-gallery.is-ordering .ordered-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem 1.5rem;
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 0;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    height: clamp(240px, 34vw, 500px) !important;
    margin: 0 !important;
    transform: translateY(0) scale(1) !important;
    border-radius: 0;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    cursor: pointer;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo:hover {
    transform: scale(1.025) !important;
    box-shadow: 0 18px 38px rgba(0,0,0,0.24);
    z-index: 20 !important;
}

@media (max-width: 1100px) {
    .scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scatter-gallery.is-ordering .ordered-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .gallery-menu.visible {
        display: block;
    }
    .scatter-gallery.is-ordering {
        padding: 1.5rem 1rem 4rem 0;
    }
    .scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scatter-gallery.is-ordering .ordered-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
    .scatter-gallery.is-ordering .scatter-photo.ordered-photo {
        height: 54vw !important;
    }

    .mobile-column-gallery.is-ordering {
        height: auto;
        overflow: visible;
    }
    .mobile-column-gallery.is-ordering .mobile-column-gallery__track {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.8rem;
    }
    .mobile-column-gallery.is-ordering .mobile-gallery-card {
        width: 100% !important;
        height: 54vw !important;
        transform: none !important;
    }
}

/* ===============================
   FINAL — ORDINA: GRIGLIA SCORRIBILE + ASPECT RATIO
================================ */
.scatter-gallery.is-ordering {
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 1rem;
}
.scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scatter-gallery.is-ordering .ordered-track {
    align-items: start;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo {
    height: auto !important;
    min-height: 0 !important;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo img {
    display: block;
    width: 100%;
    height: auto !important;
    max-height: 30vh;
    object-fit: contain;
}
.gallery-sort {
    text-transform: none !important;
}

@media (max-width: 768px) {
    /* I due controlli restano in basso a sinistra, affiancati e separati. */
    #nightDayWrapper {
        left: 19px;
        bottom: 20px;
    }
    .lang-corner {
        left: 92px;
        bottom: 20px;
    }

    .scatter-gallery.is-ordering,
    .mobile-column-gallery.is-ordering {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        overflow-x: hidden;
    }

    .scatter-gallery.is-ordering .scatter-photo.ordered-photo {
        height: auto !important;
    }
    .scatter-gallery.is-ordering .scatter-photo.ordered-photo img {
        max-height: 24vh;
    }

    .mobile-column-gallery.is-ordering .mobile-gallery-card {
        height: auto !important;
        min-height: 0 !important;
    }
    .mobile-column-gallery.is-ordering .mobile-gallery-card img {
        width: 100%;
        height: auto !important;
        max-height: 30vh;
        object-fit: contain;
    }
}


/* ===============================
   ORDINA — TRANSIZIONI FLUIDE / NESSUNA CORNICE
================================ */
.scatter-gallery.is-ordering {
    transition: opacity 420ms cubic-bezier(.22,1,.36,1);
}
.scatter-gallery.is-ordering::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.scatter-gallery.is-ordering .ordered-track {
    transition: opacity 420ms cubic-bezier(.22,1,.36,1), transform 520ms cubic-bezier(.22,1,.36,1);
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo {
    background: transparent !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    transition: transform 420ms cubic-bezier(.22,1,.36,1), opacity 420ms cubic-bezier(.22,1,.36,1) !important;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo img {
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
}
.scatter-gallery.is-ordering .scatter-photo.ordered-photo:hover {
    box-shadow: none !important;
    transform: scale(1.018) !important;
}

@media (max-width: 768px) {
  .project-copy-toggle { display: none !important; }
}

/* MOBILE — titoli progetto e body copy allineati alla gerarchia About */
@media (max-width: 768px) {
    .project > h2,
    .project.about-page .about-label {
        font-size: 1rem !important;
        line-height: 1.1 !important;
        font-weight: 700;
        letter-spacing: 1px;
        color: inherit !important;
        opacity: 0.7 !important;
    }

    .project p,
    .project li,
    .project figcaption {
        font-size: 0.95rem;
        line-height: 1.5;
        text-align: left !important;
    }
}

/* DESKTOP — project article copy justified, with indent only on the first line */
@media (min-width: 769px) {
    .project p {
        text-align: justify;
        text-indent: 1.4em;
        hyphens: auto;
        word-spacing: normal;
    }

    .project li,
    .project figcaption {
        text-align: left;
        text-indent: 0;
    }
}

/* DESKTOP — justified copy: only the first paragraph of each project is indented */
@media (min-width: 769px) {
    .project p {
        text-align: justify;
        text-indent: 0;
        hyphens: auto;
        word-spacing: normal;
    }

    .project p:first-of-type {
        text-indent: 1.4em;
    }

    .project li,
    .project figcaption {
        text-align: left;
        text-indent: 0;
    }
}


/* Language-aware typography */
html:lang(it), .lang-it {
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

html:lang(en), .lang-en {
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
}

/* Keep the first line of the first article paragraph indented in both languages */
.article-content p:first-of-type,
.article-text p:first-of-type,
.post-content p:first-of-type,
.project-content p:first-of-type {
  text-indent: 1.5em;
}

/* Mobile-only elements stay completely invisible on desktop/web. */
.mobile-topbar,
.mobile-footer { display: none; }

/* =========================================================
   MOBILE ONLY — v4
   Desktop/web rules above are intentionally untouched.
   ========================================================= */
@media (max-width: 768px) {
    html, body {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-text-size-adjust: 100%;
    }

    body { padding: 0; }
    canvas { z-index: 1; pointer-events: none; }

    /* Mobile header */
    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 10000;
        height: calc(48px + env(safe-area-inset-top));
        padding: env(safe-area-inset-top) 16px 0;
        display: flex;
        align-items: center;
        gap: 8px;
        background: rgba(255,255,255,.94);
        color: #666;
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    body.night .mobile-topbar { background: rgba(17,17,17,.94); color: #d0d0d0; }

    .mobile-brand {
        appearance: none;
        border: 0 !important;
        background: transparent !important;
        color: inherit !important;
        padding: 0;
        font: 500 .78rem/1 "Ronzino", sans-serif;
        letter-spacing: .8px;
        white-space: nowrap;
        cursor: pointer;
    }
    .mobile-project-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #666;
        font: 300 .74rem/1 "Ronzino", sans-serif;
        letter-spacing: .3px;
    }
    body.night .mobile-project-title { color: #cfcfcf; }

    .hamburger {
        margin-left: auto;
        flex: 0 0 24px;
        width: 24px;
        height: 20px;
        padding: 2px 0;
        border: 0 !important;
        background: transparent !important;
        color: #666 !important;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        cursor: pointer;
        appearance: none;
        -webkit-appearance: none;
    }
    body.night .hamburger { color: #d0d0d0 !important; }
    .hamburger span {
        display: block;
        width: 100%;
        height: 1px;
        background: currentColor !important;
    }
    body.mobile-menu-open .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    body.mobile-menu-open .hamburger span:nth-child(2) { opacity: 0; }
    body.mobile-menu-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Hide desktop navigation while the mobile overlay is closed. */
    .ui {
        position: relative;
        z-index: 5;
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 100svh;
        padding: calc(48px + env(safe-area-inset-top)) 16px 70px;
        margin: 0;
        overflow: visible;
    }

    /* Hamburger menu: same visual treatment as PROJECT. */
    .menu {
        position: fixed;
        top: calc(48px + env(safe-area-inset-top));
        left: 0;
        right: 0;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .58rem;
        width: 100%;
        max-height: calc(100svh - 48px - env(safe-area-inset-top));
        padding: 18px 16px 28px;
        overflow-y: auto;
        background: rgba(255,255,255,.97);
        color: #666;
        border: 0 !important;
        box-shadow: none !important;
        transform: translateY(-10px);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    }
    body.night .menu { background: rgba(17,17,17,.97); color: #d0d0d0; }
    body.mobile-menu-open .menu {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .menu h1 { display: none; }
    .menu > .show-all-nav-link,
    .menu > .gallery-menu,
    .menu .contact-item { display: none !important; }

    .menu > a,
    .menu .toggle {
        color: #666 !important;
        opacity: .72;
        font-size: .9rem;
        line-height: 1.05;
        font-weight: 500;
        font-variant-caps: all-small-caps;
        font-variant: small-caps;
        letter-spacing: .75px;
        text-transform: none;
        text-decoration: none !important;
        border: 0 !important;
    }
    body.night .menu > a,
    body.night .menu .toggle { color: #d0d0d0 !important; }
    .menu .menu-item { width: 100%; cursor: pointer; }
    .submenu {
        margin: .18rem 0 0 .72rem;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height .22s ease, opacity .22s ease;
        border: 0 !important;
    }
    .menu-item.open .submenu { max-height: 240px; opacity: .72; }
    .submenu a {
        display: block;
        margin: .28rem 0 0;
        color: #666 !important;
        font-size: .73rem;
        line-height: 1.15;
        font-weight: 300;
        font-variant: normal;
        text-transform: lowercase;
        letter-spacing: .15px;
        text-decoration: none !important;
        border: 0 !important;
    }
    body.night .submenu a { color: #d0d0d0 !important; }

    /* Home: first image of every article, centered, ~25vw wide. */
    .content {
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        margin: 0;
        opacity: 1;
        pointer-events: auto;
        overflow: visible;
    }
    .project {
        width: 100%;
        max-width: none;
        height: auto;
        min-height: 0;
        max-height: none;
        margin: 0;
        padding: 0 0 2rem;
        border: 0 !important;
        overflow: visible;
        display: block;
    }
    .mobile-home-gallery {
        width: 100%;
        min-height: calc(100svh - 80px);
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 11svh 0 4rem;
        overflow: visible;
    }
    .mobile-home-gallery__track {
        width: 25vw;
        max-width: 120px;
        min-width: 72px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }
    .mobile-home-card {
        display: block;
        width: 100%;
        opacity: 0;
        transform: translateY(10px);
        transition: opacity .42s ease var(--home-delay), transform .52s ease var(--home-delay);
    }
    .mobile-home-gallery.is-ready .mobile-home-card { opacity: 1; transform: translateY(0); }
    .mobile-home-card img {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: contain;
    }

    /* Mobile project pages */
    .project > h2 { display: none; }
    .project-text-col,
    .project-media-col,
    .project.about-page > .about-text-col {
        display: block;
        width: 100%;
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 0;
        margin: 0;
    }
    .project-text-col { margin-bottom: 1.5rem; }
    .project-copy { width: 100%; max-width: 100%; }
    .project p, .project li, .project figcaption {
        max-width: 100%;
        font-size: .9rem;
        line-height: 1.4;
        text-align: left !important;
        overflow-wrap: break-word;
    }
    .project-media-col {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    .project-media-col img,
    .project-media-col video,
    .project-media-col figure,
    .project-media-col figure img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
    }
    .project-meta { border: 0 !important; }
    .project > * { border-left: 0 !important; border-right: 0 !important; }

    /* Day/Night: the word itself is the switch. */
    #nightDayWrapper {
        position: fixed !important;
        left: 16px !important;
        right: auto !important;
        top: auto !important;
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
        z-index: 10001 !important;
        display: block !important;
        font: 300 .72rem/1 "Ronzino", sans-serif !important;
        color: #666 !important;
        cursor: pointer;
    }
    body.night #nightDayWrapper { color: #d0d0d0 !important; }
    #nightDayButton { display: none !important; }
    #nightDayLabel { display: inline !important; }

    /* Language switch: top-right, next to the hamburger. */
    .lang-corner {
        position: fixed !important;
        top: calc(16px + env(safe-area-inset-top)) !important;
        right: 54px !important;
        bottom: auto !important;
        left: auto !important;
        z-index: 10001 !important;
        display: flex !important;
        gap: .45rem !important;
        align-items: center;
    }
    .lang-btn {
        color: inherit !important;
        font-size: .68rem !important;
        border: 0 !important;
        background: transparent !important;
        padding: 0 !important;
    }

    /* Footer only contains email + Instagram. */
    .mobile-footer {
        position: relative;
        z-index: 6;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 18px 16px max(20px, env(safe-area-inset-bottom));
        color: #666;
        font: 300 .7rem/1.2 "Ronzino", sans-serif;
    }
    body.night .mobile-footer { color: #ccc; }
    .mobile-footer a { color: inherit; text-decoration: none; overflow-wrap: anywhere; }
}
\n\n/* =========================================================\n   MOBILE FINAL TWEAKS — v5\n   Desktop/web rules are not touched.\n   ========================================================= */\n@media (max-width: 768px) {\n    /* Home: project thumbnails in a compact grid, never a column. */\n    .mobile-home-gallery {\n        width: 100%;\n        padding: calc(62px + env(safe-area-inset-top)) 0\n                 calc(82px + env(safe-area-inset-bottom));\n        display: flex;\n        justify-content: center;\n        align-items: flex-start;\n    }\n\n    .mobile-home-gallery__track {\n        width: 78vw;\n        max-width: none;\n        min-width: 0;\n        display: grid;\n        grid-template-columns: repeat(3, minmax(0, 1fr));\n        align-items: start;\n        justify-items: center;\n        column-gap: 3.5vw;\n        row-gap: 5vw;\n    }\n\n    .mobile-home-card {\n        width: 25vw;\n        max-width: 120px;\n        min-width: 0;\n        margin: 0;\n    }\n\n    .mobile-home-card img {\n        display: block;\n        width: 100%;\n        height: auto;\n        max-width: 100%;\n        object-fit: contain;\n    }\n\n    /* Footer: contacts aligned to the right. */\n    .mobile-footer {\n        justify-content: flex-end;\n        text-align: right;\n        flex-wrap: wrap;\n        margin-left: auto;\n    }\n\n    .mobile-footer a {\n        flex: 0 0 auto;\n    }\n\n    /* Day/Night stays at bottom-left; the word itself is the switch. */\n    #nightDayWrapper {\n        left: 16px !important;\n        right: auto !important;\n        bottom: max(16px, env(safe-area-inset-bottom)) !important;\n    }\n\n    /* Keep the mobile menu animation smooth when a page link is tapped. */\n    .menu {\n        transition: opacity .22s ease, transform .22s ease, visibility .22s ease !important;\n    }\n}\n\n@media (max-width: 480px) {\n    .mobile-home-gallery__track {\n        width: 82vw;\n        column-gap: 3vw;\n        row-gap: 6vw;\n    }\n    .mobile-home-card {\n        width: 25vw;\n    }\n}\n

/* =========================================================
   MOBILE PATCH — HOME MASONRY + FOOTER CONTROLS
   Final overrides for v5.
   ========================================================= */
@media (max-width: 768px) {
    /* Home: phone-gallery / masonry layout.
       Images keep their native aspect ratio; no forced tile height. */
    .mobile-home-gallery {
        width: 100%;
        min-height: calc(100svh - 80px);
        display: block;
        padding: calc(62px + env(safe-area-inset-top)) 0
                 calc(82px + env(safe-area-inset-bottom));
        overflow: visible;
    }

    .mobile-home-gallery__track {
        width: min(92vw, 520px);
        margin: 0 auto;
        min-width: 0;
        display: block;
        column-count: 3;
        column-gap: 10px;
        column-fill: balance;
    }

    .mobile-home-card {
        display: block;
        width: 100%;
        margin: 0 0 12px;
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        opacity: 0;
        transform: translateY(10px);
        transition: opacity .42s ease var(--home-delay), transform .52s ease var(--home-delay);
    }

    .mobile-home-gallery.is-ready .mobile-home-card {
        opacity: 1;
        transform: translateY(0);
    }

    .mobile-home-card img {
        display: block;
        width: 100%;
        height: auto !important;
        max-width: 100%;
        object-fit: contain;
    }

    /* Fixed bottom controls: contacts on the right, Day/Night on the left. */
    .mobile-footer {
        position: fixed !important;
        left: auto !important;
        right: 16px !important;
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: 70vw;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 10001 !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 12px !important;
        text-align: right !important;
    }

    .mobile-footer a {
        flex: 0 0 auto !important;
        white-space: nowrap;
    }

    #nightDayWrapper {
        position: fixed !important;
        left: 16px !important;
        right: auto !important;
        top: auto !important;
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
        z-index: 10002 !important;
    }
}

@media (max-width: 480px) {
    .mobile-home-gallery__track {
        width: calc(100vw - 20px);
        column-gap: 7px;
    }

    .mobile-home-card {
        margin-bottom: 8px;
    }

    .mobile-footer {
        right: 12px !important;
        gap: 8px !important;
        max-width: 78vw;
    }

    #nightDayWrapper {
        left: 12px !important;
    }
}


/* =========================================================
   MOBILE FIX — FINAL 3-COLUMN HOME + SAFE CONTENT/FOOTER
   ========================================================= */
@media (max-width: 768px) {
    /* Keep the fixed header from covering the beginning of project text. */
    .content {
        width: 100% !important;
        padding-top: calc(76px + env(safe-area-inset-top)) !important;
        padding-bottom: calc(96px + env(safe-area-inset-bottom)) !important;
        box-sizing: border-box !important;
    }

    .project {
        box-sizing: border-box !important;
        padding-top: 0 !important;
        padding-bottom: 2rem !important;
        overflow: visible !important;
    }

    /* Home gallery: always three real columns, with natural image ratios. */
    .mobile-home-gallery {
        box-sizing: border-box !important;
        width: 100% !important;
        min-height: 0 !important;
        padding: 0 12px calc(100px + env(safe-area-inset-bottom)) !important;
        display: block !important;
        overflow: visible !important;
    }

    .mobile-home-gallery__track {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-auto-flow: row !important;
        align-items: start !important;
        justify-items: stretch !important;
        column-gap: 8px !important;
        row-gap: 8px !important;
        column-count: initial !important;
        columns: initial !important;
    }

    .mobile-home-card {
        box-sizing: border-box !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        break-inside: auto !important;
        -webkit-column-break-inside: auto !important;
    }

    .mobile-home-card img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }

    /* Fixed contacts: bottom-right, never laid out in normal document flow. */
    .mobile-footer {
        position: fixed !important;
        left: auto !important;
        right: 12px !important;
        bottom: max(14px, env(safe-area-inset-bottom)) !important;
        width: auto !important;
        max-width: calc(100vw - 92px) !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 10001 !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 10px !important;
        text-align: right !important;
        pointer-events: auto !important;
    }

    .mobile-footer a {
        flex: 0 1 auto !important;
        white-space: nowrap !important;
        overflow-wrap: normal !important;
    }

    /* Day stays independently fixed at bottom-left. */
    #nightDayWrapper {
        position: fixed !important;
        left: 12px !important;
        right: auto !important;
        top: auto !important;
        bottom: max(14px, env(safe-area-inset-bottom)) !important;
        z-index: 10002 !important;
    }
}

@media (max-width: 480px) {
    .content {
        padding-top: calc(72px + env(safe-area-inset-top)) !important;
        padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important;
    }

    .mobile-home-gallery {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .mobile-home-gallery__track {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        column-gap: 6px !important;
        row-gap: 6px !important;
    }

    .mobile-footer {
        right: 8px !important;
        max-width: calc(100vw - 76px) !important;
        gap: 7px !important;
        font-size: .66rem !important;
    }

    #nightDayWrapper {
        left: 8px !important;
    }
}


/* =========================================================
   MOBILE ARTICLE STABILITY — FINAL
   One normal document scroll; title only in the fixed top bar.
   ========================================================= */
@media (max-width: 768px) {
    html,
    body {
        width: 100% !important;
        min-height: 100% !important;
        height: auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .ui {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100svh !important;
        display: block !important;
        overflow: visible !important;
        padding: calc(48px + env(safe-area-inset-top)) 16px 100px !important;
        box-sizing: border-box !important;
    }

    .menu {
        position: fixed !important;
        top: calc(48px + env(safe-area-inset-top)) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-height: calc(100svh - 48px - env(safe-area-inset-top)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
    }

    .content {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 0 calc(100px + env(safe-area-inset-bottom)) !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    .project,
    .project.about-page {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    /* The article title is represented once, in .mobile-project-title. */
    .project h2,
    .project.about-page h2 {
        display: none !important;
    }

    .mobile-project-title {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    /* Do not clone/hide the article body on mobile: use the original language
       paragraphs directly. This removes the intermittent duplicated/blocked copy. */
    .project-copy {
        display: none !important;
    }

    .project-copy-source {
        display: block !important;
    }

    body.lang-en .project-copy-source.lang-it,
    body:not(.lang-en) .project-copy-source.lang-en {
        display: none !important;
    }

    .project-copy-toggle {
        display: none !important;
    }

    .project-text-col,
    .project.about-page > .about-text-col {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 0 !important;
        margin: 0 0 1.5rem !important;
        box-sizing: border-box !important;
    }

    .project p,
    .project li,
    .project figcaption {
        position: static !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        transform: none !important;
        clip: auto !important;
        font-size: .9rem !important;
        line-height: 1.4 !important;
        margin: 0 0 .75rem !important;
    }

    .project-media-col {
        display: flex !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .project-media-col img,
    .project-media-col video,
    .project-media-col figure,
    .project-media-col figure img {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        transform: none !important;
        margin: 0 !important;
    }

    /* Fixed controls remain independent from the article flow. */
    .mobile-footer {
        position: fixed !important;
        left: auto !important;
        right: 12px !important;
        bottom: max(14px, env(safe-area-inset-bottom)) !important;
        z-index: 10001 !important;
    }

    #nightDayWrapper {
        position: fixed !important;
        left: 12px !important;
        right: auto !important;
        top: auto !important;
        bottom: max(14px, env(safe-area-inset-bottom)) !important;
        z-index: 10002 !important;
    }
}

/* =========================================================
   MOBILE HEADER + MENU TYPOGRAPHY — FINAL
   ========================================================= */
@media (max-width: 768px) {
    /* Project title: centered in the header, between the brand and language controls. */
    .mobile-topbar {
        position: fixed !important;
        justify-content: initial !important;
    }

    .mobile-project-title {
        position: absolute !important;
        left: 50% !important;
        top: calc(50% + env(safe-area-inset-top) / 2) !important;
        transform: translate(-50%, -50%) !important;
        width: min(42vw, 220px) !important;
        max-width: 42vw !important;
        margin: 0 !important;
        text-align: center !important;
        font-weight: 300 !important;
        letter-spacing: .2px !important;
    }

    /* Main hamburger labels: light weight, no small-caps / mixed letter heights. */
    .menu > a,
    .menu .toggle {
        font-family: "Ronzino", sans-serif !important;
        font-size: .9rem !important;
        line-height: 1.08 !important;
        font-weight: 300 !important;
        font-variant: normal !important;
        font-variant-caps: normal !important;
        text-transform: uppercase !important;
        letter-spacing: .35px !important;
        opacity: .68 !important;
    }
}


/* =========================================================
   MOBILE FINAL MICRO-TWEAKS — HEADER BASELINE + MENU SPACING
   ========================================================= */
@media (max-width: 768px) {
    /* Project title: same size as TASHI DORJEE and baseline-aligned. */
    .mobile-brand {
        font-size: .78rem !important;
        line-height: 1 !important;
    }

    .mobile-project-title {
        font-size: .78rem !important;
        line-height: 1 !important;
        font-weight: 300 !important;
        letter-spacing: .2px !important;
        top: calc(50% + env(safe-area-inset-top) / 2) !important;
        transform: translate(-50%, -50%) !important;
    }

    /* Keep the same vertical rhythm between every main hamburger item. */
    .menu {
        row-gap: .58rem !important;
    }
    .menu > .top-link + .menu-item {
        margin-top: 0 !important;
    }
}

/* =========================================================
   MOBILE MENU — UNIFORM ITEM RHYTHM
   ========================================================= */
@media (max-width: 768px) {
    /* Every top-level menu entry occupies the same vertical rhythm.
       Closed submenus must not contribute hidden margin/height. */
    .menu {
        gap: 0 !important;
    }

    .menu > .top-link,
    .menu > .menu-item {
        margin: 0 0 .95rem 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        line-height: 1.08 !important;
    }

    .menu > .menu-item > .toggle {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1.08 !important;
    }

    .menu > .menu-item:not(.open) > .submenu {
        display: none !important;
        margin: 0 !important;
        max-height: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        border: 0 !important;
    }

    .menu > .menu-item.open > .submenu {
        margin-top: .18rem !important;
    }

    .menu > .menu-item:last-child,
    .menu > .top-link:last-child {
        margin-bottom: 0 !important;
    }
}
