/*
Theme Name: El Resplandor
Theme URI: https://www.elresplandor.com
Author: El Resplandor
Description: Tema de bloques para una web de críticas de cine. Portadas a sangre, tarjetas redondeadas, modo oscuro automático y el bloque "La película de hoy" de la app El Resplandor.
Version: 1.0.2
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: elresplandor
Tags: blog, news, block-patterns, full-site-editing, dark-mode, one-column, three-columns
*/

/* ---------------------------------------------------------------------------
   Modo oscuro: sigue al sistema, como la app. Se redefinen los colores de la
   paleta, así cualquier bloque que use la paleta cambia solo.
   ------------------------------------------------------------------------ */

@media (prefers-color-scheme: dark) {
	:root:root {
		--wp--preset--color--base: #0b0b0c;
		--wp--preset--color--surface: #1c1c1e;
		--wp--preset--color--contrast: #f5f5f7;
		--wp--preset--color--muted: #a1a1a6;
		--wp--preset--color--border: #2c2c2e;
		--wp--preset--color--accent: #d0606e;
		--wp--preset--color--accent-soft: #2a1518;
		color-scheme: dark;
	}
}

/* ---------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------ */

body {
	background: var(--wp--preset--color--base);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

:where(.wp-site-blocks) > * { margin-block-start: 0; }

img { height: auto; }

::selection { background: var(--wp--preset--color--accent); color: #fff; }

.er-main { padding-bottom: var(--wp--preset--spacing--60); }

.er-eyebrow {
	margin: 0 0 0.4rem;
	color: var(--wp--preset--color--accent);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}
.er-eyebrow--light { color: rgba(255, 255, 255, 0.85); }

/* ---------------------------------------------------------------------------
   Cabecera
   ------------------------------------------------------------------------ */

.er-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--base) 82%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(18px);
	backdrop-filter: saturate(180%) blur(18px);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
.admin-bar .er-header { top: var(--wp-admin--admin-bar--height, 32px); }

.er-header__bar { min-height: 64px; gap: 1rem; }
.er-header__actions { gap: 0.75rem; }

.er-logo {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 900;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	white-space: nowrap;
}
.er-logo a { color: var(--wp--preset--color--contrast); text-decoration: none; }
.er-logo a:hover { color: var(--wp--preset--color--accent); text-decoration: none; }

.er-nav a { color: var(--wp--preset--color--contrast); }
.er-nav a:hover { color: var(--wp--preset--color--accent); text-decoration: none; }
.er-nav .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--border) !important;
	border-radius: var(--wp--custom--radius-small);
	background: var(--wp--preset--color--base) !important;
	padding: 0.4rem 0;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
	/* El núcleo fuerza el texto del submenú a negro: con el fondo oscuro no se leía. */
	color: var(--wp--preset--color--contrast) !important;
}
.er-nav .wp-block-navigation__submenu-container a {
	padding: 0.55rem 1.1rem !important;
	color: var(--wp--preset--color--contrast) !important;
}
.er-nav .wp-block-navigation__submenu-container a:hover {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--accent) !important;
}
.er-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	padding: var(--wp--preset--spacing--50) max(16px, var(--wp--preset--spacing--40));
}
.er-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	font-size: 1.5rem;
	gap: 1rem;
}

.er-search .wp-block-search__button {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	padding: 0.4rem;
	border: 0;
}
.er-search .wp-block-search__input {
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	padding: 0.45rem 0.9rem;
}

/* ---------------------------------------------------------------------------
   Portadas (cover): imagen a sangre con degradado para leer el título
   ------------------------------------------------------------------------ */

.er-hero { margin-top: 0 !important; padding-bottom: var(--wp--preset--spacing--50) !important; }
.er-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.55) 62%, rgba(0, 0, 0, 0.9) 100%);
}
.er-hero .wp-block-cover__inner-container { z-index: 2; color: #fff; }
.er-hero .wp-block-cover__image-background { filter: saturate(1.05); }

.er-hero__title {
	margin: 0.2rem 0 0.6rem;
	max-width: 18ch;
	font-size: var(--wp--preset--font-size--huge);
	font-weight: 900;
	line-height: 0.98;
	letter-spacing: -0.03em;
	text-transform: uppercase;
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}
.er-hero__title a { color: #fff; }
.er-hero__title a:hover { text-decoration: none; opacity: 0.9; }

.er-hero__excerpt {
	max-width: 60ch;
	color: rgba(255, 255, 255, 0.88);
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.4;
}
.er-hero__excerpt p { margin: 0; }

.er-hero__meta { gap: 0.75rem; align-items: center; margin-top: 1rem; }
.er-hero .wp-block-post-date,
.er-hero__date { color: rgba(255, 255, 255, 0.8); }

/* Crítica: un poco más contenida que la portada de inicio. */
.er-hero--single .er-hero__title { max-width: 20ch; }

/* ---------------------------------------------------------------------------
   Etiquetas de categoría (festival, plataforma…) y chips
   ------------------------------------------------------------------------ */

.er-kicker {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0 0 0.5rem;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}
.er-kicker .wp-block-post-terms__separator { display: none; }
.er-kicker a {
	padding: 0.2rem 0.6rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--accent);
}
.er-kicker a:hover { text-decoration: none; background: var(--wp--preset--color--accent); color: #fff; }
.er-kicker--light a { background: rgba(255, 255, 255, 0.16); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* "Cine" y "Críticas" están en casi todas las entradas: no aportan nada en la tarjeta. */
.er-kicker a[href$="/category/cine/"],
.er-kicker a[href$="/category/criticas/"] { display: none; }
.er-kicker:not(:has(a:not([href$="/category/cine/"]):not([href$="/category/criticas/"]))) { display: none; }

.er-chips,
ul.er-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.er-chips a {
	display: inline-block;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	border: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-size: 0.875rem;
}
.er-chips a:hover { border-color: var(--wp--preset--color--accent); color: var(--wp--preset--color--accent); text-decoration: none; }
.er-chips .wp-block-post-terms__separator { display: none; }
.er-chips--large a { padding: 0.7rem 1.2rem; font-size: 1rem; font-weight: 600; }

/* ---------------------------------------------------------------------------
   Secciones y rejilla de tarjetas
   ------------------------------------------------------------------------ */

.er-section { margin-top: var(--wp--preset--spacing--60) !important; }
.er-section__head { margin-bottom: 1.25rem; }
.er-section__head h2,
.er-section > h2 { margin: 0 0 1.25rem; }
.er-section__head h2 { margin: 0; }
.er-section__more { margin: 0; font-weight: 600; font-size: 0.9375rem; }

.er-grid { gap: var(--wp--preset--spacing--40) !important; }

.er-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--surface);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.er-card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14); }

.er-card__image { margin: 0 !important; overflow: hidden; }
.er-card__image img { transition: transform 0.5s ease; }
.er-card:hover .er-card__image img { transform: scale(1.04); }
.er-card__image:empty,
.er-card__image:not(:has(img)) { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--wp--preset--color--accent), #1c1c1e); }

.er-card__body { padding: 1.1rem 1.25rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.er-card__body > * { margin: 0; }
.er-card__title { margin: 0 0 0.5rem !important; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.015em; }
.er-card__excerpt { color: var(--wp--preset--color--muted); font-size: 0.9375rem; line-height: 1.5; flex: 1; }
.er-card__excerpt p { margin: 0; }
.er-card__date { margin-top: 0.85rem !important; font-size: 0.8125rem; }

.er-grid-query > .wp-block-buttons { margin-top: var(--wp--preset--spacing--50); }

.er-pagination { margin-top: var(--wp--preset--spacing--50); gap: 0.4rem; font-weight: 600; }
.er-pagination a,
.er-pagination .current {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.85rem;
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}
.er-pagination .current { background: var(--wp--preset--color--accent); color: #fff; }
.er-pagination a:hover { text-decoration: none; background: var(--wp--preset--color--border); }

.er-empty { color: var(--wp--preset--color--muted); }

/* ---------------------------------------------------------------------------
   Archivo, búsqueda, páginas
   ------------------------------------------------------------------------ */

.er-page { padding-top: var(--wp--preset--spacing--50); }
.er-page__head { margin-bottom: var(--wp--preset--spacing--50); }
.er-page__title { margin: 0 0 0.75rem; font-size: var(--wp--preset--font-size--xx-large); }
.er-page__head .wp-block-term-description { max-width: 60ch; color: var(--wp--preset--color--muted); }

.er-search-big { max-width: 560px; }
.er-search-big .wp-block-search__inside-wrapper { gap: 0.5rem; }
.er-search-big .wp-block-search__input {
	padding: 0.8rem 1.1rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font-size: 1rem;
}
.er-search-big .wp-block-search__button { margin-left: 0; }
.er-404 .er-search-big { margin-inline: auto; }

/* ---------------------------------------------------------------------------
   La crítica
   ------------------------------------------------------------------------ */

.er-content {
	margin-top: var(--wp--preset--spacing--50) !important;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.1875rem;
	line-height: 1.7;
}
.er-content > p:first-of-type::first-letter {
	float: left;
	margin: 0.08em 0.1em 0 0;
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 3.6em;
	font-weight: 900;
	line-height: 0.8;
}
.er-content strong { font-weight: 700; }
.er-content h2,
.er-content h3 { font-family: var(--wp--preset--font-family--sans); margin-top: 2.2em; }
.er-content img { border-radius: var(--wp--custom--radius-small); }

/* Las críticas antiguas pegan el iframe de YouTube con ancho y alto fijos. */
.er-content iframe[src*="youtube"],
.er-content iframe[src*="vimeo"] {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: var(--wp--custom--radius-small);
	background: #000;
}
.er-content p:has(> iframe:only-child) { margin: 2rem 0; }
.er-content p:has(> iframe:only-child) > br { display: none; }

/* Restos de plugins del tema anterior (caja de autor vacía, contador de visitas). */
.er-content .awpa-title,
.er-content .wp-post-author-wrap,
.er-content .post-views.content-post { display: none !important; }

.er-cast { margin-top: var(--wp--preset--spacing--50) !important; padding-top: var(--wp--preset--spacing--40); border-top: 1px solid var(--wp--preset--color--border); }
.er-cast:not(:has(a)) { display: none; }

.er-postnav { font-weight: 700; }
.er-postnav a { color: var(--wp--preset--color--contrast); }
.er-postnav a:hover { color: var(--wp--preset--color--accent); text-decoration: none; }
.er-postnav--prev { margin-top: var(--wp--preset--spacing--50) !important; }
.er-postnav--next { text-align: right; margin-top: 0.5rem !important; }
.er-postnav:empty { display: none; }

/* ---------------------------------------------------------------------------
   Newsletter y festivales
   ------------------------------------------------------------------------ */

.er-newsletter {
	margin-top: var(--wp--preset--spacing--60) !important;
	padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40) !important;
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--accent-soft);
	text-align: center;
}
.er-newsletter .er-eyebrow { text-align: center; }
.er-newsletter h2 { margin: 0 0 0.5rem; }
.er-newsletter p { color: var(--wp--preset--color--contrast); }

.er-split { margin-top: var(--wp--preset--spacing--60) !important; gap: var(--wp--preset--spacing--40) !important; }
.er-split .er-newsletter { margin-top: 0 !important; }

.er-festivals { margin-top: var(--wp--preset--spacing--60) !important; }
.er-festivals h2 { margin: 0 0 1.25rem; }

/* ---------------------------------------------------------------------------
   Bloque "La película de hoy"
   ------------------------------------------------------------------------ */

.er-today {
	overflow: hidden;
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--surface);
}
.er-today__poster {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 340px;
	background-color: #1c1c1e;
	background-position: center;
	background-size: cover;
	color: #fff;
}
.er-today__poster::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 20%, rgba(0, 0, 0, 0.85) 100%);
}
.er-today__inner { position: relative; padding: 1.5rem; }
.er-today__date {
	display: inline-block;
	margin-bottom: 0.75rem;
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: var(--wp--preset--color--accent);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.er-today__eyebrow { margin: 0; color: rgba(255, 255, 255, 0.8); font-size: 0.875rem; }
.er-today__title { margin: 0.15rem 0 0.35rem; color: #fff; font-size: var(--wp--preset--font-size--x-large); }
.er-today__meta { margin: 0; color: rgba(255, 255, 255, 0.8); font-size: 0.875rem; }

.er-today__hook { margin: 1.25rem 1.5rem 0; padding-left: 1rem; border-left: 4px solid var(--wp--preset--color--accent); }
.er-today__hook p { margin: 0 0 0.4rem; }
.er-today__label { color: var(--wp--preset--color--accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.er-today__editorial { font-weight: 700; }
.er-today__cta { margin: 1rem 1.5rem 1.5rem; font-weight: 700; }
.er-today__empty { padding: 1rem; border: 1px dashed var(--wp--preset--color--border); border-radius: var(--wp--custom--radius-small); color: var(--wp--preset--color--muted); }

/* ---------------------------------------------------------------------------
   Comentarios
   ------------------------------------------------------------------------ */

.er-comments { margin-top: var(--wp--preset--spacing--60) !important; }
.er-comment { padding: 1.1rem 0; border-bottom: 1px solid var(--wp--preset--color--border); }
.er-comment .wp-block-comment-author-name { font-weight: 700; }
.er-comment .wp-block-comment-date { color: var(--wp--preset--color--muted); font-size: 0.8125rem; }
.er-comments textarea,
.er-comments input[type="text"],
.er-comments input[type="email"],
.er-comments input[type="url"] {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius-small);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
	font: inherit;
}

/* ---------------------------------------------------------------------------
   404: la habitación 237
   ------------------------------------------------------------------------ */

.er-404 { padding-top: var(--wp--preset--spacing--60); text-align: center; }
.er-404__room {
	margin: 0;
	color: var(--wp--preset--color--accent);
	font-size: clamp(6rem, 22vw, 12rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.04em;
	text-align: center;
	background-image: repeating-linear-gradient(45deg, var(--wp--preset--color--accent) 0 14px, #6e2731 14px 28px);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* ---------------------------------------------------------------------------
   Pie
   ------------------------------------------------------------------------ */

.er-footer {
	margin-top: 0 !important;
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--night);
	color: #d1d1d6;
}
.er-footer .er-logo a { color: #fff; }
.er-footer .wp-block-site-tagline { color: #a1a1a6; margin-top: 0.4rem; }
.er-footer .er-eyebrow { color: #d0606e; }
.er-footer__links { margin: 0; padding: 0; list-style: none; }
.er-footer__links li { margin: 0.35rem 0; }
.er-footer__links a { color: #f5f5f7; }
.er-footer__fine { margin-top: var(--wp--preset--spacing--50) !important; padding-top: 1rem; border-top: 1px solid #2c2c2e; color: #6c6c70; font-size: 0.8125rem; }

/* ---------------------------------------------------------------------------
   Móvil
   ------------------------------------------------------------------------ */

@media (max-width: 781px) {
	.er-logo { font-size: 1rem; letter-spacing: 0.14em; }
	.er-hero { min-height: 64vh !important; }
	.er-hero__excerpt { font-size: 1.0625rem; }
	.er-content { font-size: 1.125rem; }
	.er-card:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.er-card,
	.er-card__image img { transition: none; }
}
