/* Hero full-bleed + collage slot (Unsplash — licenza https://unsplash.com/license) */

body.visiva-tool--lombardia {
  --tool-accent: #38bdf8;
  --tool-accent-deep: #0ea5e9;
  --tool-accent-glow: rgba(56, 189, 248, 0.45);
  --tool-hero-image: url("../assets/images/tools/slot-distance/lombardia-hero-bg.jpg");
  --tool-hero-overlay: linear-gradient(
    115deg,
    rgba(8, 15, 30, 0.62) 0%,
    rgba(8, 15, 30, 0.42) 38%,
    rgba(8, 15, 30, 0.18) 72%,
    rgba(8, 15, 30, 0.06) 100%
  );
}

body.visiva-tool--piemonte {
  --tool-accent: #c4b5fd;
  --tool-accent-deep: #8b5cf6;
  --tool-accent-glow: rgba(139, 92, 246, 0.45);
  --tool-hero-image: url("../assets/images/tools/slot-distance/piemonte-hero-bg.jpg");
  --tool-hero-overlay: linear-gradient(
    115deg,
    rgba(15, 10, 28, 0.58) 0%,
    rgba(20, 12, 35, 0.4) 40%,
    rgba(15, 23, 42, 0.16) 74%,
    rgba(15, 23, 42, 0.05) 100%
  );
}

.tool-hero {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  min-height: min(52vh, 560px);
  margin-bottom: 8px;
  display: flex;
  align-items: stretch;
  isolation: isolate;
  overflow: hidden;
}

.tool-hero__bg {
  position: absolute;
  inset: 0;
  background-image: var(--tool-hero-image);
  background-size: cover;
  background-position: center 42%;
  z-index: 0;
}

.tool-hero__noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.045;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.tool-hero__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--tool-hero-overlay);
}

.tool-hero__inner {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 1820px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 48px) clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.tool-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 40px);
  align-items: center;
}

@media (min-width: 960px) {
  .tool-hero__grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: clamp(20px, 3vw, 48px);
  }
}

.tool-hero__copy {
  color: #f1f5f9;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.tool-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.88);
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  margin: 0 0 14px;
  width: fit-content;
}

.tool-hero__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tool-accent);
  box-shadow: 0 0 16px var(--tool-accent-glow);
  flex-shrink: 0;
}

.tool-hero__title {
  font-family: var(--font-display, "Outfit", sans-serif);
  font-size: clamp(1.65rem, 3.8vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  background: linear-gradient(105deg, #fff 12%, rgba(255, 255, 255, 0.86) 42%, var(--tool-accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not (background-clip: text) {
  .tool-hero__title {
    color: #fff;
    background: none;
  }
}

.tool-hero__lead {
  font-size: clamp(0.95rem, 1.35vw, 1.08rem);
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.9);
  max-width: 46ch;
  margin: 0;
}

.tool-hero__lead strong {
  color: #fff;
  font-weight: 700;
}

.tool-hero__collage {
  position: relative;
  min-height: 280px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
  align-items: stretch;
  perspective: 900px;
}

@media (min-width: 960px) {
  .tool-hero__collage {
    min-height: 320px;
  }
}

.tool-hero__shot {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transform: translateZ(0);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease;
}

.tool-hero__shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.08) contrast(1.03);
}

.tool-hero__shot--a {
  grid-row: span 2;
  transform: rotate(-2.5deg) translateY(6px);
}

.tool-hero__shot--b {
  transform: rotate(2deg) translateY(-4px);
}

.tool-hero__shot--c {
  transform: rotate(-1.2deg) translateY(8px);
}

@media (hover: hover) and (pointer: fine) {
  .tool-hero__collage:hover .tool-hero__shot--a {
    transform: rotate(-1.5deg) translateY(4px) scale(1.02);
  }

  .tool-hero__collage:hover .tool-hero__shot--b {
    transform: rotate(1deg) translateY(-2px) scale(1.02);
  }

  .tool-hero__collage:hover .tool-hero__shot--c {
    transform: rotate(-0.5deg) translateY(6px) scale(1.02);
  }
}

.tool-hero__shot--a img {
  min-height: 260px;
}

.tool-hero__shot--b img,
.tool-hero__shot--c img {
  min-height: 120px;
}

@media (min-width: 960px) {
  .tool-hero__shot--a img {
    min-height: 300px;
  }

  .tool-hero__shot--b img,
  .tool-hero__shot--c img {
    min-height: 140px;
  }
}

.tool-hero__credit {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(148, 163, 184, 0.85);
}

.tool-hero__credit a {
  color: rgba(186, 230, 253, 0.95);
  text-decoration: none;
  border-bottom: 1px solid rgba(56, 189, 248, 0.35);
}

.tool-hero__credit a:hover {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

body.visiva-tool--piemonte .tool-hero__credit a {
  color: rgba(221, 214, 254, 0.95);
  border-bottom-color: rgba(167, 139, 250, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .tool-hero__bg {
    transform: none;
    animation: none !important;
  }

  .tool-hero__shot--a,
  .tool-hero__shot--b,
  .tool-hero__shot--c {
    transform: none;
  }

  .tool-hero__collage:hover .tool-hero__shot--a,
  .tool-hero__collage:hover .tool-hero__shot--b,
  .tool-hero__collage:hover .tool-hero__shot--c {
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .tool-hero__bg {
    animation: tool-hero-ken 22s ease-in-out infinite alternate;
  }
}

@keyframes tool-hero-ken {
  from {
    transform: scale(1.02) translate(0, 0);
  }

  to {
    transform: scale(1.08) translate(-1.2%, 0.8%);
  }
}

body.visiva-tool--lombardia .calc-hero {
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 0 48px rgba(56, 189, 248, 0.12);
}

body.visiva-tool--piemonte .calc-hero {
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55) inset,
    0 0 48px rgba(139, 92, 246, 0.14);
}
