/* =========================================================
   DRM Custom Garage — lavori.css
   ========================================================= */

/* ---------- Page Hero ---------- */
.page-hero {
  padding: 100px 24px 40px;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}
.page-hero .eyebrow { margin-bottom: 12px; }
.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin-bottom: 14px;
}
.page-hero p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

/* ---------- Compare ---------- */
.compare {
  padding: 60px 24px 80px;
  background: var(--bg-elevated);
}
.compare .section-head {
  text-align: center;
  margin-bottom: 36px;
}
.compare .section-kicker {
  color: var(--red);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
}
.compare .section-head h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.compare-slider {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 60px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.04);
  user-select: none;
  touch-action: none;
  background: #0a0a0a;
}
.compare-before,
.compare-after {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.compare-before img,
.compare-after img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  pointer-events: none;
  background: #0a0a0a;
}
.compare-after img {
  transform: scale(1.68);
  transform-origin: center center;
  margin-top: -7%;
}
.compare-after {
  clip-path: inset(0 0 0 50%);
  will-change: clip-path;
}
.compare-before .slide-tag,
.compare-after .slide-tag {
  position: absolute;
  top: 18px;
  z-index: 4;
  pointer-events: none;
}
.compare-before .slide-tag { left: 18px; }
.compare-after  .slide-tag { right: 18px; left: auto; }
.slide-tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.compare-handle {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 52px;
  margin-left: -26px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  cursor: ew-resize;
  touch-action: none;
}
.compare-handle::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 20px rgba(0,0,0,0.6), 0 0 6px rgba(255,255,255,0.5);
  transform: translateX(-50%);
}
.compare-handle-grip {
  position: relative;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: 0 8px 28px rgba(255,43,43,0.5), 0 2px 10px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.compare-handle:hover .compare-handle-grip,
.compare-handle:active .compare-handle-grip {
  transform: scale(1.1);
  box-shadow: 0 10px 32px rgba(255,43,43,0.6), 0 3px 12px rgba(0,0,0,0.5);
}

/* ---------- Portfolio (modificato: griglia invece di carosello) ---------- */
.portfolio {
  padding: 80px 24px 100px;
}
.carousel {
  max-width: 1280px;
  margin: 0 auto;
}
.carousel-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}
.carousel-tab {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  transition: all 0.22s ease;
  cursor: pointer;
}
.carousel-tab:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}
.carousel-tab.is-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 6px 22px rgba(255,43,43,0.4);
}
.carousel-viewport {
  overflow: visible; /* non più nascosto */
}
.carousel-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  /* rimossa la transizione e transform */
}
.carousel-slide {
  /* non più flex: 0 0 ... */
  padding: 0;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.carousel-slide.is-hidden {
  display: none; /* nasconde con filtro */
}
.carousel-slide:hover {
  transform: translateY(-4px);
}

.slide-visual {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.32);
  transition: box-shadow 0.35s ease;
}
.carousel-slide:hover .slide-visual {
  box-shadow: 0 24px 52px rgba(0,0,0,0.42);
}
.slide-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.carousel-slide:hover .slide-visual img {
  transform: scale(1.06);
}
.slide-visual .slide-tag {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 2;
}
.slide-more {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.25s ease;
}
.carousel-slide:hover .slide-more {
  opacity: 1;
  transform: translateY(0);
}
.carousel-slide h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 7px;
  padding: 0 4px;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.carousel-slide p {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  padding: 0 4px;
  margin: 0;
}

/* Nessun controllo carosello (frecce/pallini) */

/* ---------- CTA ---------- */
.cta-final {
  padding: 90px 24px 110px;
  text-align: center;
}
.cta-inner {
  max-width: 640px;
  margin: 0 auto;
}
.cta-inner h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 14px;
}
.cta-inner p {
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.55;
}

/* ===================== MODAL SCHEDA PROGETTO ===================== */
.project-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.project-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.project-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.project-modal-content {
  position: relative;
  width: 100%;
  max-width: 980px;
  max-height: 92vh;
  background: var(--bg-card, #121212);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  transform: scale(0.96) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.project-modal.is-open .project-modal-content {
  transform: scale(1) translateY(0);
}
.project-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.project-modal-close:hover {
  background: var(--red);
  border-color: var(--red);
}

/* Gallery */
.project-modal-gallery {
  position: relative;
  background: #0a0a0a;
  aspect-ratio: 16 / 10;
  max-height: 58vh;
}
.gallery-main {
  width: 100%;
  height: 100%;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}
.gallery-nav:hover {
  background: var(--red);
  border-color: var(--red);
}
.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }
.gallery-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  font-size: 0.8rem;
  color: #fff;
  letter-spacing: 0.04em;
}

/* Info */
.project-modal-info {
  padding: 22px 28px 10px;
}
.project-modal-info h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.project-modal-info p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

/* Thumbs */
.gallery-thumbs {
  display: flex;
  gap: 10px;
  padding: 16px 28px 24px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.gallery-thumbs::-webkit-scrollbar {
  height: 4px;
}
.gallery-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}
.gallery-thumb {
  flex: 0 0 80px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-thumb.is-active,
.gallery-thumb:hover {
  opacity: 1;
  border-color: var(--red);
}

/* Mobile modal */
@media (max-width: 700px) {
  .project-modal {
    padding: 12px;
  }
  .project-modal-content {
    max-height: 94vh;
    border-radius: 16px;
  }
  .project-modal-gallery {
    aspect-ratio: 4 / 3;
    max-height: 45vh;
  }
  .gallery-nav {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
  .gallery-prev { left: 10px; }
  .gallery-next { right: 10px; }
  .project-modal-info {
    padding: 16px 18px 8px;
  }
  .project-modal-info h3 {
    font-size: 1.15rem;
  }
  .gallery-thumbs {
    padding: 12px 18px 18px;
  }
  .gallery-thumb {
    flex: 0 0 68px;
    height: 48px;
  }
}

/* ---------- Mobile generale ---------- */
@media (max-width: 700px) {
  .page-hero { padding: 70px 18px 30px; }
  .compare { padding: 40px 16px 60px; }
  .compare .section-head { margin-bottom: 28px; }
  .compare-slider {
    max-width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
  }
  .compare-handle { width: 44px; margin-left: -22px; }
  .compare-handle-grip { width: 42px; height: 42px; }
  .portfolio { padding: 50px 16px 70px; }
  .carousel-tabs { gap: 8px; margin-bottom: 28px; }
  .carousel-tab { padding: 8px 14px; font-size: 0.78rem; }
  .carousel-track {
    grid-template-columns: 1fr; /* una colonna su mobile */
    gap: 20px;
  }
  .cta-final { padding: 60px 18px 80px; }
}