/*
 * Luv, Mud — boy / girl collection cards (sections/luvmud-boy-girl.liquid)
 *
 * Clay sticker cards: thick navy outline, offset "clay" shadow, a slight opposite tilt each. The big word uses the
 * same bubbly lettering as the hero (heaviest heading weight, dark outline drawn behind the fill, sticker shadow).
 */

.lbg {
  --lbg-ink: #17233a;
  overflow-x: clip;
}

.lbg__title {
  margin: 0 0 clamp(1.5rem, 3.5vw, 2.75rem);
  font-family: var(--heading-font-family);
  font-weight: var(--lbg-word-weight, 700);
  font-size: calc(clamp(2rem, 1.2rem + 2.6vw, 3.4rem) * var(--text-heading-size-factor, 1));
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-align: center;
  text-wrap: balance;
  color: #c4d96b;
  -webkit-text-stroke: 0.12em var(--lbg-ink);
  paint-order: stroke fill;
  text-shadow: 0.03em 0.07em 0 var(--lbg-ink), 0.03em 0.12em 0.18em rgb(23 35 58 / 0.25);
}

.lbg__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 3rem);
  max-width: 78rem;
  margin-inline: auto;
}

@media screen and (min-width: 700px) {
  .lbg__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------------------------------------------------------------
 * Card
 * ------------------------------------------------------------------------------------------------------------------ */

.lbg-card {
  --lbg-rest: -1.2deg;
  --lbg-word-tilt: -6deg;
  position: relative;
  display: block;
  aspect-ratio: 1;
  container-type: inline-size;
  border: 3px solid var(--lbg-ink);
  border-radius: clamp(22px, 3vw, 36px);
  box-shadow: 0 8px 0 var(--lbg-ink), 0 18px 32px rgb(23 35 58 / 0.18);
  transform: rotate(var(--lbg-rest));
  transition: transform 0.38s cubic-bezier(0.3, 1.45, 0.5, 1), box-shadow 0.38s ease;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

.lbg-card--girl {
  --lbg-rest: 1.2deg;
  --lbg-word-tilt: 5deg;
}

.lbg-card__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  background: #8fc8f3;
}

.lbg-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1);
}

/* The word sits in the scene's empty sky, above the outfit */
.lbg-card__word {
  position: absolute;
  left: 50%;
  top: 5%;
  z-index: 1;
  translate: -50% 0;
  rotate: var(--lbg-word-tilt);
  font-family: var(--heading-font-family);
  font-weight: var(--lbg-word-weight, 700);
  font-size: 19cqw;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--lbg-word);
  -webkit-text-stroke: 0.12em var(--lbg-ink);
  paint-order: stroke fill;
  text-shadow: 0.035em 0.08em 0 var(--lbg-ink), 0.035em 0.14em 0.2em rgb(23 35 58 / 0.35);
  pointer-events: none;
}

.lbg-card__letter {
  display: inline-block;
  transform-origin: 50% 90%;
}

.lbg-card:focus-visible {
  outline: 3px solid var(--lbg-ink);
  outline-offset: 6px;
}

/* Hover (mouse only): the card lifts and straightens, the scene zooms a touch, the letters hop in a wave */
@media (hover: hover) and (pointer: fine) {
  .lbg-card:hover {
    transform: translateY(-6px) rotate(0deg);
    box-shadow: 0 14px 0 var(--lbg-ink), 0 26px 40px rgb(23 35 58 / 0.22);
  }

  .lbg-card:hover .lbg-card__img {
    transform: scale(1.05);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .lbg-card:hover .lbg-card__letter {
    animation: lbg-hop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) calc(var(--i) * 70ms) both;
  }
}

/* Press: squish down onto its shadow, like the hero's clay button */
.lbg-card:active {
  transform: translateY(5px) rotate(0deg) scale(1.01, 0.985);
  box-shadow: 0 3px 0 var(--lbg-ink), 0 8px 16px rgb(23 35 58 / 0.16);
  transition-duration: 0.12s;
}

/* A slow, gentle bob so the words feel alive (each card out of step) */
@media (prefers-reduced-motion: no-preference) {
  .lbg-card__word {
    animation: lbg-bob 4.2s ease-in-out infinite;
  }

  .lbg-card--girl .lbg-card__word {
    animation-delay: -2.1s;
  }
}

@keyframes lbg-bob {
  0%, 100% { translate: -50% 0; }
  50% { translate: -50% -3%; }
}

@keyframes lbg-hop {
  0%, 100% { transform: none; }
  35% { transform: translateY(-0.2em) scale(0.92, 1.1); }
  65% { transform: translateY(0) scale(1.1, 0.9); }
  82% { transform: translateY(-0.04em) scale(0.98, 1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .lbg-card,
  .lbg-card__img {
    transition: none;
  }

  .lbg-card:hover .lbg-card__img {
    transform: none;
  }
}
