/*
Theme Name: AFEMPES Salud Mental
Theme URI: https://www.afempes.es/
Description: Tema hijo moderno, accesible y seguro sobre Kadence para AFEMPES (Paterna, L'Eliana y San Antonio de Benagéber).
Author: David Crespo
Author URI: https://www.david-crespo.com/
Template: kadence
Version: 1.2.3
Text Domain: afempes-salud-mental
*/

:root {
	/* Paleta oficial AFEMPES */
	--af-bg: #F7FAF8;
	--af-surface: #FFFFFF;
	--af-surface-soft: #EBF2EE;
	--af-surface-rose: #FBF6F7;
	--af-primary: #165B4A;
	--af-primary-hover: #0F4336;
	--af-primary-dark: #103B31;
	--af-primary-tint: rgba(22, 91, 74, 0.08);
	--af-rose: #A66E7E;
	--af-rose-deep: #7C4B5A;
	--af-sage: #89A599;
	--af-ink: #132A24;
	--af-muted: #425A53;
	--af-border: rgba(22, 91, 74, 0.13);
	--af-border-strong: rgba(22, 91, 74, 0.26);
	--af-shadow-sm: 0 6px 20px -8px rgba(18, 72, 58, 0.08);
	--af-shadow-md: 0 18px 42px -14px rgba(18, 72, 58, 0.10);
	--af-shadow-lg: 0 28px 60px -18px rgba(16, 59, 49, 0.18);

	/* Escala uniforme de radios */
	--af-radius-sm: 10px;
	--af-radius-md: 16px;
	--af-radius-lg: 22px;
	--af-radius-pill: 9999px;

	/* Tipografía */
	--af-font-display: "Outfit", system-ui, -apple-system, sans-serif;
	--af-font-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;

	/* Contenedor y z-index */
	--af-container: 1280px;
	--af-z-sticky: 40;
	--af-z-dropdown: 60;
	--af-z-drawer: 80;
	--af-z-modal: 100;

	/* Sincronización con tokens de Kadence para páginas interiores y entradas */
	--global-palette1: #165B4A;
	--global-palette2: #0F4336;
	--global-palette3: #132A24;
	--global-palette4: #243F38;
	--global-palette5: #425A53;
	--global-palette6: #5C746D;
	--global-palette7: #EBF2EE;
	--global-palette8: #F7FAF8;
	--global-palette9: #FFFFFF;
	--global-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
	--global-heading-font-family: "Outfit", system-ui, -apple-system, sans-serif;
}

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

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body.af-body {
	margin: 0;
	background-color: var(--af-bg);
	color: var(--af-ink);
	font-family: var(--af-font-body);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--af-primary);
	text-decoration-thickness: 1.5px;
	text-underline-offset: 3px;
	transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

a:hover {
	color: var(--af-primary-hover);
}

:focus-visible {
	outline: 3px solid #165B4A;
	outline-offset: 3px;
}

h1, h2, h3, h4 {
	font-family: var(--af-font-display);
	color: var(--af-ink);
	letter-spacing: -0.025em;
	text-wrap: balance;
	margin-top: 0;
}

p {
	text-wrap: pretty;
}

/* Skip link accesible */
.af-skip-link {
	position: absolute;
	left: -9999px;
	top: 12px;
	z-index: 200;
	background: var(--af-primary);
	color: #FFFFFF;
	padding: 0.75rem 1.25rem;
	border-radius: var(--af-radius-pill);
	font-weight: 600;
	text-decoration: none;
}

.af-skip-link:focus {
	left: 16px;
}

.af-container {
	width: 100%;
	max-width: var(--af-container);
	margin-inline: auto;
	padding-inline: clamp(1rem, 3vw, 2rem);
}

/* Botones de sistema */
.af-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	font-family: var(--af-font-body);
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1;
	padding: 0.875rem 1.5rem;
	border-radius: var(--af-radius-pill);
	border: 1.5px solid transparent;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease;
}

.af-btn:active {
	transform: translateY(1px) scale(0.985);
}

.af-body .af-btn--primary {
	background-color: var(--af-primary);
	color: #FFFFFF;
	box-shadow: 0 8px 20px -6px rgba(22, 91, 74, 0.38);
}

.af-body .af-btn--primary:hover,
.af-body .af-btn--primary:focus,
.af-body .af-btn--primary:focus-visible {
	background-color: var(--af-primary-hover);
	color: #FFFFFF;
	box-shadow: 0 12px 24px -6px rgba(15, 67, 54, 0.44);
}

.af-body .af-btn--secondary {
	background-color: var(--af-surface);
	color: var(--af-primary);
	border-color: var(--af-border-strong);
	box-shadow: none;
}

.af-body .af-btn--secondary:hover,
.af-body .af-btn--secondary:focus,
.af-body .af-btn--secondary:focus-visible {
	background-color: var(--af-surface-soft);
	color: var(--af-primary-hover);
	border-color: var(--af-primary);
	box-shadow: none;
}

.af-btn--sm {
	padding: 0.6rem 1.1rem;
	font-size: 0.875rem;
}

.af-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Ajuste limpio para entradas y páginas interiores no Elementor */
body:not(.home):not(.elementor-page) #inner-wrap {
	padding-block: clamp(2rem, 4vw, 3.5rem);
}

body.elementor-page #inner-wrap {
	padding-block: 0;
}

body:not(.home) .content-container.site-container {
	max-width: var(--af-container);
	margin-inline: auto;
	padding-inline: clamp(1rem, 3vw, 2rem);
}

body:not(.home) .entry-content-wrap,
body:not(.home) .entry {
	background: var(--af-surface);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-lg);
	padding: clamp(1.5rem, 3vw, 3rem);
	box-shadow: var(--af-shadow-sm);
}

/* Ocultar elementos visuales duplicados del editor si un bloque antiguo usara paddings raros */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
	*, *::before, *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
