/* ==========================================================================
   Theme — main.css
   Variables CSS, reset suave, layout magazine, dark/light.
   ========================================================================== */

/* Reset suave */
*,
*::before,
*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--epp-font-body);
	font-size: var(--epp-font-size-base, 17px);
	line-height: 1.6;
	color: var(--epp-color-text);
	background: var(--epp-color-bg);
	transition: background-color .2s ease, color .2s ease;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--epp-color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 {
	font-family: var(--epp-font-heading);
	color: var(--epp-color-primary);
	line-height: 1.2;
	margin: 0 0 .6em;
	font-weight: 700;
}
/* Muchos titulares de las variantes son <span>/<div> (no h1-h6): que también
   usen la fuente de títulos del paquete tipográfico seleccionado. */
[class*="title"] { font-family: var(--epp-font-heading); }
[data-scheme="dark"] h1,
[data-scheme="dark"] h2,
[data-scheme="dark"] h3,
[data-scheme="dark"] h4,
[data-scheme="dark"] h5,
[data-scheme="dark"] h6 { color: var(--epp-color-text); }
p { margin: 0 0 1em; }

/* A11y skip link */
.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px);
	clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.epp-skip-link:focus {
	clip: auto; clip-path: none;
	background: var(--epp-color-primary); color: #fff;
	display: block; font-size: 14px; padding: 12px 16px;
	position: absolute; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto;
}

/* Layout helpers */
.epp-container {
	width: 100%;
	max-width: var(--epp-container, 1280px);
	margin-inline: auto;
	padding-inline: 20px;
}
.epp-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.epp-site { flex: 1; }
.epp-site-content { padding: 32px 0 64px; }

/* Banda del hero de portada: ancho completo, capada al ancho elegido (Personalizar → Layout) */
.epp-hero-wrap { width: 100%; max-width: var(--epp-container, 1440px); margin-inline: auto; padding: 24px 20px 0; }
@media (max-width: 600px) { .epp-hero-wrap { padding: 12px 0 0; } }

/* Bandas del home: la banda es ANCHO COMPLETO (admite color de fondo full-width
   por bloque); su contenido se capa al ancho elegido y se centra. */
.epp-band { width: 100%; }
.epp-band__inner { width: 100%; max-width: var(--epp-container, 1440px); margin-inline: auto; padding-inline: 20px; }
@media (max-width: 600px) { .epp-band__inner { padding-inline: 0; } }
/* Las secciones nuevas (1–5) van transparentes: el fondo lo pone la banda. */
.epp-band .epp-sc1, .epp-band .epp-sc2, .epp-band .epp-sc3, .epp-band .epp-sc4, .epp-band .epp-sc5 { background: transparent; }
/* En el home tipo revista el contenido va en bandas; el contenedor base se colapsa */
.epp-magazine-home .epp-site-content { padding: 0; }

/* Wordmark de texto: fallback del logo cuando el medio no ha subido imagen.
   Muestra el nombre del sitio (Ajustes → Generales) con la tipografía de marca. */
.epp-logo-text {
	font-family: var(--epp-font-heading);
	font-weight: 800;
	line-height: 1;
	color: inherit;
	letter-spacing: -0.01em;
	white-space: nowrap;
	display: inline-block;
}
.epp-logo-text,
.epp-logo-text:hover { text-decoration: none; }

/* Imagen destacada a sangre completa arriba del contenido (single 3/7/9): debajo
   van el texto y la barra lateral en columnas. */
.epp-single-topimg { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); margin-bottom: 36px; }
.epp-single-topimg img { width: 100%; height: clamp(300px, 46vh, 560px); object-fit: cover; display: block; }
@media (max-width: 900px) {
	.epp-single-topimg { margin-bottom: 24px; }
	.epp-single-topimg img { height: clamp(220px, 40vh, 360px); }
}
/* Layout con barra lateral.
   #primary (post) y #secondary (sidebar) son ambos hijos directos de #content,
   así que la rejilla de 2 columnas va en #content. :has(#secondary) hace que las
   2 columnas solo apliquen cuando la barra existe (páginas sin barra → 1 columna). */
.epp-layout-sidebar-right .epp-main-content:has( #secondary ),
.epp-layout-sidebar-left .epp-main-content:has( #secondary ) {
	display: grid;
	gap: 40px;
	align-items: start;
}
.epp-layout-sidebar-right .epp-main-content:has( #secondary ) {
	grid-template-columns: minmax(0, 1fr) 320px;
}
.epp-layout-sidebar-left .epp-main-content:has( #secondary ) {
	grid-template-columns: 320px minmax(0, 1fr);
}
.epp-layout-sidebar-left .epp-main-content:has( #secondary ) #primary { order: 2; }
.epp-layout-sidebar-left .epp-main-content:has( #secondary ) #secondary { order: 1; }
/* El breadcrumb (1er hijo de #content) abarca ambas columnas; si no, ocuparía una
   celda del grid y empujaría el artículo a la columna de la barra. */
.epp-main-content:has( #secondary ) > .epp-breadcrumb { grid-column: 1 / -1; margin-bottom: 0; }
@media (max-width: 900px) {
	.epp-main-content:has( #secondary ) { grid-template-columns: 1fr; }
}

/* Topbar */
.epp-topbar {
	border-bottom: 1px solid color-mix(in srgb, var(--epp-color-text) 12%, transparent);
	font-size: .85em;
	padding: 6px 0;
}
.epp-topbar .epp-menu { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.epp-topbar .epp-menu a { color: var(--epp-color-text); opacity: .8; }
.epp-topbar .epp-menu a:hover { opacity: 1; }

/* ==========================================================================
   Header — base compartida (cada variante trae su propio CSS inline)
   ========================================================================== */
.epp-sticky-header .epp-site-header { position: sticky; top: 0; z-index: 50; }
.epp-logo-img { display: block; }

/* Cluster de herramientas de cabecera (solo contiene la hamburguesa) */
.epp-tools { display: inline-flex; align-items: center; }

/* Hamburguesa (abre el panel off-canvas) — SOLO visible en móvil (<=900px) */
.epp-burger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 8px; color: inherit; }
.epp-burger span { display: block; width: 22px; height: 2px; background: currentColor; }
@media (max-width: 900px) { .epp-burger { display: inline-flex; } }

/* Cambio de iconos sol/luna en el botón de tema */
.epp-scheme-toggle .epp-icon--moon { display: none; }
[data-scheme="dark"] .epp-scheme-toggle .epp-icon--sun { display: none; }
[data-scheme="dark"] .epp-scheme-toggle .epp-icon--moon { display: inline-block; }

/* Search drawer */
.epp-header-search { padding: 16px 0; border-top: 1px solid color-mix(in srgb, var(--epp-color-text) 8%, transparent); }
.epp-search-form { display: flex; gap: 8px; }
.epp-search-field {
	flex: 1; padding: 10px 14px;
	border: 1px solid color-mix(in srgb, var(--epp-color-text) 20%, transparent);
	border-radius: 8px;
	background: transparent; color: inherit;
	font: inherit;
}
.epp-search-submit { padding: 0 14px; background: var(--epp-color-accent); color: #fff; border: 0; border-radius: 8px; cursor: pointer; }

/* Offcanvas */
.epp-offcanvas {
	position: fixed; inset: 0 auto 0 0; width: min(320px, 85vw);
	background: var(--epp-color-bg);
	box-shadow: 4px 0 24px rgba(0,0,0,.2);
	padding: 24px 20px; z-index: 100;
	transform: translateX(-100%);
	transition: transform .25s ease;
}
.epp-offcanvas.is-open { transform: translateX(0); }
.epp-offcanvas[hidden] { display: block !important; }
.epp-offcanvas__close {
	position: absolute; top: 12px; right: 12px;
	background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer;
	color: inherit;
}
.epp-offcanvas .epp-menu { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; }
.epp-offcanvas .epp-menu a { color: var(--epp-color-text); font-weight: 600; }

/* ==========================================================================
   Featured / Hero magazine
   ========================================================================== */
.epp-featured { margin-bottom: 48px; }
.epp-featured__grid {
	display: grid;
	gap: 32px;
	grid-template-columns: 1fr;
}
@media (min-width: 900px) {
	.epp-featured__grid--3,
	.epp-featured__grid--4,
	.epp-featured__grid--5 {
		grid-template-columns: 1.4fr 1fr;
		grid-template-rows: auto auto;
		grid-auto-flow: dense;
	}
	.epp-featured__grid--3 .epp-featured__item--main,
	.epp-featured__grid--4 .epp-featured__item--main,
	.epp-featured__grid--5 .epp-featured__item--main {
		grid-row: span 2;
	}
}
.epp-featured__item { display: flex; flex-direction: column; gap: 16px; }
.epp-featured__thumb { display: block; overflow: hidden; border-radius: 12px; }
.epp-featured__thumb img { width: 100%; object-fit: cover; transition: transform .4s ease; }
.epp-featured__item:hover .epp-featured__thumb img { transform: scale(1.03); }

.epp-featured__item--main .epp-featured__thumb img { aspect-ratio: 16/10; }
.epp-featured__item--side .epp-featured__thumb img { aspect-ratio: 16/9; }

.epp-featured__title {
	font-family: var(--epp-font-heading);
	line-height: 1.15;
	margin: 6px 0 4px;
}
.epp-featured__item--main .epp-featured__title { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
.epp-featured__item--side .epp-featured__title { font-size: 1.25rem; }
.epp-featured__title a { color: var(--epp-color-primary); text-decoration: none; }
[data-scheme="dark"] .epp-featured__title a { color: var(--epp-color-text); }
.epp-featured__title a:hover { color: var(--epp-color-accent); }

.epp-featured__excerpt {
	font-size: 1.05em;
	color: color-mix(in srgb, var(--epp-color-text) 80%, transparent);
	margin-bottom: 4px;
}

.epp-featured__body { display: flex; flex-direction: column; gap: 4px; }
.epp-featured__body .epp-card__cat {
	font-size: .75em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--epp-color-accent);
	text-decoration: none;
}

/* Grid 1: solo el main, fullwidth */
.epp-featured__grid--1 { grid-template-columns: 1fr; }
.epp-featured__grid--1 .epp-featured__item--main .epp-featured__thumb img { aspect-ratio: 21/9; }

/* Grid 2: dos columnas iguales */
@media (min-width: 900px) {
	.epp-featured__grid--2 { grid-template-columns: 1fr 1fr; }
}

/* Archive grid */
.epp-posts-area__main {
	display: grid;
	gap: 32px;
}
.epp-archive-grid {
	grid-template-columns: repeat(var(--epp-cols-mb, 1), minmax(0, 1fr));
}
.epp-posts-area__main[data-pc] { grid-template-columns: repeat(var(--epp-cols, 3), minmax(0, 1fr)); }
.epp-posts-area__main { --epp-cols: attr(data-mb number, 1); }
@media (min-width: 600px) { .epp-posts-area__main[data-tb="1"] { grid-template-columns: 1fr; } .epp-posts-area__main[data-tb="2"] { grid-template-columns: repeat(2, 1fr); } .epp-posts-area__main[data-tb="3"] { grid-template-columns: repeat(3, 1fr); } .epp-posts-area__main[data-tb="4"] { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .epp-posts-area__main[data-lt="1"] { grid-template-columns: 1fr; } .epp-posts-area__main[data-lt="2"] { grid-template-columns: repeat(2, 1fr); } .epp-posts-area__main[data-lt="3"] { grid-template-columns: repeat(3, 1fr); } .epp-posts-area__main[data-lt="4"] { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .epp-posts-area__main[data-pc="1"] { grid-template-columns: 1fr; } .epp-posts-area__main[data-pc="2"] { grid-template-columns: repeat(2, 1fr); } .epp-posts-area__main[data-pc="3"] { grid-template-columns: repeat(3, 1fr); } .epp-posts-area__main[data-pc="4"] { grid-template-columns: repeat(4, 1fr); } }
.epp-archive-list { grid-template-columns: 1fr; }
.epp-archive-full { grid-template-columns: 1fr; }
.epp-archive-list .epp-card { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: center; }
@media (max-width: 600px) { .epp-archive-list .epp-card { grid-template-columns: 1fr; } }

/* Card */
.epp-card { display: flex; flex-direction: column; gap: 12px; }
.epp-card__thumb { display: block; overflow: hidden; border-radius: 12px; }
.epp-card__thumb img { width: 100%; aspect-ratio: 16/9; object-fit: cover; transition: transform .4s ease; }
.epp-card:hover .epp-card__thumb img { transform: scale(1.04); }
.epp-card__cat {
	display: inline-block;
	font-size: .75em; font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--epp-color-accent);
	text-decoration: none;
}
.epp-card__title {
	font-size: 1.25rem;
	margin: 4px 0;
	line-height: 1.25;
}
.epp-card__title a { color: var(--epp-color-primary); text-decoration: none; }
[data-scheme="dark"] .epp-card__title a { color: var(--epp-color-text); }
.epp-card__title a:hover { color: var(--epp-color-accent); }
.epp-card__excerpt { color: color-mix(in srgb, var(--epp-color-text) 80%, transparent); font-size: .95em; }

/* Entry meta */
.epp-entry-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .8em; opacity: .75; align-items: center; }
.epp-entry-meta a { color: inherit; text-decoration: none; }
.epp-entry-meta a:hover { color: var(--epp-color-accent); }
.epp-entry-meta__sep { opacity: .5; }

/* Singular */
.epp-singular { max-width: 760px; margin-inline: auto; }
.epp-layout-full-width .epp-singular,
.epp-layout-no-sidebar .epp-singular { max-width: 760px; }
.epp-singular__header { text-align: center; margin-bottom: 32px; }
.epp-singular__cat {
	display: inline-block; color: var(--epp-color-accent);
	font-size: .8em; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; text-decoration: none;
	margin-bottom: 12px;
}
.epp-singular__title {
	font-size: clamp(1.8rem, 4vw, 3rem);
	margin: 0 0 16px;
}
.epp-singular__thumb { margin: 0 -10vw 32px; }
@media (max-width: 1024px) { .epp-singular__thumb { margin-inline: 0; } }
.epp-singular__thumb img { width: 100%; border-radius: 12px; }
/* Con barra lateral, la imagen no hace breakout (si no, se encimaría sobre el sidebar).
   El post conserva su ancho de lectura estándar (760px). */
.epp-main-content:has( #secondary ) .epp-singular__thumb { margin-inline: 0; }
.epp-singular__content { font-size: 1.08em; line-height: 1.75; }
.epp-singular__content > * { margin-bottom: 1.2em; }
.epp-singular__tags { margin-top: 24px; font-size: .85em; opacity: .8; }
.epp-singular__tags a { display: inline-block; padding: 4px 10px; border: 1px solid currentColor; border-radius: 999px; margin: 0 4px 4px 0; text-decoration: none; color: inherit; }
.epp-tags__label { font-weight: 700; }

/* Author + share */
.epp-author-box {
	display: grid; grid-template-columns: 96px 1fr; gap: 20px;
	padding: 24px; border-radius: 12px;
	background: color-mix(in srgb, var(--epp-color-text) 5%, transparent);
	margin-top: 40px;
}
.epp-author-box__avatar img { border-radius: 50%; }
.epp-author-box__name { margin: 0 0 6px; font-size: 1.1rem; }
.epp-author-box__bio { margin: 0 0 8px; font-size: .95em; opacity: .85; }
.epp-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; align-items: center; }
.epp-share__label { font-weight: 700; font-size: .9em; }
.epp-share__link {
	font-size: .85em; padding: 6px 12px;
	border: 1px solid color-mix(in srgb, var(--epp-color-text) 20%, transparent);
	border-radius: 999px; color: inherit; text-decoration: none;
}
.epp-share__link:hover { background: var(--epp-color-accent); color: #fff; border-color: var(--epp-color-accent); }

/* Sidebar widgets */
.epp-widget-area { display: flex; flex-direction: column; gap: 32px; }
.epp-widget__title {
	font-size: 1rem; text-transform: uppercase; letter-spacing: .08em;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--epp-color-accent);
	margin: 0 0 16px;
}

/* Pagination */
.epp-posts-area__pagination { margin-top: 40px; display: flex; justify-content: center; gap: 8px; }
.epp-posts-area__pagination a, .epp-posts-area__pagination span {
	display: inline-block; padding: 8px 14px; border-radius: 8px;
	border: 1px solid color-mix(in srgb, var(--epp-color-text) 15%, transparent);
	color: inherit; text-decoration: none;
}
.epp-posts-area__pagination .current { background: var(--epp-color-accent); color: #fff; border-color: var(--epp-color-accent); }

/* Buttons */
.epp-button, .epp-load-more {
	display: inline-block; cursor: pointer;
	background: var(--epp-color-primary);
	color: #fff; padding: 12px 24px;
	border: 0; border-radius: 8px; font-weight: 600;
	font: inherit; font-weight: 600;
	text-decoration: none;
}
.epp-button:hover, .epp-load-more:hover { background: var(--epp-color-accent); color: #fff; text-decoration: none; }
.epp-load-more-wrap { display: flex; justify-content: center; margin-top: 40px; }

/* Footer */
.epp-site-footer { background: var(--epp-color-primary); color: #fff; margin-top: 64px; }
.epp-site-footer a { color: #fff; }
.epp-footer-widgets { padding: 64px 0; }
.epp-footer-widgets__grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.epp-footer-widgets .epp-widget__title { color: #fff; border-color: rgba(255,255,255,.3); }
.epp-footer-bottom { padding: 20px 0; border-top: 1px solid rgba(255,255,255,.15); font-size: .9em; }
.epp-footer-bottom__inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.epp-menu--footer { display: flex; gap: 20px; flex-wrap: wrap; }

/* Back to top */
.epp-to-top {
	position: fixed; right: 20px; bottom: 20px;
	width: 44px; height: 44px;
	border-radius: 50%; border: 0; cursor: pointer;
	background: var(--epp-color-primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
	transform: translateY(20px); z-index: 40;
}
.epp-to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* Page header (archive/search/404) */
.epp-page-header { padding: 32px 0 24px; text-align: center; border-bottom: 1px solid color-mix(in srgb, var(--epp-color-text) 10%, transparent); margin-bottom: 32px; }
.epp-page-title { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 0; }

/* Comments */
.epp-comments-area { margin-top: 56px; }
.epp-comments-title { font-size: 1.4rem; margin-bottom: 24px; }
.epp-comment-list { list-style: none; padding: 0; margin: 0 0 32px; display: flex; flex-direction: column; gap: 24px; }
.epp-comment-list .comment { padding: 16px; border-radius: 12px; background: color-mix(in srgb, var(--epp-color-text) 4%, transparent); }
.epp-comment-list .children { list-style: none; padding-left: 24px; margin-top: 16px; }

/* Block editor compat */
.alignwide { max-width: 1100px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.wp-block-button__link { background: var(--epp-color-accent); color: #fff; border-radius: 8px; }
