/*
 * Proyectos (F10, propuesta B): cabecera del listado, filtros, retícula
 * editorial, tarjetas, proyectos recientes, ficha y visor de fotos.
 */

/* ------------------------------------------------------------------ */
/* Cabecera del listado                                               */
/* ------------------------------------------------------------------ */

.projects-hero {
	padding: 96px 0 56px;
}

.projects-hero__grid {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px 96px;
	margin-top: 40px;
}

.projects-hero__title {
	flex: 8 1 560px;
	min-width: 0;
}

.projects-hero__side {
	display: flex;
	flex: 3 1 260px;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	font-size: 1.0625rem;
}

.projects-hero__side p {
	margin: 0;
}

/* ------------------------------------------------------------------ */
/* Filtros                                                            */
/* ------------------------------------------------------------------ */

.projects-filter {
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.projects-filter__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 88px;
	padding-block: 16px;
}

.projects-filter__group {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.projects-filter__group[hidden] {
	display: none;
}

.projects-filter__order {
	margin: 0;
	color: var(--muted);
	font-size: 0.875rem;
}

.filter-chip {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border: 1px solid var(--ink);
	border-radius: 999px;
	background: transparent;
	color: var(--ink);
	font-size: 0.875rem;
	font-weight: 700;
	white-space: nowrap;
	transition: background-color 180ms ease, color 180ms ease;
}

.filter-chip:hover {
	background: var(--paper-2);
}

.filter-chip[aria-pressed="true"] {
	background: var(--ink);
	color: var(--white);
}

/* ------------------------------------------------------------------ */
/* Retícula editorial                                                 */
/* ------------------------------------------------------------------ */

.projects-browser__body {
	padding: 96px 0 72px;
}

.projects-grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	align-items: start;
	gap: 96px 32px;
}

.project-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.project-card[hidden] {
	display: none;
}

.project-card__media {
	display: block;
	overflow: hidden;
	background: var(--paper-2);
}

.project-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
}

.project-card:hover .project-card__media img {
	transform: scale(1.03);
}

.project-card__heading {
	display: flex;
	align-items: baseline;
	gap: 14px;
}

.project-card__number {
	flex: 0 0 auto;
	color: var(--text-muted);
	font-family: var(--font-display);
	font-size: 1.375rem;
	font-style: italic;
	font-weight: 600;
	line-height: 1;
}

.project-card__title {
	font-family: var(--font-display);
	font-size: 1.875rem;
	font-style: italic;
	font-weight: 600;
	line-height: 1.1;
}

.project-card__title a {
	text-decoration: none;
}

.project-card__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}

.project-card__meta {
	margin: 0;
	color: var(--text-muted);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.project-card--big {
	grid-column: span 7;
}

.project-card--big .project-card__media {
	aspect-ratio: 16 / 10;
}

.project-card--small {
	grid-column: span 5;
	margin-top: 96px;
}

.project-card--small .project-card__media {
	aspect-ratio: 4 / 3;
}

.projects-more {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin-top: 96px;
}

.projects-more[hidden],
.projects-more [hidden] {
	display: none;
}

.projects-more__status {
	margin: 0;
	color: var(--muted);
	font-size: 0.9375rem;
}

.projects-list__empty {
	padding-block: 48px;
}

/* ------------------------------------------------------------------ */
/* Proyectos recientes (portada)                                      */
/* ------------------------------------------------------------------ */

.projects-recent {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 32px;
}

.projects-recent .project-card {
	flex: 1 1 300px;
}

.projects-recent .project-card:nth-child(2) {
	margin-top: 64px;
}

.project-card--square .project-card__media {
	aspect-ratio: 1 / 1;
}

.project-card--square .project-card__number {
	font-size: 1.25rem;
}

.project-card--square .project-card__title {
	font-size: 1.625rem;
	line-height: 1.15;
}

/* ------------------------------------------------------------------ */
/* Ficha: imagen a sangre                                             */
/* ------------------------------------------------------------------ */

.project-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 760px;
	overflow: hidden;
}

.project-hero--plain {
	min-height: 440px;
}

.project-hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.project-hero__shade {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 360px;
	background: linear-gradient(to top, rgba(25, 23, 27, 0.88), rgba(25, 23, 27, 0));
}

.project-hero__inner {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	padding-bottom: 56px;
}

.project-hero__text {
	min-width: 0;
}

.project-hero__back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.project-hero__back:hover {
	text-decoration: underline;
	text-underline-offset: 6px;
}

.project-hero__marker {
	margin-top: 16px;
}

.project-hero__title {
	max-width: 14ch;
	margin-top: 20px;
	font-family: var(--font-display);
	font-size: 6rem;
	font-style: italic;
	font-weight: 600;
	line-height: 0.95;
	overflow-wrap: anywhere;
}

.project-photos-bar {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Ficha: cuerpo                                                      */
/* ------------------------------------------------------------------ */

.project-body {
	padding: 96px 0;
}

.project-body__grid {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 48px 96px;
}

.project-sheet {
	position: sticky;
	top: 24px;
	display: flex;
	flex: 4 1 300px;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
	padding: 32px;
	background: var(--white);
}

.admin-bar .project-sheet {
	top: 56px;
}

.project-sheet__list {
	margin: 0;
	border-top: 1px solid var(--ink);
}

.project-sheet__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--paper-2);
}

.project-sheet__row dt {
	color: var(--muted);
	font-size: 0.9375rem;
}

.project-sheet__row dd {
	max-width: 60%;
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	text-align: right;
}

.project-sheet__cta-title {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.35;
}

.project-sheet__cta-title em {
	font-family: var(--font-display);
	font-style: italic;
	font-weight: 600;
}

.project-body__main {
	display: flex;
	flex: 7 1 480px;
	flex-direction: column;
	gap: 48px;
	min-width: 0;
}

.project-lead {
	max-width: 32ch;
	margin: 0;
	font-family: var(--font-display);
	font-size: 2rem;
	font-style: italic;
	font-weight: 600;
	line-height: 1.25;
}

.project-description {
	max-width: 64ch;
	line-height: 1.7;
}

.project-description > * + * {
	margin-top: 20px;
}

.project-description p {
	margin: 0;
}

.project-description a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.project-description img {
	width: 100%;
}

.project-figures {
	display: grid;
	grid-template-columns: 3fr 2fr;
	gap: 16px;
}

.project-figure {
	display: block;
	overflow: hidden;
	background: var(--paper-2);
	cursor: zoom-in;
}

.project-figure__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
}

.project-figure:hover .project-figure__image {
	transform: scale(1.02);
}

.project-figures .project-figure:nth-child(1) {
	aspect-ratio: 3 / 2;
}

.project-figures .project-figure:nth-child(2) {
	aspect-ratio: 3 / 4;
}

.project-figures .project-figure:nth-child(3) {
	grid-column: 1 / -1;
	aspect-ratio: 16 / 9;
}

.project-figures--1 {
	grid-template-columns: 1fr;
}

.project-figures--1 .project-figure:nth-child(1) {
	aspect-ratio: 16 / 9;
}

/* ------------------------------------------------------------------ */
/* Siguiente proyecto                                                 */
/* ------------------------------------------------------------------ */

.next-project {
	position: relative;
	display: block;
	height: 360px;
	overflow: hidden;
	text-decoration: none;
}

.next-project__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.45;
	transition: opacity 300ms ease;
}

.next-project:hover .next-project__image {
	opacity: 0.6;
}

.next-project__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	height: 100%;
}

.next-project__text {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.next-project__title {
	font-family: var(--font-display);
	font-size: 3.5rem;
	font-style: italic;
	font-weight: 600;
	line-height: 1;
}

.next-project__arrow {
	display: inline-flex;
	flex: 0 0 72px;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--yellow);
	color: var(--ink);
}

.next-project__arrow .icon {
	width: 28px;
	height: 28px;
}

.next-project:focus-visible {
	outline-offset: -6px;
}

/* ------------------------------------------------------------------ */
/* Visor de fotos                                                     */
/* ------------------------------------------------------------------ */

.lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(25, 23, 27, 0.96);
	color: var(--white);
	--focus-color: var(--yellow);
}

.lightbox::backdrop {
	background: transparent;
}

.lightbox__inner {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	padding: 72px 88px;
}

.lightbox__image {
	max-width: 100%;
	max-height: calc(100vh - 160px);
	object-fit: contain;
}

.lightbox__close {
	position: absolute;
	top: 16px;
	right: 16px;
	min-height: 44px;
	padding: 0 20px;
	border: 1.5px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
}

.lightbox__arrow {
	position: absolute;
	top: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: inherit;
	transform: translateY(-50%);
}

.lightbox__arrow:hover,
.lightbox__close:hover {
	background: rgba(255, 255, 255, 0.2);
}

.lightbox__arrow--prev {
	left: 16px;
}

.lightbox__arrow--next {
	right: 16px;
}

.lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 700;
	transform: translateX(-50%);
}

/* ------------------------------------------------------------------ */
/* Tableta                                                            */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.projects-grid {
		gap: 72px 24px;
	}

	.project-card--small {
		margin-top: 72px;
	}

	.project-card__title {
		font-size: 1.625rem;
	}

	.project-hero {
		min-height: 640px;
	}

	.project-hero__title {
		font-size: 4.5rem;
	}

	.project-body__grid {
		gap: 48px;
	}

	.project-sheet {
		position: static;
	}

	.next-project__title {
		font-size: 2.75rem;
	}
}

/* ------------------------------------------------------------------ */
/* Móvil                                                              */
/* ------------------------------------------------------------------ */

@media (max-width: 767px) {
	.projects-hero {
		padding: 48px 0 32px;
	}

	.projects-hero__grid {
		margin-top: 24px;
	}

	.projects-hero__title,
	.projects-hero__side {
		flex-basis: 100%;
	}

	.projects-filter__inner {
		width: 100%;
		min-height: 0;
		padding: 16px 0;
	}

	.projects-filter__group {
		flex-wrap: nowrap;
		width: 100%;
		padding-inline: var(--gutter);
		overflow-x: auto;
		scrollbar-width: none;
	}

	.projects-filter__group::-webkit-scrollbar {
		display: none;
	}

	.filter-chip {
		flex: 0 0 auto;
		padding: 0 18px;
	}

	.projects-filter__order {
		display: none;
	}

	.projects-browser__body {
		padding: 40px 0 72px;
	}

	.projects-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 48px;
	}

	.project-card {
		gap: 10px;
	}

	.project-card--big,
	.project-card--small {
		grid-column: auto;
		margin-top: 0;
	}

	.project-card--small {
		margin-left: 56px;
	}

	.project-card__number {
		font-size: 1.125rem;
	}

	.project-card__title,
	.project-card--square .project-card__title {
		font-size: 1.5rem;
		line-height: 1.15;
	}

	.projects-more {
		margin-top: 56px;
	}

	.projects-recent {
		gap: 40px;
	}

	.projects-recent .project-card:nth-child(2) {
		margin-top: 0;
		margin-left: 56px;
	}

	.project-hero {
		min-height: 540px;
	}

	.project-hero--plain {
		min-height: 360px;
	}

	.project-hero__shade {
		height: 280px;
	}

	.project-hero__inner {
		padding-bottom: 28px;
	}

	.project-hero__title {
		margin-top: 14px;
		font-size: 3rem;
		line-height: 1;
	}

	.project-hero__photos {
		display: none;
	}

	.project-photos-bar {
		display: block;
		padding-top: 20px;
	}

	.project-body {
		padding: 32px 0 0;
	}

	.project-body__grid,
	.project-body__main {
		gap: 32px;
	}

	.project-sheet {
		gap: 16px;
		padding: 24px;
	}

	.project-sheet__row {
		gap: 12px;
		padding: 12px 0;
	}

	.project-lead {
		font-size: 1.625rem;
	}

	.project-figures {
		grid-template-columns: 1fr;
	}

	.project-figures .project-figure:nth-child(n) {
		grid-column: auto;
		aspect-ratio: 3 / 2;
	}

	.next-project {
		height: 240px;
		margin-top: 48px;
	}

	.next-project__inner {
		align-items: flex-end;
		padding-bottom: 24px;
	}

	.next-project__text {
		gap: 8px;
	}

	.next-project__title {
		font-size: 1.75rem;
		line-height: 1.1;
	}

	.next-project__arrow {
		flex-basis: 48px;
		width: 48px;
		height: 48px;
	}

	.next-project__arrow .icon {
		width: 20px;
		height: 20px;
	}

	.lightbox__inner {
		padding: 72px 12px;
	}

	.lightbox__arrow {
		top: auto;
		bottom: 8px;
		width: 48px;
		height: 48px;
		transform: none;
	}
}
