/*
 * Invitación a seguir en Instagram, sin código ni cookies de Meta.
 * HTML + CSS; el aviso de los 20 s lo activa js/instagram.js. La foto y las miniaturas se sirven desde el sitio; Instagram
 * no recibe nada hasta que la persona hace clic (y aun así, sin «referer»).
 *
 * A) .ig-tarjeta  → tarjeta completa, debajo del recuadro del autor en cada entrada (partes/instagram-tarjeta.php).
 * B) .ig-boton    → botón animado al pie de la columna izquierda; a los 20 s muestra un globo (partes/instagram-boton.php).
 * C) .ig-flotante → aviso flotante en teléfono y tableta, a los 20 s dentro del sitio (partes/instagram-aviso.php).
 */

:root {
	--ig-degradado: linear-gradient(45deg, #feda75 0%, #fa7e1e 25%, #d62976 50%, #962fbf 75%, #4f5bd5 100%);
	--ig-aro: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #d62976, #feda75);
}

/* ---------- Pieza común: foto con aro degradado (como las historias) ---------- */
.ig-aro {
	--t: 76px;
	position: relative;
	display: inline-grid;
	place-items: center;
	flex: none;
	width: var(--t);
	height: var(--t);
	border-radius: 50%;
	isolation: isolate;
}
.ig-aro::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: var(--ig-aro);
	transition: transform 0.6s ease;
}
.ig-aro img {
	width: calc(var(--t) - 6px);
	height: calc(var(--t) - 6px);
	border: 3px solid #fff;
	border-radius: 50%;
	object-fit: cover;
	display: block;
}

.ig-glifo { width: 1em; height: 1em; flex: none; }

/* ---------- A) Tarjeta completa ---------- */
.ig-tarjeta {
	position: relative;
	margin: 0 0 48px;
	padding: 28px 32px 32px;
	border: 1px solid var(--linea, #e6e6e6);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(24, 24, 24, 0.04), 0 12px 32px -12px rgba(27, 73, 98, 0.16);
	overflow: hidden;
}
/* Filo superior con el degradado: identifica la red sin copiar su interfaz. */
.ig-tarjeta::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: var(--ig-degradado);
}

.ig-cabeza { display: flex; align-items: center; gap: 20px; }
.ig-datos { flex: 1; min-width: 0; }
.ig-red {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 6px;
	font: 400 13px/1 var(--fuente-etiquetas, sans-serif);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #d62976;
}
.ig-usuario {
	display: block;
	margin: 0 0 4px;
	font: 700 22px/1.15 var(--fuente-menu, sans-serif);
	letter-spacing: -0.01em;
	color: var(--titulo, #1b4962);
	overflow-wrap: anywhere;
}
.ig-bio { margin: 0; font-size: 15px; line-height: 1.55; color: #4a4a4a; }

.ig-tarjeta:hover .ig-aro::before { transform: rotate(180deg); }

/* Botón principal */
.ig-seguir {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex: none;
	padding: 13px 22px;
	border-radius: 999px;
	background: var(--tinta, #181818);
	color: #fff;
	font: 700 15px/1 var(--fuente-menu, sans-serif);
	white-space: nowrap;
	overflow: hidden;
	isolation: isolate;
	transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.ig-seguir::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--ig-degradado);
	opacity: 0;
	transition: opacity 0.35s ease;
}
.ig-seguir .ig-flecha { transition: transform 0.25s ease; }
.ig-seguir:hover,
.ig-seguir:focus-visible {
	text-decoration: none;
	transform: translateY(-1px);
	box-shadow: 0 10px 24px -8px rgba(214, 41, 118, 0.55);
}
.ig-seguir:hover::before,
.ig-seguir:focus-visible::before { opacity: 1; }
.ig-seguir:hover .ig-flecha,
.ig-seguir:focus-visible .ig-flecha { transform: translateX(3px); }

/* Tres publicaciones destacadas */
.ig-rejilla {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
	list-style: none;
	margin: 24px 0 0;
	padding: 0;
}
.ig-rejilla a {
	position: relative;
	display: block;
	aspect-ratio: 1;
	border-radius: 10px;
	overflow: hidden;
	background: #f3f6f9;
}
.ig-rejilla img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.ig-rejilla a::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 55%, rgba(24, 24, 24, 0.45));
	opacity: 0;
	transition: opacity 0.3s ease;
}
.ig-rejilla .ig-glifo {
	position: absolute;
	right: 10px;
	bottom: 10px;
	z-index: 1;
	width: 20px;
	height: 20px;
	color: #fff;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.ig-rejilla a:hover img { transform: scale(1.06); }
.ig-rejilla a:hover::after,
.ig-rejilla a:hover .ig-glifo { opacity: 1; transform: none; }

/* ---------- B) Botón de la columna izquierda ---------- */

/* Ángulo animable: mueve un destello de color alrededor del borde. */
@property --ig-giro {
	syntax: "<angle>";
	inherits: false;
	initial-value: 0deg;
}

/* Logo de Instagram pintado con el degradado (máscara SVG, sin imágenes externas). */
.ig-logo {
	display: inline-block;
	flex: none;
	width: 16px;
	height: 16px;
	background: var(--ig-degradado);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='5.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='12' cy='12' r='4.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='17.3' cy='6.7' r='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='5.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='12' cy='12' r='4.2' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3Ccircle cx='17.3' cy='6.7' r='1.3'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* La columna pasa a ser flexible para mandar el botón al fondo. */
.lateral { display: flex; flex-direction: column; }
.ig-lateral {
	position: relative;
	margin: auto 0 36px;
	padding-top: 40px;
}

.ig-boton {
	--ig-borde: rgba(24, 24, 24, 0.1);
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 9px 11px 18px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	/* Fondo con un velo apenas perceptible del degradado; el borde lleva un destello que da la vuelta. */
	background:
		linear-gradient(120deg, #fffdf8, #fff 40%, #fdf7fb 75%, #f7f7ff) padding-box,
		conic-gradient(from var(--ig-giro),
			var(--ig-borde) 0deg 240deg,
			#feda75 265deg, #fa7e1e 285deg, #d62976 310deg, #962fbf 335deg,
			var(--ig-borde) 360deg) border-box;
	box-shadow: 0 1px 2px rgba(24, 24, 24, 0.04), 0 8px 22px -12px rgba(150, 47, 191, 0.35);
	color: var(--tinta, #181818);
	text-align: left;
	isolation: isolate;
	animation: ig-orbita 4.5s linear infinite;
	transition: box-shadow 0.3s ease, transform 0.25s ease;
}
/* Relleno degradado que entra de izquierda a derecha al pasar el cursor. */
.ig-boton::before {
	content: "";
	position: absolute;
	inset: -1.5px;
	z-index: -1;
	border-radius: inherit;
	background: var(--ig-degradado);
	clip-path: inset(0 100% 0 0 round 999px);
	transition: clip-path 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.ig-boton-texto { flex: 1; min-width: 0; display: grid; gap: 4px; }
.ig-boton-titulo {
	display: flex;
	align-items: center;
	gap: 7px;
	font: 700 14px/1.1 var(--fuente-menu, sans-serif);
	letter-spacing: 0.005em;
	transition: color 0.3s ease;
}
.ig-boton-titulo .ig-logo { transition: background 0.3s ease; }
.ig-boton-usuario {
	padding-left: 23px;
	font-size: 12.5px;
	line-height: 1.1;
	color: #737373;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	transition: color 0.3s ease;
}

/* Círculo degradado con «+», que se vuelve flecha al pasar el cursor */
.ig-boton-accion {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--ig-degradado);
	color: #fff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px -6px rgba(214, 41, 118, 0.7);
	transition: background 0.3s ease, color 0.3s ease, transform 0.35s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.ig-boton-accion svg {
	position: absolute;
	width: 16px;
	height: 16px;
	transition: opacity 0.25s ease, transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}
.ig-boton-accion .ig-ir { opacity: 0; transform: translateX(-8px); }

.ig-boton:hover,
.ig-boton:focus-visible {
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 14px 30px -10px rgba(214, 41, 118, 0.6);
}
.ig-boton:hover::before,
.ig-boton:focus-visible::before { clip-path: inset(0 0 0 0 round 999px); }
.ig-boton:hover .ig-boton-titulo,
.ig-boton:hover .ig-boton-usuario,
.ig-boton:focus-visible .ig-boton-titulo,
.ig-boton:focus-visible .ig-boton-usuario { color: #fff; }
.ig-boton:hover .ig-boton-titulo .ig-logo,
.ig-boton:focus-visible .ig-boton-titulo .ig-logo { background: #fff; }
.ig-boton:hover .ig-boton-accion,
.ig-boton:focus-visible .ig-boton-accion { background: #fff; color: #d62976; transform: scale(1.06); }
.ig-boton:hover .ig-boton-accion .ig-mas,
.ig-boton:focus-visible .ig-boton-accion .ig-mas { opacity: 0; transform: rotate(90deg) scale(0.4); }
.ig-boton:hover .ig-boton-accion .ig-ir,
.ig-boton:focus-visible .ig-boton-accion .ig-ir { opacity: 1; transform: none; }

/* Globo que aparece sobre el botón a los 20 segundos (computadora). */
.ig-globo {
	position: absolute;
	left: 50%;
	bottom: calc(100% - 24px);
	width: max-content;
	max-width: 240px;
	margin: 0;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--tinta, #181818);
	color: #fff;
	font: 400 13px/1.35 var(--fuente-texto, sans-serif);
	text-align: center;
	box-shadow: 0 12px 28px -10px rgba(24, 24, 24, 0.45);
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 8px) scale(0.92);
	transform-origin: 50% 100%;
	transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1), visibility 0s linear 0.45s;
	pointer-events: none;
}
.ig-globo::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	width: 12px;
	height: 12px;
	margin: -7px 0 0 -6px;
	border-radius: 0 0 3px 0;
	background: inherit;
	transform: rotate(45deg);
}
.ig-globo strong { font-weight: 700; }

/* Estado de llamado de atención (lo activa instagram.js una vez por visita). */
.ig-atencion .ig-globo {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0) scale(1);
	transition-delay: 0s;
}
.ig-atencion .ig-boton { animation: ig-orbita 1.6s linear infinite, ig-pulso 1.6s ease-out 3; }
.ig-atencion .ig-boton-accion { animation: ig-latido 1.6s ease-in-out 3; }

@keyframes ig-orbita { to { --ig-giro: 360deg; } }
@keyframes ig-pulso {
	0% { box-shadow: 0 0 0 0 rgba(214, 41, 118, 0.45), 0 8px 22px -12px rgba(150, 47, 191, 0.35); }
	100% { box-shadow: 0 0 0 16px rgba(214, 41, 118, 0), 0 8px 22px -12px rgba(150, 47, 191, 0.35); }
}
@keyframes ig-latido {
	0%, 100% { transform: scale(1) rotate(0); }
	20% { transform: scale(1.18) rotate(90deg); }
	40% { transform: scale(1) rotate(90deg); }
}

/* ---------- C) Aviso flotante en teléfono y tableta ---------- */
.ig-flotante[hidden] { display: none; }
.ig-flotante {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 78px; /* encima del botón «Contacto» */
	z-index: 9990;
	max-width: 400px;
	margin: 0 auto;
	opacity: 0;
	transform: translateY(24px) scale(0.96);
	transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.2, 1.3, 0.4, 1);
	pointer-events: none;
}
.ig-flotante.ig-visible { opacity: 1; transform: none; pointer-events: auto; }
.menu-abierto .ig-flotante.ig-visible { opacity: 0; transform: translateY(24px); pointer-events: none; }

.ig-flotante-enlace {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 12px 12px 12px;
	border: 1.5px solid transparent;
	border-radius: 20px;
	background:
		linear-gradient(#fff, #fff) padding-box,
		conic-gradient(from var(--ig-giro),
			rgba(24, 24, 24, 0.08) 0deg 220deg,
			#feda75 250deg, #fa7e1e 275deg, #d62976 305deg, #962fbf 335deg,
			rgba(24, 24, 24, 0.08) 360deg) border-box;
	box-shadow: 0 20px 44px -16px rgba(24, 24, 24, 0.35), 0 2px 6px rgba(24, 24, 24, 0.06);
	color: var(--tinta, #181818);
	animation: ig-orbita 4.5s linear infinite;
}
.ig-flotante-enlace:hover { text-decoration: none; }

.ig-insignia {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 14px;
	background: var(--ig-degradado);
	color: #fff;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px -8px rgba(214, 41, 118, 0.8);
	overflow: hidden;
}
.ig-insignia .ig-glifo { width: 24px; height: 24px; }
/* Brillo que cruza la insignia al aparecer */
.ig-insignia::after {
	content: "";
	position: absolute;
	inset: -50%;
	background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%);
	transform: translateX(-60%);
}
.ig-visible .ig-insignia::after { animation: ig-brillo 1.4s ease 0.5s; }

.ig-flotante-texto { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ig-flotante-texto strong { font: 700 15px/1.15 var(--fuente-menu, sans-serif); }
.ig-flotante-texto span { font-size: 13px; line-height: 1.2; color: #737373; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-flotante-seguir {
	flex: none;
	padding: 10px 16px;
	border-radius: 999px;
	background: var(--tinta, #181818);
	color: #fff;
	font: 700 14px/1 var(--fuente-menu, sans-serif);
}

.ig-flotante-cerrar {
	position: absolute;
	top: -10px;
	right: -6px;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #fff;
	color: #555;
	box-shadow: 0 2px 8px rgba(24, 24, 24, 0.2);
}
.ig-flotante-cerrar svg { width: 14px; height: 14px; }

@keyframes ig-brillo { to { transform: translateX(60%); } }

/* En computadora, la columna izquierda está siempre visible: no hace falta el aviso. */
@media (min-width: 1200px) {
	.ig-flotante { display: none !important; }
}
/* En teléfono y tableta la columna es el menú desplegable; el globo no se muestra ahí. */
@media (max-width: 1199px) {
	.ig-globo { display: none; }
	.ig-lateral { margin-bottom: 96px; } /* deja libre el botón «Contacto», que flota abajo a la derecha */
}

/* ---------- Tarjeta angosta (teléfono o columna estrecha) ---------- */
/* Responde al ancho de la propia tarjeta, no al de la pantalla. */
.ig-tarjeta { container-type: inline-size; }
@container (max-width: 520px) {
	.ig-cabeza { flex-wrap: wrap; gap: 16px; }
	.ig-tarjeta .ig-aro { --t: 64px; }
	.ig-usuario { font-size: 19px; }
	.ig-seguir { width: 100%; order: 3; }
	.ig-rejilla { gap: 6px; margin-top: 18px; }
}
@media (max-width: 768px) {
	.ig-tarjeta { padding: 24px 20px 20px; }
}

/* Quien pide menos movimiento no ve giros ni desplazamientos. */
@media (prefers-reduced-motion: reduce) {
	.ig-boton, .ig-flotante-enlace { animation: none !important; }
	.ig-atencion .ig-boton-accion, .ig-visible .ig-insignia::after { animation: none !important; }
	.ig-tarjeta *, .ig-tarjeta *::before, .ig-tarjeta *::after,
	.ig-boton, .ig-boton *, .ig-boton::before, .ig-globo, .ig-flotante { transition-duration: 0.01s !important; }
}
