/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.about-main-content {
    width: 82%;
}

@media (min-aspect-ratio: 21/9) {
    .about-main-content {
        width: 60%;
    }
}

@media (max-width: 600px) {
    .about-main-content {
        width: 100%;
    }
}
/* Legacy Replica font stack */
@font-face {
    font-family: 'replica-light';
    src: url('../fonts/Replica-Light.eot');
    src: url('../fonts/Replica-Light.eot?#iefix') format('embedded-opentype'), url('../fonts/Replica-Light.woff2') format('woff2'), url('../fonts/Replica-Light.woff') format('woff'), url('../fonts/Replica-Light.ttf') format('truetype'), url('../fonts/Replica-Light.svg#Replica-Light') format('svg');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'replica-regular';
    src: url('../fonts/Replica-Regular.eot');
    src: url('../fonts/Replica-Regular.eot?#iefix') format('embedded-opentype'), url('../fonts/Replica-Regular.woff2') format('woff2'), url('../fonts/Replica-Regular.woff') format('woff'), url('../fonts/Replica-Regular.ttf') format('truetype'), url('../fonts/Replica-Regular.svg#Replica-Regular') format('svg');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'replica-bold';
    src: url('../fonts/Replica-Bold.eot');
    src: url('../fonts/Replica-Bold.eot?#iefix') format('embedded-opentype'), url('../fonts/Replica-Bold.woff2') format('woff2'), url('../fonts/Replica-Bold.woff') format('woff'), url('../fonts/Replica-Bold.ttf') format('truetype'), url('../fonts/Replica-Bold.svg#Replica-Bold') format('svg');
    font-weight: 700;
    font-style: normal;
}

html, body {
    height: 100%;
    font-family: 'replica-light', sans-serif;
    font-size: 15px;
    letter-spacing: 0.05rem;
    line-height: 1.3rem;
    color: #444;
    background: #f1f1f1;
    overflow-x: hidden;
    overflow-y: auto;
}


/* Strong emphasis uses Manrope for a crisper bold */
strong, b, .strong {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}

header .logo {
    font-family: 'replica-regular', sans-serif;
    letter-spacing: 0.03em;
}

#menu {
    font-family: 'replica-light', sans-serif;
    letter-spacing: 0.05rem;
}

h1 {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}

a {
    color: #444;
    text-decoration: none;
    transition: opacity 0.3s;
}

    a:hover {
        opacity: 0.7;
    }

/* GRID SYSTEM per pagine interne */
#container, #container-fluid {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: row;
}

.col-4 {
    width: 33.33%;
    min-width: 300px;
    max-width: 400px;
}

.col-6 {
    width: 50%;
}

.col-8 {
    width: 66.67%;
    flex: 1;
}

.col-12 {
    width: 100%;
}

/* HEADER - Sidebar sinistra */
body.has-sidebar header {
    position: relative; /* non fixed: resta nella col-4 del flex container */
    width: 33.33%;
    min-width: 300px;
    max-width: 400px;
    height: 100vh;
    overflow-y: auto;
    background: #f1f1f1;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

    body.has-sidebar header #menu {
        display: block !important; /* Force menu visibility in sidebar mode */
        margin-top: 20px;
    }

/* About block rendered inside header */
body.has-sidebar header {
    /* controlla quanto il blocco resta vicino al fondo: aumenta per alzarlo */
    --about-left-bottom-offset: 150px;
}

    body.has-sidebar header .about-left {
        margin-top: 0; /* no auto push */
        margin-top: auto; /* keep bottom behavior */
        padding-top: 0;
        padding-bottom: var(--about-left-bottom-offset);
    }

/* MAIN - Area contenuto destra */
body.has-sidebar main {
    /* niente margin-left: il container flex gestisce le colonne */
    min-height: 100vh;
    width: 66.67%; /* col-8 */
    flex: 1 1 auto; /* permette di espandersi quando la sidebar è più stretta */
    padding: 0;
    background: #f1f1f1;
}

@media (min-width: 1200px) {
    body.has-sidebar header {
        width: 400px;
        max-width: 4000px;
    }

    body.has-sidebar main {
        width: calc(100% - 400px); /* si adatta alla larghezza effettiva sidebar */
    }
}

/* HEADER - Solo angolo in alto a sinistra sulla home */
header {
    position: fixed;
    left: 0;
    top: 0;
    margin: 0;
    padding-left: 30px;
    padding-top: 30px;
    z-index: 1001;
    background: #f1f1f1;
}

    header .logo {
        display: inline-block;
        margin-bottom: 15px;
        cursor: pointer;
        background: #f1f1f1;
        padding: 10px 10px 10px 0;
        color: #000;
        font-family: 'replica-regular', sans-serif;
        font-weight: 400;
        font-size: 20px; /* base */
    }

.logo {
    color: rgb(0, 0, 0);
    font-size: 20px;
    background: transparent;
    padding: 0;
}

body.has-sidebar header .logo {
    background: transparent;
    padding: 0;
    color: #000;
    font-size: 20px; /* +2 rispetto al resto del menu */
}

/* Base menu styling: no underline, grey regular; selected black regular */
#menu a {
    display: block;
    font-size: 16px;
    margin: 6px 0;
    color: #A9A9A9;
    font-weight: 400;
    text-decoration: none;
    position: relative;
    padding: 2px 0;
}

    #menu a.selected,
    #menu a:hover {
        color: #000;
        font-weight: 400;
        text-decoration: none;
        opacity: 1;
    }

/* Works header internal layout */
.works-header .menu-filters {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Align categories list a bit lower to line up with "Works" */
.works-header .filters-list {
    margin-top: 24px;
}

/* Ensure filters list is vertical on desktop */
.filters-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .filters-list a {
        font-size: 14px;
        color: #A9A9A9;
        line-height: 1.2rem;
        font-weight: 400;
        text-decoration: none;
    }

        .filters-list a:hover,
        .filters-list a.selected-filter {
            color: #000;
            font-weight: 400;
            text-decoration: none;
        }

/* Project titles: black light, on hover black regular */
.project-title {
    font-size: 15px;
    color: #666;
    padding-top: 3px;
    margin-top: 6px;
    line-height: 1.2;
    font-family: 'replica-light', sans-serif;
    transition: font-family 0.2s ease, color 0.2s ease;
}

.projects-grid > div:hover .project-title {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}

/* PROJECTS GRID - uniform margins and square image frames */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 35px;
    row-gap: 15px;
    padding: 35px;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr); /* sempre 3 colonne */
        column-gap: 35px;
        row-gap: 15px;
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 35px;
        row-gap: 15px;
    }
}

@media (min-aspect-ratio: 21/9) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
        column-gap: 35px;
        row-gap: 15px;
    }
}

.project-card {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1; /* spazi immagine quadrati */
    overflow: hidden;
    border: none;
    background: #fafafa;
    opacity: 1; /* override a:hover opacity */
}

    .project-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: none; /* nessuno zoom */
        transition: filter 0.2s ease;
    }

    /* Titolo sovrapposto all'immagine */
    .project-card .project-title {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 30px;
        padding: 10px 12px;
        font-size: 15px;
        line-height: 1.2;
        color: #000;
        font-family: 'replica-light', sans-serif;
        font-weight: 300;
        background: rgba(241,241,241,0.95);
        transition: font-family 0.2s ease;
    }

    /* Hover progetto (riassunto)
   - Immagine: niente zoom, leggero aumento luminosità/illuminazione
   - Titolo: light -> regular
*/
    .project-card:hover img {
        filter: brightness(1.06) saturate(1.03);
        transform: none;
    }

    .project-card:hover .project-title {
        font-family: 'replica-regular', sans-serif;
        font-weight: 400;
    }

/* Remove old below-title styling if present elsewhere */
.project-title {
    margin-top: 0;
}

/* Responsive spacing */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .works-header .filters-list {
        margin-top: 16px;
    }

    body.has-sidebar header .about-left {
        margin-top: 20px;
        padding-bottom: 0;
    }
}

/* ADMIN STYLES */

.admin-submenu a {
    font-size: 14px;
    color: #aaa;
    margin: 5px 0;
}

    .admin-submenu a:hover {
        color: #666;
    }

/* ADMIN modal for project editor */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000; /* ensure above TinyMCE panels */
}

    .modal-overlay.hidden {
        display: none;
    }

.modal-panel {
    width: min(1100px, 92vw);
    max-height: 90vh;
    overflow: auto;
    background: #f1f1f1;
    border: 1px solid #e0e0e0;
    padding: 20px 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    position: relative;
    z-index: 5010; /* above overlay base */
}

    .modal-panel .tox-tinymce {
        z-index: 5020 !important;
    }

    .modal-panel .tox-tinymce-aux, .modal-panel .tox-tinymce-inline {
        z-index: 5030 !important;
    }

/* Drag handle + previews */
.drag-handle {
    width: 16px;
    height: 16px;
    display: inline-grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    cursor: grab;
}

    .drag-handle span {
        width: 6px;
        height: 6px;
        background: #bbb;
        display: block;
        border-radius: 1px;
    }

.project-item, .media-item {
    cursor: grab;
}

.media-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #eee;
}

/* CANVAS - fullscreen sulla home */
canvas.sketch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 1;
}

/* NEWS GRID */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    padding: 20px 0;
}

.news-item {
    border: 1px solid #e0e0e0;
    padding: 20px;
    min-height: 200px;
    background: #f1f1f1;
}

/* FOOTER */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 30px;
    background: rgba(245,245,245,0.95);
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    text-align: center;
    z-index: 999;
}

    footer a {
        margin: 0 15px;
        color: #999;
    }

/* UTILITIES (avoid redefining Bootstrap classes) */
.text-danger {
    color: #d9534f;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .col-4, .col-6 {
        width: 100%;
    }



    main,
    body.has-sidebar main {
        margin-left: 0;
        width: 100%; /* Ensure main spans full width below header */
        min-height: auto;
    }

    #container, #container-fluid {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    html, body {
        overflow: auto;
    }

    .works-header .menu-filters {
        flex-direction: row;
        gap: 40px;
    }



    .filters-list a {
        display: inline-block;
        flex: none;
        width: auto;
        margin-bottom: 4px;
    }

    .projects-grid,
    .news-grid {
        grid-template-columns: 1fr;
        padding-left: 20px;
        padding-right: 20px; /* RESET & BASE */
        *

{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
/* Legacy Replica font stack */
@font-face {
    font-family: 'replica-light';
    src: url('../fonts/Replica-Light.eot');
    src: url('../fonts/Replica-Light.eot?#iefix') format('embedded-opentype'), url('../fonts/Replica-Light.woff2') format('woff2'), url('../fonts/Replica-Light.woff') format('woff'), url('../fonts/Replica-Light.ttf') format('truetype'), url('../fonts/Replica-Light.svg#Replica-Light') format('svg');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'replica-regular';
    src: url('../fonts/Replica-Regular.eot');
    src: url('../fonts/Replica-Regular.eot?#iefix') format('embedded-opentype'), url('../fonts/Replica-Regular.woff2') format('woff2'), url('../fonts/Replica-Regular.woff') format('woff'), url('../fonts/Replica-Regular.ttf') format('truetype'), url('../fonts/Replica-Regular.svg#Replica-Regular') format('svg');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'replica-bold';
    src: url('../fonts/Replica-Bold.eot');
    src: url('../fonts/Replica-Bold.eot?#iefix') format('embedded-opentype'), url('../fonts/Replica-Bold.woff2') format('woff2'), url('../fonts/Replica-Bold.woff') format('woff'), url('../fonts/Replica-Bold.ttf') format('truetype'), url('../fonts/Replica-Bold.svg#Replica-Bold') format('svg');
    font-weight: 700;
    font-style: normal;
}

html, body {
    height: 100%;
    font-family: 'replica-light', sans-serif;
    font-size: 15px;
    letter-spacing: 0.05rem;
    line-height: 1.3rem;
    color: #444;
    background: #f1f1f1;
    overflow-x: hidden;
    overflow-y: auto;
}
/* Strong emphasis uses Manrope for a crisper bold */
strong, b, .strong {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}

header .logo {
    font-family: 'replica-regular', sans-serif;
    letter-spacing: 0.03em;
}

#menu {
    font-family: 'replica-light', sans-serif;
    letter-spacing: 0.05rem;
}

h1 {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}

a {
    color: #444;
    text-decoration: none;
    transition: opacity 0.3s;
}

    a:hover {
        opacity: 0.7;
    }
/* GRID SYSTEM per pagine interne */
#container, #container-fluid {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
    flex-direction: row;
}

.col-4 {
    width: 33.33%;
    min-width: 300px;
    max-width: 400px;
}

.col-6 {
    width: 50%;
}

.col-8 {
    width: 66.67%;
    flex: 1;
}

.col-12 {
    width: 100%;
}
/* HEADER - Sidebar sinistra */
body.has-sidebar header {
    position: relative; /* non fixed: resta nella col-4 del flex container */
    width: 33.33%;
    min-width: 300px;
    max-width: 400px;
    height: 100vh;
    overflow-y: auto;
    background: #f1f1f1;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

    body.has-sidebar header #menu {
        display: block !important; /* Force menu visibility in sidebar mode */
        margin-top: 20px;
    }
/* About block rendered inside header */
body.has-sidebar header {
    /* controlla quanto il blocco resta vicino al fondo: aumenta per alzarlo */
    --about-left-bottom-offset: 150px;
}

    body.has-sidebar header .about-left {
        margin-top: 0; /* no auto push */
        margin-top: auto; /* keep bottom behavior */
        padding-top: 0;
        padding-bottom: var(--about-left-bottom-offset);
    }
/* MAIN - Area contenuto destra */
body.has-sidebar main {
    /* niente margin-left: il container flex gestisce le colonne */
    min-height: 100vh;
    width: 66.67%; /* col-8 */
    flex: 1 1 auto; /* permette di espandersi quando la sidebar è più stretta */
    padding: 0;
    background: #f1f1f1;
}

@media (min-width: 1200px) {
    body.has-sidebar header {
        width: 400px;
        max-width: 4000px;
    }

    body.has-sidebar main {
        width: calc(100% - 400px); /* si adatta alla larghezza effettiva sidebar */
    }
}
/* HEADER - Solo angolo in alto a sinistra sulla home */
header {
    position: fixed;
    left: 0;
    top: 0;
    margin: 0;
    padding-left: 30px;
    padding-top: 30px;
    z-index: 1001;
    background: #f1f1f1;
}

    header .logo {
        display: inline-block;
        margin-bottom: 15px;
        cursor: pointer;
        background: #f1f1f1;
        padding: 10px 10px 10px 0;
        color: #000;
        font-family: 'replica-regular', sans-serif;
        font-weight: 400;
        font-size: 20px; /* base */
    }

.logo {
    color: rgb(0, 0, 0);
    font-size: 20px;
    background: transparent;
    padding: 0;
}

body.has-sidebar header .logo {
    background: transparent;
    padding: 0;
    color: #000;
    font-size: 20px; /* +2 rispetto al resto del menu */
}
/* Base menu styling: no underline, grey regular; selected black regular */
#menu a {
    display: block;
    font-size: 16px;
    margin: 6px 0;
    color: #A9A9A9;
    font-weight: 400;
    text-decoration: none;
    position: relative;
    padding: 2px 0;
}

    #menu a.selected,
    #menu a:hover {
        color: #000;
        font-weight: 400;
        text-decoration: none;
        opacity: 1;
    }
/* Works header internal layout */
.works-header .menu-filters {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
/* Align categories list a bit lower to line up with "Works" */
.works-header .filters-list {
    margin-top: 24px;
}
/* Ensure filters list is vertical on desktop */
.filters-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .filters-list a {
        font-size: 14px;
        color: #A9A9A9;
        line-height: 1.2rem;
        font-weight: 400;
        text-decoration: none;
    }

        .filters-list a:hover,
        .filters-list a.selected-filter {
            color: #000;
            font-weight: 400;
            text-decoration: none;
        }
/* Project titles: black light, on hover black regular */
.project-title {
    font-size: 15px;
    color: #666;
    margin-top: 6px;
    line-height: 1.2;
    font-family: 'replica-light', sans-serif;
    transition: font-family 0.2s ease, color 0.2s ease;
}

.projects-grid > div:hover .project-title {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}
/* PROJECTS GRID - uniform margins and square image frames */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    padding: 30px;
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr); /* sempre 3 colonne */
        gap: 30px; /* piu righe visibili a pagina */
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

.project-card {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1; /* spazi immagine quadrati */
    overflow: hidden;
    border: none;
    background: #fafafa;
    opacity: 1; /* override a:hover opacity */
}

    .project-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transform: none; /* nessuno zoom */
        transition: filter 0.2s ease;
    }
    /* Titolo sovrapposto all'immagine */
    .project-card .project-title {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 30px;
        padding: 10px 12px;
        font-size: 15px;
        line-height: 1.2;
        color: #000;
        font-family: 'replica-light', sans-serif;
        font-weight: 300;
        background: rgba(241,241,241,0.95);
        transition: font-family 0.2s ease;
    }
    /* Hover progetto (riassunto)
   - Immagine: niente zoom, leggero aumento luminosità/illuminazione
   - Titolo: light -> regular
*/
    .project-card:hover img {
        filter: brightness(1.06) saturate(1.03);
        transform: none;
    }

    .project-card:hover .project-title {
        font-family: 'replica-regular', sans-serif;
        font-weight: 400;
    }
/* Remove old below-title styling if present elsewhere */
.project-title {
    margin-top: 0;
}
/* Responsive spacing */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .works-header .filters-list {
        margin-top: 16px;
    }

    body.has-sidebar header .about-left {
        margin-top: 20px;
        padding-bottom: 0;
    }
}
/* ADMIN STYLES */

.admin-submenu a {
    font-size: 14px;
    color: #aaa;
    margin: 5px 0;
}

    .admin-submenu a:hover {
        color: #666;
    }
/* ADMIN modal for project editor */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000; /* ensure above TinyMCE panels */
}

    .modal-overlay.hidden {
        display: none;
    }

.modal-panel {
    width: min(1100px, 92vw);
    max-height: 90vh;
    overflow: auto;
    background: #f1f1f1;
    border: 1px solid #e0e0e0;
    padding: 20px 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    position: relative;
    z-index: 5010; /* above overlay base */
}

    .modal-panel .tox-tinymce {
        z-index: 5020 !important;
    }

    .modal-panel .tox-tinymce-aux, .modal-panel .tox-tinymce-inline {
        z-index: 5030 !important;
    }
/* Drag handle + previews */
.drag-handle {
    width: 16px;
    height: 16px;
    display: inline-grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    cursor: grab;
}

    .drag-handle span {
        width: 6px;
        height: 6px;
        background: #bbb;
        display: block;
        border-radius: 1px;
    }

.project-item, .media-item {
    cursor: grab;
}

.media-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border: 1px solid #eee;
}
/* CANVAS - fullscreen sulla home */
canvas.sketch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 1;
}
/* NEWS GRID */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    padding: 20px 0;
}

.news-item {
    border: 1px solid #e0e0e0;
    padding: 20px;
    min-height: 200px;
    background: #f1f1f1;
}
/* FOOTER */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 30px;
    background: rgba(245,245,245,0.95);
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    text-align: center;
    z-index: 999;
}

    footer a {
        margin: 0 15px;
        color: #999;
    }
/* UTILITIES (avoid redefining Bootstrap classes) */
.text-danger {
    color: #d9534f;
}
/* RESPONSIVE */
@media (max-width: 1024px) {
    .col-4, .col-6 {
        width: 100%;
    }



    main,
    body.has-sidebar main {
        margin-left: 0;
        width: 100%; /* Ensure main spans full width below header */
        min-height: auto;
    }

    #container, #container-fluid {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    html, body {
        overflow: auto;
    }

    .works-header .menu-filters {
        flex-direction: row;
        gap: 40px;
    }



    .filters-list a {
        display: inline-block;
        flex: none;
        width: auto;
        margin-bottom: 4px;
    }

    .projects-grid,
    .news-grid {
        grid-template-columns: 1fr;
        padding-left: 20px;
        padding-right: 20px;
        gap: 20px;
    }

    body.has-sidebar header .about-left {
        margin-top: 20px;
        padding-top: 0;
    }
}
/* PROJECT DETAIL PAGE */
#work-details {
    margin-top: 40px;
    font-size: 15px;
    letter-spacing: 0.05rem;
    line-height: 1.3rem;
}

    #work-details h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    #work-details p {
        margin-bottom: 15px;
        line-height: 1.5;
    }

    #work-details .description {
        margin-top: 20px;
    }

#work {
    width: 100%;
    padding: 0;
}
/* Riduci effetto hover globale solo per le slide del dettaglio (niente fade al passaggio) */
.detail-page a.carousel-slide:hover {
    opacity: 1;
}
/* Più spazio al testo: sidebar un po' più larga su desktop */
@media (min-width: 1200px) {
    body.has-sidebar.detail-page header {
        width: 520px;
        max-width: 520px;
    }

    body.has-sidebar.detail-page main {
        width: calc(100% - 520px);
    }
}
/* CAROUSEL */
.carousel {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #f1f1f1; /* Changed from #000 */
}

.carousel-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.carousel-arrows {
    position: absolute;
    inset: 0;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100vh;
    position: relative;
    padding: 60px; /* Added margin around image */
}

    .carousel-slide img,
    .carousel-slide video {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
        object-position: center;
        background: #f1f1f1; /* Changed from #000 */
    }
/* Frecce: definizione completa (posizionamento + hit-area) */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 72px;
    height: 100%;
    background-color: transparent;
    color: #444;
    border: none;
    font-size: 34px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    pointer-events: auto;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

    .carousel:hover .carousel-prev,
    .carousel:hover .carousel-next,
    .carousel-prev:hover,
    .carousel-next:hover {
        opacity: 1;
    }

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
}

    .dot.active {
        background: rgba(0, 0, 0, 0.6);
    }

@media (max-width: 1024px) {
    .carousel-slide {
        padding: 20px; /* Reduced padding on mobile */
    }
    /* Mobile: frecce sotto l'immagine (non sovrapposte) */
    .carousel-controls {
        position: static;
        inset: auto;
        pointer-events: auto;
        padding: 12px 20px 0;
    }

    .carousel-arrows {
        position: static;
        inset: auto;
        display: flex;
        gap: 12px;
    }

    .carousel-prev,
    .carousel-next {
        position: static;
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        transform: none;
        width: 50%;
        height: 44px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 22px;
        opacity: 1;
        padding: 0;
    }

    .carousel-dots {
        position: static;
        left: auto;
        bottom: auto;
        transform: none;
        justify-content: center;
        margin-top: 10px;
    }

    body.has-sidebar header {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    /* Project detail mobile: work-details -> carousel -> description */
    .detail-wrapper {
        display: flex;
        flex-direction: column;
    }

    .detail-sidebar {
        order: 1;
        width: 100%;
        max-width: 100%;
        height: auto;
        position: relative;
        padding: 100px 20px 20px 20px;
        overflow: visible;
    }

    .detail-main {
        order: 2;
        margin-left: 0;
        width: 100%;
    }

    .detail-description-mobile {
        order: 3;
        padding: 20px;
        background: #f1f1f1;
    }

    .detail-mobile-header {
        padding: 100px 20px 20px 20px;
    }
    /* visibility gestita da classi Bootstrap (d-none / d-lg-*) */
    /* Detail page stacking and carousel sizing on mobile */
    .detail-main .carousel {
        height: auto;
    }

    .detail-main .carousel-viewport {
        height: 70vh;
    }

    .detail-main .carousel-slide,
    .detail-main .carousel-slide img,
    .detail-main .carousel-slide video {
        height: 70vh;
    }
}
/* WORKS MAP */
.project-map-shell {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    padding: 30px;
}

.map-view {
    min-height: 60vh;
}

#project-map {
    width: 100%;
    height: 60vh;
    min-height: 420px;
    background: #f1f1f1;
}

.map-thumbs {
    max-height: 60vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-thumb img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.map-thumb.selected img {
    filter: grayscale(0%) !important;
}

@media (max-width: 1024px) {
    .project-map-shell {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    #project-map {
        height: 50vh;
        min-height: 320px;
    }

    .map-thumbs {
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
    }

    .map-thumb {
        flex: 0 0 auto;
        width: 160px;
    }
}
/* Filters: optional separator to detach "world map" */
.filters-sep {
    height: 10px;
}
/* Ensure the world map link isn't glued to the categories */
.filters-worldmap {
    margin-bottom: 2px;
}
/* Primary nav: left menu + right slot aligned */
.primary-nav-row {
    display: grid;
    /* Use auto columns so each column only takes the space it needs
       and reduce the gap between them to bring the two navs closer */
    grid-template-columns: auto auto;
    /*column-gap: 12px;*/
    align-items: start;
}

.primary-nav-left {
    min-width: 120px;
}

.primary-nav-right {
    min-width: 140px;
}
/* ABOUT PAGE */
.about-page {
    padding: 30px;
}



.about-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.about-left h1,
.about-main-content h1 {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}

.about-left .contact h1,
.about-left .studio h1 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.about-description {
    font-size: 15px;
    line-height: 1.5;
}

.about-images-mobile {
    margin-top: 30px;
    display: grid;
    gap: 20px;
}

@media (max-width: 1024px) {
    .about-page {
        padding: 20px;
    }
}

.descriptionProject {
    margin-top: 30px;
}

gap: 20px;
}

body.has-sidebar header .about-left {
    margin-top: 20px;
    padding-top: 0;
}

}

/* PROJECT DETAIL PAGE */
#work-details {
    margin-top: 40px;
    font-size: 15px;
    letter-spacing: 0.05rem;
    line-height: 1.3rem;
}

    #work-details h1 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    #work-details p {
        margin-bottom: 15px;
        line-height: 1.5;
    }

    #work-details .description {
        margin-top: 20px;
    }

#work {
    width: 100%;
    padding: 0;
}

@media (max-width: 1024px) {

    #work {
        margin-top: 70px
    }
}
/* Riduci effetto hover globale solo per le slide del dettaglio (niente fade al passaggio) */
.detail-page a.carousel-slide:hover {
    opacity: 1;
}

/* Più spazio al testo: sidebar un po' più larga su desktop */
@media (min-width: 1200px) {
    body.has-sidebar.detail-page header {
        width: 520px;
        max-width: 520px;
    }

    body.has-sidebar.detail-page main {
        width: calc(100% - 520px);
    }
}

/* CAROUSEL */
.carousel {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #f1f1f1; /* Changed from #000 */
}

.carousel-viewport {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.carousel-arrows {
    position: absolute;
    inset: 0;
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100vh;
    position: relative;
    padding: 60px; /* Added margin around image */
}

    .carousel-slide img,
    .carousel-slide video {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: contain;
        object-position: center;
        background: #f1f1f1; /* Changed from #000 */
    }

/* Frecce: definizione completa (posizionamento + hit-area) */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 72px;
    height: 100%;
    background-color: transparent;
    color: #444;
    border: none;
    font-size: 34px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    pointer-events: auto;
}

.carousel-prev {
    left: 0;
}

.carousel-next {
    right: 0;
}

    .carousel:hover .carousel-prev,
    .carousel:hover .carousel-next,
    .carousel-prev:hover,
    .carousel-next:hover {
        opacity: 1;
    }

.carousel-dots {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
}

    .dot.active {
        background: rgba(0, 0, 0, 0.6);
    }

@media (max-width: 1024px) {
    .carousel-slide {
        padding: 20px; /* Reduced padding on mobile */
    }

    .carousel-prev,
    .carousel-next {
        width: 50%;
        height: 44px;
        top: auto;
        transform: none;
        background: rgba(255,255,255,0.5);
        border-radius: 22px;
        opacity: 1;
        justify-content: center;
        padding: 0;
    }

    .carousel-controls {
        position: static;
        inset: auto;
        pointer-events: auto;
        padding: 12px 20px 0;
    }

    .carousel-arrows {
        position: static;
        inset: auto;
        display: flex;
        gap: 12px;
    }

    .carousel-prev,
    .carousel-next {
        position: static;
        left: auto;
        right: auto;
    }

    .carousel-dots {
        position: static;
        left: auto;
        bottom: auto;
        transform: none;
        justify-content: center;
        margin-top: 10px;
    }

    .carousel-prev:hover,
    .carousel-next:hover {
        background: rgba(255,255,255,0.8);
        transform: translateY(-50%);
    }

    body.has-sidebar header {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    /* Reorder elements on mobile: Nav -> Photos -> Text */
    .detail-wrapper {
        display: flex;
        flex-direction: column;
    }

    .detail-header {
        display: contents; /* Remove header box to allow reordering children */
    }

    .header-nav {
        order: 1;
        width: 100%;
        padding: 20px;
        background: #f1f1f1;
    }

    .detail-main {
        order: 2;
        margin-left: 0;
        width: 100%;
    }

    #work-details {
        order: 3;
        padding: 20px;
        background: #f1f1f1;
    }

    /* Detail page stacking and carousel sizing on mobile */
    .detail-main .carousel {
        height: 70vh;
    }

    .detail-main .carousel-slide,
    .detail-main .carousel-slide img,
    .detail-main .carousel-slide video {
        height: 70vh;
    }
}

/* WORKS MAP */
.project-map-shell {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    padding: 30px;
}

.map-view {
    min-height: 60vh;
}

#project-map {
    width: 100%;
    height: 60vh;
    min-height: 420px;
    background: #f1f1f1;
}

.map-thumbs {
    max-height: 60vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-thumb img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.map-thumb.selected img {
    filter: grayscale(0%) !important;
}

@media (max-width: 1024px) {
    .project-map-shell {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }

    #project-map {
        height: 50vh;
        min-height: 320px;
    }

    .map-thumbs {
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        flex-direction: row;
    }

    .map-thumb {
        flex: 0 0 auto;
        width: 160px;
    }
}

/* Filters: optional separator to detach "world map" */
.filters-sep {
    height: 10px;
}

/* Ensure the world map link isn't glued to the categories */
.filters-worldmap {
    margin-bottom: 2px;
}



/* Primary nav: left menu + right slot aligned */
.primary-nav-row {
    display: grid;
    /* Use auto columns so each column only takes the space it needs
       and reduce the gap between them to bring the two navs closer */
    grid-template-columns: auto auto;
    /*column-gap: 12px;*/
    align-items: start;
}

.primary-nav-left {
    min-width: 120px;
}

.primary-nav-right {
    min-width: 140px;
}



/* ABOUT PAGE */
.about-page {
    padding: 35px;
}

.about-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.about-image {
    width: 100%;
    object-fit: cover;
    display: block;
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: none;
}

.about-left h1,
.about-main-content h1 {
    font-family: 'replica-regular', sans-serif;
    font-weight: 400;
}

.about-left .contact h1,
.about-left .studio h1 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.about-description {
    font-size: 15px;
    line-height: 1.5;
}

/* About mobile: 1a immagine -> testo -> 2a immagine */
.about-image-mobile-first {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.about-image-mobile-second {
    display: grid;
    gap: 20px;
    margin-top: 30px;
}

.about-images-mobile {
    margin-top: 30px;
    display: grid;
    gap: 20px;
}

.page-sidebar {
    display: flex;
    /*justify-content: center;*/ /* centro orizzontale */
    align-items: center; /* centro verticale */
}

.about-left {
    text-align: left;
}

@media (max-width: 1024px) {
    .about-page {
        padding: 20px;
    }
}

.descriptionProject {
    margin-top: 30px;
}

/* ============================================
   NUOVO LAYOUT: Nav fissa + Sidebar per pagina
   ============================================ */

/* Nav compatta fissa in alto a sinistra */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    padding: 30px 30px 0 30px;
    z-index: 1001;
    background: #f1f1f1;
}

    .top-nav .logo {
        display: block;
        margin-bottom: 15px;
        cursor: pointer;
        color: #000;
        font-family: 'replica-regular', sans-serif;
        font-weight: 400;
        font-size: 20px;
    }

@media (max-width: 1024px) {
    .top-nav .logo {
        margin-bottom: 2px;
    }
    }

    .top-nav #menu {
        font-family: 'replica-light', sans-serif;
        letter-spacing: 0.05rem;
    }

        .top-nav #menu a {
            display: block;
            font-size: 16px;
            margin: 6px 0;
            color: #A9A9A9;
            font-weight: 400;
            text-decoration: none;
        }

            .top-nav #menu a.selected,
            .top-nav #menu a:hover {
                color: #000;
            }

    /* Contenitore principale della pagina */
    #page-container {
        width: 100%;
        min-height: 100vh;
    }

    /* Layout a due colonne: sidebar + contenuto */
    .page-with-sidebar {
        display: flex;
        flex-direction: row;
        min-height: 100vh;
        width: 100%;
    }

    /* Sidebar sinistra - gestita dalla pagina */
    .page-sidebar {
        width: 33.33%;
        min-width: 300px;
        max-width: 400px;
        height: 100vh;
        position: sticky;
        top: 0;
        padding: 180px 30px 30px 30px; /* Spazio per la nav fissa */
        overflow-y: auto;
        background: #f1f1f1;
        flex-shrink: 0;
    }

    /* Contenuto principale a destra */
    .page-content {
        flex: 1;
        min-height: 100vh;
        background: #f1f1f1;
    }

    /* Filtri nella sidebar di Works */
    .page-sidebar .filters-list {
        margin-top: 0;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

        .page-sidebar .filters-list a {
            font-size: 14px;
            color: #A9A9A9;
            line-height: 1.2rem;
            font-weight: 400;
            text-decoration: none;
        }

            .page-sidebar .filters-list a:hover,
            .page-sidebar .filters-list a.selected-filter {
                color: #000;
            }

    /* Detail page: sidebar con info progetto */
    .detail-sidebar #work-details {
        margin-top: 0;
    }

        .detail-sidebar #work-details h1 {
            font-size: 18px;
            font-family: 'replica-regular', sans-serif;
            font-weight: 400;
            margin-bottom: 15px;
        }

    .detail-sidebar .project-location,
    .detail-sidebar .project-year {
        font-size: 14px;
        color: #666;
        margin-bottom: 8px;
    }

    .detail-sidebar .description {
        margin-top: 20px;
        font-size: 15px;
        line-height: 1.5;
    }

    /* Project detail: blocco description mobile nascosto su desktop */
    .detail-description-mobile {
        display: none;
    }

    /* Detail page: sidebar più larga */
    @media (min-width: 1200px) {
        .detail-page .page-sidebar {
            width: 400px;
            max-width: 520px;
        }
    }

    /* ============================================
   RESPONSIVE: Mobile/Tablet
   ============================================ */
    @media (max-width: 1024px) {
        /* Nav resta fissa ma più compatta */
        .top-nav {
            padding: 20px;
            background: #f1f1f1;
            width: 100%;
        }

        /* Layout diventa verticale */
        .page-with-sidebar {
            flex-direction: column;
        }

        /* Sidebar diventa header della pagina */
        .page-sidebar {
            position: relative;
            width: 100%;
            max-width: 100%;
            height: auto;
            min-height: auto;
            padding: 100px 20px 0px 20px; /* Spazio per nav mobile */
            overflow: visible;
        }

        /* Contenuto occupa tutta la larghezza */
        .page-content {
            width: 100%;
        }

        /* Filtri orizzontali su mobile */
        .page-sidebar .filters-list {
            flex-direction: row;
            flex-wrap: wrap;
            gap: 12px;
        }

            .page-sidebar .filters-list a {
                display: inline-block;
            }

        /* Detail page mobile: riordina elementi */
        .detail-page .page-with-sidebar {
            display: flex;
            flex-direction: column;
        }

        .detail-page .page-sidebar {
            order: 3; /* Dettagli dopo le immagini */
            padding-top: 20px;
        }

        .detail-page .page-content {
            order: 2; /* Carousel prima */
        }

        /* Carousel più piccolo su mobile */
        .detail-page .carousel {
            height: 70vh;
        }

        .detail-page .carousel-slide,
        .detail-page .carousel-slide img,
        .detail-page .carousel-slide video {
            height: 70vh;
        }

        /* About page: sidebar nascosta, contenuto full width */
        .about-page .page-sidebar {
            display: none;
        }
    }

    /* Pagine senza sidebar visibile (About, News) */
    .page-sidebar:empty {
        display: none;
    }

        .page-sidebar:empty + .page-content {
            padding-top: 120px;
            padding-left: 30px;
        }

    @media (max-width: 1024px) {
        .page-sidebar:empty + .page-content {
            padding-top: 100px;
            padding-left: 20px;
        }
    }

    /* Pagine senza sidebar (admin, login, ecc.) */
    #page-container > .content,
    #page-container > .container {
        padding-top: 120px;
        padding-left: 30px;
        padding-right: 30px;
    }


    /* Pagine senza sidebar (Works, News) - contenuto full width */
    .page-content-full {
        padding-top: 120px;
        min-height: 100vh;
        background: #f1f1f1;
    }

    @media (max-width: 1024px) {
        .page-content-full {
            padding-top: 100px;
        }
        /* About sidebar styles */


    }


    @media (max-width: 1024px) {
        /* About sidebar styles */
        .about-left {
            margin-top: auto;
            padding-top: 42px;
        }
    }

    /* About sidebar styles */
    .about-left {
        margin-top: auto;
        padding-top: 42px;
    }

        .about-left .studio,
        .about-left .contact {
            margin-bottom: 20px;
        }

            .about-left .studio h1,
            .about-left .contact h1 {
                font-size: 14px;
                font-weight: 700;
                margin-bottom: 10px;
                text-transform: uppercase;
                font-family: 'replica-regular', sans-serif;
            }

    .instagram-link {
        font-size: 12px;
        text-decoration: none;
        opacity: 0.9;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        color: #444;
    }

        .instagram-link svg {
            fill: currentColor;
            display: block;
        }

        .instagram-link:hover {
            opacity: 1;
        }

    /* ProjectDetail mobile order (Bootstrap-friendly)
   Alcune regole legacy impostano order su #work-details/.detail-main.
   Qui le annulliamo per ottenere: work-details -> carousel -> description. */
    @media (max-width: 1024px) {
        .detail-wrapper {
            display: flex;
            flex-direction: column;
        }

        #work-details,
        .detail-main,
        .detail-description-mobile {
            order: 0;
        }
    }

    /* ============================================
   MOBILE NAV - Hamburger Menu
   ============================================ */

    /* Header con logo e hamburger */
    .nav-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Hamburger button - nascosto su desktop */
    .menu-toggle {
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        gap: 5px;
    }

    .hamburger-line {
        display: block;
        width: 22px;
        height: 2px;
        background-color: #444;
        transition: all 0.3s ease;
    }

    /* Mobile styles */
    @media (max-width: 1024px) {
        /* Mostra hamburger su mobile */
        .menu-toggle {
            display: flex;
        }

        /* Nav fissa su mobile */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            padding: 15px 20px;
            background: #f1f1f1;
            z-index: 1001;
        }

        s
        .top-nav .primary-nav-row.is-open {
            display: block;
        }

        /* Menu verticale su mobile */
        .top-nav .primary-nav-left,
        .top-nav .primary-nav-right {
            width: 100%;
        }

        .top-nav #menu {
            display: block !important;
        }
    }

    /* ============================================
   FIX: ProjectDetail mobile header + carousel controls
   (override regole legacy duplicate sopra)
   ============================================ */
    @media (max-width: 1024px) {
        /* Header (titolo/location/year) deve stare sotto la nav fissa */
        .detail-page .detail-mobile-header {
            padding-top: 75px;
            padding-left: 20px;
            padding-right: 20px;
            background-color: #f1f1f1;
            z-index: 1000;
            position: fixed;
            width: 100%;
        }

        /* Carousel: lascia spazio ai controlli sotto l'immagine */
        .detail-page .carousel {
            height: auto !important;
            overflow: visible;
            padding-top: 42%;
        }

        .detail-page .carousel-viewport {
            height: 100%;
            overflow: hidden;
        }

        .detail-page .carousel-slide,
        .detail-page .carousel-slide img,
        .detail-page .carousel-slide video {
            height: 100%;
            max-height: 300pt;
        }

        /* Controlli sotto: sempre visibili e non sovrapposti */
        .detail-page .carousel-controls {
            position: static;
            inset: auto;
            pointer-events: auto;
            padding: 12px 20px 0;
        }

        .detail-page .carousel-arrows {
            position: static;
            inset: auto;
            display: flex;
            gap: 12px;
        }

        .detail-page .carousel-prev,
        .detail-page .carousel-next {
            position: static;
            top: auto;
            bottom: auto;
            left: auto;
            right: auto;
            transform: none;
            width: 50%;
            height: 44px;
            border-radius: 22px;
        }

            .detail-page .carousel-prev:hover,
            .detail-page .carousel-next:hover {
                transform: none;
            }

        .detail-page .carousel-dots {
            position: static;
            left: auto;
            bottom: auto;
            transform: none;
            justify-content: center;
            margin-top: 10px;
        }
    }

    /* ============================================
   FIX: Works map thumbs scroll on mobile
   ============================================ */
    @media (max-width: 1024px) {
        .project-map-shell .map-side {
            min-width: 0;
            width: 100%;
            overflow: hidden;
        }

        .project-map-shell .map-thumbs {
            min-width: 0;
            width: 100%;
            max-width: 100%;
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            gap: 12px;
            overflow-x: auto;
            overflow-y: hidden;
            -webkit-overflow-scrolling: touch;
        }

        .project-map-shell .map-thumb {
            flex: 0 0 auto;
            width: 160px;
        }
    }

    /* ============================================
   FIX: No hamburger + shrink-wrap top-nav
   ============================================ */
    .menu-toggle {
        display: none !important;
    }

    .top-nav {
        display: inline-block;
        width: fit-content;
    }

    @media (max-width: 1024px) {
        .top-nav {
            right: auto;
            width: 100%;
        }


            .top-nav .primary-nav.is-open .primary-nav-row {
                display: block !important;
            }

                /* Se c'è primary-nav-right, deve restare a destra (non a capo) */
                .top-nav .primary-nav.is-open .primary-nav-row.has-right {
                    display: grid !important;
                    grid-template-columns: auto auto;
                    align-items: start;
                }

            .top-nav .primary-nav.is-open .primary-nav-left,
            .top-nav .primary-nav.is-open .primary-nav-right {
                width: auto !important;
            }
    }
