/* ============================================================
   INSTAGRAM — Life at Sand Beach
   Layout unchanged · Hover: zoom + darken + icon
   ============================================================ */

.instagram {
  background: var(--color-white);
  padding-block: clamp(4rem, 7vw, 7rem);
}

/* ── Header ── */
.instagram__header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.instagram__handle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.instagram__handle:hover { color: var(--color-ocean); }

.instagram__handle svg {
  width: 20px;
  height: 20px;
}

/* ── Grid — 6 columns desktop, responsive ── */
.instagram__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
}

/* ── Individual post tile ── */
.instagram__post {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  display: block;
  /* Slight rounded corners for the Instagram feel */
  border-radius: 4px;
  /* Contain the scale transform cleanly */
  transform: translateZ(0);
}

/* ── Image — zooms on hover ── */
.instagram__post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  /* Base state — no zoom, no brightness change */
  transform: scale(1);
  filter: brightness(1);
  transition:
    transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    filter    0.4s ease;
}

.instagram__post:hover img {
  transform: scale(1.08);   /* subtle zoom */
  filter: brightness(0.75); /* darken behind the overlay */
}

/* ── Overlay — fades in on hover ── */
.instagram__post-overlay {
  position: absolute;
  inset: 0;
  /* Semi-transparent dark layer + Instagram gradient tint */
  background: linear-gradient(
    135deg,
    rgba(88, 42, 114, 0.45) 0%,
    rgba(193, 53, 132, 0.35) 50%,
    rgba(253, 152, 39, 0.25) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  /* Hidden by default */
  opacity: 0;
  transition: opacity 0.35s ease;
}

.instagram__post:hover .instagram__post-overlay {
  opacity: 1;
}

/* ── Instagram icon inside overlay ── */
.instagram__post-overlay svg {
  width: 36px;
  height: 36px;
  color: #ffffff;
  /* Scales up slightly as it appears */
  transform: scale(0.75);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.instagram__post:hover .instagram__post-overlay svg {
  transform: scale(1);
}

/* ── Focus state for keyboard users ── */
.instagram__post:focus-visible {
  outline: 3px solid var(--color-ocean);
  outline-offset: 2px;
  border-radius: 4px;
}

.instagram__post:focus-visible .instagram__post-overlay {
  opacity: 1;
}

.instagram__post:focus-visible .instagram__post-overlay svg {
  transform: scale(1);
}

/* ── CTA button ── */
.instagram__cta {
  text-align: center;
  margin-top: 2.5rem;
}

/* ── Responsive — collapse columns, hide extras ── */
@media (max-width: 1024px) {
  .instagram__grid { grid-template-columns: repeat(4, 1fr); }
  .instagram__post:nth-child(n+5) { display: none; }
}

@media (max-width: 600px) {
  .instagram__grid { grid-template-columns: repeat(3, 1fr); }
  .instagram__post:nth-child(n+4) { display: none; }
}
