/* ZUGA subscribe — lilac band, copy + CTA, photo in a pill-stack frame. */

.zuga-sub {
  /* Four stacked pills (lobes down both sides), same family as the favorites
     cards; drawn as a mask so it can clip a photo. Aspect 100 : 107.5. */
  --zuga-pills: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 107.5' preserveAspectRatio='none'%3E%3Cg fill='%23000'%3E%3Crect width='100' height='31.6' rx='15.8'/%3E%3Crect y='25.3' width='100' height='31.6' rx='15.8'/%3E%3Crect y='50.6' width='100' height='31.6' rx='15.8'/%3E%3Crect y='75.9' width='100' height='31.6' rx='15.8'/%3E%3C/g%3E%3C/svg%3E");

  position: relative;
  padding: clamp(6rem, 8vw, 10rem) 0 clamp(8rem, 10vw, 13rem);
  background: var(--zuga-sub-bg, var(--zuga-lilac));
  overflow-x: clip;
}

.zuga-sub--fade {
  background: linear-gradient(180deg, var(--zuga-sub-bg) 82%, var(--zuga-sub-fade) 100%);
}

/* Paint above the band before so the wavy top edge sits on top of it. */
.section-zuga-subscribe {
  position: relative;
  z-index: 3;
}

.zuga-sub__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(4rem, 6vw, 8rem);
  align-items: center;
}

.zuga-sub--media-left .zuga-sub__content {
  order: 2;
}

/* --------------------------------------------------------------------------
   Copy
   -------------------------------------------------------------------------- */
.zuga-sub__content {
  position: relative;
  z-index: 2;
  max-width: 48rem;
}

.zuga-sub__title {
  font-size: clamp(3.6rem, 4.6vw, 6.4rem);
}

.zuga-sub__text {
  margin: 2rem 0 2.8rem;
  font-size: 1.5rem;
  font-weight: 500;
}

.zuga-sub__text > :first-child {
  margin-top: 0;
}

.zuga-sub__text > :last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Framed photo
   -------------------------------------------------------------------------- */
.zuga-sub__media {
  position: relative;
}

.zuga-sub__frame-wrap {
  position: relative;
  z-index: 1;
  width: 82%;
  margin-left: auto;
}

.zuga-sub__frame {
  position: relative;
  margin: 0;
  aspect-ratio: 100 / 107.5;
  rotate: -2.5deg;
}

.zuga-sub__outline,
.zuga-sub__photo {
  position: absolute;
  display: block;
  -webkit-mask: var(--zuga-pills) 0 0 / 100% 100% no-repeat;
  mask: var(--zuga-pills) 0 0 / 100% 100% no-repeat;
}

.zuga-sub__outline {
  inset: -0.6rem;
  background: var(--zuga-white);
}

.zuga-sub__photo {
  inset: 0;
  overflow: hidden;
  /* Visible while the image is blank, so the white outline reads as a border. */
  background: color-mix(in srgb, var(--zuga-sub-bg) 86%, #8a4fd0);
}

/* Slightly oversized so the gentle scroll parallax (0.02) never reveals an
   edge; keep the overscan small or the photo looks zoomed in. */
.zuga-sub__photo-inner {
  position: absolute;
  inset: -3% 0;
  display: block;
}

.zuga-sub__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 0.8s var(--zuga-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .zuga-sub__frame:hover .zuga-sub__image {
    scale: 1.05;
  }
}

.zuga-sub .zuga-placeholder {
  border: 0;
  background: transparent;
}

/* White brush-stroke image behind the frame, spilling out on both sides. */
.zuga-sub__scribbles {
  position: absolute;
  z-index: 0;
  left: -28%;
  top: 18%;
  width: 136%;
  height: auto;
  max-width: none;
  pointer-events: none;
  opacity: 0.85;
}

/* Painted on left to right with a sliding gradient mask (not clip-path: an
   element clipped to nothing never lazy-loads or triggers the in-view
   observer). Gradient is 220% wide; position 100% = hidden, 0% = shown. */
.zuga-motion .zuga-sub__scribbles {
  -webkit-mask: linear-gradient(90deg, #000 45%, transparent 55%) 100% 0 / 220% 100% no-repeat;
  mask: linear-gradient(90deg, #000 45%, transparent 55%) 100% 0 / 220% 100% no-repeat;
  transition:
    -webkit-mask-position 1.6s var(--zuga-ease-out) 0.2s,
    mask-position 1.6s var(--zuga-ease-out) 0.2s;
}

.zuga-motion .zuga-sub__scribbles.is-inview {
  -webkit-mask-position: 0% 0;
  mask-position: 0% 0;
}

/* --------------------------------------------------------------------------
   Mobile: copy first, frame below
   -------------------------------------------------------------------------- */
@media screen and (max-width: 749px) {
  .zuga-sub__grid {
    grid-template-columns: 1fr;
  }

  .zuga-sub--media-left .zuga-sub__content {
    order: 0;
  }

  .zuga-sub__frame-wrap {
    width: 88%;
    margin: 0 auto;
  }

  .zuga-sub__scribbles {
    left: -8%;
    width: 116%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zuga-sub__image {
    transition: none;
  }

  .zuga-motion .zuga-sub__scribbles {
    -webkit-mask: none;
    mask: none;
    transition: none;
  }
}
