/* Instagram presentation: all rules are deliberately scoped to the ig-* experience. */
.ig-expand {
  cursor: pointer;
  white-space: normal;
  line-height: 1.3;
  padding-top: 10px;
  padding-bottom: 10px;
  text-align: center;
}

.ig-card-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ig-card-actions .pill {
  width: 100%;
}

.ig-content-expand {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  min-height: 40px;
  padding: 0 13px;
  border-color: transparent;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}

.embed-label .ig-expand {
  min-height: 38px;
  padding: 0 13px;
  font-size: 12px;
  line-height: 1.15;
}

.moved-content-copy .ig-expand {
  position: relative;
  z-index: 3;
  min-height: 42px;
  margin-top: 16px;
  padding: 0 16px;
  border-color: #fff;
  background: #fff;
  color: #042e54;
  font-size: 13px;
}

.ig-presentation {
  --ig-background: #030405;
  --ig-panel: #101215;
  --ig-line: rgba(255, 255, 255, .18);
  --ig-text: #f7f8f8;
  --ig-muted: #bcc3c8;
  position: fixed;
  inset: 0;
  width: var(--ig-viewport-width, 100vw);
  max-width: none;
  height: 100vh;
  height: var(--ig-viewport-height, 100dvh);
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--ig-background);
  color: var(--ig-text);
  font: 16px/1.4 'DM Sans', sans-serif;
}

.ig-presentation[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.ig-presentation::backdrop {
  background: #000;
}

.ig-presentation:fullscreen,
.ig-presentation:-webkit-full-screen {
  width: var(--ig-viewport-width, 100vw);
  height: var(--ig-viewport-height, 100dvh);
}

.ig-presentation button,
.ig-presentation a {
  font: inherit;
}

.ig-presentation button:focus-visible,
.ig-presentation a:focus-visible,
.ig-image-scroll:focus-visible {
  outline: 3px solid #1897d1;
  outline-offset: 3px;
}

.ig-presentation-header,
.ig-presentation-footer {
  position: relative;
  z-index: 3;
  display: grid;
  align-items: center;
  gap: 14px;
  padding-right: max(20px, env(safe-area-inset-right));
  padding-left: max(20px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(3, 4, 5, .98), rgba(3, 4, 5, .86));
}

.ig-presentation-header {
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: max(72px, calc(58px + env(safe-area-inset-top)));
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--ig-line);
}

.ig-presentation-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ig-text);
  font: 700 clamp(18px, 2.2vw, 28px)/1.1 Manrope, sans-serif;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-counter {
  min-width: 42px;
  margin: 0;
  color: var(--ig-muted);
  font: 600 14px/1 'DM Sans', sans-serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ig-close,
.ig-prev,
.ig-next,
.ig-zoom,
.ig-direct {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--ig-line);
  border-radius: 999px;
  color: var(--ig-text);
  background: rgba(255, 255, 255, .07);
  text-decoration: none;
  transition: background-color 160ms cubic-bezier(.23, 1, .32, 1), border-color 160ms cubic-bezier(.23, 1, .32, 1), transform 160ms cubic-bezier(.23, 1, .32, 1);
  -webkit-tap-highlight-color: transparent;
}

.ig-close:hover,
.ig-prev:hover:not(:disabled),
.ig-next:hover:not(:disabled),
.ig-zoom:hover:not(:disabled),
.ig-direct:hover {
  border-color: rgba(24, 151, 209, .78);
  background: rgba(24, 151, 209, .13);
}

.ig-close:active,
.ig-prev:active:not(:disabled),
.ig-next:active:not(:disabled),
.ig-zoom:active:not(:disabled),
.ig-direct:active {
  transform: scale(.97);
}

.ig-close {
  width: 44px;
  padding: 0;
  border-radius: 50%;
  font-size: 29px;
  line-height: 1;
}

.ig-close > span {
  display: block;
  transform: translateY(-1px);
}

.ig-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #000;
}

.ig-presentation-rail {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ig-presentation-rail::-webkit-scrollbar,
.ig-image-scroll::-webkit-scrollbar {
  display: none;
}

.ig-slide {
  position: relative;
  display: block;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.ig-image-scroll {
  position: absolute;
  inset: clamp(10px, 2.25vh, 28px) clamp(12px, 3.25vw, 54px);
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: grab;
  outline-offset: -5px;
  touch-action: pan-x;
  -webkit-tap-highlight-color: transparent;
}

.ig-image-scroll > img {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform: translate(-50%, -50%);
  user-select: none;
  -webkit-user-drag: none;
}

.ig-image-scroll.is-zoomed {
  overflow: auto;
  cursor: move;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

.ig-image-scroll.is-zoomed > img {
  position: relative;
  top: auto;
  left: auto;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: auto;
  object-fit: contain;
  transform: none;
}

.ig-account-slide {
  display: grid;
  padding: clamp(10px, 2.25vh, 28px) clamp(12px, 3.25vw, 54px);
  place-items: center;
}

.ig-presentation .ig-account-panel {
  display: grid;
  width: min(100%, 920px);
  height: 100%;
  min-height: 0;
  padding: clamp(25px, 6vw, 72px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: clamp(20px, 3vw, 34px);
  background: linear-gradient(135deg, #042e54, #0a5b87);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}

.ig-presentation .ig-account-panel .handle {
  color: #1897d1;
}

.ig-presentation .ig-account-panel h3 {
  max-width: 760px;
  font-size: clamp(36px, 6vw, 76px);
}

.ig-presentation .ig-account-panel p {
  color: #d5dce4;
}

.ig-presentation-footer {
  grid-template-columns: minmax(0, 1fr) auto auto;
  min-height: max(76px, calc(62px + env(safe-area-inset-bottom)));
  padding-top: 9px;
  padding-bottom: max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--ig-line);
  background: linear-gradient(0deg, rgba(3, 4, 5, .98), rgba(3, 4, 5, .88));
}

.ig-zoom,
.ig-direct {
  min-width: 0;
  padding: 0 17px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.ig-zoom:disabled,
.ig-prev:disabled,
.ig-next:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.ig-direct {
  border-color: rgba(24, 151, 209, .56);
  color: #8dddff;
}

.ig-navigation {
  display: flex;
  gap: 8px;
}

.ig-prev,
.ig-next {
  width: 44px;
  padding: 0;
  font-size: 21px;
  line-height: 1;
}

@media (max-width: 680px) {
  .embed-label {
    align-items: flex-start;
  }

  .embed-label .ig-expand {
    min-height: 36px;
    padding: 0 10px;
    font-size: 11px;
  }

  .moved-content-copy .ig-expand {
    min-height: 40px;
    margin-top: 12px;
    font-size: 12px;
  }

  .ig-presentation-header,
  .ig-presentation-footer {
    gap: 9px;
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }

  .ig-presentation-header {
    min-height: max(64px, calc(52px + env(safe-area-inset-top)));
  }

  .ig-presentation-title {
    font-size: 18px;
  }

  .ig-counter {
    min-width: 35px;
    font-size: 13px;
  }

  .ig-account-slide {
    padding: 9px 7px;
  }

  .ig-image-scroll {
    inset: 9px 7px;
  }

  .ig-presentation .ig-account-panel {
    padding: 25px 20px;
    border-radius: 18px;
  }

  .ig-presentation .ig-account-panel h3 {
    font-size: clamp(32px, 10vw, 48px);
  }

  .ig-presentation .ig-account-panel p {
    font-size: 16px;
  }

  .ig-presentation-footer {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: max(118px, calc(106px + env(safe-area-inset-bottom)));
    padding-top: 8px;
  }

  .ig-zoom {
    grid-column: 1;
    grid-row: 1;
  }

  .ig-direct {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
    min-height: 44px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    font-size: 13px;
    white-space: normal;
  }

  .ig-navigation {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }
}

@media (max-width: 700px) {
  .ig-content-expand {
    top: 12px;
    right: 12px;
    min-height: 40px;
    font-size: 11px;
  }
}

@media (max-width: 390px) {
  .ig-presentation-title {
    font-size: 16px;
  }

  .ig-close,
  .ig-prev,
  .ig-next {
    width: 44px;
  }

  .ig-zoom {
    padding: 0 12px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ig-presentation-rail {
    scroll-behavior: auto;
  }

  .ig-close,
  .ig-prev,
  .ig-next,
  .ig-zoom,
  .ig-direct {
    transition: none;
  }
}
