/**
 * Estilos compartidos por los bloques del portfolio: tokens, retícula,
 * etiquetas, enlaces, pies de foto, el hero de tres columnas y el visor.
 *
 * Los colores y medidas son variables (--nog-*): el tema puede
 * cambiarlas. Breakpoint único: 760px.
 */

:root {
	--nog-bg: #f4f3f0;
	--nog-bg-hover: #ecebe7;
	--nog-placeholder: #e7e6e2;
	--nog-ink: #161615;
	--nog-ink-2: #2b2b29;
	--nog-ink-3: #3d3d3a;
	--nog-muted: #6b6a65;
	--nog-rule: rgba(22, 22, 21, 0.12);
	--nog-rule-strong: rgba(22, 22, 21, 0.3);
	--nog-error: oklch(0.52 0.18 30);
	--nog-sans: "Geist", "Geist Variable", system-ui, sans-serif;
	--nog-mono: "Geist Mono", "Geist Mono Variable", ui-monospace, monospace;
	--nog-gap: 24px;
	--nog-pad: 32px;
	--nog-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (max-width: 759px) {
	:root {
		--nog-pad: 20px;
	}
}

[class*="nog-"],
[class*="nog-"]::before,
[class*="nog-"]::after {
	box-sizing: border-box;
}

/* Retícula de 12 columnas ------------------------------------------- */

.nog-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--nog-gap);
}

/* Tipografía utilitaria ---------------------------------------------- */

.nog-mono-label,
.nog-mono-xs,
.nog-label,
.nog-link,
.nog-caption {
	font-family: var(--nog-mono);
	font-size: 10.5px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	line-height: 1.6;
}

.nog-mono-label {
	margin: 0;
	line-height: 1.8;
}

.nog-mono-xs,
.nog-caption--xs {
	font-size: 9.5px;
	line-height: 1.7;
}

.nog-mono-p {
	margin: 0;
	font-family: var(--nog-mono);
	font-size: 11px;
	line-height: 1.7;
}

.nog-num {
	font-size: 18px;
	letter-spacing: -0.01em;
}

.nog-muted {
	color: var(--nog-muted);
}

.nog-ink {
	color: var(--nog-ink);
}

.nog-ink-3 {
	color: var(--nog-ink-3);
}

.nog-h2-xl {
	margin: 0;
	font-weight: 500;
	font-size: clamp(40px, 4vw, 72px);
	line-height: 0.95;
	letter-spacing: -0.045em;
}

/* Etiqueta de sección: texto + línea de 40×1px ------------------------ */

.nog-label {
	display: flex;
	align-items: center;
	gap: 20px;
	color: var(--nog-ink-3);
}

.nog-label__rule {
	display: inline-block;
	flex: none;
	width: 40px;
	height: 1px;
	background: var(--nog-rule-strong);
}

.nog-label--coords {
	color: var(--nog-ink);
}

.nog-label--section {
	margin-bottom: 28px;
}

/* Enlace subrayado con flecha ---------------------------------------- */

.nog-link {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 10px;
	padding: 0 0 4px;
	border: 0;
	border-bottom: 1px solid var(--nog-ink);
	background: none;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.3s;
}

.nog-link:hover,
.nog-link:focus-visible {
	opacity: 0.6;
}

.nog-link[aria-disabled="true"] {
	opacity: 0.4;
	cursor: default;
}

/* Pie de foto: título a la izquierda, dato a la derecha --------------- */

.nog-caption {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

/* Imágenes ------------------------------------------------------------ */

.nog-img {
	display: block;
	max-width: none;
	height: auto;
}

.nog-thumb {
	display: flex;
	flex-direction: column;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.nog-thumb__frame {
	display: block;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	background: var(--nog-placeholder);
}

.nog-thumb__frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.4s var(--nog-ease);
}

.nog-thumb:hover img {
	transform: scale(1.03);
}

/* Hero de tres columnas ----------------------------------------------- */

.nog-hero {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--nog-gap);
	row-gap: 40px;
	align-items: stretch;
	min-height: calc(100vh - 66px);
	padding: 6vh var(--nog-pad) 10vh;
}

.nog-hero__text {
	display: flex;
	flex-direction: column;
	grid-column: 1 / span 4;
	justify-content: space-between;
	gap: 48px;
}

.nog-hero__intro {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.nog-hero__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 40px;
}

.nog-hero__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 28px;
}

.nog-hero__title {
	margin: 0;
	font-weight: 500;
	font-size: clamp(48px, 5.4vw, 100px);
	line-height: 0.94;
	letter-spacing: -0.05em;
	text-wrap: balance;
}

.nog-hero__title--home {
	font-size: clamp(44px, 4.8vw, 88px);
	line-height: 0.98;
	letter-spacing: -0.045em;
}

.nog-hero__subtitle {
	margin: 0;
	font-size: clamp(18px, 1.5vw, 22px);
	letter-spacing: -0.01em;
	color: var(--nog-muted);
}

.nog-hero__media {
	display: flex;
	flex-direction: column;
	grid-column: 5 / span 6;
	align-self: start;
	gap: 12px;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	text-decoration: none;
}

a.nog-hero__media:not([href]) {
	cursor: default;
}

.nog-hero__media.is-zoom {
	cursor: zoom-in;
}

.nog-hero__frame {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 5 / 4;
	background: var(--nog-placeholder);
}

.nog-hero__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.6s ease;
}

.nog-hero__img.is-active {
	opacity: 1;
}

/* En la home el cambio es más lento y la foto entrante se acerca. */
.nog-hero--home .nog-hero__img {
	transform: scale(1.05);
	transition: opacity 1.1s ease, transform 6s var(--nog-ease);
}

.nog-hero--home .nog-hero__img.is-active {
	transform: scale(1);
}

/* Franja lateral */

.nog-rail {
	display: flex;
	flex-direction: column;
	grid-column: 11 / -1;
	align-items: stretch;
	gap: 28px;
	padding-top: 20px;
}

.nog-rail__count {
	font-size: 18px;
	letter-spacing: -0.01em;
}

.nog-rail__line {
	width: 1px;
	height: 72px;
	background: rgba(22, 22, 21, 0.4);
}

.nog-rail__list {
	display: flex;
	flex-direction: column;
	gap: 8px 18px;
}

.nog-rail__item {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-family: var(--nog-mono);
	font-size: 11px;
	line-height: 1.3;
	text-align: left;
	text-decoration: none;
	opacity: 0.38;
	cursor: pointer;
	transition: opacity 0.4s;
}

.nog-hero--home .nog-rail__item {
	transition-duration: 0.5s;
}

.nog-rail__item.is-active,
.nog-rail__item:hover,
.nog-rail__item:focus-visible {
	opacity: 1;
}

.nog-rail__item[aria-disabled="true"] {
	cursor: default;
}

/* Índice de la entrada */

.nog-hero--post .nog-rail__list {
	gap: 10px 18px;
}

.nog-rail__toc {
	display: flex;
	flex-direction: column;
	gap: 2px;
	opacity: 0.55;
	transition-duration: 0.3s;
}

.nog-rail__toc span:first-child {
	font-size: 9.5px;
}

.nog-hero.has-no-toc .nog-rail {
	visibility: hidden;
}

/* Aviso solo para el editor ------------------------------------------- */

.nog-notice {
	margin: 0;
	padding: 24px var(--nog-pad);
	border: 1px dashed var(--nog-rule-strong);
	font-family: var(--nog-mono);
	font-size: 11px;
	color: var(--nog-muted);
}

/* Visor a pantalla completa ------------------------------------------- */

.nog-viewer {
	position: fixed;
	inset: 0;
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #0b0b0a;
	color: #e9e8e4;
	font-family: var(--nog-mono);
	font-size: 10.5px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0;
	transition: opacity 0.45s ease;
}

.nog-viewer.is-open {
	opacity: 1;
}

.nog-viewer::backdrop {
	background: transparent;
}

.nog-viewer button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	cursor: pointer;
}

.nog-viewer__bar {
	position: absolute;
	right: 0;
	left: 0;
	z-index: 3;
	display: flex;
	justify-content: space-between;
	gap: 24px;
	padding: 22px 28px;
}

.nog-viewer__bar--top {
	top: 0;
}

.nog-viewer__bar--bottom {
	bottom: 0;
	pointer-events: none;
}

.nog-viewer__right {
	display: flex;
	gap: 32px;
}

.nog-viewer__close:hover {
	opacity: 0.6;
}

.nog-viewer__meta {
	color: #8d8c87;
	white-space: pre;
}

.nog-viewer__stage {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.nog-viewer__img {
	position: absolute;
	inset: 9vh 6vw;
	width: 88vw;
	height: 82vh;
	object-fit: contain;
	opacity: 0;
	transform: scale(1.015);
	transition: opacity 0.6s ease, transform 0.9s var(--nog-ease);
}

.nog-viewer__img.is-active {
	opacity: 1;
	transform: none;
}

.nog-viewer__nav {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 2;
	width: 50%;
}

.nog-viewer__nav--prev {
	left: 0;
	cursor: w-resize !important;
}

.nog-viewer__nav--next {
	right: 0;
	cursor: e-resize !important;
}

.nog-viewer__nav:focus-visible {
	outline-offset: -6px;
	outline-color: #e9e8e4;
}

html.nog-viewer-open {
	overflow: hidden;
}

/* Pantallas estrechas -------------------------------------------------- */

@media (max-width: 759px) {

	.nog-grid > *,
	.nog-hero > * {
		grid-column: 1 / -1 !important;
	}

	.nog-hero {
		min-height: 0;
	}

	.nog-rail {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 12px 20px;
	}

	.nog-rail__line {
		width: 32px;
		height: 1px;
	}

	.nog-rail__list {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

@media (prefers-reduced-motion: reduce) {

	.nog-hero__img,
	.nog-viewer,
	.nog-viewer__img,
	.nog-thumb__frame img {
		transition-duration: 0.01ms !important;
	}
}
