/**
 * Maria Fornet — global styles that theme.json can't express.
 * Design tokens (colors, fonts, spacing) live in theme.json.
 */

/* Keyboard focus — visible, high contrast, no layout shift */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--ink, #171510);
	outline-offset: 2px;
}

/* Skip link (core prints it; keep it visible above everything) */
.skip-link:focus {
	z-index: 100000;
}

/* Data tables */
table {
	border-collapse: collapse;
	width: 100%;
}
th,
td {
	padding: 0.5em 0.75em;
	text-align: left;
}
thead th {
	border-bottom: 2px solid var(--wp--preset--color--ink, #171510);
}

/* MF Home: core/image wraps images in a figure with default margins.
   The design expects images flush inside their sections. */
.mf-home .wp-block-image {
	margin: 0;
}

/* MF Home: WP global styles emit `.wp-block-image img { height: auto }`
   (0,1,1), which outranks the fixed height in mf-home.css (.mf-figure__image).
   Restore the design height at higher specificity. */
.mf-home figure.wp-block-image.mf-figure__image img {
	height: 100%;
}

/* Page-frame gutters shrink globally on small screens (header + footer). */
@media (max-width: 860px) {
	:root {
		--wp--custom--gutter--default: var(--wp--custom--gutter--md);
	}
}

@media (max-width: 480px) {
	:root {
		--wp--custom--gutter--default: var(--wp--custom--gutter--sm);
	}
}

/* Header — the v2 site header (parts/header.html). The compact .dc row
   (brand mark MF + nav + Acceder) is the shared one; the Home keeps its
   own rows via patterns/mf-home-top.php. Capture-page rhythm overrides
   live in mf-home.css. */
.mf-topbar {
	padding: 26px var(--wp--custom--gutter--default) 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* La fila compacta del .dc (Contacto/Afiliadas/Sobre): aire 26 abajo también. */
.mf-header-compact {
	padding-bottom: 26px;
}

/* La marca «MF» de la fila compacta: Playfair 900, 24px, tracking -.11em. */
.mf-header-brand {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 900;
	font-size: 24px;
	line-height: 1;
	letter-spacing: -.11em;
}

.mf-header-brand a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

/* Design canvas: the whole composition (header, content, footer) caps at
   1240px on wide screens, per the .dc.html page wrapper. */
.mf-topbar,
.mf-masthead,
.mf-footer {
	max-width: 1240px;
	margin-right: auto;
	margin-left: auto;
}

.mf-vol {
	font-family: var(--wp--preset--font-family--jost);
	font-size: var(--wp--preset--font-size--micro);
	letter-spacing: var(--wp--custom--label--tracking);
	text-transform: uppercase;
	color: var(--wp--custom--tint--ink-55);
}

.mf-topbar__nav {
	display: flex;
	align-items: center;
	gap: 30px;
}

/* Core's container already flexes and inherits gap from the nav element
   (`gap: inherit`), so the 30px rhythm is set once here. */
.mf-topbar .wp-block-navigation {
	gap: 30px;
}

/* Core pins the anchor to color:inherit (0,4,1), so the active color goes
   on the li; the gold bar renders on the anchor itself. */
.mf-topbar li.current-menu-item { color: var(--wp--preset--color--ink); }

/* Los ancla de navegación no llevan subrayado (el elemento a global hace
   subrayado desde theme.json; en el menú el .dc lo pide sin subrayado). */
.mf-topbar a {
	text-decoration: none;
}

.mf-topbar li.current-menu-item > a {
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--gold);
}

.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu {
	gap: 7px;
}

/* Hover bridge: keeps the pointer "inside" the item while crossing the
   8px gap between the trigger and the panel. */
.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 10px;
}

/* Open state (design: ink text + gold bar under the item while the panel
   is open — core only marks custom links current, so the bar must key on
   the open state). */
.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu:hover,
.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu:focus-within {
	color: var(--wp--preset--color--ink);
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--gold);
}

.mf-topbar .wp-block-navigation-submenu__toggle {
	padding: 7px 0;
	cursor: pointer;
	/* Core pins the icon button to .6em for its chevron svg. */
	width: auto;
	height: auto;
}

.mf-topbar .wp-block-navigation-submenu__toggle svg {
	display: none;
}

/* Filled triangle glyph (design ▼), 8px like the original site's.
   Explicit box: core nav sets line-height 0, which collapses an empty
   pseudo-element. */
.mf-topbar .wp-block-navigation-submenu__toggle::before {
	content: "";
	display: block;
	box-sizing: border-box;
	width: 8px;
	height: 5px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
}

/* Dropdown panel: one flat level (v2 design). The 8px offset and 300px
   floor come from the design artifact; core's open-state rules pin
   min-width:200px at (0,5,0), so the floor is restated against core's
   own selectors. */
.mf-topbar .wp-block-navigation__container > li > .wp-block-navigation__submenu-container {
	background: var(--wp--preset--color--cream);
	border: 1px solid var(--wp--preset--color--ink);
	padding: 26px 30px;
	min-width: 300px;
	margin-top: 8px;
	gap: 22px;
	color: var(--wp--preset--color--ink);
}

.mf-topbar .wp-block-navigation .has-child:not(.open-on-click):not(.open-on-hover-click):focus-within > .wp-block-navigation__submenu-container,
.mf-topbar .wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded="true"] ~ .wp-block-navigation__submenu-container {
	min-width: 300px;
}

.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu:hover > .wp-block-navigation__submenu-container,
.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu:focus-within > .wp-block-navigation__submenu-container {
	display: flex;
	width: auto;
	height: auto;
	overflow: visible;
	opacity: 1;
	visibility: visible;
}

/* Item sublabels (the design's second line under each entry) — core hides
   __description by default. */
.mf-topbar .wp-block-navigation__submenu-container .wp-block-navigation-item__description {
	display: block;
	margin-top: 6px;
	font-size: var(--wp--custom--sublabel--font-size);
	letter-spacing: var(--wp--custom--sublabel--tracking);
	color: var(--wp--custom--tint--ink-50);
}

/* Design: sublabel stacks under the label — core renders the anchor as a
   flex row (label + description side by side) and pads it .5em 1em. */
.mf-topbar .wp-block-navigation__submenu-container > li > a {
	flex-direction: column;
	align-items: flex-start;
	padding: 0;
	white-space: nowrap;
}

.mf-topbar .wp-block-navigation__submenu-container li:hover { color: var(--wp--preset--color--gold-dark); }

.mf-topbar .wp-block-navigation__submenu-container li:hover .wp-block-navigation-item__description {
	color: inherit;
}

/* «Acceder» del header (el .dc: borde 1px tinta con inversión al hover;
   es un ítem del menú 15). El color va en el LI para vencer el
   color:inherit que core clava en el ancla. */
.mf-topbar li.mf-acceder > a {
	border: 1px solid var(--wp--preset--color--ink);
	padding: 6px 14px;
	transition: background .25s ease, color .25s ease;
}

.mf-topbar li.mf-acceder:hover,
.mf-topbar li.mf-acceder:focus-within {
	color: var(--wp--preset--color--cream);
}

.mf-topbar li.mf-acceder > a:hover,
.mf-topbar li.mf-acceder > a:focus {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
}

/* Masthead */
.mf-masthead { padding: 18px var(--wp--custom--gutter--default) 0; }

.mf-masthead__inner {
	border-top: 1px solid var(--wp--preset--color--ink);
	border-bottom: 1px solid var(--wp--preset--color--ink);
	padding: 14px 0 16px;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 40px;
}

.mf-masthead .wp-block-site-title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 900;
	font-size: 46px;
	line-height: .9;
	letter-spacing: -.03em;
}

.mf-masthead .wp-block-site-title a {
	color: inherit;
	text-decoration: none;
}

.mf-masthead .wp-block-site-tagline {
	font-family: var(--wp--preset--font-family--jost);
	font-size: var(--wp--preset--font-size--micro);
	letter-spacing: var(--wp--custom--label--tracking);
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
	padding-bottom: 12px;
	text-align: right;
}

/* Footer — el pie legal simple compartido (parts/footer.html: fila MF +
   enlace legal + © del .dc). Los pies per-página (el rico de las páginas MF
   del .dc — patrón mf-footer-rich — y los cremas de CF) viven en patrones
   dentro de cada página. */
.mf-footer {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--cream);
	/* El aire antes del pie: 80px (LEEME §2, ≤88px). El pie RICO no lleva
	   separacion (el .dc lo pega al contenido) — ver .mf-footer--rich. */
	margin-top: 80px;
	padding: 44px var(--wp--custom--gutter--default) 44px;
}

/* Pie rico (familia 1 de los .dc: Home, Punto, Santaurora, Otros proyectos):
   el .dc lo pinta pegado al contenido (sin separacion) y con su propio
   padding (60px arriba). El ancho de 1240 y el fondo los hereda de .mf-footer. */
.mf-footer--rich {
	margin-top: 0;
	padding-top: 60px;
	padding-bottom: 44px;
}

.mf-footer__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px 32px;
}

/* La banda «Escríbenos» del pie rico (patrón mf-home-site-footer). */
/* El .dc lleva el filete y sus 44px de aire en el ENVOLVENTE del pie, con la
   rejilla de 4 columnas dentro (la rejilla no lleva padding propio): el
   filete cae a 60px del borde del pie y las columnas a 105px. */
.mf-footer__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 40px;
}

/* Home: el .dc separa el manifiesto «Quédate» del filete con 80px. El
   envoltorio lo toma del flow-layout del pie, asi que hay que anularlo en
   el hijo (si no, los 80px se cuentan dos veces). */
.mf-footer__main + .mf-footer__inner {
	margin-top: 80px;
}

:root :where(.mf-footer__inner) > * {
	margin-block-start: 0;
}

/* El envoltorio del pie: filete + 44px de aire (literal del .dc). */
.mf-footer__inner {
	border-top: 1px solid var(--wp--custom--tint--cream-22);
	padding-top: 44px;
}

.mf-footer__col {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
}

/* Los grupos de la rejilla y de las columnas son flow-layouts de WP: sus
   hijos reciben margin-block-start 24px que el .dc no tiene. El aire real lo
   dan los gaps (14px en la columna, 40px entre columnas). */
.mf-footer__grid > *,
.mf-footer__col > * {
	margin-block-start: 0;
}

.mf-footer__heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--jost);
	font-size: var(--wp--preset--font-size--micro);
	letter-spacing: var(--wp--custom--label--tracking);
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
}

/* "Punto de Inflexión" is a nav item styled as a sub-heading (design: gold
   micro label with extra top separation before "El programa"). */
.mf-footer__col li.mf-footer__heading {
	margin-top: 10px;
}

/* Column menus: PT Serif body links (theme.json styles navs Jost micro caps).
   El .dc los pide a 17px fijos (body-17 del theme es fluido 17→18 y en el pie
   inflaba la altura de la banda), con separacion 14px (literal del .dc: gap
   14px en la columna) y el interlineado del navegador (normal ≈ 23px). */
.mf-footer__col .wp-block-navigation__container {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 17px;
	line-height: normal;
	letter-spacing: 0;
	text-transform: none;
	color: var(--wp--custom--tint--cream-80);
}

/* El nav de core arranca con margin-block 24px (el ritmo del flujo): en el
   pie el .dc no lleva ese aire (el gap de 14px de la columna es el único
   separador entre el rotulo y la lista). */
.mf-footer__col .wp-block-navigation {
	margin-top: 0;
	/* El interlineado del nav (1.6 del tema) sobra: el .dc mide las lineas
	   por su altura de texto, no por el leading. */
	line-height: normal;
}

.mf-footer__col .wp-block-navigation__container > li:hover {
	color: var(--wp--preset--color--gold);
}

.mf-footer__col .wp-block-navigation a {
	text-decoration: none;
}

/* Core renders every nav item as a row flex box (parent link + sub list
   side by side); the footer needs parent and sub items stacked. */
.mf-footer__col .wp-block-navigation .has-child {
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

/* Sub lists render static and indented (design: sub-items of a group).
   Selector matches core's `.wp-block-navigation .has-child …` specificity
   and prints later, so it wins the cascade. */
.mf-footer__col .wp-block-navigation-submenu > .wp-block-navigation__submenu-container {
	position: static;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	width: auto;
	height: auto;
	min-width: 0;
	margin: 0;
	padding: 0 0 0 14px;
	background: transparent;
	border: none;
	border-left: 1px solid var(--wp--custom--tint--cream-22);
	font-style: italic;
	font-size: var(--wp--preset--font-size--body-14);
	color: var(--wp--custom--tint--cream-60);
	opacity: 1;
	visibility: visible;
	overflow: visible;
	left: auto;
	top: auto;
	z-index: auto;
	transition: none;
}

.mf-footer__col .wp-block-navigation-submenu__toggle {
	display: none;
}

/* «Acceder» del pie rico (el .dc: borde crema, hover oro con texto tinta;
   vive dentro del menú 24). */
/* «Acceder» del pie rico: el .dc lo separa del ultimo enlace con 12px MAS
   que el gap normal de 14px de la columna (26px en total) y lo pinta con
   borde crema. El margen va en el <li> (el nav de WP mide la altura del
   <li>, no la del <a>). */
.mf-footer li.mf-acceder {
	margin-top: 12px;
}

.mf-footer li.mf-acceder > a {
	display: inline-block;
	padding: 12px 18px;
	color: var(--wp--preset--color--cream);
	background: transparent;
	border: 1px solid var(--wp--custom--tint--cream-50);
	font-size: var(--wp--preset--font-size--micro);
	letter-spacing: var(--wp--custom--label--tracking);
	text-transform: uppercase;
}

.mf-footer li.mf-acceder:hover {
	color: var(--wp--preset--color--ink);
}

.mf-footer li.mf-acceder > a:hover,
.mf-footer li.mf-acceder > a:focus {
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--gold);
	border-color: var(--wp--preset--color--gold);
}

/* «Habla con nosotras ; )" band */
.mf-footer__contact {
	margin-top: 54px;
	border-top: 1px solid var(--wp--custom--tint--cream-22);
	padding-top: 34px;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 26px 40px;
}

/* El .dc acota la banda «Escríbenos» a 620px (para que el titular de 34px
   ocupe dos lineas) y el paragrafo a 46ch. */
.mf-footer__contact__intro {
	display: flex;
	flex-direction: column;
	gap: 14px;
	max-width: 620px;
}

/* El .dc: el titular es un ancla (mailto) dorada que flota a crema. */
.mf-footer__contact-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 800;
	font-size: var(--wp--preset--font-size--display-34);
	line-height: 1.2;
	letter-spacing: -.02em;
}

.mf-footer__contact-title a {
	align-self: flex-start;
	color: var(--wp--preset--color--gold);
	text-decoration: none;
	transition: color .25s ease;
}

.mf-footer__contact-title a:hover,
.mf-footer__contact-title a:focus {
	color: var(--wp--preset--color--cream);
}

.mf-footer__contact-text {
	margin: 0;
	max-width: 46ch;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 17px;
	line-height: 1.7;
	color: var(--wp--custom--tint--cream-80);
}

/* Círculo del correo (el .dc: 58px con borde crema y hover oro; el
   reemplazo del par de círculos social del pie v2). */
.mf-footer__circle {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	color: var(--wp--preset--color--cream);
	background: transparent;
	border: 1px solid var(--wp--custom--tint--cream-50);
	transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.mf-footer__circle svg {
	width: 24px;
	height: 24px;
	display: block;
}

.mf-footer__circle:hover,
.mf-footer__circle:focus {
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--gold);
	border-color: var(--wp--preset--color--gold);
}

/* Legal row: el .dc la pinta a 45px (26 de aire + 19 de contenido). La fila
   no puede heredar el interlineado fluido del tema (30.72px) o crece, pero
   los items (Jost 10px) llevan su interlineado normal (15px), como el .dc. */
.mf-footer__legal {
	margin-top: 44px;
	border-top: 1px solid var(--wp--custom--tint--cream-22);
	padding-top: 26px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px 32px;
	line-height: 1;
}

.mf-footer__legal .mf-footer__nav .wp-block-navigation__container,
.mf-footer__legal .mf-footer__nav .wp-block-navigation__container > li,
.mf-footer__legal .mf-footer__copyright {
	line-height: normal;
}

.mf-footer__sig {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 900;
	font-size: 22px;
	line-height: .8;
	letter-spacing: -.11em;
	color: var(--wp--preset--color--gold);
}

/* El nav de core arranca con margin-block 24px (ritmo del flujo): la fila
   legal del .dc no lleva ese aire. */
.mf-footer__nav {
	margin-top: 0;
	/* El nav es un hijo de la fila legal: sin este reset hereda su gap
	   (18px 32px) y la fila no envuelve como en el .dc. */
	gap: 0;
}

.mf-footer__nav .wp-block-navigation__container {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 10px 20px;
	/* Overrides the theme.json nav color (ink-60) for the dark footer. */
	color: var(--wp--custom--tint--cream-60);
}

.mf-footer__nav .wp-block-navigation__container > li + li::before {
	/* El .dc pone el punto como un <span> real entre los enlaces (ocupa
	   sitio en el flujo): aqui es un ::before, asi que se le da el margen
	   que le falta para igualar la separacion (46px en el .dc). */
	content: "·";
	color: var(--wp--custom--tint--cream-30);
	margin-right: 20px;
}

.mf-footer__nav a {
	text-decoration: none;
}

.mf-footer__nav .wp-block-navigation__container > li:hover {
	color: var(--wp--preset--color--gold);
}

.mf-footer__copyright {
	margin: 0;
	font-family: var(--wp--preset--font-family--jost);
	font-size: var(--wp--preset--font-size--micro);
	letter-spacing: var(--wp--custom--label--tracking);
	text-transform: uppercase;
	color: var(--wp--custom--tint--cream-40);
}

@media (max-width: 860px) {
	.mf-topbar {
		flex-wrap: wrap;
		gap: 14px 22px;
	}

	.mf-topbar__nav { gap: 18px; }
	.mf-topbar .wp-block-navigation__container { gap: 18px; flex-wrap: wrap; }

	.mf-masthead__inner {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.mf-masthead .wp-block-site-tagline { padding-bottom: 0; text-align: left; }

	.mf-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.mf-topbar__nav { gap: 12px; }
	.mf-topbar .wp-block-navigation__container { gap: 12px; }

	/* El desplegable deja de colgar del ítem. Con `right: -40px` el panel de
	   300px se salía por la izquierda en pantallas estrechas y el texto
	   quedaba cortado. En móvil se ancla a la barra de navegación y ocupa su
	   ancho: siempre cabe entre los márgenes. */
	.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu {
		position: static;
	}

	/* El puente de hover no tiene sentido con apertura por toque. */
	.mf-topbar .wp-block-navigation__container > li.wp-block-navigation-submenu::after {
		content: none;
	}

	.mf-topbar .wp-block-navigation__container > li > .wp-block-navigation__submenu-container {
		left: 0;
		right: 0;
		top: calc(100% + 8px);
		margin-top: 0;
		width: auto;
		min-width: 0;
		box-sizing: border-box;
	}

	.mf-footer {
		padding-bottom: 32px;
	}

	.mf-footer__grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}
}