/* ─────── INSTAGRAM · rejilla de feed ─────── */
.insta {
  position: relative;
  background: var(--crema);
  color: var(--carbon);
  padding: clamp(100px, 13vh, 170px) 0;
  overflow: hidden;
  isolation: isolate;
}

.insta-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 56px;
}

/* ─── HEADER ─── */
.insta-header {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  grid-template-areas:
    "eye  eye"
    "head intro";
  gap: 0 80px;
  align-items: end;
  margin-bottom: clamp(40px, 5vh, 64px);
}
.insta-eyebrow { grid-area: eye; margin-bottom: 40px; }
.insta-headline { grid-area: head; }
.insta-intro { grid-area: intro; }

.insta-headline {
  font-family: 'Alice', serif;
  font-size: clamp(34px, 5.2vw, 76px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.014em;
  max-width: 13ch;
}
.insta-headline em { font-style: normal; color: var(--verde); display: block; }

.insta-intro {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.85;
  color: #4A4A44;
  max-width: 420px;
  padding-bottom: 10px;
}

/* ─── REJILLA · a sangre, fotos pegadas con celo ───
   Mismo gesto que el collage del manifiesto (rotación + cinta + sombra),
   pero en tira corrida de lado a lado en vez de collage asimétrico.
   Sangra 24px por cada lado para que las esquinas giradas se salgan de cuadro;
   .insta las recorta con su overflow:hidden. */
.insta-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 20px;
  row-gap: 36px;              /* deja sitio al celo de la fila de abajo */
  width: calc(100vw + 48px);
  margin-left: calc(50% - 50vw - 24px);
}

.insta-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--crema2);
  filter: drop-shadow(0 6px 18px rgba(26,26,24,0.10));
  /* --rot la pone cada nth-child · --rev-y la mueve el observer de reveal.
     Se componen en UN solo transform: si el reveal genérico escribiera su
     propio transform, se comería la rotación del collage. */
  --rot: 0deg;
  --rev-y: 26px;
  opacity: 0;
  transform: translateY(var(--rev-y)) rotate(var(--rot));
  transition: transform 0.75s var(--ease-out), opacity 0.9s var(--ease-out), filter 0.4s var(--ease-out);
}
.insta-tile.is-in { opacity: 1; --rev-y: 0px; }

/* Cada foto su inclinación · nunca dos seguidas igual */
.insta-tile:nth-child(1) { --rot: -1.5deg; }
.insta-tile:nth-child(2) { --rot: 1.1deg; }
.insta-tile:nth-child(3) { --rot: -0.8deg; }
.insta-tile:nth-child(4) { --rot: 1.6deg; }
.insta-tile:nth-child(5) { --rot: 1.3deg; }
.insta-tile:nth-child(6) { --rot: -1.6deg; }
.insta-tile:nth-child(7) { --rot: 0.9deg; }
.insta-tile:nth-child(8) { --rot: -1.2deg; }

/* Hover · endereza y levanta, igual que la galería de arriba */
.insta-tile:hover {
  --rot: 0deg;
  --rev-y: -6px;
  filter: drop-shadow(0 12px 28px rgba(26,26,24,0.18));
  z-index: 4;
}

/* Recorte interno · contiene la foto y deja el <li> libre para el celo */
.insta-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.insta-clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease-out);
}
.insta-tile:hover .insta-clip img { transform: scale(1.06); }

/* Celo · trozo de cinta translúcida pegando la foto, alternando esquina */
.insta-tile::before {
  content: '';
  position: absolute;
  width: 68px;
  height: 21px;
  top: -9px;
  left: -16px;
  transform: rotate(-30deg);
  background:
    linear-gradient(135deg,
      rgba(255,255,255,0.42) 0%,
      rgba(248,245,239,0.82) 35%,
      rgba(248,245,239,0.86) 65%,
      rgba(255,255,255,0.4) 100%);
  border-top: 1px solid rgba(255,255,255,0.5);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow:
    0 3px 6px rgba(0,0,0,0.16),
    inset 0 0 0 0.5px rgba(255,255,255,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 6;
  pointer-events: none;
}
/* Lado del celo · todas a la izquierda salvo la última de cada fila, que va a
   la derecha. Si dos tiles contiguas pegaran su cinta a la misma junta, las dos
   cintas se tocan y leen como una mancha blanca en vez de como celo. */
.insta-tile:nth-child(4)::before,
.insta-tile:nth-child(8)::before {
  left: auto;
  right: -16px;
  transform: rotate(28deg);
}
/* Variación · ancho, giro y altura distintos en cada una */
.insta-tile:nth-child(2)::before { width: 62px; transform: rotate(-24deg); top: -8px; }
.insta-tile:nth-child(3)::before { width: 74px; transform: rotate(-33deg); }
.insta-tile:nth-child(4)::before { width: 66px; }
.insta-tile:nth-child(5)::before { width: 64px; top: -8px; left: -13px; transform: rotate(-27deg); }
.insta-tile:nth-child(6)::before { width: 72px; transform: rotate(-35deg); }
.insta-tile:nth-child(7)::before { width: 66px; top: -8px; transform: rotate(-25deg); }
.insta-tile:nth-child(8)::before { width: 60px; transform: rotate(31deg); }

/* Velo · solo al pasar por encima, para que el pie se lea */
.insta-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(8,8,10,0.78) 0%, rgba(8,8,10,0.28) 42%, rgba(8,8,10,0) 72%);
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.insta-tile:hover .insta-scrim { opacity: 1; }

.insta-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}
.insta-tile:hover .insta-caption { opacity: 1; transform: translateY(0); }

/* Marca de reel · siempre visible, esquina inferior derecha
   (arriba chocaría con el celo) */
.insta-reel-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  fill: #fff;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.45));
  pointer-events: none;
  z-index: 2;
}

/* ─── CTA · handle ─── */
.insta-cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: clamp(32px, 4vh, 48px);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--verde);
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(4,114,6,0.42);
  transition: border-color 0.3s var(--ease-out), gap 0.3s var(--ease-out);
}
.insta-cta:hover { border-bottom-color: var(--verde); gap: 20px; }
.insta-cta-arrow {
  width: 20px;
  height: 1px;
  background: currentColor;
  position: relative;
  flex-shrink: 0;
}
.insta-cta-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

/* ─── REVEAL ─── */
.insta-reveal:not(.insta-tile) {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.insta-reveal:not(.insta-tile).is-in { opacity: 1; transform: translateY(0); }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .insta { padding: 90px 0; }
  .insta-inner { padding: 0 24px; }
  .insta-header {
    grid-template-columns: 1fr;
    grid-template-areas: "eye" "head" "intro";
    gap: 22px 0;
    margin-bottom: 36px;
  }
  .insta-eyebrow { margin-bottom: 14px; }
  .insta-headline { max-width: none; }
  .insta-intro { max-width: none; padding-bottom: 0; }

  .insta-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 14px;
    row-gap: 26px;
    width: calc(100vw + 28px);
    margin-left: calc(50% - 50vw - 14px);
  }
  /* Menos inclinación en 2 columnas · a este tamaño se nota el triple */
  .insta-tile:nth-child(1) { --rot: -0.9deg; }
  .insta-tile:nth-child(2) { --rot: 0.7deg; }
  .insta-tile:nth-child(3) { --rot: 0.6deg; }
  .insta-tile:nth-child(4) { --rot: -0.8deg; }
  .insta-tile:nth-child(5) { --rot: -0.7deg; }
  .insta-tile:nth-child(6) { --rot: 0.9deg; }
  .insta-tile:nth-child(7) { --rot: 0.8deg; }
  .insta-tile:nth-child(8) { --rot: -0.6deg; }
  .insta-tile::before { width: 52px; height: 17px; top: -7px; left: -12px; }
  .insta-tile:nth-child(2)::before,
  .insta-tile:nth-child(4)::before,
  .insta-tile:nth-child(6)::before,
  .insta-tile:nth-child(8)::before { left: auto; right: -12px; }
  /* Sin hover en táctil: el pie se oculta y manda la foto */
  .insta-caption { display: none; }
  .insta-reel-icon { width: 21px; height: 21px; bottom: 8px; right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .insta-reveal:not(.insta-tile) { opacity: 1; transform: none; transition: none; }
  .insta-tile { opacity: 1; --rev-y: 0px; transition: none; }
  .insta-tile:hover { --rev-y: 0px; }
  .insta-tile:hover .insta-clip img { transform: none; }
}
