/*
Theme Name: La Vitrina de Juana
Theme URI: https://lavitrinadejuana.com
Description: Child theme of Twenty Twenty-Five for La Vitrina de Juana.
Author: Pedro&Juana
Template: twentytwentyfive
Version: 0.5.0
Requires at least: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lavitrina
*/

/*
 * Most styling lives in theme.json (colors, type, spacing).
 * Use this file only for details theme.json can't express.
 */

/* Keep the footer at the bottom of the window, even on short pages. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > footer:last-child {
	margin-block-start: auto;
}

/* ------------------------------------------------------------------
 * Portada — Frame 0
 *
 * Sizes from the design, in points (1 pt = 1 px), live in theme.json →
 * settings.custom.hero. --lv-u is one design point; it shrinks only on
 * phones narrower than ~430 px so the longest line still fits.
 * ------------------------------------------------------------------ */

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

:root {
	/* The longest line (the dates, ~392 pt with tracking) must fit the screen. */
	--lv-u: min(1px, calc((100vw - 2.5rem) / 392));
}

.lv-portada {
	margin: 0;
}

.lv-hero {
	--lv-margen: var(--wp--custom--hero--margen);
	--lv-separacion: calc(var(--wp--custom--hero--separacion) * var(--lv-u)); /* 10 mm */
	box-sizing: border-box;
	min-height: calc(100svh - var(--wp-admin--admin-bar--height, 0px));
	padding: var(--lv-margen);
	display: grid;
	grid-template-columns: repeat(3, max-content);
	justify-content: center; /* the whole group sits in the middle */
	align-content: center;
	align-items: center; /* titles centered on the middle block */
	column-gap: var(--lv-separacion);
	overflow: hidden;
}

.lv-hero > * {
	margin: 0 !important;
}

/* "La vitrina" · "de Juana" — Century Std Light 62 / 74,
   horizontal scale 50 %, tracking 0.
   CSS can't narrow a font's layout box, so the text is squeezed with
   `scale` and portada.js sets the box to the squeezed width. */
.lv-hero__titulo {
	font-family: var(--wp--preset--font-family--century-std);
	font-weight: 300;
	font-size: calc(var(--wp--custom--hero--titulo) * var(--lv-u));
	line-height: calc(var(--wp--custom--hero--titulo-interlineado) * var(--lv-u));
	letter-spacing: 0;
	white-space: nowrap;
	scale: var(--wp--custom--hero--titulo-escala) 1;
	transform-origin: left center;
}

.lv-hero__izq { justify-self: end; }
.lv-hero__der { justify-self: start; }

/* ------------------------------------------------------------------
 * The scene block (.lv-escena) — used in the escena posts and as the
 * fallback in the template. Plain text = Century Std Light 14;
 * bold text = Mono45 Headline Bold 25, in capitals. Leading 23 for all.
 * ------------------------------------------------------------------ */

.lv-escena {
	font-family: var(--wp--preset--font-family--century-std);
	font-weight: 300;
	font-size: calc(var(--wp--custom--hero--etiqueta) * var(--lv-u));
	line-height: calc(var(--wp--custom--hero--interlineado) * var(--lv-u));
	text-align: center;
}

.lv-escena > *,
.lv-escena p {
	margin: 0 !important;
}

/* The Mono45 text sets the 23 pt line; the Century text adds no height,
   so its baseline shift doesn't open up the leading. */
.lv-escena p {
	line-height: 0;
}

.lv-escena strong,
.lv-escena b {
	font-family: var(--wp--preset--font-family--mono-45-headline);
	font-weight: 700;
	font-size: calc(var(--wp--custom--hero--nombre) * var(--lv-u));
	line-height: calc(var(--wp--custom--hero--interlineado) * var(--lv-u));
	letter-spacing: var(--wp--custom--hero--tracking-nombre); /* tracking 100 */
	text-transform: uppercase;
	/* Baseline shift: the labels ("Curaduría", "1er escenario") sit 10 pt
	   above the names' baseline. Moving the names down by 10 pt instead
	   gives the same result while the plain text stays editable. */
	vertical-align: calc(var(--wp--custom--hero--desplazamiento-etiqueta) * var(--lv-u) * -1);
}

/* "1er", "2do": raised without opening up the leading */
.lv-escena sup {
	font-size: 0.64em;
	line-height: 0;
	vertical-align: baseline;
	position: relative;
	top: -0.5em;
}

.lv-escena a {
	color: inherit;
	text-decoration: none;
}

.lv-escena a:hover,
.lv-escena a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.15em;
	text-decoration-thickness: 0.08em;
}

/* Below ~1040 px the three columns don't fit: "La vitrina" above,
   "de Juana" below, 10 mm from the block, all centered. */
@media (max-width: 1040px) {
	.lv-hero {
		grid-template-columns: max-content;
		row-gap: var(--lv-separacion);
		justify-items: center;
	}

	.lv-hero__izq,
	.lv-hero__der {
		justify-self: center;
	}
}

/* ------------------------------------------------------------------
 * Frames below the portada (posts in the category PORTADA)
 *
 * Plain text: Century Std Light 21 / 23, tracking 0 (italic with Ctrl+I).
 * Bold text:  Mono45 Headline Bold 21 / 23, capitals, tracking 100.
 * Superscript (e.g. "1er") uses the same raise as the portada.
 * Sizes: theme.json → settings.custom.frame
 * ------------------------------------------------------------------ */

.lv-frames {
	margin: 0 !important;
}

.lv-frame {
	box-sizing: border-box;
	min-height: calc(100svh - var(--wp-admin--admin-bar--height, 0px));
	padding: var(--wp--custom--hero--margen);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	scroll-margin-top: var(--wp-admin--admin-bar--height, 0px);
}

/* A frame taller than the screen gets extra room after its text, so the
   end can be read before the next jump. portada.js sets .is-alto. */
.lv-frame.is-alto {
	padding-block-end: max(var(--wp--custom--hero--margen), var(--wp--custom--frame--respiro));
}

/* Width of the text column in a frame */
.lv-frame__texto {
	width: 100%;
	max-width: var(--wp--custom--frame--ancho);
}

/* Post text — the same in the frames, on single post pages and in the
   block editor (whose content area is .wp-block-post-content). */
.lv-frame__texto,
.wp-block-post-content {
	font-family: var(--wp--preset--font-family--century-std);
	font-weight: 300;
	font-size: calc(var(--wp--custom--frame--texto) * var(--lv-u));
	line-height: calc(var(--wp--custom--frame--interlineado) * var(--lv-u));
	letter-spacing: 0;
}

/* One empty line (23 pt) between paragraphs, images, etc. */
.lv-frame__texto > *,
.wp-block-post-content.wp-block-post-content > * {
	margin-block: 0 calc(var(--wp--custom--frame--interlineado) * var(--lv-u));
}

.lv-frame__texto > *:last-child,
.wp-block-post-content.wp-block-post-content > *:last-child {
	margin-block-end: 0;
}

.lv-frame__texto strong,
.lv-frame__texto b,
.wp-block-post-content strong,
.wp-block-post-content b {
	font-family: var(--wp--preset--font-family--mono-45-headline);
	font-weight: 700;
	font-style: normal;
	letter-spacing: var(--wp--custom--frame--tracking-mono);
	text-transform: uppercase;
}

/* Mono45 has no italic: italic inside bold stays upright. */
.lv-frame__texto strong em,
.lv-frame__texto em strong,
.wp-block-post-content strong em,
.wp-block-post-content em strong {
	font-style: normal;
}

.lv-frame__texto sup,
.wp-block-post-content sup {
	font-size: 0.64em;
	line-height: 0;
	vertical-align: baseline;
	position: relative;
	top: -0.5em;
}

.lv-frame__texto img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-inline: auto;
}

/* Touch screens: a swipe near the start of a frame settles on it, but a
   long frame can be read to its end without being pulled away. Mouse and
   keyboard jumps are handled by portada.js. */
@media (pointer: coarse) {
	html {
		scroll-snap-type: y proximity;
	}

	.lv-hero,
	.lv-frame {
		scroll-snap-align: start;
	}
}

/* Animation states, set by portada.js */
.lv-intro .lv-hero {
	visibility: hidden;
}

.lv-hero.is-preparado .lv-hero__centro {
	clip-path: var(--lv-recorte-inicial);
	opacity: 0;
}

.lv-hero.is-animando .lv-hero__titulo {
	transition: translate var(--wp--custom--hero--duracion) cubic-bezier(0.65, 0, 0.35, 1);
}

.lv-hero.is-animando .lv-hero__centro {
	transition:
		clip-path var(--wp--custom--hero--duracion) cubic-bezier(0.65, 0, 0.35, 1),
		opacity calc(var(--wp--custom--hero--duracion) * 0.5) ease-out;
}

.lv-hero.is-animando:not(.is-preparado) .lv-hero__centro {
	clip-path: inset(0 0 0 0);
	opacity: 1;
}

/* ------------------------------------------------------------------
 * Single post page
 *
 * Title: the same as bold text in a post — Mono45 Headline Bold 21 / 23,
 * capitals, tracking 100 (theme.json → settings.custom.frame).
 * ------------------------------------------------------------------ */

.wp-block-post-title.lv-titulo-entrada {
	font-family: var(--wp--preset--font-family--mono-45-headline);
	font-weight: 700;
	font-size: calc(var(--wp--custom--frame--texto) * var(--lv-u));
	line-height: calc(var(--wp--custom--frame--interlineado) * var(--lv-u));
	letter-spacing: var(--wp--custom--frame--tracking-mono);
	text-transform: uppercase;
}
