/*
Theme Name: Noelia Portfolio
Description: A custom block theme scaffolded by Studio Code.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.2
Version: 1.0.9
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: noelia-portfolio
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, accessibility-ready, style-variations
*/

:root {
	color-scheme: dark;
	--hair: rgb(240 239 236 / 0.18);
	--hair-soft: rgb(240 239 236 / 0.1);
	--hueco: rgb(240 239 236 / 0.05);
	--section: clamp(3.25rem, 7vw, 6.5rem);
}

::selection {
	background: var(--wp--preset--color--text);
	color: var(--wp--preset--color--background);
}

/* WordPress inserts a margin-block-start equal to the block gap (24px unless
   theme.json sets styles.spacing.blockGap) between the template's top-level
   sections (header part, main, footer part) — a gap that exists even when no
   markup asks for it. Zero it so sections butt edge-to-edge and own their
   vertical rhythm via padding; this does not affect block gaps inside nested
   layouts. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* With that gap gone, main carries its own vertical padding so templates this
   theme does not author still clear the header and footer. A descendant
   selector, not a child one. Templates built from full-bleed sections opt out
   with is-flush and let the sections own the rhythm. */
.wp-site-blocks main {
	padding-block: var(--wp--preset--spacing--60, 48px) var(--wp--preset--spacing--70, 64px);
}
.wp-site-blocks main.is-flush {
	padding-block: 0;
}

/* ---------- Desplazamiento suave en los atajos ---------- */
@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* ---------- Header: slim sticky bar ---------- */
header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 60;
	background: var(--wp--preset--color--background);
	border-bottom: 1px solid var(--hair);
}
body.admin-bar header.wp-block-template-part {
	top: 32px;
}
.site-header .wp-block-site-title a {
	text-decoration: none;
}
.site-header .wp-block-navigation-item__content {
	text-decoration: none;
	padding-bottom: 2px;
	border-bottom: 1px solid transparent;
	transition: border-color 240ms ease;
}
.site-header .wp-block-navigation-item__content:hover,
.site-header .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content {
	border-bottom-color: var(--wp--preset--color--text);
}

/* ---------- Sections and the interrupted column ---------- */
.section-text {
	padding-block: var(--section);
}
.section-text--tight {
	padding-block: clamp(1.75rem, 4vw, 3rem);
}
/* Piezas marcadas a sangre: los márgenes en línea que trae el bloque dejaban
   la imagen dentro del margen de la página, así que nunca llegaba al borde.
   Aquí recuperan el ancho completo de la ventana. */
.entry-content > .wp-block-image.alignfull {
	margin-left: calc(-1 * var(--wp--style--root--padding-left, 0px)) !important;
	margin-right: calc(-1 * var(--wp--style--root--padding-right, 0px)) !important;
}
/* Una franja a sangre que debe medir lo mismo que el bloque que tiene debajo
   (el del retrato): mismas medidas que .about-hero-row, medidas desde la
   columna de lectura (640 px), no desde el ancho de la ventana. */
@media (min-width: 1040px) {
	.entry-content > figure.wp-block-image.alignfull.ancho-hero {
		--medida-franja: calc(var(--wp--style--global--content-size, 40rem) + 12vw);
		width: var(--medida-franja) !important;
		max-width: 1200px;
		margin-left: calc((100% - var(--medida-franja)) / 2) !important;
		margin-right: calc((100% - var(--medida-franja)) / 2) !important;
	}
}
@media (min-width: 1440px) {
	.entry-content > figure.wp-block-image.alignfull.ancho-hero {
		width: 1200px !important;
		margin-left: calc((100% - 1200px) / 2) !important;
		margin-right: calc((100% - 1200px) / 2) !important;
	}
}
.band {
	padding-block: 0;
}

/* Pieces inside the reading column break out of it: the column keeps its
   60–68 character measure for type, the images take the room they need. The
   negative margins are half the extra width, so the piece stays centred on the
   column and never depends on 100vw (which would overhang a scrollbar). */
@media (min-width: 1040px) {
	.entry-content .section-text > figure.wp-block-image > img {
		display: block;
		width: calc(100% + 12vw);
		max-width: 1200px;
		margin-inline: -6vw;
	}
}
@media (min-width: 1440px) {
	.entry-content .section-text > figure.wp-block-image > img {
		width: 1200px;
		margin-inline: calc((100% - 1200px) / 2);
	}
}
/* The caption row lives inside the full-bleed band, so WordPress cannot give it
   the content width: align it to the reading column by hand, with the root
gutter kept on small screens. */
.band > .wp-block-group {
	max-width: min(
		calc(100% - 2 * var(--wp--style--root--padding-left, 1.25rem)),
		var(--wp--style--global--content-size)
	);
	margin-block-start: 0;
	margin-inline: auto;
	padding-inline: 0;
}
.section-text,
.band {
	scroll-margin-top: 5rem;
}
/* Los títulos con ancla son destino de los atajos: que la barra fija no los tape. */
.entry-content h1[id],
.entry-content h2[id],
.entry-content h3[id] {
	scroll-margin-top: 5rem;
}
.piece-caption {
	padding-block: 0.875rem 0;
}
.piece-caption .wp-block-paragraph {
	font-size: var(--wp--preset--font-size--label);
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin: 0;
}
.piece-caption .wp-block-paragraph a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
	border-bottom: 1px solid var(--hair);
	padding-bottom: 1px;
}
.piece-caption .wp-block-paragraph a:hover {
	border-bottom-color: var(--wp--preset--color--text);
}

/* Media: full colour, never tinted, cropped to the frame */
/* Menú desplegable del móvil: panel en el negro de la página, texto claro. */
.wp-block-navigation .wp-block-navigation__responsive-container,
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation .wp-block-navigation__responsive-container.has-modal-open {
	background-color: #131313 !important;
	color: #f0efec;
}

.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	background-color: transparent !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	background-color: transparent;
	color: var(--wp--preset--color--text);
}

.wp-block-navigation__responsive-container.is-menu-open a,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--text);
}

/* Ninguna imagen se amplía: sin visor emergente y sin cursor de aumento. */
.wp-lightbox-overlay,
.wp-block-image .wp-lightbox-container button {
	display: none !important;
}
.entry-content img {
	cursor: default !important;
}
/* Las imágenes no se seleccionan, no se arrastran y no ofrecen menú de pulsación
   larga: por ahí se llegaba a "guardar imagen" o "copiar imagen". */
img {
	-webkit-user-select: none;
	user-select: none;
	-webkit-user-drag: none;
	-webkit-touch-callout: none;
}
.wp-block-image.is-style-piece,
.wp-block-image.is-style-piece img {
	margin: 0;
}
.wp-block-image.is-style-piece {
	overflow: hidden;
}
.wp-block-image.is-style-piece img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: contrast(1.03);
	background: var(--hueco);
}
/* La banda ocupa el ancho completo, pero cada pieza se dibuja en su propia
   proporción y sin recorte: nada se agranda para rellenar una altura fija. */
.band .wp-block-image.is-style-piece img {
	aspect-ratio: auto !important;
	width: 100%;
	height: auto !important;
	max-height: none;
	object-fit: contain !important;
}
/* Piezas marcadas como apaisadas en móvil: se recortan a un marco 16:9 en lugar
   de estirarse en vertical, así se leen como banda y no se agrandan. */
@media (max-width: 700px) {
	.movil-apaisada img,
	.band .wp-block-image.movil-apaisada img {
		aspect-ratio: 16 / 9 !important;
		height: auto !important;
		max-height: none;
	}
}

/* ---------- Label style (registered also for the editor) ---------- */
.wp-block-paragraph.is-style-label p,
p.is-style-label {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin: 0;
}

/* ---------- Hairline-ruled index of disciplines ---------- */
.index-row {
	padding-block: 1.35rem;
	border-top: 1px solid var(--hair);
	align-items: baseline;
	gap: 1rem 1.5rem;
}
.index-row:last-child {
	border-bottom: 1px solid var(--hair);
}
.index-row .wp-block-heading {
	margin: 0;
	font-size: clamp(1.15rem, 2.2vw, 1.5rem);
	flex: 1 1 12rem;
}
.index-row .wp-block-heading a {
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 240ms ease;
}
.index-row .wp-block-heading a:hover {
	border-bottom-color: var(--wp--preset--color--text);
}
.index-row .index-note {
	flex: 0 1 20rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
	margin: 0;
}
.index-row .index-num {
	flex: 0 0 2.5rem;
}

/* ---------- Rules ---------- */
.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--hair);
	opacity: 1;
	margin-block: 0;
}
.wp-block-separator.is-style-hairline-soft {
	border-top-color: var(--hair-soft);
}

/* ---------- Forms ---------- */
.wp-block-jetpack-contact-form {
	gap: 1.25rem !important;
}
.wp-block-jetpack-contact-form .jetpack-field {
	margin: 0;
}
.wp-block-jetpack-contact-form label,
.wp-block-jetpack-contact-form .jetpack-field-label {
	font-size: var(--wp--preset--font-size--label);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}
/* Jetpack prints its required marker in English; the field already carries the
   required attribute, so the marker is redundant in a Spanish form. */
.wp-block-jetpack-contact-form .grunion-label-required {
	display: none;
}
.wp-block-jetpack-contact-form input[type="text"],
.wp-block-jetpack-contact-form input[type="email"],
.wp-block-jetpack-contact-form input[type="tel"],
.wp-block-jetpack-contact-form input[type="url"],
.wp-block-jetpack-contact-form textarea {
	width: 100%;
	background: transparent;
	border: 1px solid var(--hair);
	border-radius: 0;
	padding: 0.75rem 0.875rem;
	font-family: var(--wp--preset--font-family--figtree);
	font-size: 1rem;
	color: var(--wp--preset--color--text);
}
.wp-block-jetpack-contact-form input:focus,
.wp-block-jetpack-contact-form textarea:focus {
	outline: 1px solid var(--wp--preset--color--text);
	outline-offset: -1px;
	border-color: var(--wp--preset--color--text);
}

/* ---------- Footer ---------- */
footer.wp-block-template-part {
	border-top: 1px solid var(--hair);
}
.site-footer .wp-block-paragraph {
	margin: 0;
}
.site-footer a {
	text-decoration: none;
	border-bottom: 1px solid var(--hair);
}
.site-footer a:hover {
	border-bottom-color: var(--wp--preset--color--text);
}

/* ---------- Motion (final state first; JS adds the hidden start) ---------- */
html.js-reveal .reveal {
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 600ms ease, transform 600ms ease;
}
html.js-reveal .reveal.is-visible {
	opacity: 1;
	transform: none;
}
@media (prefers-reduced-motion: reduce) {
	html.js-reveal .reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.site-header .wp-block-navigation-item__content,
	.index-row .wp-block-heading a {
		transition: none;
	}
}

/* ---------- Small screens ---------- */
@media (max-width: 700px) {
	.site-header .wp-block-navigation {
		font-size: 0.625rem;
	}
	.index-row {
		align-items: flex-start;
	}
	.index-row .index-note {
		flex: 1 1 100%;
	}
}

/* ---------- Sobre mí: retrato junto al texto ---------- */
.about-hero-row {
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: flex-start;
}
/* La fila del retrato rompe la columna de lectura. WordPress fija los márgenes
   laterales de los hijos de un layout constrained con !important, así que aquí
   hay que igualarlo y ganar por especificidad. */
@media (min-width: 1040px) {
	.entry-content .section-text > .about-hero-row {
		width: calc(100% + 12vw);
		max-width: 1200px;
		margin-left: -6vw !important;
		margin-right: -6vw !important;
	}
}
@media (min-width: 1440px) {
	.entry-content .section-text > .about-hero-row {
		width: 1200px;
		margin-left: calc((100% - 1200px) / 2) !important;
		margin-right: calc((100% - 1200px) / 2) !important;
	}
}
/* La foto se centra en su columna aunque el bloque traiga una alineación o un
   ancho fijado a mano (core/.wp-block-image.alignleft pesa más que una clase
   suelta, de ahí el selector con .entry-content). */
.entry-content .about-photo,
.entry-content .about-photo.alignleft,
.entry-content .about-photo.alignright {
	display: flex;
	justify-content: center;
	align-items: center;
	float: none;
	margin: 0;
}
.about-photo img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin-inline: auto;
	object-fit: cover;
	filter: contrast(1.03);
	background: var(--hueco);
}
.about-photo-caption {
	margin-block-start: 0.6rem;
}

/* ---------- Programas: rejilla con un hueco para el icono ---------- */
.tool-cat + .tool-cat {
	margin-block-start: 1.5rem;
}
.tool-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.75rem 2rem;
	margin-block-start: 0.65rem;
}
.tool {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}
.tool p {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.35;
}
.tool figure.icon-slot {
	flex: 0 0 30px;
	width: 30px;
	margin: 0;
}
.tool .icon-slot img {
	width: 30px;
	height: 30px;
	display: block;
	object-fit: contain;
	filter: none;
}
@media (max-width: 600px) {
	.tool-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Rejilla de vídeos ---------- */
.video-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(1rem, 2.5vw, 1.75rem);
}
@media (min-width: 1040px) {
	.entry-content .section-text > .video-grid {
		width: calc(100% + 12vw);
		max-width: 1200px;
		margin-left: -6vw !important;
		margin-right: -6vw !important;
	}
}
@media (min-width: 1440px) {
	.entry-content .section-text > .video-grid {
		width: 1200px;
		margin-left: calc((100% - 1200px) / 2) !important;
		margin-right: calc((100% - 1200px) / 2) !important;
	}
}
.video-grid > * {
	margin-block: 0;
}
.video-grid > .video-cell {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	margin-block: 0;
}
.video-cell .video-name {
	margin: 0;
}
.video-cell > * {
	margin-block: 0;
}
/* El bloque de vídeo está vacío hasta que se suba el archivo: el marco 16:9 y el
   filete los pone el CSS, y se mantienen cuando el vídeo entra en el bloque. */
.video-slot {
	margin: 0;
	aspect-ratio: 16 / 9;
	background: var(--hueco);
	border: 1px solid var(--hair);
	overflow: hidden;
}
.video-slot video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: #000;
}
@media (max-width: 700px) {
	.video-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Mosaico de imágenes, sin separación ---------- */
.mosaic-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0;
}
.mosaic-grid > .mosaic-item {
	display: block;
	margin: 0;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--hueco);
}
.mosaic-grid > .mosaic-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}
@media (min-width: 1040px) {
	.entry-content .section-text > .mosaic-grid {
		width: calc(100% + 12vw);
		max-width: 1200px;
		margin-left: -6vw !important;
		margin-right: -6vw !important;
	}
}
@media (min-width: 1440px) {
	.entry-content .section-text > .mosaic-grid {
		width: 1200px;
		margin-left: calc((100% - 1200px) / 2) !important;
		margin-right: calc((100% - 1200px) / 2) !important;
	}
}
@media (max-width: 700px) {
	.mosaic-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Rejilla de vídeos en vertical (9:16) ---------- */
.video-grid.video-grid--vertical {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}
.video-grid.video-grid--vertical .video-slot {
	aspect-ratio: 9 / 16;
}
@media (max-width: 900px) {
	.video-grid.video-grid--vertical {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- Rejilla de tres vídeos horizontales ---------- */
.video-grid.video-grid--three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 700px) {
	.video-grid.video-grid--three {
		grid-template-columns: 1fr;
	}
}

/* ---------- Rejillas de imágenes: 2, 4 y 3 columnas ---------- */
.img-grid {
	display: grid;
	gap: clamp(0.75rem, 2vw, 1.625rem);
}
.img-grid > .img-cell {
	display: block;
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--hueco);
}
.img-grid > .img-cell img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}
.img-grid--two {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
.img-grid--three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.img-grid--four {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
	.img-grid--three,
	.img-grid--four {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
/* Celdas verticales (3:4) cuando la obra es de pie. */
.img-grid.img-grid--portrait > .img-cell {
	aspect-ratio: 3 / 4;
}
/* Sin recorte: la celda toma la altura real de la fotografía. */
.img-grid.img-grid--natural > .img-cell {
	aspect-ratio: auto;
	background: none;
}
.img-grid.img-grid--natural > .img-cell img {
	height: auto;
	object-fit: contain;
}
@media (min-width: 1040px) {
	.entry-content .section-text > .img-grid {
		width: calc(100% + 12vw);
		max-width: 1200px;
		margin-left: -6vw !important;
		margin-right: -6vw !important;
	}
}
@media (min-width: 1440px) {
	.entry-content .section-text > .img-grid {
		width: 1200px;
		margin-left: calc((100% - 1200px) / 2) !important;
		margin-right: calc((100% - 1200px) / 2) !important;
	}
}

/* Etiqueta pequeña bajo cada pieza de una rejilla de imágenes. */
.img-cell-wrap {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	margin-block: 0;
}
.img-cell-wrap > * {
	margin-block: 0;
}
.img-cell-wrap .img-name {
	margin: 0;
}
