/* Inspiración — Estudio Foresta
   Tokens, barra, menú y apertura viven en shared/internas.css; el
   footer, en shared/footer.css; los bloques de la sección, en foresta.css.
   Aquí la galería sincronizada desde Instagram y los embeds públicos. */

/* El bloque de Instagram dentro de la ceja de «Inspiración»: «Explora nuestro
   día a día», la cuenta y el enlace. La línea de arriba lo separa del párrafo. */
.ig-perfil {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var(--line);
}

.ig-perfil-titulo {
	font-family: var(--display);
	font-size: clamp(17px, 1.8vw, 20px);
	font-weight: 500;
	line-height: 1.25;
}

.ig-perfil-lead {
	font-size: 14px;
	line-height: 1.5;
	color: var(--muted);
}

.ig-perfil-enlace {
	margin-top: 6px;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--line);
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.ig-perfil-enlace:hover,
.ig-perfil-enlace:focus-visible {
	color: var(--ochre);
}

/* Galería */
.ig-grid {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.ig-link {
	display: block;
	position: relative;
}

.ig-foto figure {
	position: relative;
	overflow: hidden;
	background: var(--ink);
}

/* 3:4 es el recorte de la grilla del perfil de Instagram: el mismo encuadre
   que ve quien entra a @estudioforesta, sin recortar más de la cuenta. */
.ig-foto img {
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	transition: transform 0.6s var(--ease);
}

/* Video del tile: se superpone a la portada cuando arranca, así que la imagen
   sigue siendo el alt y el poster. `pointer-events: none` deja pasar el click
   al enlace del post. */
.ig-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
	opacity: 0;
	transition:
		opacity 0.4s var(--ease),
		transform 0.6s var(--ease);
}

.ig-video.is-playing {
	opacity: 1;
}

.ig-foto:hover img,
.ig-foto:hover .ig-video,
.ig-foto:focus-within img,
.ig-foto:focus-within .ig-video {
	transform: scale(1.04);
}

.ig-foto figure.is-reproduciendo .ig-play {
	opacity: 0;
}

.ig-foto figcaption {
	position: absolute;
	inset: auto 0 0 0;
	padding: 10px 12px;
	background: linear-gradient(to top, rgba(26, 23, 20, 0.82), transparent);
	font-family: var(--mono);
	font-size: 9px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--paper);
	opacity: 0;
	transition: opacity 0.3s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Indicador de video: la portada viene del feed, igual que una foto. */
.ig-play {
	position: absolute;
	top: 8px;
	right: 8px;
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(26, 23, 20, 0.62);
	pointer-events: none;
	transition: opacity 0.3s;
}

.ig-play::before {
	content: "";
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 6px solid var(--paper);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
}

.ig-foto:hover figcaption,
.ig-foto:focus-within figcaption {
	opacity: 1;
}

@media (hover: none) {
	.ig-foto figcaption {
		opacity: 1;
	}
}

/* Embeds públicos */
.ig-embeds {
	margin-top: clamp(40px, 6vw, 72px);
}

.ig-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

.ig-head .eyebrow {
	margin-bottom: 0;
}

.ig-count {
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--muted);
}

.ig-posts {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.ig-post figure {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ig-post iframe {
	width: 100%;
	height: 520px;
	border: 1px solid var(--line);
	background: var(--paper);
}

.ig-post figcaption a {
	padding-bottom: 4px;
	border-bottom: 1px solid var(--line);
	font-family: var(--mono);
	font-size: 10px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.ig-post figcaption a:hover {
	color: var(--ochre);
}

@media (max-width: 900px) {
	.ig-grid,
	.ig-posts {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.ig-grid {
		gap: 6px;
	}
	.ig-posts {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ig-foto img,
	.ig-foto:hover img,
	.ig-foto:focus-within img,
	.ig-video,
	.ig-foto:hover .ig-video,
	.ig-foto:focus-within .ig-video {
		transform: none;
	}
}
