/* ============================================
FONT PERSONALIZZATI
============================================ */

@font-face {
    font-family: 'Microsoft Yi Baiti';
    src: url('../font/microsoft-yi-baiti-regular.woff2') format('woff2'),
         url('../font/Microsoft Yi Baiti Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Swis721 BlkCn BT';
    src: url('../font/swis721-blkcn-bt-black.woff2') format('woff2'),
         url('../font/Swis721 BlkCn BT Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'AlergiaNormal-Bold';
    src: url('../font/alergianormal-bold.woff2') format('woff2'),
         url('../font/AlergiaNormal-Bold.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Barlow (prima da Google Fonts): usato per data news e selettore lingua */
@font-face {
    font-family: 'Barlow';
    src: url('../font/barlow-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
/* ============================================
COMFORTHOME - STYLESHEET COMPLETO
============================================ */

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

:root {
    --anthracite: #272727;
    --medium-grey: #ffffff;
    --white: #515151;
    --text-dark: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);

    --top-bar-height: 60px;
    --bottom-bar-height: 60px;
    --header-bar-height: 90px;
    --footer-bar-height: 60px;

    /* Margini generosi: spazio tra bordo schermo e contenuto */
    --margin-side: 13%;

    /* Font */
    --font-bars: 'AlergiaNormal-Bold', sans-serif;
    --font-main: 'Microsoft Yi Baiti', serif;
}

html, body {
    height: 100%;
    font-family: var(--font-main);
}

body { font-size: 18px; }

body {
    display: flex;
    flex-direction: column;
    background-color: var(--medium-grey);
    overflow: hidden;
}

/* ============================================
TOP-BAR E BOTTOM-BAR (FISSE E OPACHE)
============================================ */

.top-bar,
.bottom-bar {
    position: fixed;
    width: 100%;
    background-color: var(--text-dark);
    text-align: center;
    z-index: 1000;
}

.top-bar {
    top: 0;
    height: var(--top-bar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
}

.bottom-bar {
    bottom: 0;
    height: var(--bottom-bar-height);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
}

.top-bar .bar-title,
.bottom-bar .bar-title {
    font-size: clamp(17px, 11vw, 56px);
    font-weight: 700;
    letter-spacing: clamp(2px, 0.5vw, 18px);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: var(--font-bars);
}

/* ============================================
MAIN-CONTENT (SCROLLABILE TRA LE DUE BARRE)
============================================ */

.main-content {
    position: fixed;
    top: var(--top-bar-height);
    bottom: var(--bottom-bar-height);
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--medium-grey);
    z-index: 1;
}

/* Scrollbar personalizzata */
.main-content::-webkit-scrollbar { width: 8px; }
.main-content::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
.main-content::-webkit-scrollbar-thumb { background: var(--anthracite); border-radius: 4px; }
.main-content::-webkit-scrollbar-thumb:hover { background: #2a2a2a; }

/* ============================================
HEADER-BAR - LOGO E MENU
============================================ */

.header-bar {
    position: fixed;
    top: var(--top-bar-height);
    left: 0;
    right: 0;
    height: var(--header-bar-height);
    background-color: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px 0 10px;
    z-index: 999;
    pointer-events: none;
}

.header-bar > * { pointer-events: auto; }

.header-logo {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-logo a {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.header-logo img {
    height: calc(var(--header-bar-height) - 10px);
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-logo img:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.menu-toggle {
    cursor: pointer;
    color: var(--white);
    font-size: 24px;
    transition: transform 0.3s ease;
    text-shadow: none;
}

.menu-toggle:hover { transform: scale(1.1); }

/* Mobile/tablet: l'hamburger sta sopra l'immagine -> bianco */
@media screen and (max-width: 1023px) {
    .header-bar .menu-toggle,
    .header-bar .menu-toggle i { color: #ffffff; }
}

/* ============================================
FOOTER-BAR (TRASPARENTE SOPRA MAIN-CONTENT)
============================================ */

.footer-bar {
    position: fixed;
    bottom: var(--bottom-bar-height);
    left: 0;
    right: 0;
    height: var(--footer-bar-height);
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    z-index: 999;
    pointer-events: none;
}

.footer-bar .page-name {
    color: var(--white);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ============================================
MENU DROPDOWN
============================================ */

.dropdown-menu {
    position: fixed;
    top: calc(var(--top-bar-height) + var(--header-bar-height));
    right: -100%;
    width: 250px;
    height: auto;
    max-height: calc(100vh - var(--top-bar-height) - var(--bottom-bar-height) - var(--header-bar-height) - var(--footer-bar-height));
    background-color: var(--anthracite);
    box-shadow: -2px 0 10px var(--shadow);
    z-index: 998;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.dropdown-menu.active { right: 0; }

.dropdown-menu ul { list-style: none; padding: 0; margin: 0; }
.dropdown-menu li { border-bottom: 1px solid rgba(255,255,255,0.1); }
.dropdown-menu li:last-child { border-bottom: none; }

.dropdown-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.3s ease;
    font-size: 20px;
}

.dropdown-menu a:hover,
.dropdown-menu a.active { background-color: rgba(255,255,255,0.1); }

/* ============================================
HOME PAGE - LOGO
============================================ */

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--top-bar-height) - var(--bottom-bar-height));
    padding: 20px;
}

.logo-menu-container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 40px 20px;
}

.logo-home {
    width: 70%;
    height: auto;
    margin-bottom: 40px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

/* ============================================
LAYOUT DEFAULT — MOBILE
Immagine sopra, testo sotto
============================================ */

.page-image {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-image img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
}

.content-wrapper {
    padding: 15px 15px;
    color: var(--white);
}

/* ============================================
PAGINA CHI&COSA
============================================ */

.about-section { margin-bottom: 30px; }

.about-section h2 {
    font-size: 29px;
    margin-bottom: 15px;
    color: var(--white);
}

.about-section p {
    line-height: 1.45;
    margin-bottom: 15px;
    font-size: 20px;
    text-align: justify;
    text-justify: inter-word;
}

.services-list {
    list-style: disc;
    padding-left: 40px;
    margin-top: 15px;
}

.services-list li {
    line-height: 1.6;
    font-size: 20px;
    padding-left: 10px;
}

.services-list li strong { color: var(--white); }

/* ============================================
PAGINA PROGETTI - LISTA
============================================ */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.project-item {
    display: flex;
    gap: 15px;
    background-color: color-mix(in srgb, white 70%, #c9c9c9);
    padding: 15px;
    text-decoration: none;
    color: var(--white);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.project-image {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.project-info h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--white);
}

.project-info p {
    font-size: 17px;
    line-height: 1.4;
    color: rgb(97 94 94);
    text-align: justify;
    text-justify: inter-word;
}

/* ============================================
PAGINA CONTATTI
============================================ */

.contact-section h2 {
    font-size: 26px;
    margin-bottom: 25px;
    color: var(--white);
}

.contact-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.contact-item i {
    font-size: 24px;
    color: var(--white);
    margin-top: 5px;
}

.contact-item h3 {
    font-size: 22px;
    margin-bottom: 5px;
    color: var(--white);
}

.contact-item p {
    font-size: 19px;
    line-height: 1.5;
    color: rgba(0,0,0,0.8);
}

.map-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.map-link img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.map-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(58,58,58,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-link:hover .map-overlay { opacity: 1; }
.map-link:hover img { filter: grayscale(0%); }

.map-overlay i { font-size: 40px; color: var(--white); }
.map-overlay span { color: var(--white); font-size: 18px; font-weight: 600; }

/* ============================================
PAGINA DETTAGLIO PROGETTO
============================================ */

.project-detail h2 {
    font-size: 29px;
    margin-bottom: 20px;
    color: var(--white);
}

.project-info-section { margin-bottom: 30px; }

.project-info-section h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--white);
}

.project-info-section p {
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 19px;
    text-align: justify;
    text-justify: inter-word;
}

.project-details-list { list-style: none; padding: 0; }

.project-details-list li {
    padding: 7px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    font-size: 19px;
}

.project-details-list li strong { color: var(--white); }

/* .project-gallery rimane per retrocompatibilità ma non usata su progetto.php */
.project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.project-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-gallery img:hover { transform: scale(1.04); }

/* ============================================
BACK LINK
============================================ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 12px 20px;
    background-color: var(--text-dark);
    color: var(--anthracite);
    text-decoration: none;
    font-size: 22px;
    transition: background-color 0.3s ease;
}

.back-link:hover { 
	background-color: #2a2a2a; 
	color: var(--text-dark);
}

/* ============================================
THUMBNAILS GALLERY — tenute per retro-compat
============================================ */

.thumbnails-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 12px 0 20px 0;
    padding: 0 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.thumbnails-container::-webkit-scrollbar { display: none; }

.thumbnails-gallery {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 5px;
    justify-content: center;
    min-width: min-content;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    border-color: rgba(0,0,0,0.2);
}

.thumbnail-item.active {
    border-color: var(--white);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

.thumbnail-item:hover img { opacity: 0.8; }

/* ============================================
LIGHTBOX
============================================ */

.lightbox {
    display: none;
    position: fixed;
    /* occupa solo lo spazio tra top-bar e bottom-bar: le barre restano visibili */
    top: var(--top-bar-height);
    bottom: var(--bottom-bar-height);
    left: 0;
    right: 0;
    background-color: rgba(0,0,0,0.95);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 80%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-nav {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    color: var(--white);
    cursor: pointer;
    z-index: 10000;
    user-select: none;
    transition: background-color 0.3s ease;
    background-color: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }
.lightbox-nav:hover { background-color: rgba(0,0,0,0.85); }

/* ============================================
MEDIA QUERIES — TABLET (768px)
============================================ */

@media screen and (min-width: 768px) {

    :root {
        --top-bar-height: 70px;
        --bottom-bar-height: 70px;
        --header-bar-height: 70px;
        --footer-bar-height: 70px;
    }

    .top-bar .bar-title,
    .bottom-bar .bar-title {
        font-size: clamp(44px, 6.5vw, 62px);
        line-height: 1;
        letter-spacing: clamp(2px, 0.5vw, 18px);
    }

    .header-bar { padding: 20px 25px 0 20px; }
    .header-logo img { height: calc(var(--header-bar-height) - 15px); }
    .menu-toggle { font-size: 28px; }
    .dropdown-menu { width: 300px; }
    .logo-home { max-width: 400px; }

    .page-image img { height: 380px; }

    .project-image { width: 150px; height: 150px; }
    .project-info h3 { font-size: 22px; }
    .project-info p { font-size: 17px; }

    .project-gallery { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
    .project-gallery img { height: 200px; }

    .lightbox img { max-width: 95%; max-height: 95%; }
}

/* ============================================
MEDIA QUERIES — DESKTOP (1024px)
Layout due colonne: immagine sx, testo dx
============================================ */

@media screen and (min-width: 1024px) {

    :root {
        --top-bar-height: 80px;
        --bottom-bar-height: 80px;
        --header-bar-height: 80px;
        --footer-bar-height: 80px;
    }

    .top-bar .bar-title,
    .bottom-bar .bar-title {
        font-size: 80px;
        letter-spacing: clamp(2px, 0.5vw, 18px);
    }

    .header-bar { padding: 20px 25px 0 20px; }
    .header-logo img { height: calc(var(--header-bar-height) - 10px); }
    .menu-toggle { font-size: 30px; }
    .logo-home { max-width: 500px; }

    /* --------------------------------------------------
    GRIGLIA DUE COLONNE
    Colonna sx: immagine fissa (sticky)
    Colonna dx: contenuto scorrevole
    -------------------------------------------------- */

    .main-content {
        display: block;
    }

    .main-content:has(.page-image) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr auto;
    }

    /* COLONNA SINISTRA — immagine hero fissa */
    .page-image {
        grid-column: 1;
        grid-row: 1 / 3;
        position: sticky;
        top: 0;
        height: calc(100vh - var(--top-bar-height) - var(--bottom-bar-height));
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        isolation: isolate;
    }

    .page-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    /* Frecce overlay hero: nascoste (click diretto → lightbox) */
    .page-image .gallery-arrow {
        display: none !important;
    }

    /* Thumbnails — nascoste su desktop */
    .thumbnails-container {
        display: none;
    }

    /* COLONNA DESTRA — testo */
    .content-wrapper {
        grid-column: 2;
        grid-row: 1 / 3;
        max-width: 100%;
    }

    /* Tipografia desktop */
    .about-section h2,
    .contact-section h2 { font-size: 33px; }
    .about-section p,
    .project-info-section p { font-size: 21px; }
    .services-list li { font-size: 21px; }

    /* Lista progetti */
    .project-item { padding: 20px; }
    .project-image { width: 180px; height: 180px; }
    .project-info h3 { font-size: 24px; }
    .project-info p { font-size: 19px; }

    /* Contatti: info + mappa affiancate */
    .contact-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 40px;
    }

    .contact-info-column { flex: 1; }
    .contact-map-column { flex: 1; }
    .map-link img { height: 400px; }

    /* Gallery progetto (griglia legacy) */
    .project-gallery { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
    .project-gallery img { height: 220px; }

    /* Lightbox: frecce visibili */
    .lightbox-nav { display: flex; font-size: 50px; width: 70px; height: 70px; }
    .lightbox-nav.prev { left: 30px; }
    .lightbox-nav.next { right: 30px; }

    /* Frecce overlay immagine principale */
    .gallery-arrow {
        display: flex;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 48px;
        height: 48px;
        background-color: rgba(0,0,0,0.45);
        color: #fff;
        border: none;
        border-radius: 50%;
        font-size: 20px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10;
        transition: background-color 0.2s ease;
        user-select: none;
    }

    .gallery-arrow:hover { background-color: rgba(0,0,0,0.75); }
    .gallery-arrow.prev { left: 16px; }
    .gallery-arrow.next { right: 16px; }
}

/* ============================================
MEDIA QUERIES — WIDESCREEN (1440px)
============================================ */

@media screen and (min-width: 1440px) {

    :root { --margin-side: 14%; }

    .about-section p,
    .project-info-section p { font-size: 23px; }
    .services-list li { font-size: 23px; }

    .lightbox-nav { font-size: 60px; width: 80px; height: 80px; }
    .lightbox-nav.prev { left: 40px; }
    .lightbox-nav.next { right: 40px; }
}

/* ============================================
CONTATTI — GRIGLIA INFO
============================================ */

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.contact-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px;
    background-color: color-mix(in srgb, white 70%, #c9c9c9);
}

.contact-card-icon {
    font-size: 22px;
    color: var(--white);
    flex-shrink: 0;
    margin-top: 2px;
    width: 28px;
    text-align: center;
}

.contact-card-body h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 6px;
}

.contact-card-body p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--white);
}

.contact-card-body a {
    color: var(--white);
    text-decoration: none;
}

.contact-card-body a:hover {
    text-decoration: underline;
}

.contact-card-body .note {
    font-size: 14px;
    opacity: 0.7;
}

/* Mappa full-width */
.contact-map-full {
    margin-bottom: 24px;
}

.contact-map-full .map-link img {
    height: 260px;
}

/* ============================================
CONTATTI — DESKTOP (1024px)
============================================ */

@media screen and (min-width: 1024px) {

    /* 2 colonne: Orari | Indirizzo  /  Telefono | Email */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        margin-bottom: 28px;
    }

    .contact-card {
        padding: 20px;
    }

    .contact-card-icon { font-size: 26px; width: 32px; }
    .contact-card-body h3 { font-size: 21px; }
    .contact-card-body p { font-size: 19px; }

    /* Mappa occupa tutta la larghezza della colonna destra */
    .contact-map-full .map-link img {
        height: 380px;
    }
}

@media screen and (min-width: 1440px) {
    .contact-map-full .map-link img {
        height: 440px;
    }
}

/* ============================================
FORM DI CONTATTO
============================================ */

.contact-form-wrapper {
    background-color: #ffffff;
    padding: 28px 24px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.form-feedback {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 17px;
    border-radius: 3px;
}

.form-feedback.success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #2e7d32;
}

.form-feedback.error {
    background-color: #fdecea;
    color: #c62828;
    border-left: 4px solid #c62828;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.form-group label span {
    color: #c62828;
}

.form-group input,
.form-group textarea {
    font-family: var(--font-main);
    font-size: 17px;
    color: var(--white);
    background-color: #f7f7f7;
    border: 1px solid #e0e0e0;
    border-radius: 2px;
    padding: 11px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--anthracite);
    box-shadow: 0 0 0 2px rgba(39,39,39,0.08);
    background-color: #fff;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #bbb;
}

.form-submit {
    text-align: right;
}

.form-submit button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background-color: var(--anthracite);
    color: #fff;
    border: none;
    border-radius: 2px;
    font-family: var(--font-main);
    font-size: 17px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.form-submit button:hover {
    background-color: #111;
}

/* Mobile: nome e cognome in colonna */
@media screen and (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .contact-form-wrapper {
        padding: 20px 16px;
    }
}






/* ============================================
LIGHTBOX — BOTTONE CHIUDI X
============================================ */

/* Mobile: in basso a destra */
.lightbox-close {
    position: fixed;
    bottom: calc(var(--bottom-bar-height) + 16px);
    right: 16px;
    top: auto;
    left: auto;
    transform: none;
    width: 34px;
    height: 34px;
    background-color: rgba(0,0,0,0.8);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    line-height: 1;
}

.lightbox-close:hover {
    background-color: rgba(0,0,0,1);
}

/* Desktop: fixed in alto a destra, allineata all'immagine visibile */
@media screen and (min-width: 1024px) {
    .lightbox-close {
        position: fixed;
        top: calc(var(--top-bar-height) + 12px);
        right: 5%;
        left: auto;
        transform: none;
    }
}

/* ============================================
MASONRY GALLERY — DESKTOP (1024px)
============================================ */

@media screen and (min-width: 1024px) {
    .project-masonry-gallery {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 16vw;
        gap: 12px;
        margin: 28px 0 24px 0;
    }
    /* Reset pattern mobile */
    .masonry-item:nth-child(5n+1) { grid-row: span 1; }
    .masonry-item:nth-child(5n+3) { grid-row: span 1; }
    .masonry-item:nth-child(7n+1) { grid-row: span 1; }
    .masonry-item:nth-child(7n+4) { grid-row: span 1; }
    /* Pattern 3 colonne desktop: alterna immagini doppie */
    .masonry-item:nth-child(4n+1) { grid-row: span 2; }
    .masonry-item:nth-child(4n+3) { grid-row: span 2; }
}

@media screen and (min-width: 1440px) {
    .project-masonry-gallery {
        grid-auto-rows: 13vw;
        gap: 14px;
    }
}


/* ============================================
MASONRY GALLERY — CSS GRID
Span calcolato in PHP, gallery sempre piatta
============================================ */

.project-masonry-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 38vw;
    gap: 6px;
    margin: 24px 0 20px 0;
}

.masonry-item {
    overflow: hidden;
    cursor: pointer;
}

.masonry-item.span2 {
    grid-row: span 2;
}

.masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.masonry-item:hover img {
    transform: scale(1.03);
    opacity: 0.88;
}

@media screen and (min-width: 768px) {
    .project-masonry-gallery {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 20vw;
        gap: 8px;
    }
}

@media screen and (min-width: 1024px) {
    .project-masonry-gallery {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 15vw;
        gap: 10px;
        margin: 28px 0 24px 0;
    }
}

@media screen and (min-width: 1440px) {
    .project-masonry-gallery {
        grid-auto-rows: 12vw;
        gap: 12px;
    }
}

/* ===== RECENSIONI ===== */
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: var(--color-bg-card, #f0f0f0);
    margin-bottom: 24px;
}
.reviews-summary-num {
    font-size: 48px;
    font-weight: 700;
    color: #272727;
    line-height: 1;
}
.reviews-summary-detail { display: flex; flex-direction: column; gap: 4px; }
.reviews-summary-detail small { font-size: 13px; color: #999; letter-spacing: .5px; }
.reviews-stars-large { font-size: 26px; color: #c9a84c; letter-spacing: 3px; }

.reviews-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 24px;
}
@media (min-width: 900px) { .reviews-grid { grid-template-columns: 1fr 1fr; } }

.reviews-card { border-left: 3px solid #c9a84c !important; }
.reviews-stars { font-size: 20px; color: #c9a84c; letter-spacing: 2px; margin-bottom: 10px; }
.reviews-text  { font-size: 17px; line-height: 1.75; color: #515151; margin-bottom: 10px; }
.reviews-author { font-size: 14px; font-weight: 600; color: #272727; margin-bottom: 4px; }
.reviews-date  { font-size: 12px; color: #aaa; letter-spacing: .5px; }


.page-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
}

.scroll-top-btn {
    width: 42px;
    height: 42px;
    background: transparent;
    border: none;
    color: var(--anthracite);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.scroll-top-btn:hover {
    background: var(--anthracite);
    color: #fff;
    transform: translateY(-2px);
}

/* ============================================
SELETTORE LINGUA (IT / EN) — nell'header-bar
============================================ */

.header-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    letter-spacing: 1px;
    color: var(--anthracite);
    background-color: rgba(255,255,255,0.82);
    padding: 4px 10px;
    border-radius: 2px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

.lang-switch a {
    color: var(--anthracite);
    text-decoration: none;
    opacity: 0.55;
    padding: 2px 2px;
    border-bottom: 1px solid transparent;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.lang-switch a:hover { opacity: 1; }

.lang-switch a.active {
    opacity: 1;
    font-weight: 700;
    border-bottom-color: currentColor;
}

.lang-switch span { opacity: 0.4; }

@media screen and (min-width: 1024px) {
    .lang-switch { font-size: 19px; }
}

/* ============================================
NEWS
============================================ */

.news-date {
    display: block;
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8a8a8a;
    margin-bottom: 6px;
}

.news-detail .news-date { font-size: 14px; margin-bottom: 10px; }

.news-lead {
    font-size: 21px;
    line-height: 1.45;
    color: var(--white);
    font-style: italic;
    margin-bottom: 22px;
    padding-left: 14px;
    border-left: 3px solid var(--anthracite);
}

.news-empty {
    color: #999;
    text-align: center;
    padding: 20px 0;
}

@media screen and (min-width: 1024px) {
    .news-lead { font-size: 23px; }
}


/* ============================================
PAGINE CORTE: barra Home / Torna su sempre in fondo
(usata in news.php: aggiungere .content-wrapper--fill)
============================================ */

.content-wrapper--fill {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--top-bar-height) - var(--bottom-bar-height) - 260px);
}

.content-wrapper--fill > .page-bottom-bar { margin-top: auto; padding-top: 2rem; }

@media screen and (min-width: 768px) {
    .content-wrapper--fill { min-height: calc(100vh - var(--top-bar-height) - var(--bottom-bar-height) - 380px); }
}

@media screen and (min-width: 1024px) {
    .content-wrapper--fill { min-height: calc(100vh - var(--top-bar-height) - var(--bottom-bar-height)); }
}

/* Desktop: spazio a destra dei titoli per non finire sotto il selettore IT/EN */
@media screen and (min-width: 1024px) {
    .project-detail h2 { padding-right: 120px; }
}

/* Testo solo per motori di ricerca e screen reader (es. H1 di pagina) */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
