/*
Theme Name: Estudio Milanese
Theme URI: https://estudiomilanese.com.ar
Author: Estudio Milanese
Description: Tema de bloques one page para el estudio contable de Juan Pablo Milanese. Todas las secciones se editan desde el editor de bloques de WordPress.
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.5.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: estudio-milanese
Tags: one-column, full-site-editing, block-patterns, block-styles, custom-colors, editor-style
*/

/* ---------- Base ---------- */

html {
	scroll-behavior: smooth;
}

/* Deja lugar al encabezado fijo al saltar a una sección del menú. */
[id] {
	scroll-margin-top: 96px;
}

.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* ---------- Encabezado ---------- */

header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0);
	z-index: 50;
}

.em-header {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid #eef0f2;
}

.em-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--primario);
}

.em-header .wp-block-button__link {
	padding: 0.55rem 1.1rem;
	font-size: var(--wp--preset--font-size--small);
}

@media (max-width: 599px) {
	.em-header .em-chip,
	.em-header .wp-block-buttons {
		display: none;
	}
}

/* ---------- Secciones ---------- */

.em-section.em-section {
	margin-block: 0 !important;
	padding-top: var(--wp--preset--spacing--80);
	padding-bottom: var(--wp--preset--spacing--80);
}

.em-section-header {
	max-width: 640px;
	margin-inline: auto !important;
	margin-bottom: var(--wp--preset--spacing--70) !important;
	text-align: center;
}

.em-section-header > * {
	margin-block: 0.75rem 0;
}

/* ---------- Etiquetas y chips ---------- */

p.is-style-eyebrow {
	display: inline-block;
	width: fit-content;
	padding: 0.3rem 0.9rem;
	border-radius: 999px;
	background: var(--wp--preset--color--celeste);
	color: var(--wp--preset--color--primario);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.5;
}

.em-section-header p.is-style-eyebrow {
	margin-inline: auto;
}

p.is-style-eyebrow-punto {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	width: fit-content;
	padding: 0.35rem 0.9rem;
	border-radius: 999px;
	background: #f1f3f5;
	color: #334155;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.5;
}

p.is-style-eyebrow-punto::before,
p.is-style-chip::before {
	content: "";
	flex: none;
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accion);
}

p.is-style-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	width: fit-content;
	margin: 0;
	padding: 0.5rem 1rem;
	border-radius: 12px;
	border: 1px solid var(--wp--preset--color--borde);
	background: var(--wp--preset--color--blanco);
	color: var(--wp--preset--color--primario);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	box-shadow: var(--wp--custom--sombra--suave);
}

p.is-style-badge {
	margin: 0;
	padding: 0.2rem 0.75rem;
	border-radius: 999px;
	background: var(--wp--preset--color--celeste);
	color: var(--wp--preset--color--primario);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.em-chip {
	margin: 0;
	padding: 0.15rem 0.7rem;
	border-radius: 999px;
	border: 1px solid #e2e8f0;
	background: #f1f5f9;
	color: #475569;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	white-space: nowrap;
}

/* ---------- Botones ---------- */

.wp-block-button.is-style-whatsapp .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	box-shadow: 0 8px 20px rgba(31, 168, 85, 0.24);
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.wp-block-button.is-style-whatsapp .wp-block-button__link::before {
	content: "";
	flex: none;
	width: 1.25em;
	height: 1.25em;
	background-color: currentColor;
	-webkit-mask: var(--em-icono-whatsapp) center / contain no-repeat;
	mask: var(--em-icono-whatsapp) center / contain no-repeat;
}

.wp-block-button.is-style-whatsapp .wp-block-button__link:hover {
	transform: translateY(-1px);
}

:root {
	--em-icono-whatsapp: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.04 2c-5.46 0-9.91 4.45-9.91 9.91 0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21 5.46 0 9.91-4.45 9.91-9.91 0-2.65-1.03-5.14-2.9-7.01A9.82 9.82 0 0 0 12.04 2m.01 1.67c2.2 0 4.26.86 5.82 2.42a8.23 8.23 0 0 1 2.41 5.83c0 4.54-3.7 8.24-8.24 8.24-1.48 0-2.93-.4-4.2-1.15l-.3-.18-3.12.82.83-3.04-.2-.31a8.2 8.2 0 0 1-1.26-4.38c0-4.54 3.7-8.24 8.24-8.24m4.52 11.66c-.25-.13-1.47-.72-1.7-.81-.23-.08-.39-.13-.56.13-.17.25-.64.81-.79.97-.14.17-.29.19-.54.06-.25-.13-1.06-.39-2.03-1.25-.75-.67-1.26-1.5-1.41-1.75-.14-.25-.02-.39.11-.51.11-.11.25-.29.37-.44.13-.14.17-.25.25-.42.08-.17.04-.31-.02-.44-.06-.13-.56-1.35-.77-1.85-.2-.49-.41-.42-.56-.43h-.48c-.17 0-.44.06-.67.31-.23.25-.88.86-.88 2.1s.9 2.44 1.03 2.61c.13.17 1.78 2.72 4.31 3.81.6.26 1.07.42 1.44.54.61.19 1.16.17 1.6.1.49-.07 1.47-.6 1.68-1.18.21-.57.21-1.05.15-1.16-.06-.11-.22-.18-.47-.3'/%3E%3C/svg%3E");
}

.wp-block-button.is-style-outline .wp-block-button__link {
	border: 1.5px solid #cbd5e1;
	color: #334155;
	background: transparent;
	font-weight: 500;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: #f8fafc;
	color: var(--wp--preset--color--primario);
}

.em-boton-grande .wp-block-button__link {
	padding: 1.1rem 2.2rem;
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 800;
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

/* Botón flotante de WhatsApp */
.em-wa-flotante {
	position: fixed;
	right: clamp(1rem, 3vw, 2rem);
	bottom: clamp(1rem, 3vw, 2rem);
	z-index: 60;
	margin: 0 !important;
}

.em-wa-flotante .wp-block-button__link {
	border-radius: 999px;
	padding: 0.9rem 1.3rem;
	box-shadow: 0 16px 36px -6px rgba(20, 39, 64, 0.35);
}

/* ---------- Tarjetas ---------- */

.em-card {
	height: 100%;
	border: 1px solid #eceae4;
	border-radius: 24px;
	background: var(--wp--preset--color--blanco);
	box-shadow: var(--wp--custom--sombra--suave);
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.em-card:hover {
	box-shadow: var(--wp--custom--sombra--media);
}

.em-card.has-crema-claro-background-color {
	border-color: #e7e3da;
}

.wp-block-column > .em-card {
	height: 100%;
}

.em-card-top {
	margin-bottom: 1.5rem;
}

.em-card-link {
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid #f1f1ee;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

.em-card-link a {
	text-decoration: none;
	color: var(--wp--preset--color--primario);
}

.em-card-link a::after {
	content: " →";
}

/* Íconos */
.wp-block-image.em-icono {
	margin: 0;
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: var(--wp--preset--color--celeste);
}

.wp-block-image.em-icono img {
	width: 26px;
	height: 26px;
}

.wp-block-image.em-icono.em-icono-verde {
	background: #e6f6ec;
}

.wp-block-image.em-icono.em-icono-gris {
	background: #f1f5f9;
}

.wp-block-image.em-icono.em-icono-claro {
	background: rgba(255, 255, 255, 0.15);
}

/* Número de paso */
p.is-style-numero {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0 0 1.25rem;
	border-radius: 50%;
	background: var(--wp--preset--color--primario);
	color: var(--wp--preset--color--blanco);
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 800;
	box-shadow: var(--wp--custom--sombra--suave);
}

/* ---------- Portada ---------- */

.em-hero h1 {
	margin-top: 1.5rem;
}

.em-respaldo {
	padding-top: 1rem;
	border-top: 1px solid #f1f5f9;
	color: #64748b;
	font-size: var(--wp--preset--font-size--small);
}

.em-respaldo strong {
	color: var(--wp--preset--color--texto);
}

/* Foto con tarjeta superpuesta */
.wp-block-cover.em-foto {
	border-radius: 24px;
	overflow: hidden;
	box-shadow: var(--wp--custom--sombra--fuerte);
	padding: 1rem;
}

.wp-block-cover.em-foto .wp-block-cover__inner-container {
	width: 100%;
}

.em-foto-tarjeta {
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.95);
	box-shadow: var(--wp--custom--sombra--media);
	color: var(--wp--preset--color--texto);
}

.em-foto-tarjeta p {
	margin: 0;
}

/* Chat de WhatsApp de ejemplo en la portada */
.em-chat-fondo {
	padding: clamp(1.25rem, 4vw, 2.5rem);
	border-radius: 24px;
	background: var(--wp--preset--color--celeste);
}

.em-chat {
	max-width: 400px;
	margin-inline: auto;
	overflow: hidden;
	border-radius: 20px;
	background: var(--wp--preset--color--blanco);
	box-shadow: var(--wp--custom--sombra--fuerte);
}

.em-chat p {
	margin: 0;
}

.em-chat-cabecera {
	align-items: center;
	padding: 0.85rem 1.1rem;
	background: #075e54;
	color: #fff;
}

.em-chat-avatar {
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--wp--preset--color--blanco);
	color: var(--wp--preset--color--primario);
	font-family: var(--wp--preset--font-family--manrope);
	font-size: 0.95rem;
	font-weight: 800;
}

.em-chat-nombre {
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 700;
	line-height: 1.3;
}

.em-chat-estado {
	font-size: 0.8rem;
	line-height: 1.3;
	opacity: 0.85;
}

.em-chat-cuerpo {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	min-height: 260px;
	padding: 1.25rem 1rem;
	background: #efeae2;
}

.em-chat .em-burbuja {
	position: relative;
	max-width: 85%;
	padding: 0.55rem 0.8rem 1.15rem;
	border-radius: 10px;
	box-shadow: 0 1px 1px rgba(11, 20, 26, 0.13);
	color: #111b21;
	font-size: 0.95rem;
	line-height: 1.4;
}

.em-chat .em-burbuja::after {
	position: absolute;
	right: 0.6rem;
	bottom: 0.25rem;
	color: #667781;
	font-size: 0.68rem;
}

.em-chat .em-burbuja-enviada {
	align-self: flex-end;
	border-top-right-radius: 2px;
	background: #d9fdd3;
}

.em-chat .em-burbuja-enviada::after {
	content: "9:41 ✓✓";
	color: #53bdeb;
}

.em-chat .em-burbuja-recibida {
	align-self: flex-start;
	border-top-left-radius: 2px;
	background: #fff;
}

.em-chat .em-burbuja-recibida::after {
	content: "9:42";
}

.em-chat-escribir {
	padding: 0.7rem 1rem;
	background: #f0f2f5;
}

.em-chat-escribir a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.6rem 0.6rem 0.6rem 1rem;
	border-radius: 999px;
	background: #fff;
	color: #667781;
	font-size: 0.95rem;
	text-decoration: none;
}

.em-chat-escribir a::after {
	content: "";
	width: 34px;
	height: 34px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--accion) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M3.4 20.4 21 12 3.4 3.6l-.01 6.53L15 12 3.39 13.87z'/%3E%3C/svg%3E") center / 18px no-repeat;
}

.em-chat-escribir a:hover {
	color: var(--wp--preset--color--accion-oscuro);
}

@media (max-width: 781px) {
	.em-chat-cuerpo {
		min-height: 0;
	}

	.em-hero .wp-block-buttons .wp-block-button {
		width: 100%;
	}

	.em-hero .wp-block-buttons .wp-block-button__link {
		width: 100%;
	}
}

/* ---------- Preguntas frecuentes ---------- */

.wp-block-details.em-faq {
	margin: 0;
	border: 1px solid #e7e3da;
	border-radius: 20px;
	background: var(--wp--preset--color--crema-claro);
	padding: 1.25rem 1.5rem;
	box-shadow: var(--wp--custom--sombra--suave);
}

.em-faq-col > .wp-block-details.em-faq + .wp-block-details.em-faq {
	margin-top: 1.25rem;
}

.wp-block-details.em-faq summary {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	cursor: pointer;
	list-style: none;
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	color: var(--wp--preset--color--primario);
}

.wp-block-details.em-faq summary::-webkit-details-marker {
	display: none;
}

.wp-block-details.em-faq summary::after {
	content: "+";
	flex: none;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--texto-secundario);
	transition: transform 0.2s ease;
}

.wp-block-details.em-faq[open] summary::after {
	transform: rotate(45deg);
}

.wp-block-details.em-faq p {
	margin-top: 0.75rem;
	color: var(--wp--preset--color--texto-secundario);
}

/* ---------- Contacto ---------- */

.em-dato {
	height: 100%;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.08);
	text-align: left;
}

.em-dato p {
	margin: 0;
	overflow-wrap: anywhere;
}

.em-dato a {
	color: inherit;
	text-decoration: none;
}

.em-dato a:hover {
	text-decoration: underline;
}

/* ---------- Pie ---------- */

.em-footer p {
	margin: 0;
}

/* ---------- Ajustes de tarjetas y grillas ---------- */

.em-card {
	padding: clamp(1.5rem, 3vw, 2rem);
	gap: 0.75rem;
}

.em-card > * {
	margin: 0;
}

.em-card h3 {
	margin-top: 0.25rem;
}

.em-cols-destacadas {
	margin-bottom: 2rem;
}

.em-cols-destacadas .em-card h3 {
	font-size: clamp(1.25rem, 2.2vw, 1.6rem);
}

.em-pasos {
	margin-bottom: var(--wp--preset--spacing--70);
}

.em-ventajas {
	padding: clamp(1.5rem, 3vw, 2rem);
	border: 1px solid #e7e3da;
	border-radius: 24px;
}

.em-ventaja {
	gap: 1rem;
	align-items: flex-start !important;
}

.em-ventaja-texto,
.em-dato-texto {
	gap: 0.15rem;
}

.em-ventaja-texto > *,
.em-dato-texto > * {
	margin: 0;
}

.em-contacto-cabecera {
	margin-bottom: var(--wp--preset--spacing--70);
}

.em-contacto-cabecera .wp-block-buttons {
	margin-top: 2rem;
}

.em-dato {
	padding: 1.25rem;
	gap: 1rem;
}

.em-datos .wp-block-column {
	min-width: 0;
}

@media (min-width: 782px) and (max-width: 1100px) {
	.em-pasos,
	.em-datos {
		flex-wrap: wrap !important;
	}

	.em-pasos > .wp-block-column,
	.em-datos > .wp-block-column {
		flex-basis: calc(50% - 1rem) !important;
	}
}

.em-header .wp-block-navigation a {
	text-decoration: none;
}

@media (max-width: 781px) {
	.wp-block-cover.em-foto {
		min-height: 340px !important;
	}
}

/* ---------- Animaciones ----------
 * Solo se activan si el visitante no pidió "reducir movimiento".
 * La clase em-anim la agrega functions.php en <html>.
 */

/* Portada: el texto entra escalonado al cargar */
@keyframes em-subir {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

html.em-anim .em-hero-cols > .wp-block-column:first-child > * {
	animation: em-subir 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

html.em-anim .em-hero-cols > .wp-block-column:first-child > :nth-child(2) { animation-delay: 0.08s; }
html.em-anim .em-hero-cols > .wp-block-column:first-child > :nth-child(3) { animation-delay: 0.16s; }
html.em-anim .em-hero-cols > .wp-block-column:first-child > :nth-child(4) { animation-delay: 0.24s; }
html.em-anim .em-hero-cols > .wp-block-column:first-child > :nth-child(5) { animation-delay: 0.32s; }

html.em-anim .em-hero-cols > .wp-block-column:last-child {
	animation: em-subir 0.8s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

/* Secciones: aparecen al llegar a la pantalla */
html.em-anim .em-revelar {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
	transition-delay: var(--em-retraso, 0ms), var(--em-retraso, 0ms), 0ms, 0ms;
}

html.em-anim .em-revelar.em-visible {
	opacity: 1;
	transform: none;
}

/* Chat: mensajes que llegan uno por uno */
.em-chat-cuerpo {
	position: relative;
}

html.em-anim .em-chat-animado .em-burbuja {
	opacity: 0;
	transform: translateY(8px) scale(0.96);
	transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.2);
}

html.em-anim .em-chat-animado .em-burbuja-enviada {
	transform-origin: right bottom;
}

html.em-anim .em-chat-animado .em-burbuja-recibida {
	transform-origin: left bottom;
}

html.em-anim .em-chat-animado .em-burbuja.em-visible {
	opacity: 1;
	transform: none;
}

.em-escribiendo {
	position: absolute;
	left: 1rem;
	display: flex;
	gap: 4px;
	padding: 0.75rem 0.9rem;
	border-radius: 10px;
	border-top-left-radius: 2px;
	background: #fff;
	box-shadow: 0 1px 1px rgba(11, 20, 26, 0.13);
}

.em-escribiendo span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #8696a0;
	animation: em-punto 1s infinite ease-in-out;
}

.em-escribiendo span:nth-child(2) { animation-delay: 0.15s; }
.em-escribiendo span:nth-child(3) { animation-delay: 0.3s; }

@keyframes em-punto {
	0%, 60%, 100% {
		opacity: 0.4;
		transform: none;
	}
	30% {
		opacity: 1;
		transform: translateY(-3px);
	}
}

@media (prefers-reduced-motion: no-preference) {
	/* Tarjetas y botones que responden al mouse */
	.em-card {
		transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
	}

	.em-card:hover {
		transform: translateY(-4px);
		border-color: var(--wp--preset--color--borde);
	}

	html.em-anim .em-revelar.em-visible.em-card:hover {
		transform: translateY(-4px);
	}

	.wp-block-button .wp-block-button__link {
		transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
	}

	.wp-block-button .wp-block-button__link:hover {
		transform: translateY(-2px);
	}

	/* Pulso suave del botón flotante de WhatsApp */
	.em-wa-flotante .wp-block-button__link {
		animation: em-pulso 7s 3s infinite;
	}

	@keyframes em-pulso {
		0% {
			box-shadow: 0 16px 36px -6px rgba(20, 39, 64, 0.35), 0 0 0 0 rgba(31, 168, 85, 0.5);
		}
		12% {
			box-shadow: 0 16px 36px -6px rgba(20, 39, 64, 0.35), 0 0 0 16px rgba(31, 168, 85, 0);
		}
		100% {
			box-shadow: 0 16px 36px -6px rgba(20, 39, 64, 0.35), 0 0 0 0 rgba(31, 168, 85, 0);
		}
	}
}

/* ---------- Logo en el encabezado ---------- */

.em-marca {
	align-items: center;
}

.em-marca-isotipo {
	margin: 0;
	line-height: 0;
}

.em-marca-isotipo img {
	display: block;
	height: auto;
}

.em-marca p {
	margin: 0;
	line-height: 1.1;
	color: #1f4356;
	text-transform: uppercase;
}

.em-marca-nombre {
	font-family: var(--wp--preset--font-family--manrope);
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: 0.14em;
}

.em-marca-nombre a {
	color: inherit;
	text-decoration: none;
}

.em-marca-bajada {
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.2em;
}
