.instagram-section {
  background: linear-gradient(180deg, #f8faf9, #edf3f0);
  border-block: 1px solid var(--line);
  padding-block: clamp(48px, 7vw, 100px);
  margin-bottom: clamp(48px, 7vw, 104px);
}

.instagram-container {
  width: calc(100% - clamp(32px, 6vw, 96px));
  max-width: 1440px;
}

.instagram-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin-bottom: clamp(24px, 3.5vw, 42px);
}

.instagram-header h2 {
  margin: 8px 0 0;
  color: var(--brand-teal);
  font-size: clamp(34px, 4.5vw, 62px);
}

.instagram-source {
  margin: 8px 0 0;
  font-size: clamp(15px, 1.5vw, 18px);
}

.instagram-profile {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 15px;
  border: 1px solid #cbd9d4;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-teal);
  font-size: 14px;
  font-weight: 700;
}

.instagram-profile:is(:hover, :focus-visible) {
  background: var(--brand-sage-soft);
}

.instagram-profile svg,
.instagram-fallback-info svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.instagram-posts,
.instagram-stories {
  display: grid;
  list-style: none;
  margin: 0;
  padding: 0;
}

.instagram-posts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(16px, 1.5vw, 24px);
}

.instagram-card,
.instagram-editorial {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #d5e1db;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px #25483d0d;
}

.instagram-card:focus-within {
  outline: 2px solid var(--brand-teal);
  outline-offset: 3px;
}

.instagram-card {
  display: flex;
  flex-direction: column;
}

.instagram-card :is(blockquote.instagram-media, iframe) {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.instagram-card > blockquote.instagram-media {
  display: flex;
  flex: 1;
}

.instagram-fallback {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 28px;
  min-height: 250px;
  padding: clamp(22px, 2vw, 28px);
  background: linear-gradient(150deg, #f2f7f4, #d8e6df);
  color: var(--brand-teal);
}

.instagram-fallback-image:not([hidden]) {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .20;
}

.instagram-fallback-icon {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}

.instagram-fallback-icon svg {
  width: 21px;
  height: 21px;
}

.instagram-fallback-info > * {
  display: block;
  line-height: 1.3;
}

.instagram-fallback-info strong {
  margin-block: 8px 15px;
  font-size: clamp(19px, 2vw, 28px);
  overflow-wrap: anywhere;
}

.instagram-fallback-info > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
}

.instagram-fallback:is(:hover, :focus-visible) .instagram-fallback-info > span {
  text-decoration: underline;
}

.instagram-editorial {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  background: #e2eae5;
}

.instagram-editorial .service-art {
  height: 63%;
}

.instagram-tile-copy {
  position: absolute;
  inset: auto 12px 12px;
  color: var(--brand-teal);
  font-size: clamp(13px, 1.4vw, 18px);
  line-height: 1.25;
}

.instagram-tile-copy small {
  display: block;
  margin-bottom: 4px;
}

.instagram-links {
  margin-top: 18px;
}

.instagram-links .text-link {
  font-size: 14px;
}

.instagram-stories-feed {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.instagram-stories-feed h3 {
  margin: 0 0 14px;
  font-size: 23px;
}

.instagram-stories {
  grid-auto-flow: column;
  grid-auto-columns: clamp(126px, 18vw, 176px);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 8px;
}

.instagram-stories li {
  scroll-snap-align: start;
}

.instagram-stories img,
.instagram-stories video {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  border-radius: 8px;
  background: var(--brand-graphite);
}

/* Locally hosted posts remain available regardless of the Meta preference. */
.instagram-posts:has(.instagram-local-card) {
  align-items: start;
}

.post-carousel {
  min-width: 0;
  width: 100%;
  background: #fff;
}

.post-carousel-viewport {
  position: relative;
  min-width: 0;
  background: #8fa6a0;
}

.post-carousel-track {
  display: flex;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 5;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.post-carousel-track::-webkit-scrollbar { display: none; }
.post-carousel-track:focus-visible { outline-offset: -4px; }

.post-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.post-carousel-slide img,
.post-carousel-slide video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

.post-carousel-slide video { background: #232426; }

.post-carousel-count {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 10px;
  border-radius: 100px;
  background: #232426d9;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.post-carousel-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #ffffffa8;
  border-radius: 50%;
  background: #ffffffed;
  color: #232426;
  box-shadow: 0 3px 14px #0002;
}

.post-carousel-arrow:hover { background: #fff; }
.post-carousel-arrow:disabled { visibility: hidden; cursor: default; }
.post-carousel-previous { left: 10px; }
.post-carousel-next { right: 10px; }
.post-carousel-arrow svg { width: 21px; height: 21px; }

.post-carousel-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 35px;
  padding: 3px 12px 0;
}

.post-carousel-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.post-carousel-dot::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #b6c9be; }
.post-carousel-dot[aria-current='true']::after { background: #314d3b; transform: scale(1.2); }
.instagram-local-caption { padding: 6px 22px 22px; }
.instagram-local-caption small { color: #53685b; font-size: 12px; }
.instagram-local-caption h3 { margin: 7px 0 14px; color: #263e38; font-size: 22px; line-height: 1.25; letter-spacing: -.035em; }
.instagram-local-caption a { display: inline-flex; align-items: center; gap: 9px; color: #314d3b; font-size: 13px; font-weight: 600; }
.instagram-local-caption a:hover { text-decoration: underline; text-underline-offset: 3px; }
.instagram-local-caption a svg { width: 17px; height: 17px; }

@media (max-width: 1320px) {
  .instagram-posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 1120px;
    margin-inline: auto;
  }
}

@media (max-width: 700px) {
  .instagram-posts {
    grid-template-columns: minmax(0, 1fr);
    max-width: 460px;
  }

  .instagram-fallback {
    min-height: 215px;
    gap: 24px;
    padding: 24px;
  }
}
