/* ==========================================================================
   SISTEMA VISUAL CFH — LA FORJA (WordPress Block Theme)
   Alineado con Manual de Identidad Corporativa CFH v1.0
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	color-scheme: dark;
}

html,
body,
main {
	width: 100%;
	max-width: 100%;
	overflow-x: clip;
}

body {
	margin: 0;
	font-feature-settings: "cv02", "cv03", "cv04", "cv11";
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background-color: rgba(56, 189, 248, 0.28);
	color: var(--cfh-blanco-titanio);
}

/* Accesibilidad: foco visible claro (WCAG 2.2) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--cfh-cian-navegacion);
	outline-offset: 3px;
}

.skip-link.screen-reader-text:focus {
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 99999;
	padding: 12px 18px;
	background: var(--cfh-naranja-forja);
	color: var(--cfh-vacio-grafito);
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-weight: 600;
	border-radius: var(--cfh-radius-sm);
	text-decoration: none;
}

/* Tipografía y longitud de línea recomendada (45-75 caracteres) */
p {
	max-width: 72ch;
}

p.has-text-align-center {
	margin-inline: auto;
}

p.has-text-align-right {
	margin-left: auto;
}

.cfh-measure-auto p,
.wp-block-column p,
.cfh-panel p {
	max-width: none;
}

.wp-block-group,
.wp-block-columns,
.wp-block-column {
	min-width: 0;
	max-width: 100%;
}

figure,
figure.wp-block-table,
figure.wp-block-image {
	margin-inline: 0;
	max-width: 100%;
}

.wp-block-table {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
	background-color: var(--cfh-acero-hangar);
	border: 1px solid var(--cfh-borde-tecnico);
	font-variant-numeric: tabular-nums;
}

.wp-block-table th,
.wp-block-table td {
	overflow-wrap: break-word;
}

@media (max-width: 781px) {
	.wp-block-columns .wp-block-column {
		flex-basis: auto !important;
		width: 100%;
	}
}

@media (max-width: 640px) {
	.cfh-panel,
	.cfh-panel-cobre,
	.cfh-documental-sheet {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}
}

.wp-block-table thead th {
	background-color: var(--cfh-grafito-documental);
	color: var(--cfh-blanco-titanio);
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-weight: 600;
	text-align: left;
	padding: 14px 16px;
	border-bottom: 1px solid var(--cfh-cobre-discreto);
}

.wp-block-table td {
	padding: 12px 16px;
	border-bottom: 1px solid rgba(148, 167, 176, 0.16);
	color: var(--cfh-blanco-titanio);
}

.wp-block-table tbody tr:hover {
	background-color: rgba(56, 189, 248, 0.04);
}

/* ==========================================================================
   LOGOTIPOS TRANSPARENTES Y ÁREA DE PROTECCIÓN (Manual Págs. 5-11, 18, 20)
   - Proporción siempre bloqueada (height: auto, object-fit: contain).
   - Espacio libre >= 1x (5% del lado menor) alrededor del contenedor.
   - Sin animaciones continuas ni filtros automáticos.
   ========================================================================== */
.cfh-logo-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	padding: 5% 4%;
	margin: 0;
}

.cfh-logo-wrap--tight {
	width: auto;
	padding: 8px 12px;
}

.cfh-logo-img,
.cfh-logo-wrap img {
	display: block;
	max-width: 100%;
	height: auto !important;
	object-fit: contain;
	filter: none !important;
}

/* Showcase H01 en portada (cambia a V01 legible en móviles estrechos: Manual Pág. 5) */
.cfh-hero-logo-stage {
	width: 100%;
	max-width: 960px;
	margin-inline: auto;
	padding: 16px 24px;
}

.cfh-hero-logo-desktop {
	display: block;
	width: min(860px, 100%);
	max-width: 100%;
	height: auto !important;
	margin-inline: auto;
}

.cfh-hero-logo-mobile {
	display: none !important;
	width: min(260px, 72vw);
	max-width: 100%;
	height: auto !important;
	margin-inline: auto;
}

@media (max-width: 560px) {
	.cfh-hero-logo-stage {
		padding: 12px 8px;
	}

	.cfh-hero-logo-desktop {
		display: none !important;
	}

	.cfh-hero-logo-mobile {
		display: block !important;
	}
}

/* Conmutación adaptable en cabecera (H01 en escritorio -> emblema compacto en móvil) */
.cfh-brand-link {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	padding: 6px 8px;
	border-radius: var(--cfh-radius-sm);
	transition: opacity var(--cfh-transition);
}

.cfh-brand-link:hover {
	opacity: 0.92;
}

.cfh-brand-desktop {
	display: block;
	width: auto;
	height: 54px !important;
	max-height: 54px;
}

.cfh-brand-mobile {
	display: none !important;
	width: 44px;
	height: 44px !important;
}

@media (max-width: 680px) {
	.cfh-brand-desktop {
		display: none !important;
	}

	.cfh-brand-mobile {
		display: block !important;
		width: 42px;
		height: 42px !important;
	}
}

/* ==========================================================================
   CABECERA CORPORATIVA Y NAVEGACIÓN (Manual Pág. 16: ordenada, nunca segundo cartel)
   ========================================================================== */
.cfh-site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	background-color: rgba(13, 17, 23, 0.94);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--cfh-borde-tecnico);
}

body.admin-bar .cfh-site-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .cfh-site-header {
		top: 46px;
	}
}

.cfh-site-header .cfh-brand-link,
.cfh-site-header .wp-block-buttons,
.cfh-site-header .wp-block-button {
	flex-shrink: 0;
}

.cfh-site-header .wp-block-button__link {
	white-space: nowrap;
}

@media (max-width: 1120px) and (min-width: 681px) {
	.cfh-site-header .wp-block-navigation ul {
		gap: 14px !important;
	}

	.cfh-brand-desktop {
		height: 44px !important;
		max-height: 44px;
	}
}

.cfh-site-header .wp-block-navigation a {
	color: var(--cfh-blanco-titanio);
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--cfh-transition);
}

.cfh-site-header .wp-block-navigation a:hover,
.cfh-site-header .wp-block-navigation .current-menu-item > a {
	color: var(--cfh-cian-navegacion);
}

/* Drawer móvil en temas oscuros (corrige contraste blanco por defecto de WP) */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--cfh-vacio-grafito) !important;
	color: var(--cfh-blanco-titanio) !important;
	padding: 2rem !important;
}

.wp-block-navigation__responsive-container.is-menu-open a {
	color: var(--cfh-blanco-titanio) !important;
	font-size: 1.125rem;
}

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	color: var(--cfh-blanco-titanio);
	border: 1px solid var(--cfh-borde-tecnico);
	border-radius: var(--cfh-radius-sm);
	padding: 6px;
}

/* ==========================================================================
   LIENZOS, PANELES Y ELEMENTOS ARQUITECTÓNICOS CFH (Retícula 8px)
   ========================================================================== */
/* Lienzo técnico tranquilo (70% de descanso con micro-retícula discreta) */
.cfh-canvas-grid {
	background-color: var(--cfh-vacio-grafito);
	background-image:
		linear-gradient(to right, rgba(148, 167, 176, 0.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(148, 167, 176, 0.04) 1px, transparent 1px);
	background-size: 32px 32px;
}

.cfh-hero-surface {
	position: relative;
	background:
		radial-gradient(ellipse 65% 50% at 50% 18%, rgba(56, 189, 248, 0.08), transparent 70%),
		radial-gradient(ellipse 50% 40% at 28% 24%, rgba(245, 196, 81, 0.06), transparent 65%),
		var(--cfh-vacio-grafito);
	border-bottom: 1px solid var(--cfh-borde-tecnico);
}

/* Paneles de información en Acero Hangar (#161B22) */
.is-style-cfh-panel,
.cfh-panel {
	background-color: var(--cfh-acero-hangar);
	border: 1px solid var(--cfh-borde-tecnico);
	border-radius: var(--cfh-radius-md);
	transition: border-color var(--cfh-transition), transform var(--cfh-transition);
}

.cfh-panel--interactive:hover {
	border-color: rgba(56, 189, 248, 0.45);
	transform: translateY(-2px);
}

/* Panel técnico con filete superior en Cobre Forja / Estela Áurea */
.is-style-cfh-panel-cobre,
.cfh-panel-cobre {
	background-color: var(--cfh-acero-hangar);
	border: 1px solid var(--cfh-borde-tecnico);
	border-top: 2px solid var(--cfh-cobre-forja);
	border-radius: var(--cfh-radius-md);
}

/* Patrón de tarjeta de división con acento limpio */
.cfh-division-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

/* Etiqueta breve de sección (Space Grotesk, mayúsculas 0.10em tracking — Manual Pág. 16) */
.is-style-cfh-kicker,
.cfh-kicker {
	font-family: var(--wp--preset--font-family--space-grotesk) !important;
	font-size: 0.8125rem !important;
	font-weight: 600 !important;
	letter-spacing: 0.10em !important;
	text-transform: uppercase !important;
	color: var(--cfh-cian-navegacion);
	line-height: 1.3 !important;
}

.cfh-kicker--cobre {
	color: var(--cfh-cobre-forja);
}

.cfh-kicker--aurea {
	color: var(--cfh-estela-aurea);
}

/* Línea breve Estela Áurea (#F5C451 — Manual Pág. 12: "Líneas breves y señalización destacada") */
.is-style-cfh-estela,
.cfh-estela-rule {
	border: none !important;
	height: 2px !important;
	width: 72px !important;
	max-width: 72px !important;
	margin-left: 0 !important;
	background: linear-gradient(90deg, var(--cfh-estela-aurea), rgba(245, 196, 81, 0.12)) !important;
	opacity: 1 !important;
}

.is-style-cfh-estela.has-text-align-center,
.cfh-estela-rule--center {
	margin-inline: auto !important;
}

/* Botones secundarios coherentes con el sistema */
.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button.is-style-cfh-outline-cian > .wp-block-button__link {
	background-color: transparent !important;
	color: var(--cfh-cian-navegacion) !important;
	border: 1px solid rgba(56, 189, 248, 0.55) !important;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-cfh-outline-cian > .wp-block-button__link:hover {
	background-color: rgba(56, 189, 248, 0.1) !important;
	color: var(--cfh-blanco-titanio) !important;
	border-color: var(--cfh-cian-navegacion) !important;
}

.wp-block-button.is-style-cfh-outline-cobre > .wp-block-button__link {
	background-color: transparent !important;
	color: var(--cfh-cobre-forja) !important;
	border: 1px solid rgba(213, 184, 167, 0.5) !important;
}

.wp-block-button.is-style-cfh-outline-cobre > .wp-block-button__link:hover {
	background-color: rgba(213, 184, 167, 0.1) !important;
	color: var(--cfh-blanco-titanio) !important;
	border-color: var(--cfh-cobre-forja) !important;
}

/* Garantía WCAG 2.2: Grafito (#0D1117) sobre Naranja Forja (#FF6B2B) = 6.66:1 */
.wp-block-button__link {
	word-break: keep-all;
	overflow-wrap: normal;
}

.wp-block-button:not(.is-style-outline):not(.is-style-cfh-outline-cian):not(.is-style-cfh-outline-cobre) > .wp-block-button__link,
.wp-block-button:not(.is-style-outline):not(.is-style-cfh-outline-cian):not(.is-style-cfh-outline-cobre) > .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline):not(.is-style-cfh-outline-cian):not(.is-style-cfh-outline-cobre) > .wp-block-button__link:focus,
.wp-block-button:not(.is-style-outline):not(.is-style-cfh-outline-cian):not(.is-style-cfh-outline-cobre) > .wp-block-button__link:visited {
	background-color: var(--cfh-naranja-forja, #FF6B2B);
	color: var(--cfh-vacio-grafito, #0D1117) !important;
	font-weight: 600;
}

.wp-block-button:not(.is-style-outline):not(.is-style-cfh-outline-cian):not(.is-style-cfh-outline-cobre) > .wp-block-button__link:hover {
	background-color: #FF8147;
}

/* Indicadores de estado funcionales con icono/etiqueta explícita (Manual Pág. 14) */
.cfh-status-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 12px;
	border-radius: var(--cfh-radius-sm);
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	border: 1px solid currentColor;
}

.cfh-status-pill--ok {
	color: var(--cfh-verde);
	background-color: rgba(34, 197, 94, 0.1);
}

.cfh-status-pill--warn {
	color: var(--cfh-ambar);
	background-color: rgba(245, 158, 11, 0.1);
}

.cfh-status-pill--alert {
	color: var(--cfh-rojo);
	background-color: rgba(239, 68, 68, 0.1);
}

.cfh-status-pill--info {
	color: var(--cfh-cian-navegacion);
	background-color: rgba(56, 189, 248, 0.1);
}

/* ==========================================================================
   MODO DOCUMENTAL D01 — USO RESTRINGIDO (Manual Págs. 8, 13 y 19)
   Marfil de soporte (#F3F1EB) + Grafito documental (#141C24) = 15.22:1
   Cabecera D01 contenida en su rectángulo oscuro original #141C24.
   ========================================================================== */
.is-style-cfh-documental,
.cfh-documental-sheet {
	background-color: var(--cfh-marfil-soporte) !important;
	color: var(--cfh-grafito-documental) !important;
	border: 1px solid var(--cfh-plata-mate);
	border-radius: var(--cfh-radius-sm);
}

.is-style-cfh-documental h1,
.is-style-cfh-documental h2,
.is-style-cfh-documental h3,
.is-style-cfh-documental h4,
.is-style-cfh-documental p,
.is-style-cfh-documental li,
.cfh-documental-sheet h1,
.cfh-documental-sheet h2,
.cfh-documental-sheet h3,
.cfh-documental-sheet h4,
.cfh-documental-sheet p,
.cfh-documental-sheet li {
	color: var(--cfh-grafito-documental) !important;
}

.cfh-documental-sheet .cfh-doc-meta {
	color: #3D4E58 !important;
	border-bottom: 1px solid var(--cfh-plata-mate);
	padding-bottom: 12px;
}

.cfh-d01-banner-box {
	display: inline-block;
	background-color: var(--cfh-grafito-documental);
	padding: 16px 24px;
	border-radius: 2px;
	max-width: 440px;
}

.cfh-d01-banner-box img {
	width: 100%;
	height: auto;
	display: block;
}

/* ==========================================================================
   ENTRADAS, ARCHIVOS, FORMULARIOS Y COMENTARIOS WORDPRESS
   ========================================================================== */
.cfh-post-card {
	background-color: var(--cfh-acero-hangar);
	border: 1px solid var(--cfh-borde-tecnico);
	border-radius: var(--cfh-radius-md);
	padding: 24px;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: border-color var(--cfh-transition);
}

.cfh-post-card:hover {
	border-color: rgba(213, 184, 167, 0.55);
}

.wp-block-post-featured-image img {
	border-radius: var(--cfh-radius-sm);
	border: 1px solid var(--cfh-borde-tecnico);
}

/* Formulario de búsqueda y comentarios */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select,
.wp-block-search__input {
	background-color: var(--cfh-acero-hangar);
	color: var(--cfh-blanco-titanio);
	border: 1px solid var(--cfh-borde-tecnico);
	border-radius: var(--cfh-radius-sm);
	padding: 10px 14px;
	font-family: var(--wp--preset--font-family--inter);
	font-size: 1rem;
}

input::placeholder,
textarea::placeholder {
	color: var(--cfh-azul-grisaceo);
}

.wp-block-search__button,
input[type="submit"],
.submit {
	background-color: var(--cfh-naranja-forja);
	color: var(--cfh-vacio-grafito);
	border: 1px solid var(--cfh-naranja-forja);
	border-radius: var(--cfh-radius-sm);
	padding: 10px 20px;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-weight: 600;
	cursor: pointer;
	transition: background-color var(--cfh-transition);
}

.wp-block-search__button:hover,
input[type="submit"]:hover {
	background-color: #FF8147;
}

/* Paginación */
.wp-block-query-pagination {
	gap: 12px;
}

.wp-block-query-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid var(--cfh-borde-tecnico);
	background-color: var(--cfh-acero-hangar);
	border-radius: var(--cfh-radius-sm);
	text-decoration: none;
}

.wp-block-query-pagination .page-numbers.current {
	background-color: var(--cfh-cian-navegacion);
	color: var(--cfh-vacio-grafito);
	border-color: var(--cfh-cian-navegacion);
	font-weight: 600;
}

/* ==========================================================================
   PIE DE PÁGINA CORPORATIVO
   ========================================================================== */
.cfh-site-footer {
	background-color: var(--cfh-acero-hangar);
	border-top: 1px solid var(--cfh-borde-tecnico);
}

.cfh-footer-links a {
	color: var(--cfh-plata-mate);
	text-decoration: none;
	font-size: 0.9375rem;
}

.cfh-footer-links a:hover {
	color: var(--cfh-cian-navegacion);
	text-decoration: underline;
}

/* ==========================================================================
   IMPRESIÓN DOCUMENTAL (Manual Pág. 13 y 19: texto oscuro sobre papel claro)
   ========================================================================== */
@media print {
	@page {
		margin: 20mm;
	}

	body {
		background: #FFFFFF !important;
		color: #141C24 !important;
	}

	.cfh-site-header,
	.cfh-site-footer,
	.wp-block-buttons,
	.wp-block-search {
		display: none !important;
	}

	.cfh-panel,
	.cfh-panel-cobre,
	.is-style-cfh-panel,
	.is-style-cfh-panel-cobre {
		background: #FFFFFF !important;
		color: #141C24 !important;
		border: 1px solid #BEC7CB !important;
	}

	h1, h2, h3, h4, p, li, td, th, a {
		color: #141C24 !important;
	}
}
