/* Profe Ulises — estilos complementarios a theme.json */

:root {
	--pu-radius-s: var(--wp--custom--radius--s, 10px);
	--pu-radius-m: var(--wp--custom--radius--m, 18px);
	--pu-radius-l: var(--wp--custom--radius--l, 28px);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

body { -webkit-font-smoothing: antialiased; }
/* Sin huecos entre encabezado, contenido y pie */
.wp-site-blocks > * + * { margin-block-start: 0; }
img { height: auto; }
::selection { background: var(--wp--preset--color--yellow); color: var(--wp--preset--color--ink); }

/* ---------- Encabezado ---------- */
.pu-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: saturate(160%) blur(10px);
	-webkit-backdrop-filter: saturate(160%) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .pu-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .pu-header { top: 0; position: relative; } }
.pu-header .wp-block-site-logo img { width: 200px; height: auto; }
.pu-header .wp-block-navigation .wp-block-navigation-item__content { padding: .35rem .2rem; border-radius: 8px; }
.pu-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--primary); }
@media (max-width: 600px) {
	.pu-header .pu-header-cta { display: none; }
	.pu-header .wp-block-site-logo img { width: 160px; }
}
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.25rem; }

/* ---------- Estilos de bloque ---------- */
.is-style-pu-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--pu-radius-m);
	box-shadow: var(--wp--preset--shadow--card);
}
.is-style-pu-pill {
	display: inline-flex !important;
	width: auto !important;
	border-radius: 999px;
	padding: .25rem .85rem !important;
	font-weight: 800;
	font-size: .8125rem;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.wp-block-button.is-style-pu-yellow .wp-block-button__link {
	background: var(--wp--preset--color--yellow);
	color: var(--wp--preset--color--ink);
}
.wp-block-button.is-style-pu-yellow .wp-block-button__link:hover { background: #FFB800; color: var(--wp--preset--color--ink); }
.wp-block-button.is-style-pu-light .wp-block-button__link {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--primary);
	box-shadow: inset 0 0 0 2px var(--wp--preset--color--line);
}
.wp-block-button.is-style-pu-light .wp-block-button__link:hover { box-shadow: inset 0 0 0 2px var(--wp--preset--color--primary); }
.wp-block-button.is-style-outline .wp-block-button__link { border-width: 2px; }
.wp-block-button__link { transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); }

.wp-block-read-more.is-style-pu-button {
	display: inline-block;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	border-radius: 999px;
	padding: .7rem 1.5rem;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	text-decoration: none;
	width: auto;
}
.wp-block-read-more.is-style-pu-button:hover { background: var(--wp--preset--color--primary-dark); color: #fff; }

.wp-block-post-terms.is-style-pu-badges a {
	display: inline-block;
	background: var(--wp--preset--color--sky);
	color: var(--wp--preset--color--primary);
	border-radius: 999px;
	padding: .2rem .75rem;
	text-decoration: none;
}
.wp-block-post-terms.is-style-pu-badges .wp-block-post-terms__separator { display: none; }
.wp-block-post-terms.is-style-pu-badges a + a { margin-left: .35rem; }

/* ---------- Portada ---------- */
.pu-hero { overflow: hidden; }
.pu-hero .pu-hero-avatar img { filter: drop-shadow(0 18px 30px rgba(19, 37, 74, .18)); }
.pu-hero h1 { letter-spacing: -.01em; }
.pu-hero .pu-highlight { color: var(--wp--preset--color--orange); }
.pu-hero .pu-highlight-blue { color: var(--wp--preset--color--primary); }
@media (max-width: 781px) {
	.pu-hero .pu-hero-avatar { max-width: 260px; margin-inline: auto; }
	.pu-hero .wp-block-column:first-child { text-align: center; }
	.pu-hero .wp-block-buttons { justify-content: center; }
}

.pu-path {
	height: 100%;
	transition: transform .18s ease, box-shadow .18s ease;
}
.pu-path:hover { transform: translateY(-3px); box-shadow: var(--wp--preset--shadow--lift); }
.pu-path .pu-icon {
	width: 56px; height: 56px;
	display: grid; place-items: center;
	border-radius: 16px;
	font-size: 1.75rem; line-height: 1;
	margin: 0;
}
.pu-path .pu-icon.has-background { padding: 0 !important; }

/* ---------- Tarjetas de episodio ---------- */
.pu-episode-card {
	height: 100%;
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
}
.pu-episode-card:hover { transform: translateY(-3px); box-shadow: var(--wp--preset--shadow--lift); }
.pu-episode-card .wp-block-post-featured-image { margin: 0; position: relative; overflow: hidden; }
.pu-episode-card .wp-block-post-featured-image img { transition: transform .3s ease; }
.pu-episode-card:hover .wp-block-post-featured-image img { transform: scale(1.04); }
.pu-episode-card .wp-block-post-title { margin: 0; }

/* Botón de "play" sobre cualquier miniatura de episodio */
.pu-play .wp-block-post-featured-image::after {
	content: "";
	position: absolute;
	left: 50%; top: 50%;
	width: 58px; height: 58px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(255, 255, 255, .95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231859B8' d='M8 5.5v13l11-6.5z'/%3E%3C/svg%3E") 56% 50% / 26px no-repeat;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
	pointer-events: none;
}
.pu-latest .wp-block-post-featured-image { border-radius: var(--pu-radius-m); overflow: hidden; box-shadow: var(--wp--preset--shadow--lift); }
.pu-latest .wp-block-post-featured-image::after { width: 76px; height: 76px; background-size: 34px; }

.wp-block-query-pagination { gap: .5rem; font-weight: 800; }
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers { text-decoration: none; }
.wp-block-query-pagination-numbers .page-numbers {
	display: inline-grid; place-items: center;
	min-width: 2.4rem; height: 2.4rem; padding: 0 .5rem;
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
}
.wp-block-query-pagination-numbers .page-numbers.current { background: var(--wp--preset--color--primary); color: #fff; border-color: var(--wp--preset--color--primary); }

/* ---------- Entrada (episodio) ---------- */
.pu-single .wp-block-post-content > .wp-block-embed:first-child,
.pu-single .wp-block-post-content > figure.wp-block-embed { margin-bottom: var(--wp--preset--spacing--40); }
.wp-block-embed.is-type-video .wp-block-embed__wrapper { border-radius: var(--pu-radius-m); overflow: hidden; box-shadow: var(--wp--preset--shadow--lift); }
.wp-block-post-content iframe[src*="youtube"] { border-radius: var(--pu-radius-m); max-width: 100%; }
.wp-block-post-content > p iframe[src*="youtube"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }

.pu-lang { position: relative; }
.pu-lang-label {
	display: inline-block;
	font-weight: 800;
	font-size: .8125rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: .2rem .75rem;
	margin-bottom: .25rem !important;
}
.pu-vocab table { border-collapse: collapse; width: 100%; }
.pu-vocab td, .pu-vocab th { border: 1px solid var(--wp--preset--color--line); padding: .6rem .8rem; }
.pu-vocab thead th { background: var(--wp--preset--color--sky); color: var(--wp--preset--color--primary-dark); text-align: left; }
.pu-vocab tbody tr:nth-child(even) { background: var(--wp--preset--color--base); }

.wp-block-details summary { font-family: var(--wp--preset--font-family--heading); font-weight: 700; font-size: 1.125rem; cursor: pointer; }
.wp-block-details[open] summary { margin-bottom: .75rem; }

.pu-post-nav a { text-decoration: none; }

/* Comentarios */
.wp-block-comments .wp-block-comment-template { padding-left: 0; }
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),
.wp-block-post-comments-form textarea {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--pu-radius-s);
	padding: .7rem .9rem;
	font: inherit;
}

.pu-novels-icon { margin-bottom: 0 !important; line-height: 1; }

/* ---------- Bandas de color ---------- */
.pu-band-blue a:not(.wp-block-button__link) { color: #fff; }
.pu-support .pu-support-avatar img { filter: drop-shadow(0 16px 26px rgba(0, 0, 0, .25)); }

/* ---------- Pie ---------- */
.pu-footer a { color: #DCE6F7; text-decoration: none; font-weight: 600; }
.pu-footer a:hover { color: #fff; text-decoration: underline; }
.pu-footer .wp-block-navigation .wp-block-navigation-item__content { color: #DCE6F7; }
.pu-footer .wp-block-site-logo img { width: 230px; height: auto; }
.pu-footer .wp-block-social-links .wp-social-link { background: rgba(255, 255, 255, .12) !important; color: #fff !important; }

.pu-footer-links { list-style: none; padding-left: 0; margin: 0; }
.pu-footer-links li { margin: .35rem 0; }

/* ---------- Búsqueda ---------- */
.wp-block-search__inside-wrapper { background: #fff; border: 1px solid var(--wp--preset--color--line) !important; border-radius: 999px; padding: 4px !important; }
.wp-block-search__input { border: 0 !important; background: transparent; padding-left: 1rem !important; font: inherit; }
.wp-block-search__button { border-radius: 999px !important; margin-left: 0 !important; }

/* Accesibilidad */
.skip-link:focus { background: var(--wp--preset--color--yellow); color: var(--wp--preset--color--ink); }

/* =========================================================
   Botón de modo oscuro
   ========================================================= */
.pu-theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 44px; height: 44px;
	flex: 0 0 44px;
	border-radius: 999px;
	border: 2px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	padding: 0;
	transition: transform .15s ease, border-color .15s ease, background-color .2s ease;
}
.pu-theme-toggle:hover { transform: rotate(-12deg); border-color: var(--wp--preset--color--primary); }
.pu-theme-toggle:focus-visible { outline: 3px solid var(--wp--preset--color--orange); outline-offset: 2px; }
.pu-theme-toggle .pu-icon-sun { display: none; }
html[data-theme="dark"] .pu-theme-toggle .pu-icon-sun { display: block; color: #FFC531; }
html[data-theme="dark"] .pu-theme-toggle .pu-icon-moon { display: none; }

.wp-block-site-logo .pu-logo-dark { display: none; }
html[data-theme="dark"] .wp-block-site-logo .pu-logo-light { display: none; }
html[data-theme="dark"] .wp-block-site-logo .pu-logo-dark { display: inline-block; }

/* =========================================================
   Modo oscuro
   ========================================================= */
html[data-theme="dark"] {
	color-scheme: dark;
	--pu-surface: #15264A;
	--pu-surface-2: #1B2F58;
	--wp--preset--color--base: #0C1730;
	--wp--preset--color--ink: #E8EEF9;
	--wp--preset--color--muted: #A9B6CC;
	--wp--preset--color--line: #2A3D66;
	--wp--preset--color--sky: #1F3560;
	--wp--preset--color--cream: #18233F;
	--wp--preset--color--orange-ink: #FFB866;
	--wp--preset--color--white: var(--pu-surface);
	--wp--preset--shadow--card: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
	--wp--preset--shadow--lift: 0 12px 32px rgba(0,0,0,.45);
}
html[data-theme="dark"] body { background: var(--wp--preset--color--base); }

/* El blanco sigue siendo blanco cuando es color de texto */
html[data-theme="dark"] .has-white-color { color: #FFFFFF !important; }
html[data-theme="dark"] .wp-element-button,
html[data-theme="dark"] .wp-block-button__link,
html[data-theme="dark"] .wp-block-read-more.is-style-pu-button { color: #FFFFFF; }

/* Texto oscuro sobre amarillo */
html[data-theme="dark"] .has-yellow-background-color,
html[data-theme="dark"] .has-yellow-background-color.has-ink-color,
html[data-theme="dark"] .wp-block-button.is-style-pu-yellow .wp-block-button__link { color: #13254A !important; }

/* Enlaces y azul como texto */
html[data-theme="dark"] a:where(:not(.wp-element-button):not(.wp-block-button__link):not(.custom-logo-link)) { color: #8DB8FF; }
html[data-theme="dark"] a:where(:not(.wp-element-button):not(.wp-block-button__link)):hover { color: #B9D3FF; }
html[data-theme="dark"] .has-primary-color { color: #8DB8FF !important; }
html[data-theme="dark"] .wp-block-post-title a { color: var(--wp--preset--color--ink); }
html[data-theme="dark"] .wp-block-post-title a:hover { color: #8DB8FF; }
html[data-theme="dark"] .wp-block-post-terms.is-style-pu-badges a { color: #8DB8FF; }

/* Encabezado y pie */
html[data-theme="dark"] .pu-header { background: rgba(12, 23, 48, .9); border-bottom-color: #22365E; }
html[data-theme="dark"] .pu-footer.has-ink-background-color { background-color: #070F22 !important; }
html[data-theme="dark"] .pu-footer .wp-block-heading.has-yellow-color { color: #FFC531 !important; }
html[data-theme="dark"] .wp-block-navigation__responsive-container.is-menu-open { background-color: #0C1730 !important; color: #E8EEF9 !important; }

/* Fondos de sección */
html[data-theme="dark"] .has-hero-gradient-background { background: linear-gradient(135deg, #14284F 0%, #0C1730 55%, #1F1F33 100%) !important; }
html[data-theme="dark"] .has-blue-gradient-background { background: linear-gradient(135deg, #1E5CB8 0%, #123F86 60%, #0A2A60 100%) !important; }

/* Botones claros y contornos */
html[data-theme="dark"] .wp-block-button.is-style-pu-light .wp-block-button__link { background: var(--pu-surface-2); color: #FFFFFF; box-shadow: inset 0 0 0 2px #2F4775; }
html[data-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link { color: #E8EEF9; border-color: #E8EEF9; background: transparent; }

/* Formularios, tablas y paginación */
html[data-theme="dark"] .wp-block-search__inside-wrapper { background: var(--pu-surface) !important; }
html[data-theme="dark"] .wp-block-search__input { color: #E8EEF9; }
html[data-theme="dark"] .pu-vocab thead th { color: #CFE0FF; }
html[data-theme="dark"] .pu-vocab tbody tr:nth-child(even) { background: #112244; }
html[data-theme="dark"] .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),
html[data-theme="dark"] .wp-block-post-comments-form textarea { background: var(--pu-surface); color: #E8EEF9; }
html[data-theme="dark"] .wp-block-query-pagination-numbers .page-numbers.current { background: #1859B8; border-color: #1859B8; color: #fff; }

/* Ilustraciones: un poco menos de brillo */
html[data-theme="dark"] .wp-block-image img,
html[data-theme="dark"] .wp-block-post-featured-image img { filter: brightness(.96); }

/* Transición suave al cambiar de modo */
body, .pu-header, .is-style-pu-card, .wp-block-group { transition: background-color .25s ease, color .25s ease; }
html[data-theme="dark"] .pu-hero .pu-highlight-blue { color: #6FA8FF; }
html[data-theme="dark"] .pu-footer a { color: #DCE6F7; }
html[data-theme="dark"] .pu-footer a:hover { color: #FFFFFF; }
html[data-theme="dark"] .pu-vocab thead th { border-bottom-color: #2A3D66; }
