/* ============================================================
   Mudale — Asado-style skewed columns marquee gallery
   Vertical infinite scroll, alternating up/down per column,
   different speeds, hover-to-pause, top+bottom edge fade.
   ============================================================ */

.mudale-gallery {
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 24px;
  margin-bottom: 0;
  height: 640px;
  overflow: hidden;
  background: transparent;
  /* fade top + bottom edges */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    #000 12%,
    #000 88%,
    transparent 100%
  );
}

.mudale-gallery__stage {
  /* the tilted plane that holds the columns */
  position: absolute;
  inset: -8% -4%;
  display: flex;
  flex-direction: row-reverse;   /* RTL: first column on the right */
  align-items: stretch;
  justify-content: center;
  gap: 14px;
  transform: rotate(-8deg);
  transform-origin: center center;
  will-change: transform;
}

.mudale-gallery__column {
  position: relative;
  flex: 1 1 0;
  min-width: 160px;
  max-width: 280px;
  overflow: hidden;
}

.mudale-gallery__track {
  display: flex;
  flex-direction: column;
  gap: 14px;
  will-change: transform;
  animation-name: mudale-col-up;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

/* Alternate direction column by column */
.mudale-gallery__column:nth-child(odd) .mudale-gallery__track {
  animation-name: mudale-col-up;
}
.mudale-gallery__column:nth-child(even) .mudale-gallery__track {
  animation-name: mudale-col-down;
}

/* Different speeds per column for variability (slow side) */
.mudale-gallery__column:nth-child(1) .mudale-gallery__track { animation-duration: 60s; }
.mudale-gallery__column:nth-child(2) .mudale-gallery__track { animation-duration: 75s; }
.mudale-gallery__column:nth-child(3) .mudale-gallery__track { animation-duration: 50s; }
.mudale-gallery__column:nth-child(4) .mudale-gallery__track { animation-duration: 85s; }
.mudale-gallery__column:nth-child(5) .mudale-gallery__track { animation-duration: 65s; }

.mudale-gallery__item {
  display: block;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f5fa;
  box-shadow: 0 4px 14px rgba(20, 30, 60, 0.08);
  aspect-ratio: 3 / 4;
}

.mudale-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.mudale-gallery__item:hover img {
  transform: scale(1.04);
}

/* Hover on the gallery pauses ALL columns (matches Asado behavior) */
.mudale-gallery:hover .mudale-gallery__track {
  animation-play-state: paused;
}

/* Keyframes — translate full track length, the JS duplicates items
   so a -50% translate produces a seamless loop */
@keyframes mudale-col-up {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
@keyframes mudale-col-down {
  from { transform: translateY(-50%); }
  to   { transform: translateY(0); }
}

/* Section: transparent so the page's gray bg shows through.
   No white box. Full bleed. */
.mudale-gallery-section {
  padding: 56px 0 80px;
  background: transparent;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 100%;
}

/* Heading sits ABOVE the gallery, dark navy on the gray page bg
   with a small white halo so it stays legible on any backdrop. */
.mudale-gallery-section__title {
  text-align: center;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 900;
  color: #1a3a6c;
  margin: 0 0 10px;
  position: relative;
  z-index: 3;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6),
    0 2px 6px rgba(255, 255, 255, 0.4);
}

.mudale-gallery-section__subtitle {
  text-align: center;
  font-size: clamp(15px, 1.4vw, 17px);
  color: #2d3a4f;
  margin: 0 0 28px;
  position: relative;
  z-index: 3;
}

/* Reduce columns + height on tablet / mobile */
@media (max-width: 900px) {
  .mudale-gallery { height: 520px; }
  .mudale-gallery__stage { gap: 10px; transform: rotate(-6deg); }
  .mudale-gallery__column:nth-child(5) { display: none; }
}

@media (max-width: 600px) {
  .mudale-gallery { height: 440px; }
  .mudale-gallery__stage { gap: 8px; transform: rotate(-5deg); }
  .mudale-gallery__column:nth-child(4) { display: none; }
  .mudale-gallery__column { min-width: 110px; }
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .mudale-gallery__track {
    animation: none !important;
  }
}
