/* ==========================================================================
   Tu Psicóloga en Casa — Blog
   Tokens tomados de la web principal (tupsicologaencasa.com)
   ========================================================================== */

:root {
	--tpec-cream: #f5f0e8;
	--tpec-cream-2: #ede6da;
	--tpec-paper: #ffffff;
	--tpec-line: #e0d8ca;
	--tpec-ink: #1a2e25;
	--tpec-muted: #4f6158;
	--tpec-forest-900: #1a2e25;
	--tpec-forest-800: #1f5a45;
	--tpec-forest-700: #2d7a5f;
	--tpec-sage-500: #5c9e83;
	--tpec-sage-300: #9cc4b0;
	--tpec-sage-100: #d8e7dd;
	--tpec-sage-50: #e8f0ea;
	--tpec-clay: #e8856a;
	--tpec-clay-600: #dc6e51;
	--tpec-clay-100: #fae3db;
	--tpec-radius-sm: 10px;
	--tpec-radius: 18px;
	--tpec-radius-lg: 28px;
	--tpec-shadow-sm: 0 1px 2px rgba(26, 46, 37, .06), 0 2px 8px rgba(26, 46, 37, .05);
	--tpec-shadow: 0 2px 4px rgba(26, 46, 37, .05), 0 12px 32px -8px rgba(26, 46, 37, .16);
	--tpec-container: 1180px;
	--tpec-gutter: clamp(20px, 5vw, 40px);
	--tpec-nav-h: 76px;
	--tpec-serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--tpec-sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
	-webkit-font-smoothing: antialiased;
	overflow-x: clip; /* clip (no hidden) para no romper el header sticky */
}

::selection { background: var(--tpec-sage-100); color: var(--tpec-ink); }

:where(a, button):focus-visible {
	outline: 2px solid var(--tpec-forest-700);
	outline-offset: 3px;
	border-radius: 4px;
}

h1, h2 { text-wrap: balance; }
h1 em, h2 em, .wp-block-heading em {
	font-style: italic;
	font-weight: 600;
	color: var(--tpec-forest-700);
}

/* Las piezas de la plantilla no se separan entre sí */
.wp-site-blocks > header,
.wp-site-blocks > main,
.wp-site-blocks > footer { margin-block-start: 0; }

.tpec-container {
	width: 100%;
	max-width: calc(var(--tpec-container) + var(--tpec-gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--tpec-gutter);
	box-sizing: border-box;
}

/* --- Eyebrow / lead / chip --------------------------------------------- */

.tpec-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: .78rem !important;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--tpec-forest-700);
	margin-bottom: 0;
}
.tpec-eyebrow::before {
	content: "";
	width: 22px;
	height: 1.5px;
	background: currentColor;
}

.tpec-lead {
	font-size: clamp(1.05rem, 1rem + .4vw, 1.2rem);
	color: var(--tpec-muted);
	max-width: 38em;
}

.tpec-chip { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tpec-chip a {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--tpec-sage-50);
	color: var(--tpec-forest-800);
	text-decoration: none;
	transition: background .2s;
}
.tpec-chip a:hover { background: var(--tpec-sage-100); color: var(--tpec-forest-800); }
.tpec-chip .wp-block-post-terms__separator { display: none; }
.tpec-chip a + a { margin-left: 6px; }

/* --- Botones (header/footer) ------------------------------------------- */

.tpec-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 22px;
	border-radius: 999px;
	border: 1.5px solid transparent;
	background: transparent;
	color: var(--tpec-forest-800);
	font-family: var(--tpec-sans);
	font-weight: 700;
	font-size: 1rem;
	text-decoration: none;
	white-space: nowrap;
	box-sizing: border-box;
	transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.tpec-btn--primary { background: var(--tpec-clay); color: var(--tpec-ink); }
.tpec-btn--primary:hover { background: var(--tpec-clay-600); color: var(--tpec-ink); box-shadow: 0 8px 20px -8px #dc6e5199; }
.tpec-btn--ghost:hover { background: var(--tpec-sage-50); color: var(--tpec-forest-800); }

/* Botones de bloque */
.wp-block-button .wp-block-button__link {
	min-height: 46px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.wp-block-button:not(.is-style-outline):not(.tpec-btn-light) .wp-block-button__link:hover {
	box-shadow: 0 8px 20px -8px #dc6e5199;
}
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border-color: var(--tpec-forest-800);
	color: var(--tpec-forest-800);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: var(--tpec-forest-800);
	color: #fff;
}
.wp-block-button.tpec-btn-light .wp-block-button__link {
	background: var(--tpec-cream);
	color: var(--tpec-forest-800);
}
.wp-block-button.tpec-btn-light .wp-block-button__link:hover { background: #fff; }

/* --- Logo ---------------------------------------------------------------- */

.tpec-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--tpec-ink);
}
.tpec-logo__mark { width: 42px; height: auto; flex: none; }
.tpec-logo__text {
	display: flex;
	flex-direction: column;
	font-family: var(--tpec-serif);
	line-height: 1;
	color: var(--tpec-ink);
}
.tpec-logo__name { font-size: 1.22rem; font-weight: 700; }
.tpec-logo__sub { font-size: .98rem; font-style: italic; color: var(--tpec-forest-700); margin-top: 2px; }
.tpec-logo--light .tpec-logo__text { color: var(--tpec-cream); }
.tpec-logo--light .tpec-logo__sub { color: var(--tpec-sage-300); }

/* --- Header -------------------------------------------------------------- */

.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 46px; }
}
@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; }
}

.tpec-nav {
	background: rgba(245, 240, 232, 0);
	transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.tpec-nav--scrolled {
	background: rgba(245, 240, 232, .88);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
	backdrop-filter: saturate(1.4) blur(12px);
	box-shadow: 0 1px 0 var(--tpec-line);
}
.tpec-nav__inner {
	height: var(--tpec-nav-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}
.tpec-nav .tpec-logo { position: relative; z-index: 2; }
.tpec-nav__menu { display: flex; align-items: center; gap: 28px; }
.tpec-nav__menu ul { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.tpec-nav__menu ul a {
	position: relative;
	padding: 6px 0;
	font-weight: 600;
	font-size: .95rem;
	color: var(--tpec-ink);
	text-decoration: none;
}
.tpec-nav__menu ul a::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 1.5px;
	background: var(--tpec-sage-500);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .25s;
}
.tpec-nav__menu ul a:hover::after { transform: scaleX(1); }
.tpec-nav__actions { display: flex; gap: 8px; }

.tpec-nav__toggle {
	display: none;
	position: relative;
	z-index: 2;
	width: 46px;
	height: 46px;
	border: 0;
	border-radius: 50%;
	background: var(--tpec-sage-50);
	cursor: pointer;
}
.tpec-nav__toggle span {
	position: absolute;
	left: 13px; right: 13px;
	height: 2px;
	border-radius: 2px;
	background: var(--tpec-forest-800);
	transition: transform .3s, top .3s;
}
.tpec-nav__toggle span:first-child { top: 18px; }
.tpec-nav__toggle span:last-child { top: 26px; }
.tpec-nav--open .tpec-nav__toggle span:first-child { top: 22px; transform: rotate(45deg); }
.tpec-nav--open .tpec-nav__toggle span:last-child { top: 22px; transform: rotate(-45deg); }

@media (max-width: 960px) {
	.tpec-nav__toggle { display: block; }
	.tpec-nav__menu {
		position: fixed;
		inset: 0;
		flex-direction: column;
		align-items: stretch;
		justify-content: space-between;
		gap: 32px;
		padding: calc(var(--tpec-nav-h) + 24px) var(--tpec-gutter) 32px;
		background: var(--tpec-cream);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-8px);
		transition: opacity .3s, transform .3s, visibility .3s;
		overflow-y: auto;
	}
	.tpec-nav--open .tpec-nav__menu { opacity: 1; visibility: visible; transform: none; }
	/* backdrop-filter crearía un contenedor para el menú fijo: se quita al abrir */
	.tpec-nav--open {
		background: var(--tpec-cream);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}
	.admin-bar .tpec-nav__menu { padding-top: calc(var(--tpec-nav-h) + 24px + 46px); }
	.tpec-nav__menu ul { flex-direction: column; gap: 0; }
	.tpec-nav__menu ul a {
		display: block;
		padding: 14px 0;
		border-bottom: 1px solid var(--tpec-line);
		font-family: var(--tpec-serif);
		font-weight: 600;
		font-size: 1.5rem;
		color: var(--tpec-forest-800);
	}
	.tpec-nav__menu ul a::after { display: none; }
	.tpec-nav__actions { flex-direction: column; }
	.tpec-nav__actions .tpec-btn { min-height: 54px; }
	.tpec-nav__actions .tpec-btn--ghost { border-color: var(--tpec-line); }
}

/* --- Main / hero --------------------------------------------------------- */

.tpec-main { padding-bottom: clamp(72px, 10vw, 128px); }

.tpec-hero {
	position: relative;
	padding-top: clamp(40px, 7vw, 96px);
	padding-bottom: clamp(32px, 5vw, 56px);
}
.tpec-hero > * + * { margin-block-start: 18px; }
.tpec-hero h1,
.tpec-hero .wp-block-query-title { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.6rem); line-height: 1.08; }
.tpec-hero--compact { padding-top: clamp(32px, 5vw, 64px); }

/* Hojas decorativas en la portada del blog */
.tpec-hero::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: clamp(120px, 18vw, 230px);
	aspect-ratio: 120 / 100;
	transform: translateY(-40%);
	background: url("../img/favicon.svg") no-repeat center / contain;
	opacity: .18;
	pointer-events: none;
}
@media (max-width: 700px) { .tpec-hero::after { display: none; } }

/* --- Grilla de artículos ------------------------------------------------- */


.tpec-card {
	height: 100%;
	display: flex;
	flex-direction: column;
	background: var(--tpec-paper);
	border: 1px solid var(--tpec-line);
	border-radius: var(--tpec-radius-lg);
	box-shadow: var(--tpec-shadow-sm);
	overflow: hidden;
	transition: transform .25s, box-shadow .25s;
}
.tpec-card:hover { transform: translateY(-4px); box-shadow: var(--tpec-shadow); }

.tpec-card .tpec-card__media { margin: 0; border-radius: 0; }
.tpec-card .tpec-card__media img { border-radius: 0; transition: transform .5s; }
.tpec-card:hover .tpec-card__media img { transform: scale(1.03); }
.tpec-card .tpec-card__media { overflow: hidden; }

/* Tarjeta sin imagen destacada: franja de color de marca */
.tpec-card:not(:has(.tpec-card__media)) {
	border-top: 6px solid var(--tpec-sage-500);
}

.tpec-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 24px 26px 26px;
}
.tpec-card__body > * { margin: 0 !important; }
.tpec-card__title { font-family: var(--tpec-serif) !important; font-weight: 600 !important; font-size: 1.35rem !important; line-height: 1.25 !important; }
.tpec-card__title a { color: var(--tpec-ink); text-decoration: none; }
.tpec-card__title a:hover { color: var(--tpec-forest-800); }
.tpec-card__excerpt { color: var(--tpec-muted); font-size: .97rem; }
.tpec-card__excerpt .wp-block-post-excerpt__more-text { display: none; }
.tpec-card__date { margin-top: auto !important; padding-top: 8px; font-size: .85rem; color: var(--tpec-muted); }

/* --- Paginación ---------------------------------------------------------- */

.tpec-pagination { margin-top: 48px; gap: 8px; font-weight: 700; }
.tpec-pagination a,
.tpec-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 999px;
	color: var(--tpec-forest-800);
	text-decoration: none;
	box-sizing: border-box;
}
.tpec-pagination a:hover { background: var(--tpec-sage-50); }
.tpec-pagination .page-numbers.current { background: var(--tpec-forest-800); color: #fff; }

/* --- CTA banda ----------------------------------------------------------- */

.tpec-cta {
	margin-top: clamp(72px, 10vw, 120px) !important;
	padding: clamp(48px, 7vw, 88px) var(--tpec-gutter);
	border-radius: var(--tpec-radius-lg);
	background:
		radial-gradient(120% 90% at 100% 0%, rgba(92, 158, 131, .45), transparent 60%),
		var(--tpec-forest-800);
	color: rgba(245, 240, 232, .85);
	text-align: center;
	box-sizing: border-box;
}
.tpec-cta > * + * { margin-block-start: 18px; }
.tpec-cta .tpec-eyebrow { color: var(--tpec-sage-300); justify-content: center; }
.tpec-cta h2 { color: var(--tpec-cream); font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.8rem); }
.tpec-cta h2 em { color: var(--tpec-clay); }
.tpec-cta .wp-block-buttons { margin-top: 28px; }
.tpec-cta .wp-block-button__link { min-height: 56px; padding-inline: 28px; }

/* --- Artículo individual ------------------------------------------------- */

.tpec-single__head {
	padding-top: clamp(40px, 6vw, 80px);
	text-align: center;
}
.tpec-single__head > * + * { margin-block-start: 18px; }
.tpec-single__head .tpec-chip { justify-content: center; }
.tpec-single__head .wp-block-post-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.25rem); line-height: 1.12; }
.tpec-single__meta {
	justify-content: center;
	gap: 6px 14px;
	font-size: .92rem;
	color: var(--tpec-muted);
}
.tpec-single__meta > * { margin: 0; }
.tpec-single__meta .wp-block-post-author-name { font-weight: 700; color: var(--tpec-forest-800); }
.tpec-single__meta .wp-block-post-author-name::after { content: "·"; margin-left: 14px; color: var(--tpec-sage-300); }

.tpec-single__media { margin-top: clamp(32px, 5vw, 56px) !important; }
.tpec-single__media img { box-shadow: var(--tpec-shadow); border-radius: var(--tpec-radius-lg) !important; }

.tpec-content { margin-top: clamp(32px, 5vw, 56px) !important; font-size: 1.075rem; line-height: 1.75; }
.tpec-content > p:first-child:first-letter {
	float: left;
	margin: .08em .1em 0 0;
	font-family: var(--tpec-serif);
	font-size: 3.6em;
	line-height: .82;
	font-weight: 700;
	color: var(--tpec-forest-700);
}
.tpec-content h2 { margin-top: 2.2em; }
.tpec-content h3 { margin-top: 1.8em; }
.tpec-content :where(ul, ol) { padding-left: 1.3em; }
.tpec-content li::marker { color: var(--tpec-sage-500); }
.tpec-content a { text-decoration-color: var(--tpec-sage-300); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.tpec-content a:hover { text-decoration-color: var(--tpec-forest-800); }
.tpec-content blockquote { color: var(--tpec-forest-800); }
.tpec-content hr, .tpec-content .wp-block-separator { border: 0; border-top: 1px solid var(--tpec-line); }

.tpec-note {
	margin-top: 56px !important;
	padding: 32px clamp(24px, 4vw, 40px);
	background: var(--tpec-clay-100);
	border-radius: var(--tpec-radius);
	box-sizing: border-box;
}
.tpec-note > * + * { margin-block-start: 12px; }
.tpec-note h3 { font-family: var(--tpec-serif); font-size: 1.5rem; }
.tpec-note .wp-block-buttons { margin-top: 20px; }

.tpec-single__nav {
	margin-top: 48px !important;
	padding-top: 28px;
	border-top: 1px solid var(--tpec-line);
	gap: 16px;
	font-weight: 700;
}
.tpec-single__nav a { color: var(--tpec-forest-800); text-decoration: none; }
.tpec-single__nav a:hover { text-decoration: underline; text-decoration-color: var(--tpec-sage-300); text-underline-offset: 5px; }

/* --- Footer -------------------------------------------------------------- */

.wp-site-blocks > footer.wp-block-template-part { margin-top: 0; }

.tpec-footer {
	background: var(--tpec-forest-900);
	color: rgba(245, 240, 232, .72);
	padding: 72px 0 32px;
	font-size: .95rem;
}
.tpec-footer__grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: 40px;
	padding-bottom: 48px;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.tpec-footer__brand p { margin: 18px 0 0; max-width: 26em; }
.tpec-footer h3 {
	margin: 0 0 16px;
	font-family: var(--tpec-sans);
	font-size: .78rem;
	font-weight: 800;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--tpec-sage-300);
}
.tpec-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tpec-footer a { color: inherit; text-decoration: none; }
.tpec-footer a:hover { color: #fff; }
.tpec-footer__note {
	display: flex;
	justify-content: space-between;
	gap: 24px;
	padding-top: 28px;
	font-size: .82rem;
	color: rgba(245, 240, 232, .5);
}
.tpec-footer__note p { margin: 0; }
.tpec-footer__note p:first-child { max-width: 44em; }

@media (max-width: 760px) {
	.tpec-footer__grid { grid-template-columns: 1fr 1fr; }
	.tpec-footer__brand { grid-column: 1 / -1; }
	.tpec-footer__note { flex-direction: column; }
}

/* --- Botón flotante WhatsApp -------------------------------------------- */

.tpec-fab {
	position: fixed;
	right: max(16px, env(safe-area-inset-right));
	bottom: max(16px, env(safe-area-inset-bottom));
	z-index: 90;
	width: 56px;
	height: 56px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--tpec-forest-700);
	color: #fff;
	box-shadow: 0 10px 24px -8px rgba(26, 46, 37, .55);
	transition: transform .2s, background .2s;
}
.tpec-fab:hover { transform: translateY(-2px); background: var(--tpec-forest-800); color: #fff; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
