/* Section 10 — Before / after comparison (verde, titolo hero font) */

.age-before-after {
  width: 100%;
  max-width: 100%;
  background: var(--age-green);
  color: #fff;
  font-size: 1rem;
  line-height: 1.5;
  overflow-x: clip;
}

.age-before-after *,
.age-before-after *::before,
.age-before-after *::after {
  box-sizing: border-box;
}

.age-before-after__inner {
  max-width: var(--age-content-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 4vw, 1.5rem)
    clamp(1.75rem, 4.5vw, 3rem);
}

.age-before-after__title {
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  font-family: var(--age-font-hero);
  font-size: clamp(1.35rem, 2vw + 0.85rem, 2.35rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  font-style: normal;
}

.age-before-after__compare {
  width: 100%;
  max-width: min(var(--age-content-max), 100%);
  margin: 0 auto;
  overflow-x: clip;
}

.age-before-after__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 0.5rem;
  padding-inline: 0.15rem;
  font-family: var(--age-font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.age-before-after__track {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  touch-action: none;
  user-select: none;
  isolation: isolate;
  backface-visibility: hidden;
}

.age-before-after__track.is-dragging {
  cursor: ew-resize;
}

.age-before-after__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.age-before-after__img--after {
  z-index: 0;
}

.age-before-after__img--before {
  z-index: 1;
  /* +0.5px so il bordo del clip non crea una striscia a due bordi paralleli accanto alla linea */
  clip-path: polygon(
    0 0,
    calc(var(--compare-x, 50%) + 0.5px) 0,
    calc(var(--compare-x, 50%) + 0.5px) 100%,
    0 100%
  );
}

.age-before-after__handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--compare-x, 50%);
  z-index: 3;
  width: 2.75rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: ew-resize;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  touch-action: none;
}

.age-before-after__handle:focus {
  outline: none;
}

.age-before-after__handle:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.age-before-after__handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
  background: #fff;
  border-radius: 1px;
}

.age-before-after__handle-knob {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--age-gold);
  /* niente bordo bianco: sul cerchio i lati dx/sx paiono due righe verticali accanto alla linea */
  border: none;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
  color: var(--age-text-dark);
}

.age-before-after__handle-icon {
  display: block;
  width: 1.08rem;
  height: 1.08rem;
  flex-shrink: 0;
}
