.medrano-gallery {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 710px;
  padding: 68px 20px 36px;
  color: #fff;
  background: #161b22 url('../img/slider/02.jpg') center 54% / cover no-repeat;
  text-align: center;
}

.medrano-gallery::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 15, 23, .84), rgba(15, 15, 22, .78) 48%, rgba(9, 14, 21, .88));
}

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

.medrano-gallery__content {
  max-width: 1400px;
  margin: 0 auto;
}

.medrano-gallery__eyebrow {
  margin: 0 0 8px;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.medrano-gallery__eyebrow::before,
.medrano-gallery__eyebrow::after {
  content: '⌜';
  margin: 0 8px;
  color: #10a8ad;
  font-size: 17px;
}

.medrano-gallery__eyebrow::after {
  content: '⌟';
}

.medrano-gallery h2 {
  max-width: 850px;
  margin: 0 auto 12px;
  color: #fff;
  font: 400 clamp(38px, 4.2vw, 62px)/.99 Georgia, 'Times New Roman', serif;
  letter-spacing: -.035em;
}

.medrano-gallery h2 span {
  color: #12a5a9;
}

.medrano-gallery__intro {
  max-width: 700px;
  margin: 0 auto;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}

.medrano-gallery__stage {
  position: relative;
  height: 355px;
  margin: 26px auto 9px;
  outline: none;
  perspective: 1050px;
}

.medrano-gallery__stage:focus-visible {
  outline: 2px solid #40cbd0;
  outline-offset: 3px;
}

.medrano-gallery__card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: 340px;
  height: 300px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .18);
  box-shadow: 0 22px 45px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.6);
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .35s, box-shadow .35s;
}

.medrano-gallery__card[data-distance="0"] {
  z-index: 7;
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.medrano-gallery__card[data-distance="1"] {
  z-index: 6;
  opacity: .92;
  pointer-events: auto;
  transform: translate(calc(-50% - min(18vw, 235px)), -50%) scale(.84) rotateY(12deg);
}

.medrano-gallery__card[data-distance="1"][data-side="right"] {
  transform: translate(calc(-50% + min(18vw, 235px)), -50%) scale(.84) rotateY(-12deg);
}

.medrano-gallery__card[data-distance="2"] {
  z-index: 5;
  opacity: .76;
  pointer-events: auto;
  transform: translate(calc(-50% - min(32vw, 430px)), -50%) scale(.70) rotateY(15deg);
}

.medrano-gallery__card[data-distance="2"][data-side="right"] {
  transform: translate(calc(-50% + min(32vw, 430px)), -50%) scale(.70) rotateY(-15deg);
}

.medrano-gallery__card[data-distance="3"] {
  z-index: 4;
  opacity: .6;
  pointer-events: auto;
  transform: translate(calc(-50% - min(43vw, 580px)), -50%) scale(.57) rotateY(18deg);
}

.medrano-gallery__card[data-distance="3"][data-side="right"] {
  transform: translate(calc(-50% + min(43vw, 580px)), -50%) scale(.57) rotateY(-18deg);
}

.medrano-gallery__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.medrano-gallery__card:hover,
.medrano-gallery__card:focus-visible {
  box-shadow: 0 22px 55px rgba(0, 0, 0, .6);
}

.medrano-gallery__card:focus-visible {
  outline: 3px solid #40cbd0;
  outline-offset: 4px;
}

.medrano-gallery__zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, .14);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity .2s;
}

.medrano-gallery__card.is-current:hover .medrano-gallery__zoom,
.medrano-gallery__card.is-current:focus-visible .medrano-gallery__zoom {
  opacity: 1;
}

.medrano-gallery__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 8vw, 110px);
}

.medrano-gallery__arrow {
  display: grid;
  width: 58px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  font: 24px/1 Arial, sans-serif;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}

.medrano-gallery__arrow:hover,
.medrano-gallery__arrow:focus-visible {
  border-color: #10a8ad;
  background: #087d83;
  color: #fff;
}

.medrano-gallery__all {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border: 1px solid #fff;
  border-radius: 999px;
  background: #00888d;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s;
}

.medrano-gallery__all:hover,
.medrano-gallery__all:focus-visible {
  background: #0a6970;
  color: #fff;
}

.medrano-gallery__status {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
}

@media (max-width: 700px) {
  .medrano-gallery {
    min-height: 610px;
    padding: 56px 16px 35px;
  }

  .medrano-gallery h2 {
    max-width: 520px;
    font-size: clamp(34px, 7.5vw, 49px);
  }

  .medrano-gallery__intro {
    max-width: 520px;
  }

  .medrano-gallery__stage {
    height: 310px;
    margin-top: 22px;
  }

  .medrano-gallery__card {
    width: min(70vw, 300px);
    height: 265px;
  }

  .medrano-gallery__card[data-distance="1"] {
    transform: translate(calc(-50% - 30vw), -50%) scale(.74) rotateY(12deg);
  }

  .medrano-gallery__card[data-distance="1"][data-side="right"] {
    transform: translate(calc(-50% + 30vw), -50%) scale(.74) rotateY(-12deg);
  }

  .medrano-gallery__card[data-distance="2"],
  .medrano-gallery__card[data-distance="3"] {
    opacity: 0;
    pointer-events: none;
  }

  .medrano-gallery__controls {
    gap: clamp(12px, 5vw, 28px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .medrano-gallery__card,
  .medrano-gallery__arrow,
  .medrano-gallery__all,
  .medrano-gallery__zoom {
    transition: none;
  }
}
