/* ==========================================================================
   EOM Cabecera y Pie — diseño "Editorial limpia" con modo oscuro.
   ========================================================================== */

:root {
	--eomhf-bg: #ffffff;
	--eomhf-surface: #f5f7f8;
	--eomhf-text: #1e293b;
	--eomhf-muted: #556273;
	--eomhf-border: #e2e8f0;
	--eomhf-active: #eef2f4;
	--eomhf-accent: #177784;
	--eomhf-on-accent: #ffffff;
	--eomhf-serif: "IBM Plex Serif", Georgia, serif;
}

html[data-theme="dark"] {
	color-scheme: dark;
	--eomhf-bg: #0f1517;
	--eomhf-surface: #151d20;
	--eomhf-text: #e6edf0;
	--eomhf-muted: #a5b3bf;
	--eomhf-border: #26323a;
	--eomhf-active: #26323a;
	--eomhf-accent: #4fb3bf;
	--eomhf-on-accent: #0b1214;
}

/* ---------- Cabecera ---------- */

.eomhf-header {
	position: relative;
	z-index: 100;
	background: var(--eomhf-bg);
	color: var(--eomhf-text);
	border-bottom: 1px solid var(--eomhf-border);
}

.eomhf-bar {
	display: flex;
	align-items: center;
	gap: 24px;
	max-width: 1240px;
	min-height: 76px;
	margin: 0 auto;
	padding: 0 24px;
}

.eomhf-header a,
.eomhf-footer a {
	color: inherit;
	text-decoration: none;
}

.eomhf-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

.eomhf-logo {
	display: block;
	width: 40px;
	height: 40px;
}

.eomhf-footer .eomhf-logo {
	width: 36px;
	height: 36px;
}

html[data-theme="dark"] .eomhf-logo {
	filter: invert(1);
}

.eomhf-name {
	font-family: var(--eomhf-serif);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.2;
}

.eomhf-panel {
	display: flex;
	flex: 1 1 auto;
	justify-content: center;
}

.eomhf-menu,
.eomhf-menu .sub-menu,
.eomhf-links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.eomhf-menu {
	display: flex;
	align-items: center;
	gap: 6px;
}

.eomhf-menu > li {
	position: relative;
	display: flex;
	align-items: center;
}

.eomhf-menu a {
	display: block;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.3;
}

.eomhf-menu a:hover,
.eomhf-menu a:focus-visible {
	background: var(--eomhf-active);
}

/* Página actual (y "Blog" mientras se lee un artículo). */
.eomhf-menu > .current-menu-item > a,
.eomhf-menu > .current-menu-ancestor > a,
.eomhf-menu > .current_page_parent > a,
.eomhf-menu > .current-menu-parent > a {
	background: var(--eomhf-active);
}

.eomhf-menu > .menu-item-has-children > a {
	padding-right: 4px;
	border-radius: 10px 0 0 10px;
}

.eomhf-subtoggle {
	display: grid;
	place-items: center;
	width: 28px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0 10px 10px 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.eomhf-menu > .menu-item-has-children:hover > .eomhf-subtoggle,
.eomhf-menu > .current-menu-ancestor > .eomhf-subtoggle,
.eomhf-menu > .current_page_parent > .eomhf-subtoggle {
	background: var(--eomhf-active);
}

.eomhf-subtoggle svg {
	transition: transform 0.15s;
}

.eomhf-menu .is-open > .eomhf-subtoggle svg {
	transform: rotate(180deg);
}

/* Submenú desplegable (escritorio). */
.eomhf-menu .sub-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 260px;
	padding: 8px;
	border: 1px solid var(--eomhf-border);
	border-radius: 12px;
	background: var(--eomhf-bg);
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.eomhf-menu .sub-menu::before {
	content: "";
	position: absolute;
	inset: -10px 0 auto;
	height: 10px;
}

.eomhf-menu li:hover > .sub-menu,
.eomhf-menu li:focus-within > .sub-menu,
.eomhf-menu li.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.eomhf-menu .sub-menu a {
	padding: 9px 12px;
	font-weight: 400;
}

.eomhf-menu .sub-menu .current-menu-item > a {
	background: var(--eomhf-active);
}

.eomhf-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

.eomhf-iconbtn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: var(--eomhf-text);
	cursor: pointer;
}

.eomhf-iconbtn:hover {
	background: var(--eomhf-active);
}

.eomhf-iconbtn--outline {
	border-color: var(--eomhf-border);
}

.eomhf-i--sun,
html[data-theme="dark"] .eomhf-i--moon,
.eomhf-i--close,
.eomhf-header.is-open .eomhf-i--menu {
	display: none;
}

html[data-theme="dark"] .eomhf-i--sun,
.eomhf-header.is-open .eomhf-i--close {
	display: block;
}

.eomhf-bar-account,
.eomhf-panel-account {
	display: flex;
	align-items: center;
	gap: 8px;
}

.eomhf-panel-account,
.eomhf-burger {
	display: none;
}

.eomhf-login {
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
}

.eomhf-login:hover {
	background: var(--eomhf-active);
}

.eomhf-header .eomhf-cta {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	border-radius: 10px;
	background: var(--eomhf-accent);
	color: var(--eomhf-on-accent);
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.eomhf-header .eomhf-cta:hover {
	filter: brightness(1.08);
}

.eomhf-header :focus-visible,
.eomhf-footer :focus-visible {
	outline: 2px solid var(--eomhf-accent);
	outline-offset: 2px;
}

.eomhf-search {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px 18px;
}

.eomhf-search .search-form {
	display: flex;
	gap: 8px;
}

.eomhf-search input[type="search"],
.eomhf-search .search-field {
	flex: 1 1 auto;
	min-height: 44px;
	border: 1px solid var(--eomhf-border);
	border-radius: 10px;
	background: var(--eomhf-bg);
	color: var(--eomhf-text);
}

/* ---------- Móvil y tablet ---------- */

@media (max-width: 1100px) {
	.eomhf-bar {
		flex-wrap: wrap;
		gap: 12px;
		min-height: 64px;
		padding: 10px 16px;
	}

	.eomhf-brand {
		flex: 1 1 0;
		min-width: 0;
	}

	.eomhf-name {
		font-size: 18px;
	}

	.eomhf-bar-account {
		display: none;
	}

	.eomhf-burger {
		display: grid;
	}

	.eomhf-panel {
		display: none;
		order: 3;
		flex: 1 1 100%;
		flex-direction: column;
		gap: 12px;
		padding: 4px 0 12px;
	}

	.eomhf-header.is-open .eomhf-panel {
		display: flex;
	}

	.eomhf-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 2px;
	}

	.eomhf-menu > li {
		flex-wrap: wrap;
	}

	.eomhf-menu > li > a {
		flex: 1 1 auto;
	}

	.eomhf-subtoggle {
		width: 44px;
		height: 44px;
	}

	.eomhf-menu .sub-menu {
		position: static;
		display: none;
		flex: 1 1 100%;
		min-width: 0;
		margin: 2px 0 6px 12px;
		padding: 0 0 0 8px;
		border: 0;
		border-left: 2px solid var(--eomhf-border);
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.eomhf-menu li.is-open > .sub-menu {
		display: block;
	}

	.eomhf-panel-account {
		display: flex;
		flex-wrap: wrap;
	}
}

@media (max-width: 420px) {
	.eomhf-name {
		font-size: 16px;
	}

	.eomhf-actions .eomhf-iconbtn[data-eomhf="search"] {
		display: none;
	}
}

/* ---------- Pie ---------- */

.eomhf-footer {
	background: var(--eomhf-surface);
	color: var(--eomhf-text);
	border-top: 1px solid var(--eomhf-border);
}

.eomhf-footer-in {
	display: grid;
	grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
	gap: 48px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 56px 24px 48px;
}

.eomhf-about {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.eomhf-footer .eomhf-name {
	font-size: 18px;
}

.eomhf-tagline {
	max-width: 340px;
	margin: 0;
	color: var(--eomhf-muted);
	font-size: 15px;
	line-height: 1.6;
}

.eomhf-coltitle {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.eomhf-about .eomhf-coltitle {
	margin-top: 6px;
}

.eomhf-col .eomhf-coltitle {
	margin-bottom: 14px;
}

.eomhf-links li {
	margin: 0 0 4px;
}

.eomhf-links a {
	display: inline-block;
	padding: 4px 0;
	color: var(--eomhf-muted);
	font-size: 15px;
}

.eomhf-links a:hover {
	color: var(--eomhf-text);
	text-decoration: underline;
}

/* Iconos de redes (del plugin EOM Social): versión sobria en el pie. */
.eomhf-footer .eom-profiles {
	gap: 10px;
}

.eomhf-footer .eom-share__btn {
	border: 1px solid var(--eomhf-border);
	background: var(--eomhf-bg);
	color: var(--eomhf-text) !important;
}

.eomhf-footer .eom-share__btn:hover {
	border-color: var(--eomhf-accent);
	color: var(--eomhf-accent) !important;
	filter: none;
}

.eomhf-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	max-width: 1240px;
	margin: 0 auto;
	padding: 20px 24px;
	border-top: 1px solid var(--eomhf-border);
	color: var(--eomhf-muted);
	font-size: 14px;
}

.eomhf-bottom a:hover {
	color: var(--eomhf-text);
}

@media (max-width: 900px) {
	.eomhf-footer-in {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 36px 24px;
		padding: 44px 16px 36px;
	}

	.eomhf-about {
		grid-column: 1 / -1;
	}

	.eomhf-bottom {
		padding: 18px 16px;
	}
}

/* ==========================================================================
   Modo oscuro para el resto de la web.
   ========================================================================== */

html[data-theme="dark"] {
	--ast-global-color-2: #e6edf0;
	--ast-global-color-3: #c3cdd6;
	--ast-global-color-4: #151d20;
	--ast-global-color-5: #111a1d;
	--ast-global-color-6: #e6edf0;
	--ast-global-color-7: #2b3840;
	--ast-global-color-8: #e6edf0;
}

html[data-theme="dark"] body,
html[data-theme="dark"] #page,
html[data-theme="dark"] .site-content,
html[data-theme="dark"] .ast-separate-container,
html[data-theme="dark"] .ast-plain-container,
html[data-theme="dark"] .ast-page-builder-template {
	background-color: #0f1517 !important;
	color: #c3cdd6;
}

html[data-theme="dark"] .ast-separate-container .ast-article-single,
html[data-theme="dark"] .ast-separate-container .ast-article-post,
html[data-theme="dark"] .ast-separate-container .comments-area,
html[data-theme="dark"] .ast-separate-container .ast-author-box,
html[data-theme="dark"] article.post {
	background-color: #151d20 !important;
}

html[data-theme="dark"] .entry-content,
html[data-theme="dark"] .entry-content p,
html[data-theme="dark"] .entry-content li,
html[data-theme="dark"] .entry-content td,
html[data-theme="dark"] .entry-content th {
	color: #c3cdd6;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] .entry-title,
html[data-theme="dark"] .entry-title a {
	color: #e6edf0;
}

/* Enlaces de texto: más claros (los botones mantienen el azul de Astra, que contrasta con su texto blanco). */
html[data-theme="dark"] .site-content a:not([class]),
html[data-theme="dark"] .entry-content a:not([class]),
html[data-theme="dark"] .ast-breadcrumbs a,
html[data-theme="dark"] .entry-meta a {
	color: #5fb2ef;
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
	background-color: #0f1517;
	color: #e6edf0;
	border-color: #2b3840;
}

html[data-theme="dark"] hr,
html[data-theme="dark"] .wp-block-separator {
	border-color: #2b3840;
}

/* Portada y blog (estilos propios con variables). */
html[data-theme="dark"] .eomh,
html[data-theme="dark"] .eomb {
	--ink: #e6edf0;
	--muted: #a5b3bf;
	--line: #2b3840;
	--paper: #151d20;
	--wash: #111a1d;
	--teal: #4fb3bf;
	--teal-d: #4fb3bf;
	--blue: #5fb2ef;
	--acc: #a98be0;
}

/* Secciones que ya eran oscuras (usaban --ink de fondo). */
html[data-theme="dark"] .eomh-socios,
html[data-theme="dark"] .eomb-cta--dark {
	background: #13262a !important;
}

/* Stackable: separadores y contenedores claros. */
html[data-theme="dark"] .ugb-separator-wrapper path {
	fill: #0f1517 !important;
}

html[data-theme="dark"] .ugb-container__wrapper {
	background-color: #151d20 !important;
}

html[data-theme="dark"] .eomh-hero::before {
	background-image: repeating-linear-gradient(#22303a 0, #22303a 1px, transparent 1px, transparent 24px) !important;
}

html[data-theme="dark"] .eomh-chip {
	background: #13262a !important;
}

/* Botones: fondo claro/turquesa con texto oscuro. */
html[data-theme="dark"] .eomh-btn--pri,
html[data-theme="dark"] .eomh-btn--light,
html[data-theme="dark"] .eomb-btn {
	color: #0b1214 !important;
}

html[data-theme="dark"] .eomh-btn--light,
html[data-theme="dark"] .eomb-cta--dark .eomb-btn {
	background: #e6edf0 !important;
}

/* Anuncios internos (EOM Publicidad). */
html[data-theme="dark"] [class*="eom-sp-house"]:not(.eom-sp-house-btn):not([class*="eom-sp-house-title"]):not([class*="eom-sp-house-desc"]) {
	background: #151d20 !important;
	border-color: #2b3840 !important;
}

html[data-theme="dark"] .eom-sp-house-title {
	color: #e6edf0 !important;
}

html[data-theme="dark"] .eom-sp-house-desc {
	color: #a5b3bf !important;
}

/* Índice de contenidos, anuncios internos y comentarios. */
html[data-theme="dark"] #toc_container,
html[data-theme="dark"] .toc_light_blue,
html[data-theme="dark"] .eom-sp-slot {
	background: #151d20 !important;
	border-color: #2b3840 !important;
}

html[data-theme="dark"] #wpdcom,
html[data-theme="dark"] #wpdcom .wpd-thread-head,
html[data-theme="dark"] #wpdcom .wpd-comment-text,
html[data-theme="dark"] #wpdcom .wpd-comment-author {
	color: #c3cdd6;
}

html[data-theme="dark"] #wpdcom textarea,
html[data-theme="dark"] #wpdcom .wpd-form-row input {
	background: #0f1517 !important;
	color: #e6edf0 !important;
}

html[data-theme="dark"] #wpdcom .wpd-thread-info,
html[data-theme="dark"] #wpdcom .wpd-sbs-title,
html[data-theme="dark"] .woocommerce-breadcrumb,
html[data-theme="dark"] .woocommerce-breadcrumb a {
	color: #a5b3bf !important;
}

html[data-theme="dark"] #wpdcom .wpd-rating-value {
	background: #151d20 !important;
}

html[data-theme="dark"] .wpd-rating-value {
	background: #151d20 !important;
}

/* Azules de Astra y de los anuncios usados como texto. */
html[data-theme="dark"] .entry-meta,
html[data-theme="dark"] .entry-meta *,
html[data-theme="dark"] .eom-sp-house-kicker,
html[data-theme="dark"] #wpdcom a:not([class*="btn"]):not([class*="button"]) {
	color: #5fb2ef !important;
}

/* Colores escritos a mano en el HTML del contenido (style="..."). */
html[data-theme="dark"] .site-content [style*="background:#f"],
html[data-theme="dark"] .site-content [style*="background:#e"],
html[data-theme="dark"] .site-content [style*="background-color:#f"]:not(.has-text-color),
html[data-theme="dark"] .site-content [style*="background-color:#e"]:not(.has-text-color) {
	background: #151d20 !important;
	color: #c3cdd6 !important;
}

html[data-theme="dark"] .site-content [style*="color:#1"]:not([style*="background"]),
html[data-theme="dark"] .site-content [style*="color:#2"]:not([style*="background"]),
html[data-theme="dark"] .site-content [style*="color:#3"]:not([style*="background"]),
html[data-theme="dark"] .site-content [style*="color:#4"]:not([style*="background"]),
html[data-theme="dark"] .site-content [style*="color:#5"]:not([style*="background"]) {
	color: #c3cdd6 !important;
}

html[data-theme="dark"] .site-content [style*="color:#6a35b8"] {
	color: #a98be0 !important;
}
