/*
 * INONEXT Instagram Feed popup. Neutral by default; a theme sets its brand through these
 * custom properties on .inxig-lb or :root (values below are the fallbacks):
 *   --inxig-font, --inxig-surface, --inxig-ink, --inxig-muted, --inxig-line, --inxig-accent,
 *   --inxig-cta-bg, --inxig-cta-color, --inxig-radius
 * Properties are only ever READ here, never declared, so a theme's values win regardless of
 * which stylesheet prints later.
 */
.inxig-lb-open { overflow: hidden; }

.inxig-lb {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 0;
  width: min(940px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  border-radius: var(--inxig-radius, 16px);
  background: var(--inxig-surface, #fff);
  color: var(--inxig-ink, #1f1f1f);
  font-family: var(--inxig-font, inherit);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.inxig-lb::backdrop { background: rgba(14, 10, 18, .78); }
.inxig-lb [hidden] { display: none !important; }
.inxig-lb :focus-visible { outline: 2px solid var(--inxig-accent, currentColor); outline-offset: 2px; }
.inxig-lb__body:focus { outline: none; }

.inxig-lb button {
  font: inherit;
  margin: 0;
  min-height: 0;
  box-shadow: none;
  text-transform: none;
  letter-spacing: normal;
}

.inxig-lb__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, .92);
  color: #1f1f1f;
}
.inxig-lb__close svg { width: 20px; height: 20px; }
.inxig-lb__close:hover { background: #fff; }

.inxig-lb__body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  max-height: inherit;
}

.inxig-lb__media {
  position: relative;
  display: flex;
  background: #000;
  aspect-ratio: 4 / 5;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  min-width: 0;
}
.inxig-lb__slides {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.inxig-lb__slides::-webkit-scrollbar { display: none; }
.inxig-lb__cell {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inxig-lb__cell img,
.inxig-lb__cell video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.inxig-lb__cell video { cursor: pointer; }

.inxig-lb__slide,
.inxig-lb__sound {
  position: absolute;
  z-index: 2;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.inxig-lb__slide {
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, .92);
  color: #1f1f1f;
}
.inxig-lb__slide--prev { left: 12px; }
.inxig-lb__slide--next { right: 12px; }
.inxig-lb__sound {
  left: 12px;
  bottom: 12px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
}
.inxig-lb__slide svg,
.inxig-lb__sound svg { width: 18px; height: 18px; }

.inxig-lb__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}
.inxig-lb__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.inxig-lb__dots i.is-on { background: #fff; }

.inxig-lb__watch {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .7);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
}

/* contain: size stops a long caption from growing the popup: the row takes the media's height and
   only the caption scrolls, so the button and post navigation never leave view. */
.inxig-lb__panel {
  contain: size;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 22px 24px 16px;
  overflow: hidden;
}
.inxig-lb__handle { margin: 0; padding-right: 44px; font-weight: 600; }
.inxig-lb__meta { margin: -8px 0 0; font-size: .82rem; color: var(--inxig-muted, #6b6b6b); font-variant-numeric: tabular-nums; }

.inxig-lb__caption { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.inxig-lb__scroll { flex: 1 1 auto; min-height: 0; width: 100%; overflow-y: auto; overscroll-behavior: contain; }
.inxig-lb__text { margin: 0; font-size: .95rem; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.inxig-lb__caption.is-clamped .inxig-lb__text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
.inxig-lb__more {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--inxig-muted, #6b6b6b);
  font-size: .88rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.inxig-lb__actions { flex: none; margin-top: auto; padding-top: 8px; display: grid; gap: 10px; }
.inxig-lb__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--inxig-cta-bg, #1f1f1f);
  color: var(--inxig-cta-color, #fff);
  font-weight: 600;
  text-decoration: none;
  transition: filter .18s ease;
}
.inxig-lb__cta:hover { filter: brightness(.94); color: var(--inxig-cta-color, #fff); }
.inxig-lb__ig { justify-self: center; font-size: .85rem; color: var(--inxig-muted, #6b6b6b); text-underline-offset: 3px; }

.inxig-lb__nav {
  flex: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--inxig-line, rgba(0, 0, 0, .1));
}
.inxig-lb__post {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--inxig-ink, #1f1f1f);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}
.inxig-lb__post svg { width: 16px; height: 16px; }
.inxig-lb__post:hover { color: var(--inxig-accent, #1f1f1f); background: none; }

@media (max-width: 720px) {
  .inxig-lb {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
  .inxig-lb__body { grid-template-columns: 1fr; height: 100%; max-height: none; overflow-y: auto; }
  .inxig-lb__media { aspect-ratio: auto; height: min(64vh, 125vw); height: min(64dvh, 125vw); max-height: none; }
  /* Phones scroll the whole sheet instead, with the button pinned to the bottom while she reads. */
  .inxig-lb__panel { contain: none; overflow: visible; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); }
  .inxig-lb__scroll { overflow: visible; }
  .inxig-lb__actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin: 0 -18px;
    padding: 12px 18px;
    background: var(--inxig-surface, #fff);
    box-shadow: 0 -10px 14px -12px rgba(0, 0, 0, .18);
  }
}

@media (prefers-reduced-motion: reduce) {
  .inxig-lb__slides { scroll-behavior: auto; }
  .inxig-lb__cta { transition: none; }
}
