/* =========================================================================
   UNIVERSIMAGOS — capa responsive
   -------------------------------------------------------------------------
   El escritorio (>= 1024 px) sigue viviendo en universimagos.css.
   Acá se define el sitio para celular y tablet, con el contenido real de
   WordPress. No hay una maqueta distinta: la misma página, más chica.

   Base: 0–767 px · Tablet: 768–1023 px · Escritorio: 1024+ px

   Criterios:
   - el contador de preventa es lo único que queda sticky;
   - los botones van a todo el ancho y miden 52 px de alto;
   - las cartas se dan vuelta con un tap (no hay hover en táctil);
   - ninguna sección oscura pierde su borde desgarrado;
   - el orden de las secciones es el que ya tiene WordPress.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Cartas: tap para girar en pantallas sin hover
   ---------------------------------------------------------------------- */

body.um .um-carta {
	touch-action: manipulation;
}

body.um .um-carta.is-volteada .um-carta__int {
	transform: rotateY(180deg);
}

@media (hover: none) {
	body.um .um-carta {
		-webkit-tap-highlight-color: transparent;
	}
}

/* -------------------------------------------------------------------------
   2. Base de lectura
   ---------------------------------------------------------------------- */

@media (max-width: 1023px) {
	body.um {
		--um-pad: 20px;
		--um-sec: 44px;
	}

	/* La cabecera acompaña el scroll; el contador es lo único fijo. */
	body.um #masthead.site-header {
		position: relative;
		top: auto;
		z-index: 50;
	}

	body.um #masthead .inside-header {
		min-height: 64px;
		padding: 0 20px;
	}

	body.um #masthead .main-title {
		font-size: 1.4rem;
		line-height: 0.9;
	}

	body.um #masthead .menu-toggle {
		width: 44px;
		height: 44px;
		padding: 0;
	}

	body.um #masthead .menu-toggle .gp-icon svg {
		width: 24px;
		height: 24px;
	}

	/* Contador sticky: se queda arriba cuando se fue la cabecera. */
	body.um .um-cuenta {
		position: sticky;
		top: 0;
		z-index: 55;
	}

	body.um .um-cuenta__fila {
		justify-content: space-between;
		gap: 8px;
		padding: 8px 16px;
		min-height: 36px;
	}

	body.um .um-cuenta__texto {
		font-size: 0.58rem;
		letter-spacing: 0.12em;
		white-space: nowrap;
	}

	body.um .um-cuenta__reloj {
		font-size: 0.72rem;
		letter-spacing: 0.04em;
	}

	body.um .um-cuenta__u {
		font-size: 0.58rem;
		margin-right: 0.2rem;
	}

	body.um {
		font-size: 15px;
		line-height: 1.65;
	}

	body.um p,
	body.um li {
		max-width: none;
	}

	body.um h1 {
		font-size: clamp(2.6rem, 10.5vw, 3.4rem);
		line-height: 0.94;
	}

	body.um h2 {
		font-size: clamp(1.8rem, 7vw, 2.4rem);
		line-height: 1;
	}

	body.um h3 {
		font-size: 1.35rem;
	}

	body.um .um-lead {
		font-size: 0.96rem;
		line-height: 1.6;
	}

	body.um .um-sec {
		padding-block: 40px 36px;
	}

	body.um .um-sec--ajustada {
		padding-block: 28px 26px;
	}

	/* Cuando una sección oscura corta con una clara, el título no puede
	   quedar debajo del borde desgarrado (FAQ, documentos, etc.). */
	body.um .um-sec--tinta + .um-sec {
		padding-top: 2.6rem !important;
	}

	body.um .um-acciones {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
		margin-top: 1.6rem;
	}

	body.um .um-acciones .um-btn,
	body.um .um-acciones .button {
		width: 100%;
		min-height: 52px;
		font-size: 0.78rem;
	}
}

/* -------------------------------------------------------------------------
   3. Celular
   ---------------------------------------------------------------------- */

@media (max-width: 767px) {
	/* --- Hero --- */
	body.um .um-hero {
		padding-block: 32px 28px;
	}

	body.um .um-hero__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 26px;
	}

	body.um .um-hero__grid > figure {
		order: 2;
	}

	body.um .um-hero__grid > div {
		order: 1;
	}

	body.um .um-hero__titulo {
		font-size: clamp(3rem, 13vw, 4.4rem);
		margin-bottom: 0.8rem;
	}

	body.um .um-hero__subtitulo {
		font-size: clamp(1.3rem, 5.4vw, 1.7rem);
		margin-bottom: 1rem;
	}

	body.um .um-hero__bajada {
		font-size: 0.96rem;
		line-height: 1.6;
		margin-bottom: 1.2rem;
	}

	body.um .um-hero__nota {
		font-size: 0.66rem;
		margin-top: 1.2rem;
	}

	body.um .um-carrusel {
		width: min(76vw, 300px);
	}

	/* --- Ficha --- */
	body.um .um-ficha {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		border: 0;
		gap: 12px;
		margin-block: 20px 0;
	}

	body.um .um-ficha > div {
		display: flex;
		flex-direction: column;
		border: 0;
		border-top: 2px solid var(--um-tinta);
		padding: 8px 0 0;
	}

	body.um .um-ficha dt {
		order: 2;
		font-size: 0.54rem;
		letter-spacing: 0.14em;
		margin: 4px 0 0;
		opacity: 0.7;
	}

	body.um .um-ficha dd {
		order: 1;
		font-size: 1.65rem;
		line-height: 1;
	}

	/* --- Grillas y tarjetas --- */
	body.um .um-grid--2,
	body.um .um-grid--3,
	body.um .um-grid--4 {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	body.um .um-card {
		padding: 20px;
	}

	body.um .um-card__numero {
		font-size: 2.2rem;
	}

	/* --- Personajes: dos por fila --- */
	body.um .um-reparto {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 22px 14px;
		padding-block: 28px 36px;
		align-items: end;
	}

	body.um .um-reparto__item {
		width: 100%;
		margin: 0;
	}

	body.um .um-reparto__item:nth-child(odd) {
		transform: rotate(-1.5deg);
	}

	body.um .um-reparto__item:nth-child(even) {
		transform: rotate(1.5deg);
	}

	body.um .um-reparto__item:hover {
		transform: rotate(0) translateY(-4px);
	}

	body.um .um-reparto__nombre {
		min-height: 0;
		margin-top: 8px;
		padding-top: 0;
		background: transparent;
	}

	body.um .um-reparto__nombre strong {
		font-size: 0.95rem;
	}

	body.um .um-reparto__nombre a {
		font-size: 0.54rem;
	}

	/* --- Cierre --- */
	body.um .um-sec--ajustada h2 {
		font-size: clamp(2rem, 9vw, 2.6rem);
	}

	/* --- Mazos --- */
	body.um .um-mazos {
		grid-template-columns: minmax(0, 1fr);
		gap: 18px;
	}

	body.um .um-mazo {
		min-height: 0;
		padding: 20px;
	}

	body.um .um-mazo__degradado {
		display: none;
	}

	/* La caja pendiente pasa a ser una franja arriba del texto. */
	body.um .um-mazo__fondo {
		position: relative;
		top: auto;
		right: auto;
		width: 100%;
		height: 92px;
		aspect-ratio: auto;
		transform: none;
		margin: 0 0 1.1rem;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	body.um .um-mazo__vacia {
		font-size: 0.54rem;
		letter-spacing: 0.12em;
		padding: 0.4rem;
	}

	body.um .um-mazo p {
		max-width: none;
	}

	body.um .um-mazo__link {
		margin-top: 1rem;
	}

	/* --- Documentos, índice y FAQ --- */
	body.um .um-doc {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}

	body.um .um-toc {
		position: static;
	}

	body.um .um-toc--estatico ol {
		columns: 1;
	}

	body.um .um-doc__cuerpo {
		max-width: none;
	}

	body.um .um-doc__cuerpo h2 {
		margin-top: 2.2rem;
		padding-top: 1.1rem;
	}

	body.um .um-faq summary {
		font-size: 1.05rem;
		line-height: 1.2;
	}

	/* Cada grupo de preguntas arranca con aire; si no, se pega al anterior. */
	body.um .um-faq + h2 {
		margin-top: 2.4rem;
		margin-bottom: 0.9rem;
	}

	body.um .um-faq details {
		padding: 1rem 0;
	}

	body.um .um-faq details > *:not(summary) {
		font-size: 0.94rem;
	}

	body.um .um-acordeon h2,
	body.um .um-sec h2 {
		scroll-margin-top: 52px;
	}

	/* --- Contacto: el mail como botón --- */
	body.um .um-sec .um-acciones:only-child {
		margin-top: 0;
	}

	/* --- Pie --- */
	body.um .site-footer {
		padding-block: 36px 24px;
	}

	body.um .site-footer .um-wrap {
		padding-inline: 20px;
	}

	body.um .um-footer__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 26px;
	}

	body.um .um-footer__legal {
		flex-direction: column;
		gap: 4px;
		margin-top: 2rem;
	}

	body.um .um-footer__lista {
		font-size: 0.86rem;
	}

	/* --- Novedades --- */
	body.um.blog .site-main > .um-sec {
		padding-block: 40px 36px;
	}

	body.um.blog .um-card h3 {
		font-size: 1.3rem;
	}

	/* --- Grupo de cartas estático --- */
	body.um .um-grupo--escena {
		width: 100%;
	}

	body.um .um-grupo[data-movimiento="estatico"] .um-grupo__item {
		flex-basis: calc(50% - 0.5rem);
		width: calc(50% - 0.5rem);
	}
}

/* -------------------------------------------------------------------------
   4. Tablet
   ---------------------------------------------------------------------- */

@media (min-width: 768px) and (max-width: 1023px) {
	body.um .um-sec {
		padding-block: 56px 48px;
	}

	body.um .um-sec--ajustada {
		padding-block: 36px 32px;
	}

	body.um .um-hero {
		padding-block: 48px 44px;
	}

	body.um .um-hero__grid {
		gap: 34px;
	}

	body.um .um-hero__titulo {
		font-size: clamp(2.8rem, 6vw, 4rem);
	}

	body.um .um-hero__subtitulo {
		font-size: clamp(1.4rem, 2.8vw, 1.8rem);
	}

	body.um .um-carrusel {
		width: min(32vw, 300px);
	}

	body.um .um-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	body.um .um-grid--2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body.um .um-reparto {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 12px;
		align-items: end;
		padding-block: 28px 36px;
	}

	body.um .um-reparto__item {
		width: 100%;
		margin: 0;
	}

	body.um .um-reparto__item:nth-child(odd) {
		transform: rotate(-1.5deg);
	}

	body.um .um-reparto__item:nth-child(even) {
		transform: rotate(1.5deg);
	}

	body.um .um-reparto__item:hover {
		transform: rotate(0) translateY(-4px);
	}

	body.um .um-reparto__nombre {
		min-height: 0;
		background: transparent;
	}

	body.um .um-mazos {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	body.um .um-mazo {
		min-height: 0;
		padding: 20px;
	}

	body.um .um-mazo__degradado {
		display: none;
	}

	body.um .um-mazo__fondo {
		position: relative;
		top: auto;
		right: auto;
		width: 100%;
		height: 80px;
		aspect-ratio: auto;
		transform: none;
		margin: 0 0 1rem;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	body.um .um-mazo__vacia {
		font-size: 0.52rem;
		letter-spacing: 0.12em;
		padding: 0.4rem;
	}

	body.um .um-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px;
	}

	body.um .um-footer__grid > div:first-child {
		grid-column: 1 / -1;
	}

	body.um .um-faq summary {
		font-size: 1.15rem;
	}

	body.um .um-doc {
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}

	body.um .um-toc {
		position: static;
	}

	body.um .um-toc--estatico ol {
		columns: 2;
	}
}

/* La portada recién se parte en dos columnas cuando hay ancho de sobra. */
@media (min-width: 900px) and (max-width: 1023px) {
	body.um .um-hero__grid {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
		align-items: center;
	}
}

/* -------------------------------------------------------------------------
   5. Movimiento reducido
   ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	body.um .um-carta,
	body.um .um-grupo__item,
	body.um .um-grupo__item > .um-carta {
		transition: none !important;
	}
}
