.grey-event-carousel {
  --grey-event-accent: #0f7f82;
  --grey-event-ink: #102340;
  position: relative;
  width: min(100%, 520px);
  min-width: 0;
  margin-inline: auto;
}

.grey-event-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  height: auto;
  aspect-ratio: 2244 / 2804;
  overflow: hidden;
  border: 1px solid rgba(16, 35, 64, 0.14);
  border-radius: 20px;
  background: #eef8f7;
}

.grey-event-stage-image {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.grey-event-stage-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.grey-event-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(16, 35, 64, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--grey-event-ink);
  box-shadow: 0 8px 24px rgba(16, 35, 64, 0.18);
  cursor: pointer;
  transform: translateY(-50%);
}

.grey-event-arrow:hover,
.grey-event-arrow:focus-visible {
  background: #fff;
  outline: 3px solid rgba(15, 127, 130, 0.25);
}

.grey-event-arrow.is-prev { left: 14px; }
.grey-event-arrow.is-next { right: 14px; }

.grey-event-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.grey-event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 2px 10px;
  color: var(--grey-event-ink);
}

.grey-event-caption {
  margin: 0;
  font-weight: 700;
}

.grey-event-counter {
  flex: 0 0 auto;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e4f2f1;
  color: #17686b;
  font-size: 0.86rem;
  font-weight: 800;
  text-align: center;
}

.grey-event-thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.grey-event-thumb {
  min-width: 0;
  padding: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 11px;
  background: #f5f7f8;
  cursor: pointer;
}

.grey-event-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 7px;
  background: #eef8f7;
  object-fit: contain;
  object-position: center;
}

.grey-event-thumb[aria-current="true"] {
  border-color: var(--grey-event-accent);
  background: #e4f2f1;
}

.grey-event-lightbox {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 13, 26, 0.88);
}

.grey-event-lightbox[hidden] { display: none; }

.grey-event-lightbox-dialog {
  position: relative;
  display: grid;
  width: min(1120px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.grey-event-lightbox-figure {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
  margin: 0;
  padding: 16px 64px 8px;
  overflow: hidden;
  background: #edf7f6;
}

.grey-event-lightbox-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 126px);
  object-fit: contain;
}

.grey-event-lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 12px 20px;
  color: var(--grey-event-ink);
}

.grey-event-lightbox-footer strong { min-width: 0; }

.grey-event-lightbox-close {
  position: absolute;
  z-index: 4;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(5, 16, 31, 0.82);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.grey-event-lightbox .grey-event-arrow { position: absolute; }
.grey-event-lightbox .grey-event-arrow.is-prev { left: 12px; }
.grey-event-lightbox .grey-event-arrow.is-next { right: 12px; }

@media (max-width: 760px) {
  .clinic-current-event.has-event-image {
    align-items: stretch;
  }

  .grey-event-stage {
    height: auto;
    min-height: 0;
    border-radius: 16px;
  }

  .grey-event-stage-image { padding: 0; }

  .grey-event-arrow {
    width: 44px;
    height: 44px;
  }

  .grey-event-arrow.is-prev { left: 8px; }
  .grey-event-arrow.is-next { right: 8px; }

  .grey-event-thumbs {
    display: flex;
    gap: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
  }

  .grey-event-thumb {
    flex: 0 0 58px;
  }

  .grey-event-lightbox { padding: 8px; }

  .grey-event-lightbox-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 13px;
  }

  .grey-event-lightbox-figure {
    padding: 56px 8px 6px;
  }

  .grey-event-lightbox-figure img {
    max-height: calc(100dvh - 142px);
  }

  .grey-event-lightbox-footer {
    min-height: 70px;
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  .grey-event-lightbox .grey-event-arrow {
    top: 30px;
    transform: none;
  }

  .grey-event-lightbox .grey-event-arrow.is-prev { left: 12px; }
  .grey-event-lightbox .grey-event-arrow.is-next { right: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .grey-event-carousel *,
  .grey-event-lightbox * {
    scroll-behavior: auto !important;
  }
}
