/* ==========================================================================
   Logo Marquee Section
   Ported from social-proof-carousel with renamed BEM classes.
   Layout: heading fixed on the left, logos scroll on the right.
   ========================================================================== */

/* Row: heading (left, static) + logos (right, scroll) */
.lg-logo-marquee {
  overflow: hidden;
}

/* Default fill only when no WP background is set on this block */
.lg-logo-marquee:not(.has-background) {
  background-color: var(--wp--preset--color--laser-beam-200, #dee3ff);
}

/*
 * Editor: ACF wraps the preview in an outer .has-background element,
 * while the inner .lg-logo-marquee still gets the default fill.
 * Make the inner transparent so the wrapper color shows through.
 */
.has-background .lg-logo-marquee {
  background-color: transparent;
}


.lg-logo-marquee__row {
  display: flex;
  width: 100%;
  /* padding: 2.5rem 0; */
  align-items: center;
  gap: 1.5rem;
}

/* Heading — fixed left, never scrolls */
.lg-logo-marquee__heading {
  flex: 0 0 12rem;
  max-width: 12rem;
  color: var(--wp--preset--color--supersonic, #070819);
  font-family: var(--wp--preset--font-family--archivo, "Archivo", sans-serif);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.3333;
  text-align: left;
  margin: 0;
}

/* When no heading, logos use full width */
.lg-logo-marquee:not(.lg-logo-marquee--has-heading) .lg-logo-marquee__outer {
  width: 100%;
}

/* Logos track area — fills remaining space, clips overflow */
.lg-logo-marquee__outer {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

/* Swiper container */
.lg-logo-marquee__swiper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

/*
 * Track / slides — horizontal even WITHOUT Swiper JS
 * (fixes editor preview stacking logos vertically)
 */
.lg-logo-marquee__track,
.lg-logo-marquee__swiper .swiper-wrapper {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.lg-logo-marquee__slide,
.lg-logo-marquee__swiper .swiper-slide {
  flex-shrink: 0;
  width: auto !important;
  height: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lg-logo-marquee__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--wp--preset--color--laser-beam-300, #b3bfff);
  border-radius: 0.5rem;
  box-shadow: none;
}

.lg-logo-marquee__img {
  display: block;
  width: auto;
  height: auto;
  margin: 0 auto;
  max-width: 6.3125rem;
  max-height: 1.5rem;
  object-fit: contain;
  object-position: center center;
}

/* ---------- Auto Scroll mode ---------- */

.lg-logo-marquee--auto-scroll .lg-logo-marquee__track,
.lg-logo-marquee--auto-scroll .lg-logo-marquee__swiper .swiper-wrapper {
  -webkit-transition-timing-function: linear !important;
  -o-transition-timing-function: linear !important;
  transition-timing-function: linear !important;
}

.lg-logo-marquee--auto-scroll .lg-logo-marquee__logo-wrap {
  width: 8.25rem;
  height: 3.375rem;
  padding: 1rem 1.25rem;
  overflow: hidden;
  box-sizing: border-box;
}

.lg-logo-marquee--auto-scroll .lg-logo-marquee__slide,
.lg-logo-marquee--auto-scroll .lg-logo-marquee__swiper .swiper-slide {
  width: auto !important;
}

/* ---------- Manual Arrows mode ---------- */

.lg-logo-marquee--manual-arrows .lg-logo-marquee__swiper {
  padding-bottom: 3rem;
}

.lg-logo-marquee--manual-arrows .lg-logo-marquee__img {
  max-height: 6rem;
  max-width: none;
}

/* Arrow controls */
.lg-logo-marquee__controls {
  position: absolute;
  left: 0;
  bottom: 0;
  width: auto;
  text-align: left;
  z-index: 2;
}

.lg-logo-marquee__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  margin: 0 0.25rem;
}

.lg-logo-marquee__btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.lg-logo-marquee__btn svg {
  width: 0.75rem;
  height: auto;
  fill: currentColor;
}

/* Inherit text color when set */
.lg-logo-marquee:not(.has-text-color) {
  color: var(--mtr-body-color);
}

/* Editor hint */
.lg-logo-marquee__editor-hint {
  flex: 1;
  text-align: center;
  padding: 1.5rem 1rem;
  background: #f0f0f0;
  border: 1px dashed #ccc;
  color: #666;
  margin: 0;
}

@media (min-width: 1200px) {
  .lg-logo-marquee__btn:not(:disabled):hover {
    background-color: var(--wp--preset--color--laser-beam, #0027d6);
    color: #fff;
    border-color: var(--wp--preset--color--laser-beam, #0027d6);
  }

  .lg-logo-marquee__btn:focus-visible {
    outline: 2px solid var(--wp--preset--color--laser-beam, #0027d6);
    outline-offset: 2px;
  }
}

/* Portrait and Landscape */
@media (min-width: 0) and (max-width: 767.98px) {
  .lg-logo-marquee__row {
    gap: 1.5rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .lg-logo-marquee__heading {
    flex-basis: auto;
    width: 100%;
    max-width: none;
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.4;
    text-align: center;
  }

  .lg-logo-marquee__outer {
    width: 100%;
  }

  .lg-logo-marquee__controls {
    width: 100%;
    text-align: center;
  }

  .lg-logo-marquee--auto-scroll .lg-logo-marquee__track,
  .lg-logo-marquee--auto-scroll .lg-logo-marquee__swiper .swiper-wrapper {
    padding-left: 1rem;
  }

  .lg-logo-marquee--auto-scroll .lg-logo-marquee__logo-wrap {
    width: auto;
    min-width: 5.5rem;
    height: 2.5463rem;
    padding: 0.7408rem;
    border-width: 0.0463rem;
    border-radius: 0.2778rem;
  }

  .lg-logo-marquee--auto-scroll .lg-logo-marquee__img {
    max-width: 4.2128rem;
    max-height: 1.0185rem;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
  .lg-logo-marquee--manual-arrows .lg-logo-marquee__logo-wrap {
    padding: 0.5rem 0.15rem;
  }
}
