.hb-ig-grid {
  display: grid;
  grid-template-columns: repeat(var(--hb-ig-columns, 4), minmax(0, 1fr));
  gap: var(--hb-ig-gap, 16px);
}

.hb-ig-item {
  margin: 0;
}

.hb-ig-link {
  color: inherit;
  display: block;
  position: relative;
  text-decoration: none;
}

.hb-ig-media {
  aspect-ratio: 1 / 1;
  background: #f3f3f3;
  border-radius: var(--hb-ig-radius, 8px);
  display: block;
  overflow: hidden;
  position: relative;
}

.hb-ig-aspect-4-5 .hb-ig-media {
  aspect-ratio: 4 / 5;
}

.hb-ig-aspect-16-9 .hb-ig-media {
  aspect-ratio: 16 / 9;
}

.hb-ig-aspect-original .hb-ig-media {
  aspect-ratio: auto;
}

.hb-ig-media img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: opacity .2s ease, transform .2s ease;
  width: 100%;
}

.hb-ig-aspect-original .hb-ig-media img {
  height: auto;
}

.hb-ig-hover-zoom .hb-ig-link:hover img,
.hb-ig-hover-zoom .hb-ig-link:focus-visible img {
  transform: scale(1.04);
}

.hb-ig-hover-fade .hb-ig-link:hover img,
.hb-ig-hover-fade .hb-ig-link:focus-visible img {
  opacity: .82;
}

.hb-ig-overlay {
  background: linear-gradient(transparent, var(--hb-ig-overlay, rgba(0, 0, 0, .65)));
  border-radius: 0 0 var(--hb-ig-radius, 8px) var(--hb-ig-radius, 8px);
  bottom: 0;
  color: var(--hb-ig-text, #fff);
  display: block;
  font-size: .9rem;
  left: 0;
  max-height: 60%;
  overflow: hidden;
  padding: 24px 10px 10px;
  position: absolute;
  right: 0;
}

.hb-ig-caption {
  font-size: .92rem;
  line-height: 1.45;
  margin: 8px 0 0;
}

.hb-ig-video .hb-ig-media::before {
  align-items: center;
  background: rgba(0, 0, 0, .64);
  border-radius: 50%;
  color: #fff;
  content: "▶";
  display: flex;
  font-size: .75rem;
  height: 28px;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  z-index: 2;
}

.hb-ig-consent {
  border: 1px solid #d6d6d6;
  border-radius: 8px;
  padding: 18px;
}

.hb-ig-consent p {
  margin: 0 0 12px;
}

.hb-ig-consent-button,
.hb-ig-modal-open-instagram {
  background: #111;
  border: 0;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  padding: 9px 14px;
  text-decoration: none;
}

.hb-ig-modal {
  align-items: center;
  background: rgba(0, 0, 0, .82);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 99999;
}

.hb-ig-modal.is-open {
  display: flex;
}

.hb-ig-modal-panel {
  background: #fff;
  border-radius: 8px;
  color: #111;
  max-height: calc(100vh - 48px);
  max-width: 980px;
  overflow: auto;
  position: relative;
  width: min(100%, 980px);
}

.hb-ig-modal-image {
  background: #111;
  display: block;
  max-height: 72vh;
  object-fit: contain;
  width: 100%;
}

.hb-ig-modal-body {
  padding: 16px;
}

.hb-ig-modal-caption {
  margin: 0 0 12px;
}

.hb-ig-modal-close,
.hb-ig-modal-prev,
.hb-ig-modal-next {
  align-items: center;
  background: rgba(0, 0, 0, .68);
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  position: absolute;
  width: 38px;
  z-index: 2;
}

.hb-ig-modal-close {
  right: 10px;
  top: 10px;
}

.hb-ig-modal-prev,
.hb-ig-modal-next {
  top: 42%;
}

.hb-ig-modal-prev {
  left: 10px;
}

.hb-ig-modal-next {
  right: 10px;
}

@media (max-width: 1024px) {
  .hb-ig-grid {
    grid-template-columns: repeat(var(--hb-ig-columns-tablet, 3), minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .hb-ig-grid {
    grid-template-columns: repeat(var(--hb-ig-columns-mobile, 2), minmax(0, 1fr));
  }

  .hb-ig-modal {
    padding: 12px;
  }
}
