/* CSS originale del widget Elementor OMU: recupero-edifici-storici */

@font-face {
  font-family: "Bugrino";
  src: url("../fonts/Bugrino-Bold.woff") format("woff");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bugrino";
  src: url("../fonts/Bugrino-Regular.woff") format("woff");
  font-weight: 300; 
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
}

* { box-sizing: border-box; }

.omu-page {
  --rust: #b95b00;
  --beige: #efd3bf;
  --mint: #72ffd2;
  width: 100%;
  max-width: none;
  margin: 0;
  background: #fff;
  color: #000;
  overflow-x: hidden;
  container-type: inline-size;
  font-family: Arial, Helvetica, sans-serif;
}

.omu-page a {
  color: inherit;
  text-decoration: none;
}

/* --- PAGE CONTENT (PERFETTO OVERLAP 50% DENTRO / 50% FUORI) --- */
.omu-project {
  padding: clamp(20px, 2.9cqw, 60px) 4cqw 0;
}

.omu-project-title {
  margin: 0;
  font-family: "Bugrino", Arial, sans-serif;
  font-size: clamp(48px, 8.35cqw, 120px);
  line-height: 0.9;
  font-weight: bold;
  letter-spacing: .01em;
  position: relative;
  left: 18cqw; /* Posizionamento longitudinale identico */
  top: 0;
  transform: translateY(50%); /* Esattamente metà altezza sopra l'immagine e metà dentro */
  z-index: 3;
}

.omu-project-intro {
  position: relative;
  min-height: 41.8cqw;
  display: flex;
  align-items: flex-start;
}

.omu-project-image {
  width: 57.2cqw;
  height: clamp(300px, 39.2cqw, 600px);
  border-radius: 0 0 0 3.2cqw;
  overflow: hidden;
  position: absolute;
  right: -4cqw;
  top: 0;
  z-index: 1;
  margin: 0;
}

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

.omu-project-copy {
  width: clamp(280px, 36.2cqw, 600px);
  padding-top: clamp(60px, 14cqw, 200px); /* Spazio bilanciato per evitare accavallamenti */
  position: relative;
  z-index: 2;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(16px, 2.02cqw, 24px);
  line-height: 1.72;
  letter-spacing: .055em;
  font-weight: 400;
  color: #222;
}

.omu-project-copy p {
    margin: 0 0 1.5em;
}

.omu-project-copy p:first-child {
    font-style: italic;
}

/* --- GALLERY --- */
.omu-gallery {
  padding: clamp(40px, 5.2cqw, 80px) 4cqw;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3cqw;
}

.omu-gallery a {
  display: block;
  aspect-ratio: 1/1;
  border-radius: clamp(10px, 1.8cqw, 20px);
  overflow: hidden;
  background: #eee;
  cursor: pointer;
}

.omu-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .45s ease;
}

.omu-gallery a:hover img {
  transform: scale(1.05);
}

/* --- LIGHTBOX (MINIMAL CON SCORRIMENTO DOLCE) --- */
.omu-lightbox {
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.93);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.omu-lightbox.active {
  display: flex;
  opacity: 1;
}

.omu-lightbox-container {
  position: relative;
  width: 85vw;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.omu-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.omu-lightbox-img.loaded {
  opacity: 1;
  transform: scale(1);
}

.omu-lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100001;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.omu-lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--mint);
}

.omu-lightbox-prev { left: -70px; }
.omu-lightbox-next { right: -70px; }

.omu-lightbox-close {
  position: absolute;
  top: -55px;
  right: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
}

.omu-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ff5252;
}

/* --- PROJECT NAV (RELAZIONALE COMPATTO) --- */
.omu-project-nav {
  padding: 0 4cqw clamp(40px, 7cqw, 100px);
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 1.6cqw;
}

.omu-project-nav a {
  height: clamp(50px, 4cqw, 70px);
  border: 1px solid var(--rust);
  border-radius: clamp(8px, 1.1cqw, 15px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 2.2cqw;
  color: var(--rust);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(14px, 1.9cqw, 20px);
  font-weight: 400;
  letter-spacing: .08em;
  transition: all 0.3s ease;
}

.omu-project-nav a.next {
  background: var(--rust);
  color: #fff;
}

.omu-project-nav span {
  font-size: 1.5em;
  line-height: 1;
}

/* --- CONNECT / FOOTER SECTION (FULL-BLEED A DESTRA) --- */
.omu-connect {
  padding: 0 0 clamp(30px, 2.5cqw, 60px) 4cqw;
  display: grid;
  grid-template-columns: .8fr 1.25fr;
  gap: 1.8cqw;
}

.omu-label {
  margin: 0 0 clamp(10px, 2cqw, 20px);
  font-size: clamp(18px, 2.55cqw, 28px);
  font-style: italic;
  color: rgba(0,0,0,.6);
  font-weight: 300;
}

.omu-newsletter,
.omu-social a {
  background: var(--beige);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Bugrino", Arial, sans-serif;
  color: #000;
  font-weight: 300;
  text-decoration: none;
}

.omu-newsletter {
  height: clamp(150px, 31.4cqw, 400px);
  padding: 0 10%;
  font-size: clamp(32px, 6.15cqw, 80px);
  line-height: .78;
  border-radius: clamp(12px, 1.7cqw, 25px);
}

.omu-social a {
  height: clamp(55px, 9.3cqw, 120px);
  margin-bottom: clamp(8px, 2cqw, 20px);
  padding: 0 8%;
  font-size: clamp(26px, 5.7cqw, 70px);
  line-height: 1;
  margin-right: -4cqw;
  padding-right: calc(8% + 4cqw); 
  border-radius: clamp(12px, 1.7cqw, 25px) 0 0 clamp(12px, 1.7cqw, 25px); 
}

/* --- MOBILE OPTIMIZATION --- */
@media(max-width:767px) {
  .omu-project-title {
    left: 0;
    top: 0;
    transform: none;
    margin-bottom: 20px;
  }

  .omu-project-intro {
    flex-direction: column;
    min-height: auto;
    margin-top: 10px;
  }

  .omu-project-image {
    position: relative;
    width: 100vw;
    left: -4cqw;
    right: auto;
    height: 75vw;
    border-radius: 0;
    margin-bottom: 25px;
  }

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

  .omu-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 30px 4cqw;
  }

  .omu-lightbox-container {
    width: 95%;
    height: 70%;
  }
  
  .omu-lightbox-prev { left: 15px; }
  .omu-lightbox-next { right: 15px; }
  .omu-lightbox-close { top: -50px; right: 15px; }
  .omu-lightbox-btn { width: 46px; height: 46px; font-size: 20px; }

  .omu-project-nav {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-bottom: 50px;
  }

  .omu-connect {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 15px 0 40px 4cqw;
  }

  .omu-newsletter {
    height: 180px;
    padding: 0 25px;
    border-radius: clamp(12px, 1.7cqw, 25px) 0 0 clamp(12px, 1.7cqw, 25px);
  }

  .omu-social a {
    height: 65px;
    margin-bottom: 12px;
    margin-right: 0;
    padding-right: 25px;
    border-radius: clamp(12px, 1.7cqw, 25px) 0 0 clamp(12px, 1.7cqw, 25px);
  }

  .omu-social a:last-child {
    margin-bottom: 0;
  }
}
