/*
 * Demo de la modelo independiente (TD-22): /demo/modelo/ (.xd--model). Solo se carga en esa página (inc/enqueue.php), sobre
 * demos-nuevas.css (componentes xd-*) y demos-fotos.css. Colores propios, distintos de las otras demos: negro, hueso, un gris cálido y
 * un acento nude. Títulos en Cormorant Garamond 600 (--demo-font-titulos, inline en enqueue.php).
 *
 * Contraste: texto y botones 4,5:1 o más sobre su fondo; bordes de campos, botones y chips 3:1 o más (--xd-line-strong). El texto del
 * hero va sobre la foto con un velo hueso de izquierda a derecha (escritorio) o debajo de la foto (celular). Puntos de corte: 640, 900 y
 * 1024 px.
 */

.xd--model {
	--xd-bg: #f4f1ec;
	--xd-surface: #fbf9f6;
	--xd-text: #111111;
	--xd-muted: #57514a;
	--xd-main: #111111;
	--xd-main-hover: #2e2a26;
	--xd-on-main: #f4f1ec;
	--xd-accent: #7d5a44;
	--xd-accent-soft: #e6d6c8;
	--xd-soft: #ebe6df;
	--xd-line: #d9d1c6;
	--xd-line-strong: #857d72;
	--xd-dark: #111111;
	--xd-on-dark: #f4f1ec;
	--xd-on-dark-accent: #d9b9a0;
	--xd-radius: 4px;
	--xd-radius-btn: 2px;
}

/* ---------- Títulos: Cormorant es chica, así que sube de tamaño ---------- */
.xd--model .xd-h2 {
	font-size: 2.125rem;
	font-weight: 600;
	line-height: 1.1;
}

@media (min-width: 768px) {
	.xd--model .xd-h2 {
		font-size: 2.875rem;
	}
}

.xd--model .xd-kicker,
.xd--model .mx-eyebrow {
	letter-spacing: 0.16em;
}

.xd--model .xd-brand__name {
	font-size: 1.375rem;
	font-weight: 600;
}

.xd--model .xd-area__name,
.xd--model .mx-work__brand {
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.15;
}

.xd--model .xd-btn > a,
.xd--model a.xd-btn,
.xd--model button.xd-btn {
	letter-spacing: 0.04em;
}

/* ---------- Portada ---------- */
.xd--model .mx-hero {
	position: relative;
	background-color: var(--xd-bg);
}

.xd--model .mx-hero__media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background-color: #c9c6c1;
}

.xd--model .mx-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 68% 12%;
}

.xd--model .mx-hero__inner {
	width: 100%;
	max-width: 72rem;
	margin: 0 auto;
	padding: 2rem 1rem 2.5rem;
}

@media (min-width: 640px) {
	.xd--model .mx-hero__inner {
		padding-right: 1.5rem;
		padding-left: 1.5rem;
	}
}

.xd--model .mx-eyebrow {
	margin-bottom: 0.75rem;
	color: var(--xd-accent);
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1.25rem;
	text-transform: uppercase;
}

.xd--model .mx-hero__title {
	margin-bottom: 1rem;
	color: var(--xd-text);
	font-size: clamp(3.25rem, 14vw, 4.5rem);
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 0.95;
}

.xd--model .mx-hero__text {
	max-width: 28rem;
	margin-bottom: 1.5rem;
	color: var(--xd-text);
	font-size: 1.125rem;
	line-height: 1.55;
}

.xd--model .mx-person {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 1.75rem;
}

.xd--model .mx-person__avatar {
	flex: none;
	width: 3.5rem;
	height: 3.5rem;
	overflow: hidden;
	border: 2px solid var(--xd-surface);
	border-radius: 9999px;
	background-color: var(--xd-soft);
	box-shadow: 0 0 0 1px var(--xd-line-strong);
}

.xd--model .mx-person__avatar .dm-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 22%;
}

.xd--model .mx-person__name {
	color: var(--xd-text);
	font-size: 0.9375rem;
	font-weight: 700;
	line-height: 1.25rem;
}

.xd--model .mx-person__role {
	color: var(--xd-muted);
	font-size: 0.8125rem;
	line-height: 1.25rem;
}

@media (min-width: 900px) {
	.xd--model .mx-hero {
		min-height: 36rem;
		overflow: hidden;
	}

	.xd--model .mx-hero__media {
		position: absolute;
		inset: 0;
		aspect-ratio: auto;
	}

	.xd--model .mx-hero__img {
		object-position: 50% 18%;
	}

	/* Velo hueso de izquierda a derecha: el texto oscuro queda sobre hueso, no sobre la foto */
	.xd--model .mx-hero::after {
		content: '';
		position: absolute;
		inset: 0;
		background: linear-gradient(90deg, rgba(244, 241, 236, 0.97) 0%, rgba(244, 241, 236, 0.93) 36%, rgba(244, 241, 236, 0.55) 50%, rgba(244, 241, 236, 0) 64%);
		pointer-events: none;
	}

	.xd--model .mx-hero__inner {
		position: relative;
		z-index: 1;
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: 36rem;
		padding-top: 4rem;
		padding-bottom: 4rem;
	}

	.xd--model .mx-hero__inner > * {
		max-width: 27rem;
	}

	.xd--model .mx-hero__title {
		font-size: clamp(4.5rem, 7.2vw, 6.5rem);
	}
}

/* ---------- Book ---------- */
.xd--model .xd-chip {
	border-radius: 2px;
	letter-spacing: 0.04em;
}

.xd--model .mx-book {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.xd--model .mx-book {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1rem;
	}
}

@media (min-width: 1024px) {
	.xd--model .mx-book {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.xd--model .mx-book__item[hidden] {
	display: none;
}

.xd--model .mx-book__btn {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: var(--xd-radius);
	background-color: var(--xd-soft);
	cursor: zoom-in;
}

.xd--model .mx-book__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.xd--model .mx-book__btn:hover .mx-book__img {
	transform: scale(1.03);
}

.xd--model .mx-book__cap {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 1.75rem 0.75rem 0.625rem;
	background: linear-gradient(0deg, rgba(17, 17, 17, 0.92) 0%, rgba(17, 17, 17, 0.88) 60%, rgba(17, 17, 17, 0) 100%);
	color: #f4f1ec;
	font-family: var(--ec-font-inter);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.25;
	text-align: left;
	text-transform: uppercase;
}

/* ---------- Medidas (comp card) ---------- */
.xd--model .mx-comp {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.5rem;
	padding: 1.25rem;
}

@media (min-width: 900px) {
	.xd--model .mx-comp {
		grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
		gap: 3rem;
		align-items: center;
		padding: 2rem;
	}
}

.xd--model .mx-comp__photo {
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: var(--xd-radius);
	background-color: var(--xd-soft);
}

.xd--model .mx-comp__photo .dm-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.xd--model .mx-comp__list {
	display: flex;
	flex-direction: column;
}

.xd--model .mx-comp__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.875rem 0;
	border-bottom: 1px solid var(--xd-line);
}

.xd--model .mx-comp__row dt {
	color: var(--xd-muted);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.25rem;
	text-transform: uppercase;
}

.xd--model .mx-comp__row dd {
	color: var(--xd-text);
	font-family: var(--demo-font-titulos);
	font-size: 1.75rem;
	font-weight: 600;
	line-height: 1.1;
	text-align: right;
}

.xd--model .mx-comp__note {
	margin: 1rem 0 1.5rem;
	color: var(--xd-muted);
	font-size: 0.875rem;
	line-height: 1.5;
}

/* ---------- Servicios y trabajos ---------- */
.xd--model .xe-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.xd--model .xe-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.5rem;
}

.xd--model .xd-area__icon {
	border-radius: 2px;
	background-color: var(--xd-accent-soft);
	color: var(--xd-text);
}

.xd--model .mx-works {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 640px) {
	.xd--model .mx-works {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.xd--model .mx-works {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.xd--model .mx-work {
	padding: 1.5rem;
}

.xd--model .mx-work__year {
	margin-bottom: 0.5rem;
	color: var(--xd-accent);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.25rem;
}

.xd--model .mx-work__brand {
	color: var(--xd-text);
}

.xd--model .mx-work__type {
	margin-top: 0.25rem;
	color: var(--xd-muted);
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* ---------- Sobre mí: la foto con un bloque de color corrido 24 px detrás ---------- */
.xd--model .xe-about {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.5rem;
	align-items: center;
}

@media (min-width: 900px) {
	.xd--model .xe-about {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		gap: 4rem;
	}
}

.xd--model .xe-about__photo {
	position: relative;
	margin: 0 24px 24px 0;
}

.xd--model .xe-about__block {
	position: absolute;
	inset: 24px -24px -24px 24px;
	border-radius: var(--xd-radius);
	background-color: var(--xd-accent-soft);
}

.xd--model .xe-about__photo .dm-img {
	position: relative;
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--xd-radius);
}

.xd--model .xe-about__body {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* ---------- Contacto ---------- */
.xd--model .xe-social {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.xd--model .xe-social a {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 2.5rem;
	color: var(--xd-text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.xd--model .xd-contact__item .xd-ico {
	color: var(--xd-accent);
}

/* ---------- Visor de fotos ---------- */
html.mx-viewer-open {
	overflow: hidden;
}

.xd--model .mx-viewer {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	flex-direction: column;
	background-color: #111111;
	color: #f4f1ec;
}

.xd--model .mx-viewer[hidden] {
	display: none;
}

.xd--model .mx-viewer :focus-visible {
	outline: 3px solid #d9b9a0;
	outline-offset: 2px;
}

.xd--model .mx-viewer__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 1rem;
}

.xd--model .mx-viewer__count {
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: 0.06em;
}

.xd--model .mx-viewer__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid rgba(244, 241, 236, 0.7);
	border-radius: 9999px;
	background-color: transparent;
	color: #f4f1ec;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.xd--model .mx-viewer__btn:hover {
	background-color: rgba(244, 241, 236, 0.14);
}

.xd--model .mx-viewer__btn .xd-ico {
	width: 1.375rem;
	height: 1.375rem;
}

.xd--model .mx-viewer__stage {
	flex: 1;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-areas: 'fig fig' 'prev next';
	align-content: center;
	gap: 0.75rem 1rem;
	min-height: 0;
	padding: 0 1rem 1.25rem;
}

.xd--model .mx-viewer__fig {
	grid-area: fig;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
	min-height: 0;
	margin: 0;
}

.xd--model .mx-viewer__img {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100vh - 14rem);
	max-height: calc(100dvh - 14rem);
	object-fit: contain;
	border-radius: var(--xd-radius);
	background-color: #2a2724;
}

.xd--model .mx-viewer__caption {
	color: #f4f1ec;
	font-size: 0.9375rem;
	letter-spacing: 0.04em;
	line-height: 1.4;
	text-align: center;
}

.xd--model .mx-viewer__nav--prev {
	grid-area: prev;
	justify-self: start;
}

.xd--model .mx-viewer__nav--next {
	grid-area: next;
	justify-self: end;
}

@media (min-width: 640px) {
	.xd--model .mx-viewer__stage {
		grid-template-columns: auto minmax(0, 1fr) auto;
		grid-template-areas: 'prev fig next';
		align-content: stretch;
		align-items: center;
		padding: 0 1.5rem 1.5rem;
	}

	.xd--model .mx-viewer__nav--prev,
	.xd--model .mx-viewer__nav--next {
		justify-self: center;
	}

	.xd--model .mx-viewer__img {
		max-height: calc(100vh - 11rem);
		max-height: calc(100dvh - 11rem);
	}
}

@media (prefers-reduced-motion: reduce) {
	.xd--model .mx-book__img,
	.xd--model .mx-viewer__btn {
		transition: none;
	}

	.xd--model .mx-book__btn:hover .mx-book__img {
		transform: none;
	}
}
