/* ===== PAGINA DETTAGLIO PROGETTO — tutto in una schermata ===== */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #e0e0e0;
    --modal-handle-color: #d0d0d0;
    --dim-color: rgba(0, 0, 0, 0.5);
}

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

html, body { height: 100%; }
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow: hidden;              /* niente scroll: tutto nella stessa inquadratura */
    display: flex;
    flex-direction: column;
}

button { background: none; border: none; cursor: pointer; font-family: inherit; font-size: inherit; }

/* Header: logo a sinistra, menù a tendina a destra */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 40px;
    border-bottom: 1px solid var(--border-color);
    flex: 0 0 auto;
}
.site-logo { display: block; width: 64px; line-height: 0; transition: transform 0.25s ease, opacity 0.25s ease; }
.site-logo img { width: 100%; height: auto; display: block; }
.site-logo:hover { transform: scale(1.08); opacity: 0.7; }

/* Menù a tendina */
.dropdown { position: relative; }
.dropdown-toggle {
    border: 1px solid var(--border-color);
    padding: 9px 18px;
    border-radius: 30px;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    background: #fff;
}
.dropdown-toggle::after { content: " ▾"; }
.dropdown-toggle:hover { background: #f5f5f5; }
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 600;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a {
    display: block;
    padding: 13px 18px;
    color: #000;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-bottom: 1px solid #f0f0f0;
}
.dropdown-menu a:last-child { border-bottom: none; }
.dropdown-menu a:hover { background: #f5f5f5; }

/* Area centrale */
.project-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 24px 20px;
}
.project-head { text-align: center; }
.project-head .eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}
.project-head h1 {
    font-size: 26px;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.1;
}

/* Carosello: immagini 16:9 visibili per intero, contenute (non a tutto schermo) */
.carousel-container {
    width: 100%;
    max-width: 960px;
    flex: 0 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: 8px;
}
.carousel-track { display: flex; transition: transform 0.5s ease-out; cursor: grab; }
.carousel-track.grabbing { cursor: grabbing; }
.carousel-slide {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}
.carousel-slide img {
    max-width: 100%;
    max-height: 56vh;
    width: auto;
    height: auto;
    object-fit: contain;     /* mostra tutta l'immagine, niente taglio */
    display: block;
    pointer-events: none;
}

/* Controlli */
.carousel-controls { display: flex; align-items: center; gap: 15px; font-size: 14px; }
.nav-btn {
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
}
.nav-btn:hover { background: #f5f5f5; }

/* Stesso stile del selettore lingua (pill), adattato al tema chiaro */
.details-toggle {
    margin-top: 2px;
    background: rgba(0, 0, 0, 0.05);
    color: #000;
    border: 1px solid rgba(0, 0, 0, 0.25);
    padding: 12px 22px;
    border-radius: 30px;
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    transition: background 0.3s ease;
}
.details-toggle:hover { background: rgba(0, 0, 0, 0.1); }

/* Modale dettagli (lo scroll lungo vive QUI, non nella pagina) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--dim-color);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.details-modal {
    background-color: var(--bg-color);
    width: 90%;
    max-width: 620px;
    max-height: 82vh;
    overflow-y: auto;
    border-radius: 12px 12px 0 0;
    padding: 30px 34px;
    transform: translateY(100%);
    transition: transform 0.5s ease-out;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.12);
}
.modal-overlay.open .details-modal { transform: translateY(0); }
.modal-handle {
    width: 40px; height: 4px;
    background-color: var(--modal-handle-color);
    border-radius: 2px;
    margin: 0 auto 22px;
    cursor: pointer;
}
.details-modal h2 { font-size: 20px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.details-modal p { margin-bottom: 14px; font-size: 14px; color: #333; }
.details-modal .meta-grid { margin: 18px 0 4px; }
.details-modal .meta-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #eee;
    font-size: 13px;
}
.details-modal .meta-row .k { color: #888; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.details-modal .meta-row .v { font-weight: bold; }

@media (max-width: 768px) {
    .site-header { padding: 12px 18px; }
    .project-head h1 { font-size: 21px; }
    .carousel-slide img { max-height: 44vh; }
    .project-stage { padding: 10px 14px 16px; }
}
