/* Merkarte · componentes compartidos entre páginas (mapa §7.1).
 *
 * Aquí va lo que usan la portada y Programa y no es chrome: el hero, la rejilla
 * de artistas, los botones y la separación entre secciones. Sin tamaños de
 * letra: la tipografía vive en theme.json y styles/.
 *
 * @package zaguan
 */

/* --- Secciones de primer nivel sin margen entre ellas -------------------
   El espacio lo pone el padding de cada sección (settings.custom.section).
   `body` gana a las reglas de layout de core sin forzar la cascada. */
body .wp-block-post-content > .alignfull,
body .is-root-container > .alignfull {
	margin-block-start: 0;
}

/* --- Lienzo del editor con plantilla page-landing -----------------------
   En el editor, la raíz es is-layout-flow y lleva has-global-padding: el
   gutter queda a los lados de la raíz y las secciones salen 48 px más
   estrechas que en el front. La regla 2 de editor.css (padding 0 en
   .is-root-container) pierde contra .has-global-padding, que tiene la misma
   especificidad y llega después. Aquí se gana con dos clases y el gutter
   vuelve a cada sección. Defecto del starter, pendiente de corregir allí. */
.is-root-container.is-layout-flow {
	padding-inline: 0;
}

.is-root-container.is-layout-flow > .has-global-padding {
	padding-inline: 1.5rem;
}

/* --- Botones -------------------------------------------------------------
   Relleno circular que crece desde el centro al pasar el ratón. El color del
   relleno y del texto en hover se cambian por sección con --mk-hov y
   --mk-hov-txt. */
.wp-block-button__link {
	--mk-hov: var(--wp--preset--color--contrast-2);
	--mk-hov-txt: var(--wp--preset--color--base-2);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	box-sizing: border-box;
	transition: color 0.45s cubic-bezier(0.2, 0, 0, 1), border-color 0.45s cubic-bezier(0.2, 0, 0, 1);
}

.wp-block-button__link::before {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: -1;
	background: var(--mk-hov);
	border-radius: 50%;
	transform: scale(0);
	opacity: 0.6;
	transition: transform 0.6s cubic-bezier(0.2, 0, 0, 1), opacity 0.35s cubic-bezier(0.2, 0, 0, 1), border-radius 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.wp-block-button__link:hover::before,
.wp-block-button__link:focus-visible::before {
	transform: scale(1.02);
	opacity: 1;
	border-radius: 0;
}

body .wp-block-button__link:hover,
body .wp-block-button__link:focus-visible {
	color: var(--mk-hov-txt);
	border-color: var(--mk-hov);
}

body .wp-block-button.is-style-outline > .wp-block-button__link {
	border-width: 1px;
	padding-block: 0;
	padding-inline: 1.625rem;
	background: transparent;
	color: var(--wp--preset--color--accent);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-button__link::before {
		transition: opacity 0.2s;
	}
}

/* --- Hero (mk/hero) ------------------------------------------------------ */
.mk-hero {
	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 48px;
	min-height: max(600px, 44vw);
	padding: max(28px, 3.5vw) 8.3% max(32px, 3.2vw);
	background: url(../img/hero-mancha.jpg) center top / cover no-repeat var(--wp--preset--color--mk-niebla);
}

.mk-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: url(../img/anillo.png) 52% 50% / auto 80% no-repeat;
}

/* Fuera el blockGap de flow dentro del hero: los huecos los pone la rejilla. */
body .mk-hero * {
	margin-block: 0;
}

.mk-hero__top {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: start;
	gap: 16px 24px;
}

.mk-hero__frase {
	display: flex;
	flex-direction: column;
	width: 10.7em;
	max-width: 100%;
	margin-inline: auto;
	line-height: var(--wp--custom--leading--display);
}

.mk-hero__l1 {
	padding-left: 33.9%;
}

.mk-hero__l2 {
	gap: 0;
}

.mk-hero__l3 {
	align-self: flex-end;
}

/* Programa: dos líneas con aire entre ellas. */
.mk-hero__frase--aire {
	gap: 0.16em;
}

.mk-hero__pie {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: end;
	gap: 32px 48px;
}

.mk-hero__inicio,
.mk-hero__fin {
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 2.4vw, 45px);
}

.mk-hero__fin {
	grid-column: 3;
	justify-self: end;
	align-items: flex-end;
}

.mk-hero__fecha {
	line-height: 1;
}

.mk-hero__fecha strong {
	font-weight: 600;
}

.mk-hero__logos img {
	display: block;
	width: clamp(200px, 16.1vw, 440px);
	height: auto;
}

.mk-hero__mkt img {
	display: block;
	width: clamp(132px, 10.6vw, 290px);
	height: auto;
}

.mk-hero__ctas {
	align-items: flex-end;
	gap: 10px;
}

body .mk-hero__ctas .wp-block-button__link,
body .mk-hero__ctas .is-style-outline > .wp-block-button__link {
	min-height: max(38px, 2.6vw);
	padding-inline: max(18px, 1.4vw);
}

/* --- Artistas (mk/artistas) ---------------------------------------------- */
.mk-artistas {
	padding: var(--wp--custom--section--padding) 24px;
	text-align: center;
}

body .mk-artistas > * {
	margin-block: 0;
}

body .mk-artistas > .mk-artistas__ante {
	padding-block: 6px;
	margin-block-end: clamp(6px, 0.5vw, 10px);
}

body .mk-artistas > .mk-artistas__titulo {
	margin-block-end: clamp(48px, 4.4vw, 84px);
	text-wrap: balance;
}

.mk-artistas__rejilla {
	--mk-w: clamp(150px, 13.5vw, 210px);
	--mk-gap: clamp(20px, 2.6vw, 48px);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: flex-start;
	gap: clamp(48px, 4.2vw, 76px) var(--mk-gap);
	max-width: calc(2px + 5 * var(--mk-w) + 4 * var(--mk-gap));
	margin-inline: auto;
}

body .mk-artistas__rejilla > .mk-card,
.mk-card p,
.mk-card figure {
	margin-block: 0;
}

.mk-card {
	position: relative;
	display: grid;
	grid-template-columns: 100%;
	align-content: start;
	width: var(--mk-w);
	text-align: center;
}

.mk-card__foto,
.mk-card__iniciales,
.mk-card__rrss {
	grid-area: 1 / 1;
}

.mk-card__foto {
	position: relative;
	isolation: isolate;
}

.mk-card__foto a {
	display: block;
}

.mk-card__foto img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	height: auto;
	border-radius: 50%;
	object-fit: cover;
	object-position: 50% 28%;
	transition: transform 0.45s cubic-bezier(0.2, 0, 0, 1);
}

.mk-card__foto::after {
	content: "";
	position: absolute;
	inset: -13%;
	pointer-events: none;
	background: url(../img/anillo.png) center / contain no-repeat;
	opacity: 0;
	filter: brightness(0.6) saturate(1.6);
	transform: scale(0.86) rotate(-24deg);
	transition: opacity 0.45s cubic-bezier(0.2, 0, 0, 1), transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.mk-artistas--azul .mk-card__foto::after {
	filter: brightness(1.15);
}

.mk-card:hover .mk-card__foto img,
.mk-card:focus-within .mk-card__foto img,
.mk-card:hover .mk-card__iniciales,
.mk-card:focus-within .mk-card__iniciales {
	transform: scale(1.03);
}

.mk-card:hover .mk-card__foto::after,
.mk-card:focus-within .mk-card__foto::after {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

.mk-card__iniciales {
	display: grid;
	aspect-ratio: 1;
	border-radius: 50%;
	background: color-mix(in srgb, currentcolor 9%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, currentcolor 28%, transparent);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 600;
	letter-spacing: 0.04em;
	line-height: 1;
	transition: transform 0.45s cubic-bezier(0.2, 0, 0, 1);
}

.mk-card__iniciales a {
	display: grid;
	place-items: center;
	color: inherit;
	text-decoration: none;
}

.mk-card__rrss {
	position: relative;
	z-index: 2;
	align-self: center;
	justify-self: center;
	max-width: 92%;
	padding: 12px 18px;
	border-radius: 999px;
	background: var(--wp--preset--color--contrast-2);
	color: var(--wp--preset--color--base-2);
	box-shadow: 0 10px 28px color-mix(in srgb, var(--wp--preset--color--contrast) 22%, transparent);
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1;
	opacity: 0;
	pointer-events: none;
	transform: translateY(12px) scale(0.9);
	transition: opacity 0.35s cubic-bezier(0.2, 0, 0, 1), transform 0.6s cubic-bezier(0.2, 0, 0, 1);
}

.mk-card__rrss a {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	max-width: 100%;
	overflow: hidden;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.mk-card__rrss a::after {
	content: "";
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	background: currentcolor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%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' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.mk-artistas--azul {
	background: var(--wp--preset--color--contrast-2);
	color: var(--wp--preset--color--base-2);
}

.mk-artistas--azul .mk-artistas__titulo {
	color: inherit;
}

.mk-artistas--azul .mk-card__rrss {
	background: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--contrast);
}

.mk-card:hover .mk-card__rrss,
.mk-card:focus-within .mk-card__rrss {
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

body .mk-card > .mk-card__nombre {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 2.1em;
	margin-block-start: clamp(16px, 1.3vw, 24px);
}

@media (hover: none) {
	.mk-card__rrss {
		align-self: end;
		margin-block-end: 8%;
		padding: 9px 14px;
		box-shadow: none;
		opacity: 1;
		pointer-events: auto;
		transform: none;
	}
}

@media (min-width: 761px) and (max-width: 1100px) {
	.mk-artistas__rejilla {
		gap: 44px 20px;
	}

	.mk-card {
		width: calc(20% - 16px);
	}

	.mk-card__rrss {
		padding: 9px 13px;
	}
}

@media (max-width: 760px) {
	.mk-hero {
		padding-bottom: 40px;
	}

	.mk-hero::before {
		background-size: auto 62%;
		background-position: 50% 48%;
	}

	.mk-hero__top {
		grid-template-columns: 1fr 1fr;
		width: fit-content;
		max-width: 100%;
		margin-inline: auto;
		row-gap: 12px;
	}

	.mk-hero__lema {
		line-height: 1.05;
	}

	.mk-hero__marca {
		grid-area: 2 / 1 / auto / -1;
	}

	body .mk-hero > .mk-hero__frase {
		margin-block-start: 34px;
		line-height: 0.86;
	}

	body .mk-hero > .mk-hero__pie {
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		gap: 16px;
		margin-block-start: 8px;
	}

	body .mk-hero .mk-hero__ctas {
		order: -1;
		flex: 1 1 100%;
		justify-content: flex-start;
		margin-block-end: 24px;
	}

	.mk-hero__inicio,
	.mk-hero__fin {
		gap: 18px;
	}

	.mk-hero__fecha {
		white-space: nowrap;
	}

	.mk-hero__logos img {
		width: 160px;
	}

	.mk-hero__mkt img {
		width: 92px;
	}

	body .mk-hero__ctas .wp-block-button__link,
	body .mk-hero__ctas .is-style-outline > .wp-block-button__link {
		min-height: 44px;
		padding-inline: 18px;
	}

	.mk-artistas__rejilla {
		flex-wrap: nowrap;
		justify-content: flex-start;
		max-width: none;
		margin-inline: -24px;
		padding: 0 24px 12px;
		gap: 20px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.mk-artistas__rejilla::-webkit-scrollbar {
		display: none;
	}

	.mk-card {
		flex: 0 0 62%;
		width: auto;
		scroll-snap-align: center;
	}
}
