.project-title {
    font-size: clamp(2rem, 11vw, 10rem);
    font-weight: 200;
    line-height: 0.85;
    letter-spacing: -0.05em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    animation: fadeIn 0.8s ease-out forwards;
    font-variation-settings: 'wdth' 4;
}

.project-intro {
    max-width: 950px;
    /* letter-spacing: -0.03em; */
}

/* .project-body {
    letter-spacing: -0.03em;
} */

.project-label {
    font-size: 14px;
    color: #6b7280;
    padding-top: 0.75rem;
    border-top: 1px solid #d1d5db;
    display: inline-block;
    width: 100%;
}

main section {
    animation: fadeIn 0.8s ease-out forwards;
}

@media (max-width: 768px) {

    .project-title {
        font-size: clamp(4rem, 11vw, 14rem);
        line-height: 0.95;
    }

    .project-intro,
    .project-body {
        font-size: 22px !important;
    }

    .project-category {
        margin-top: 40px;
    }
}

/* LIGHTBOX */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    transform: scale(0.96);
    transition: transform 0.25s ease;
}

.lightbox.show {
    opacity: 1;
}

.lightbox.show img {
    transform: scale(1);
}

.hidden {
    display: none;
}


.project-image {
    cursor: zoom-in;
    background-color: #f2f2f2;
}

/* Riserva spazio minimo prima che le hero image carichino, per ridurre
   il layout shift finché project-page.js non calcola il flex reale */
#hero-images img {
    min-height: 200px;
    object-fit: cover;
}



.project-gallery {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

.project-gallery figure {
    margin: 0;
    min-width: 0;
}

.project-gallery img {
    width: 100%;
    height: auto;
    display: block;
}

.project-gallery-block {
    width: 100%;
}

.gallery-text-block {
    border-radius: 6px;
    box-shadow: none;
    width: 100%;
    margin-bottom: 2.5rem !important;
}

.gallery-text-title { margin: 0 0 0.15rem 0; }

.gallery-text-body { margin: 0; color: #374151; }

@media (max-width: 767px) {
  .project-gallery {
    flex-direction: column;
    height: auto;
  }

  .project-gallery figure {
    flex: none !important;
    width: 100%;
    height: auto !important;
  }

  .project-gallery img {
    width: 100%;
    height: auto !important;
  }

  #hero-images {
    flex-direction: column;
  }

  #hero-images img {
    flex: none !important;
    width: 100%;
    height: auto;
  }
}


.project-gallery-block figure:only-child {
    flex: 1;
}

.project-gallery-block figure:only-child img {
    width: 100%;
    height: auto;
}