/* Joico: consent-gated Instagram video embed (OneTrust category C0007).
 * Same overlay as youtube-videos/joico-video-consent.css: a light scrim, the message on a dark
 * plate and the green "Cookie settings" link.
 * The placeholder card copies the silhouette of Instagram's embed (54px header, 4:5 media area,
 * 154px footer, measured 2026-12-03) so the page barely moves when the real embed replaces it.
 * Captioned embeds are taller (the caption is added below), so content under them moves down.
 * Selectors are doubled (.joico-ig .x) so theme / WPBakery rules for button, blockquote and p don't leak in.
 */

.joico-ig {
  /* REPLACE if the brand team wants different colours */
  --joico-ig-scrim: rgba(0, 0, 0, 0.38);   /* darkening over the card */
  --joico-ig-plate: rgba(0, 0, 0, 0.82);   /* backing behind the message + link */
  --joico-ig-text: #fff;
  --joico-ig-link: #4ade80;                /* green "Cookie settings" link, as on the YouTube embeds */
  --joico-ig-skeleton: #efefef;            /* grey header/footer shapes on the card */
  --joico-ig-media: #000;                  /* media area behind the poster (Instagram letterboxes Reels in black) */
  --joico-ig-icon: #fff;                   /* Instagram glyph on the media area */

  position: relative;
  display: block;
  width: 100%;
  max-width: 540px; /* Instagram's own maximum embed width */
  margin-left: auto;
  margin-right: auto;
}

/* The card: the placeholder button, and the copy of it inside Instagram's blockquote that stays
 * on screen while the embed loads. */
.joico-ig .joico-ig__placeholder,
.joico-ig .joico-ig__embed > blockquote {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid #dbdbdb;
  border-radius: 3px;
  background: #fff;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-style: normal;
  line-height: 0;
  text-align: left;
  text-indent: 0;
  quotes: none;
}

.joico-ig .joico-ig__placeholder {
  cursor: pointer;
}

.joico-ig .joico-ig__placeholder[hidden] {
  display: none;
}

.joico-ig .joico-ig__embed > blockquote::before,
.joico-ig .joico-ig__embed > blockquote::after {
  content: none;
}

/* Header: avatar circle + name bar */
.joico-ig .joico-ig__head {
  display: block;
  height: 54px;
  background:
    radial-gradient(circle at 28px 27px, var(--joico-ig-skeleton) 0 16px, transparent 16.5px),
    linear-gradient(var(--joico-ig-skeleton), var(--joico-ig-skeleton)) 56px 20px / 120px 14px no-repeat;
}

/* Media area: 4:5, like the embed's video frame */
.joico-ig .joico-ig__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--joico-ig-media);
}

/* Optional poster (Media Library upload). contain = the black side bars Instagram shows for 9:16 Reels. */
.joico-ig .joico-ig__poster {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
}

.joico-ig .joico-ig__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  color: var(--joico-ig-icon);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  transition: transform 0.2s ease;
}

.joico-ig .joico-ig__placeholder:hover .joico-ig__icon,
.joico-ig .joico-ig__placeholder:focus-visible .joico-ig__icon {
  transform: translate(-50%, -50%) scale(1.08);
}

/* Footer: link line, action icons, likes, divider, comment line */
.joico-ig .joico-ig__foot {
  display: block;
  height: 154px;
  background:
    linear-gradient(var(--joico-ig-skeleton), var(--joico-ig-skeleton)) 12px 16px / 150px 12px no-repeat,
    linear-gradient(var(--joico-ig-skeleton), var(--joico-ig-skeleton)) 12px 58px / 96px 22px no-repeat,
    linear-gradient(var(--joico-ig-skeleton), var(--joico-ig-skeleton)) 12px 92px / 64px 12px no-repeat,
    linear-gradient(var(--joico-ig-skeleton), var(--joico-ig-skeleton)) 0 118px / 100% 1px no-repeat,
    linear-gradient(var(--joico-ig-skeleton), var(--joico-ig-skeleton)) 12px 132px / 120px 10px no-repeat;
}

/* While the real embed loads, the glyph pulses */
.joico-ig .joico-ig__embed > blockquote .joico-ig__icon {
  animation: joico-ig-pulse 1.4s ease-in-out infinite;
}

@keyframes joico-ig-pulse {
  50% { opacity: 0.45; }
}

/* While gated, the glyph is hidden, as the play icon is on the YouTube embeds */
.joico-ig.is-gated .joico-ig__icon {
  display: none;
}

/* Overlay: passive scrim. Clicks pass through to the card underneath, which opens the
 * Preference Center. Only the "Cookie settings" button takes clicks itself. */
.joico-ig .joico-ig__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 1rem 1.25rem;
  border-radius: 3px;
  background: var(--joico-ig-scrim);
  color: var(--joico-ig-text);
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

.joico-ig .joico-ig__msg {
  max-width: 42ch;
  margin: 0;
  padding: 0.35rem 0.6rem 0.2rem;
  background: var(--joico-ig-plate);
  color: var(--joico-ig-text);
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

.joico-ig .joico-ig__cta {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0.2rem 0.6rem 0.35rem;
  border: 0;
  border-radius: 0;
  background: var(--joico-ig-plate);
  box-shadow: none;
  color: var(--joico-ig-link);
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto;
}

.joico-ig .joico-ig__cta:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.joico-ig .joico-ig__cta:focus-visible {
  outline: 2px solid var(--joico-ig-link);
  outline-offset: 2px;
}

/* Focus ring: on the overlay while gated (it covers the card), on the card otherwise */
.joico-ig .joico-ig__placeholder:focus-visible {
  outline: 3px solid #262626;
  outline-offset: 2px;
}

.joico-ig.is-gated .joico-ig__placeholder:focus-visible {
  outline: none;
}

.joico-ig .joico-ig__placeholder:focus-visible ~ .joico-ig__overlay {
  outline: 3px solid #fff;
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  .joico-ig .joico-ig__icon {
    transition: none;
  }

  .joico-ig .joico-ig__embed > blockquote .joico-ig__icon {
    animation: none;
  }
}

/* Higher contrast on request: a solid fill instead of the see-through scrim */
@media (prefers-contrast: more) {
  .joico-ig .joico-ig__overlay {
    background: #111;
  }

  .joico-ig .joico-ig__msg,
  .joico-ig .joico-ig__cta {
    background: none;
  }
}
