/* Scroll entrances preserve the existing transforms, including portrait scale.
 * Nothing is hidden while waiting for JS or the observer. No scroll interception.
 */
@media (prefers-reduced-motion: no-preference) {
	.mpf-scroll-enter {
		animation: mpf-scroll-entrance 320ms cubic-bezier(.22, 1, .36, 1);
	}
	.mpf-scroll-enter[data-mpf-reveal="image"] {
		--mpf-scroll-distance: 10px;
	}
	.mpf-scroll-enter[data-mpf-reveal="soft"] {
		--mpf-scroll-distance: 6px;
	}
	.mpf-scroll-enter:focus-within { animation: none; }
	@media (max-width: 650px) {
		.mpf-scroll-enter { --mpf-scroll-distance: 6px; }
		.mpf-scroll-enter[data-mpf-reveal="image"] { --mpf-scroll-distance: 8px; }
	}
}
@keyframes mpf-scroll-entrance {
	from { translate: 0 var(--mpf-scroll-distance, 8px); }
	to { translate: 0 0; }
}
@media print, (prefers-reduced-motion: reduce) {
	.mpf-scroll-enter { animation: none !important; }
}

/* Home editorial sections. All typography and colors follow theme.json. */
:where(.mpf-home-institutional, .mpf-home-fiscal, .mpf-home-tenders) {
	box-sizing: border-box;
	color: var(--wp--preset--color--ink);
	scroll-margin-top: 2rem;
}
:where(.mpf-home-institutional, .mpf-home-fiscal, .mpf-home-tenders) :where(p, h2, h3, figure) { margin: 0; }
.mpf-home-accent { display: block; color: var(--wp--preset--color--accent); }
.mpf-home-arrow {
	display: inline-block;
	width: 24px;
	height: 24px;
	flex: none;
	background: currentColor;
	mask: url('vendor/lucide/icons/arrow-right.svg') center / contain no-repeat;
}
.mpf-home-institutional {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, .85fr) minmax(0, 1fr);
	align-items: start;
	gap: clamp(1.5rem, 3vw, 3rem);
	padding-block: clamp(4rem, 7vw, 7rem) 3rem;
}
.mpf-home-institutional-copy h2 {
	color: var(--wp--preset--color--ink);
	font-size: clamp(1.75rem, 2.6vw, 2.5rem);
	line-height: 1.12;
	margin-block: 1rem 1.5rem;
}
.mpf-home-institutional-copy > p:not(.is-style-mpf-eyebrow),
.mpf-home-institutional-slide > p { font-size: 1.125rem; line-height: 1.38; }
.mpf-home-institutional-copy .wp-block-buttons { margin-top: 2rem; }
.mpf-home-institutional-copy .wp-block-button__link { padding: .55rem 1.8rem; font-size: 1rem; min-height: 44px; }
.mpf-home-institutional-image { align-self: center; }
.mpf-home-institutional-image img { display: block; width: 100%; height: auto; aspect-ratio: 806 / 1348; max-height: 500px; object-fit: contain; }
.mpf-home-institutional-slider { padding-top: 3.6rem; }
.mpf-home-institutional-slide h3 { font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.18; max-width: 17rem; margin-bottom: 1.5rem; }
.mpf-home-institutional-slide + .mpf-home-institutional-slide { margin-top: 2rem; }
.mpf-home-institutional-slider.is-enhanced .mpf-home-institutional-slide { margin: 0; min-height: 260px; }
.mpf-home-institutional-slide[hidden], .mpf-home-slider-controls[hidden] { display: none; }
.mpf-home-slider-controls { display: flex; align-items: center; gap: .5rem; margin-top: 1.5rem; }
.mpf-home-slider-controls button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 4px; background: var(--wp--preset--color--ink); color: var(--wp--preset--color--white); cursor: pointer; }
.mpf-home-slider-controls button:hover { background: var(--wp--preset--color--accent-dark); }
.mpf-home-slider-prev .mpf-home-arrow { transform: rotate(180deg); }
.mpf-home-slider-controls .mpf-home-arrow { width: 18px; height: 18px; }
.mpf-home-fiscal {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	align-items: end;
	min-height: 350px;
	margin-block: 7rem 5rem !important;
	border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--canvas);
	border: 1px solid rgb(40 40 40 / 6%);
	box-shadow: 0 3px 10px rgb(40 40 40 / 7%);
}
.mpf-home-fiscal::before {
	content: '';
	position: absolute;
	z-index: -1;
	inset: -70px calc(-1 * min(4vw, var(--wp--style--root--padding-left, 1rem))) -90px;
	background: url('images/fondo2.svg?v=3') center / cover no-repeat;
	opacity: .5;
	pointer-events: none;
}
.mpf-home-fiscal-copy { align-self: center; padding: 3.5rem 0 3.5rem clamp(2rem, 6vw, 6rem); }
.mpf-home-fiscal-copy h2 { margin-block: 1rem 1.5rem; font-size: clamp(1.7rem, 2.75vw, 2.5rem); line-height: 1.2; }
.mpf-home-fiscal-role { font-size: .7rem; letter-spacing: .1em; }
.mpf-home-fiscal-image { position: relative; margin-top: -85px !important; padding-right: clamp(1rem, 4vw, 4rem); align-self: end; transform: scale(1.18); transform-origin: 50% 100%; }
.mpf-home-fiscal-image img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.mpf-home-tenders {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 5rem);
	padding: clamp(2rem, 6vw, 6rem);
	margin-block: 0 5rem !important;
	border: 1px solid rgb(40 40 40 / 5%);
	border-radius: var(--wp--custom--radius--card);
	background: rgb(255 253 250 / 32%);
}
.mpf-home-tenders-intro h2 { margin-block: 1.3rem 1.8rem; font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.03; }
.mpf-home-tenders-lead { max-width: 15rem; font-size: 1.125rem; line-height: 1.4; }
.mpf-home-tenders-image { width: 82%; margin: -5rem -1rem -2rem auto !important; }
.mpf-home-tenders-image img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.mpf-home-tenders-list { align-self: center; }
.mpf-home-tender { border-bottom: 1px solid var(--wp--preset--color--border); }
.mpf-home-tender a { display: grid; grid-template-columns: minmax(0, 1fr) 24px; column-gap: 1.5rem; padding-block: 1.5rem 2rem; color: inherit; text-decoration: none; }
.mpf-home-tender-label { grid-column: 1; font-family: var(--wp--preset--font-family--mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .45rem; }
.mpf-home-tender strong { grid-column: 1; font-size: 1.125rem; line-height: 1.25; font-weight: 600; }
.mpf-home-tender .mpf-home-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--wp--preset--color--accent); }
.mpf-home-tender a:hover strong { text-decoration: underline; text-underline-offset: .2em; }
.mpf-home-tenders-more a { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-top: 1rem; color: var(--wp--preset--color--accent-dark); font-family: var(--wp--preset--font-family--mono); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; text-decoration: none; }
.mpf-home-tenders-more a:hover { text-decoration: underline; }
.mpf-home-tenders-more .mpf-home-arrow { width: 16px; height: 16px; transform: rotate(-45deg); }
@media (max-width: 1050px) {
	.mpf-home-institutional { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
	.mpf-home-institutional-slider { grid-column: 1 / -1; padding-top: 1rem; max-width: 40rem; }
	.mpf-home-institutional-slide h3 { max-width: none; }
	.mpf-home-institutional-slider.is-enhanced .mpf-home-institutional-slide { min-height: 150px; }
	.mpf-home-fiscal { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); min-height: 280px; }
	.mpf-home-fiscal-copy { padding: 2rem; }
	.mpf-home-fiscal-image { padding-right: 1rem; }
	.mpf-home-tenders { gap: 2rem; padding: 2.5rem; }
	.mpf-home-tenders-image { margin-top: 1rem !important; width: 100%; }
}
@media (max-width: 650px) {
	.mpf-home-institutional { grid-template-columns: minmax(0, 1fr); padding-top: 3.5rem; gap: 2rem; }
	.mpf-home-institutional-copy h2 { max-width: 24rem; }
	.mpf-home-institutional-image { width: 68%; max-width: 260px; margin-inline: auto !important; }
	.mpf-home-institutional-image img { max-height: 380px; }
	.mpf-home-institutional-slider { grid-column: auto; padding: 0; }
	.mpf-home-institutional-slider.is-enhanced .mpf-home-institutional-slide { min-height: 210px; }
	.mpf-home-fiscal { grid-template-columns: minmax(0, 1fr); margin-block: 3rem !important; }
	.mpf-home-fiscal-copy { padding: 2rem 1.5rem 0; }
	.mpf-home-fiscal-image { width: 80%; max-width: 350px; padding: 0; justify-self: center; margin: 1rem 0 0 !important; transform: none; }
	.mpf-home-fiscal::before { inset-inline: 0; }
	.mpf-home-tenders { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding: 2rem 1.5rem; margin-bottom: 3rem !important; }
	.mpf-home-tenders-intro h2 { font-size: clamp(1.8rem, 7.6vw, 2.75rem); }
	.mpf-home-tenders-lead { max-width: 24rem; }
	.mpf-home-tenders-image { width: 90%; max-width: 380px; margin: 1rem auto 0 !important; }
	.mpf-home-tender a { column-gap: 1rem; }
}

/* Share the entrance sequence with the Fiscal General before the news feed. */
@media (min-width:801px) {
 .mpf-home-building-intro { position:relative; z-index:auto; pointer-events:none; display:grid; grid-template-columns:minmax(0,45fr) minmax(0,55fr); align-items:center; align-content:center; min-height:0; gap:clamp(2.5rem,5vw,5rem); margin-block:0; overflow-x:clip; overflow-y:visible; }
 /* The shared surface stays behind the render, including after the card lands. */
 .mpf-home-building-intro::before { content:''; grid-column:1 / -1; grid-row:1; align-self:stretch; z-index:1; border:1px solid rgb(40 40 40 / 6%); border-radius:var(--wp--custom--radius--card); background:var(--wp--preset--color--canvas,#f7f4ef); box-shadow:0 3px 10px rgb(40 40 40 / 7%); translate:var(--fiscal-entry-x,0px) var(--fiscal-entry-y,0px); opacity:var(--fiscal-entry-opacity,1); }
 .mpf-home-building-intro[data-fiscal-settled=true] > .mpf-home-fiscal { z-index:3; }
 .mpf-home-building-intro > .mpf-home-fiscal { pointer-events:auto; }
 .mpf-home-building-intro > .mpf-home-fiscal { grid-column:1; grid-row:1; z-index:1; border-color:transparent; box-shadow:none; width:100%; max-width:none; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); min-height:clamp(240px,19vw,300px); margin:0!important; background:transparent; translate:var(--fiscal-entry-x,0px) var(--fiscal-entry-y,0px); opacity:var(--fiscal-entry-opacity,1); }
 .mpf-home-building-intro .mpf-home-fiscal-copy { padding:1.75rem 0 1.75rem 1.75rem; }
 .mpf-home-building-intro .mpf-home-fiscal-copy h2 { font-size:clamp(1.5rem,2.1vw,2rem); margin-block:.75rem; }
 .mpf-home-building-intro .mpf-home-fiscal-role { font-size:.625rem; line-height:1.5; letter-spacing:.04em; }
 .mpf-home-building-intro .mpf-home-fiscal-image { padding:0; margin:0!important; transform:none; }
 .mpf-home-building-intro .mpf-home-fiscal::before { display:none; }
}
@media (min-width:801px) and (prefers-reduced-motion:reduce) {
 .mpf-home-building-intro { min-height:0; padding-block:4rem; }
 .mpf-home-building-intro::before, .mpf-home-building-intro > .mpf-home-fiscal { translate:none; opacity:1; }
}
@media (max-width:800px) {
 .mpf-home-building-intro > .mpf-home-fiscal { grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); min-height:200px; margin-block:1.25rem!important; overflow:hidden; }
 .mpf-home-building-intro .mpf-home-fiscal-copy { padding:1.25rem 0 1.25rem 1rem; }
 .mpf-home-building-intro .mpf-home-fiscal-copy h2 { font-size:clamp(1.1rem,4.8vw,1.5rem); line-height:1.2; margin-block:.6rem; }
 .mpf-home-building-intro .is-style-mpf-eyebrow { font-size:.5625rem; letter-spacing:.08em; }
 .mpf-home-building-intro .mpf-home-fiscal-role { font-size:.5rem; line-height:1.55; letter-spacing:.035em; }
 .mpf-home-building-intro .mpf-home-fiscal-image { width:100%; max-width:none; padding:0; margin:0!important; transform:none; }
 .mpf-home-building-intro .mpf-home-fiscal-image img { height:clamp(150px,40vw,220px); aspect-ratio:auto; object-fit:contain; object-position:bottom right; }
}

.mpf-home-fiscal-surname { display:block; }

/* Compact desktop narrative: one viewport, then a short transition into News. */
@media (min-width:801px) {
 .mpf-home-story { position:relative; height:calc(var(--story-height) + var(--story-span)); margin-block:0!important; overflow-anchor:none; }
 .mpf-home-story > .is-style-mpf-hero[data-hero-story] { position:sticky; top:var(--story-top); height:var(--story-height); min-height:0; padding-block:18px 92px; grid-template-rows:minmax(0,1fr) auto; row-gap:12px; }
 .is-style-mpf-hero[data-hero-story] > .is-style-mpf-hero-layout { min-height:0; height:var(--story-actor-height,100%); align-self:start; }
 .is-style-mpf-hero[data-hero-story] .is-style-mpf-hero-copy { opacity:var(--story-copy-opacity,1); translate:0 var(--story-copy-y,0px); }
 .is-style-mpf-hero[data-hero-story] > .mpf-home-building-intro { position:absolute; left:var(--story-intro-left); top:var(--story-intro-top); width:var(--story-intro-width); height:var(--story-intro-height); min-height:0; max-width:none; margin:0!important; grid-template-rows:minmax(0,1fr); }
 .is-style-mpf-hero[data-hero-story] .mpf-home-fiscal { min-height:0; height:min(clamp(240px,19vw,300px),100%); align-self:center; }
 .is-style-mpf-hero[data-hero-story] .mpf-home-building-intro::before { height:min(clamp(240px,19vw,300px),100%); align-self:center; box-sizing:border-box; }
 /* Keep the portrait on the band baseline, with the head above its top edge. */
 .is-style-mpf-hero[data-hero-story] .mpf-home-fiscal-image { height:100%; min-height:0; align-self:stretch; }
 .is-style-mpf-hero[data-hero-story] .mpf-home-fiscal-image img { position:absolute; left:0; bottom:0; width:min(135%,calc(clamp(240px,19vw,300px) + 64px)); max-width:none; height:auto; }
 .is-style-mpf-hero[data-hero-story] .is-style-mpf-service-grid { z-index:4; opacity:var(--story-services-opacity,1); }
 .is-style-mpf-hero[data-hero-story] > .is-style-mpf-service-grid { margin-block:0; gap:clamp(.75rem,1.3vw,1.25rem); }
 .is-style-mpf-hero[data-hero-story] .is-style-mpf-service-grid .wp-block-image img { width:32px; height:32px; }
}

/* Reserve the first-screen composition before the enhancement module arrives. */
@media screen and (min-width:801px) and (min-height:760px) and (prefers-reduced-motion:no-preference) {
 .home .is-style-mpf-hero { height:calc(100svh - 67px - var(--wp-admin--admin-bar--height,0px)); min-height:0; padding-block:18px 92px; grid-template-rows:minmax(0,1fr) auto; row-gap:12px; }
 .home .is-style-mpf-hero > .is-style-mpf-hero-layout { min-height:0; height:100%; }
 .home .is-style-mpf-hero[data-hero-story] > .is-style-mpf-hero-layout { height:var(--story-actor-height,100%); }
}
