/* Página de obra (posts de formato galeria) */

.mf-obra__head {
	padding-block: clamp(28px, 4vw, 56px) clamp(32px, 4.5vw, 56px);
	border-bottom: 1px solid var(--mf-line);
}

.mf-obra__headrow {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 48px;
}

.mf-obra__headrow .mf-crumbs {
	padding-bottom: 8px;
}

.mf-crumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 0;
	color: var(--mf-muted);
	font-size: 0.9375rem;
}

.mf-crumbs li:not(:last-child)::after {
	content: "/";
	margin-inline: 10px;
	color: #9fb0c8;
}

.mf-crumbs a {
	display: inline-block;
	padding-block: 6px;
	color: var(--mf-muted);
	text-decoration: none;
}

.mf-crumbs a:hover {
	color: var(--mf-navy);
	text-decoration: underline;
}

.mf-crumbs [aria-current] {
	display: inline-block;
	padding-block: 6px;
	color: var(--mf-ink);
	font-weight: 500;
}

.mf-obra__titles {
	order: -1;
	flex: 1 1 520px;
}

.mf-obra__title {
	max-width: 20ch;
	color: var(--mf-ink);
	font-size: clamp(2.25rem, 5vw, 4rem);
	font-weight: 800;
	font-stretch: 92%;
	line-height: 1.02;
	letter-spacing: -0.025em;
	text-wrap: balance;
}

.mf-obra__count {
	margin-top: 14px;
	color: var(--mf-muted);
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
}

.mf-obra__body {
	padding-block: clamp(32px, 4vw, 56px) var(--mf-section);
}

/* Grade em linhas justificadas: --r = largura/altura da foto */

.mf-gal {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(8px, 1vw, 12px);
}

.mf-gal::after {
	content: "";
	flex: 999 1 0;
}

.mf-gal__item {
	flex: var(--r, 1) 1 calc(var(--r, 1) * clamp(160px, 20vw, 300px));
}

.mf-gal__link {
	position: relative;
	display: block;
	aspect-ratio: var(--r, 1);
	overflow: hidden;
	background: var(--mf-ground-2);
}

.mf-gal__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--mf-ease);
}

.mf-gal__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border: 1px solid rgba(0, 19, 58, 0.08);
	pointer-events: none;
}

.mf-gal__link:hover .mf-gal__img {
	transform: scale(1.03);
}

.mf-gal__link:focus-visible {
	outline: 3px solid var(--mf-navy);
	outline-offset: 3px;
}

/* Lightbox */

.mf-lb {
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(0, 10, 30, 0.96);
	color: #fff;
}

.mf-lb::backdrop {
	background: rgba(0, 10, 30, 0.96);
}

.mf-lb[open] {
	display: grid;
	place-items: center;
}

.mf-lb__figure {
	display: grid;
	justify-items: center;
	gap: 14px;
	max-width: calc(100vw - 160px);
}

.mf-lb__img {
	max-width: 100%;
	max-height: calc(100dvh - 120px);
	object-fit: contain;
}

.mf-lb__caption {
	color: rgba(255, 255, 255, 0.78);
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.mf-lb__btn {
	position: absolute;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 2px;
	background: rgba(0, 10, 30, 0.4);
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s var(--mf-ease), border-color 0.2s var(--mf-ease);
}

.mf-lb__btn:hover {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.mf-lb__btn:focus-visible {
	outline: 2px solid var(--mf-sky);
	outline-offset: 3px;
}

.mf-lb__btn--prev {
	top: 50%;
	left: 24px;
	transform: translateY(-50%);
}

.mf-lb__btn--next {
	top: 50%;
	right: 24px;
	transform: translateY(-50%);
}

.mf-lb__btn--close {
	top: 20px;
	right: 24px;
}

@media (max-width: 560px) {
	.mf-gal__item {
		flex-basis: calc(var(--r, 1) * 110px);
	}

	.mf-lb__figure {
		max-width: 100vw;
	}

	.mf-lb__img {
		max-height: calc(100dvh - 180px);
	}

	.mf-lb__btn--prev,
	.mf-lb__btn--next {
		top: auto;
		bottom: 20px;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mf-gal__img {
		transition: none;
	}

	.mf-gal__link:hover .mf-gal__img {
		transform: none;
	}
}
