/*
Theme Name: Prisma TV
Theme URI: https://prismamedios.cl
Author: Data Nautic
Author URI: https://datanautic.cl
Description: Tema del medio digital Prisma TV. Portada de noticias, sección Nexo, videos y programas. Editable desde el Editor del sitio.
Version: 0.2.0
Requires at least: 6.6
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: prisma-tv
*/

/* ---------- Base ---------- */
body { -webkit-font-smoothing: antialiased; }
img { height: auto; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.pt-ancho { max-width: var(--wp--style--global--wide-size); margin-inline: auto; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--wp--preset--color--amarillo); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* La firma del triángulo: una barra de 6 colores, la usamos como acento de marca */
.pt-prisma-barra { height: 4px; background: linear-gradient(90deg, #FFA113 0 16.6%, #FEC434 16.6% 33.3%, #1AB4D6 33.3% 50%, #007CBC 50% 66.6%, #FE5049 66.6% 83.3%, #DF3035 83.3%); }

/* ---------- Cabecera ---------- */
.pt-topbar { font-size: var(--wp--preset--font-size--xs); }
.pt-topbar .wp-block-social-links { gap: 0.6rem; }
.pt-topbar .wp-block-social-links .wp-social-link { font-size: 16px; }
.pt-header .wp-block-navigation { font-family: var(--wp--preset--font-family--titulos); font-weight: 700; font-size: var(--wp--preset--font-size--s); letter-spacing: .01em; }
.pt-header .wp-block-navigation a:hover { color: var(--wp--preset--color--amarillo); }
.pt-envivo > a::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .4em; border-radius: 50%; background: var(--wp--preset--color--coral); vertical-align: .08em; animation: pt-pulso 1.6s ease-in-out infinite; }
@keyframes pt-pulso { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pt-envivo > a::before { animation: none; } }
.pt-header .wp-block-search__input { border-radius: 6px; border: 0; min-width: 0; }
.pt-header .wp-block-search__button { background: transparent; color: #fff; padding: 0 .4rem; }

/* ---------- Títulos de sección ---------- */
.pt-titulo-seccion { display: flex; align-items: center; gap: .6rem; text-transform: uppercase; letter-spacing: .02em; }
.pt-titulo-seccion::before { content: ""; width: 14px; height: 14px; flex: none; background: conic-gradient(from 0deg, #FEC434 0 60deg, #FE5049 0 120deg, #DF3035 0 180deg, #007CBC 0 240deg, #1AB4D6 0 300deg, #FFA113 0); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pt-ver-todo a { font-family: var(--wp--preset--font-family--titulos); font-weight: 700; text-decoration: none; }

/* ---------- Etiquetas de sección (categorías) ---------- */
.pt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-chips a, .taxonomy-category.pt-chips a { display: inline-block; font-family: var(--wp--preset--font-family--titulos); font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: 3px 8px; border-radius: 3px; background: var(--wp--preset--color--azul-noche); color: #fff; }
.pt-chips .wp-block-post-terms__separator { display: none; }
.pt-chips a[href*="/actualidad/"] { background: #007CBC; color: #fff; }
.pt-chips a[href*="/politica"] { background: #DF3035; color: #fff; }
.pt-chips a[href*="/cultura"] { background: #FFA113; color: #011837; }
.pt-chips a[href*="/opinion"] { background: #FEC434; color: #011837; }

/* ---------- Portada: destacada ---------- */
.pt-destacada .wp-block-cover { border-radius: 10px; overflow: hidden; }
.pt-destacada .wp-block-cover__inner-container { width: 100%; }
.pt-destacada .wp-block-post-title a, .pt-lateral .wp-block-post-title a { color: inherit; text-decoration: none; }
.pt-destacada .wp-block-post-title a:hover { text-decoration: underline; }
.pt-lateral .wp-block-cover { border-radius: 10px; overflow: hidden; }

/* ---------- Tarjetas de noticias ---------- */
.pt-tarjeta { background: #fff; border-radius: 10px; overflow: hidden; height: 100%; border: 1px solid var(--wp--preset--color--linea); transition: box-shadow .2s, transform .2s; }
.pt-tarjeta:hover { box-shadow: 0 8px 24px rgba(1, 24, 55, .10); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .pt-tarjeta, .pt-tarjeta:hover { transition: none; transform: none; } }
.pt-tarjeta .wp-block-post-featured-image { margin: 0; }
.pt-tarjeta .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }
.pt-tarjeta .wp-block-post-title a { color: var(--wp--preset--color--tinta); text-decoration: none; }
.pt-tarjeta .wp-block-post-title a:hover { color: var(--wp--preset--color--rojo); }
.pt-tarjeta-cuerpo { padding: 14px 16px 18px; }
.wp-block-post-template.is-flex-container > li { display: flex; }
.wp-block-post-template.is-flex-container > li > * { width: 100%; }

/* ---------- Barra lateral ---------- */
.pt-caja { background: #fff; border: 1px solid var(--wp--preset--color--linea); border-radius: 10px; padding: 18px; }
.pt-lista-corta .wp-block-post { border-bottom: 1px dashed var(--wp--preset--color--linea); padding-bottom: 10px; margin-bottom: 10px; }
.pt-lista-corta .wp-block-post:last-child { border: 0; margin: 0; padding: 0; }
.pt-lista-corta .wp-block-post-title a { color: var(--wp--preset--color--tinta); text-decoration: none; }

/* ---------- Programas ---------- */
.pt-programa { background: var(--wp--preset--color--azul-medio); color: #fff; border-radius: 10px; overflow: hidden; height: 100%; }
.pt-programa .wp-block-post-featured-image img { aspect-ratio: 1/1; object-fit: cover; width: 100%; }
.pt-programa .wp-block-post-title a { color: #fff; text-decoration: none; }
.pt-programa-horario { font-family: var(--wp--preset--font-family--titulos); font-weight: 700; color: var(--wp--preset--color--amarillo); font-size: var(--wp--preset--font-size--xs); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Newsletter ---------- */
.pt-newsletter-form { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-newsletter-form input[type="email"] { flex: 1 1 220px; padding: 12px 14px; border-radius: 6px; border: 1px solid var(--wp--preset--color--linea); font: inherit; }
.pt-newsletter-form button { padding: 12px 18px; border-radius: 6px; border: 0; background: var(--wp--preset--color--rojo); color: #fff; font-family: var(--wp--preset--font-family--titulos); font-weight: 700; cursor: pointer; }
.pt-newsletter-form button:hover { background: var(--wp--preset--color--azul-noche); }
.pt-legal-chico { font-size: var(--wp--preset--font-size--xs); opacity: .8; }

/* ---------- Artículo ---------- */
.single .wp-block-post-content { font-size: 1.125rem; line-height: 1.75; }
.single .wp-block-post-content p { margin-block: 0 1.1em; }
.pt-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; color: var(--wp--preset--color--gris); font-size: var(--wp--preset--font-size--xs); }

/* ---------- Pie ---------- */
.pt-footer a { color: #fff; text-decoration: none; }
.pt-footer a:hover { color: var(--wp--preset--color--amarillo); }
.pt-firma a { color: var(--wp--preset--color--amarillo) !important; font-weight: 700; }

/* ---------- Celular ---------- */
@media (max-width: 781px) {
	.pt-ocultar-movil { display: none !important; }
	.pt-header .wp-block-search { display: none; }
}
.pt-lista-pie { list-style: none; padding-left: 0; line-height: 2; }

/* ---------- Portada: foto con titular encima ---------- */
.pt-foto-titular { position: relative; border-radius: 10px; overflow: hidden; background: var(--wp--preset--color--azul-noche); }
.pt-foto-titular .wp-block-post-featured-image { margin: 0; }
.pt-foto-titular .wp-block-post-featured-image img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.pt-foto-titular--grande .wp-block-post-featured-image img { aspect-ratio: 16/9.6; }
.pt-foto-titular__texto { position: absolute; inset: auto 0 0 0; padding: 18px 20px; color: #fff; background: linear-gradient(180deg, rgba(1,24,55,0) 0%, rgba(1,24,55,.78) 45%, rgba(1,24,55,.95) 100%); }
.pt-foto-titular--grande .pt-foto-titular__texto { padding: 32px 28px 24px; }
.pt-foto-titular__texto > * + * { margin-top: .5rem; }
.pt-foto-titular .wp-block-post-title { margin: 0; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pt-foto-titular .wp-block-post-title a { color: #fff; text-decoration: none; }
.pt-foto-titular .wp-block-post-title a:hover { text-decoration: underline; }
.pt-foto-titular .wp-block-post-date { color: #dfe6f2; }
.pt-lateral .wp-block-post-template { display: grid; gap: 1.25rem; }
@media (max-width: 781px) { .pt-foto-titular--grande .wp-block-post-title { font-size: 1.5rem !important; } }

/* ---------- Ajustes tras la primera revisión (05-10-2026) ---------- */
.pt-prisma-barra { width: 100vw; margin-left: calc(50% - 50vw) !important; }
.pt-topbar { border-bottom: 0 !important; }
.pt-banda-videos .pt-ver-todo a { color: var(--wp--preset--color--amarillo); }
.pt-programa .wp-block-post-excerpt { color: #c9d3e6; }
.home .pt-footer { margin-top: 0 !important; }
.pt-lateral .pt-foto-titular .wp-block-post-featured-image img { aspect-ratio: 16/9.2; }
html, body { overflow-x: clip; }
@media (max-width: 781px) {
	.pt-lateral .pt-foto-titular .wp-block-post-featured-image img { aspect-ratio: 16/10; }
	.pt-header .wp-block-site-logo img { width: 140px; }
}
/* WordPress le pone ~2.4em de margen interno a todo grupo con fondo; la cabecera y el pie no lo necesitan. */
.pt-header, .pt-footer { padding-left: 0 !important; padding-right: 0 !important; }
/* Menú de secciones en Nexo: chips en fila, sin viñetas */
.wp-block-categories.pt-chips, .pt-chips-menu { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.wp-block-categories.pt-chips li { list-style: none; margin: 0; }
.wp-block-categories.pt-chips li::marker { content: none; }

/* ---------- Rediseño plataforma de streaming (06-10-2026) ---------- */
/* La parte de arriba de la portada es oscura, como una plataforma de video; las noticias escritas siguen en claro. */
.pt-plataforma { padding-left: 0 !important; padding-right: 0 !important; background: radial-gradient(90% 60% at 85% 0%, #0A2A5C 0%, #011837 70%) !important; }
.pt-plataforma > * { padding-inline: 16px; }
.pt-plataforma .pt-ver-todo a { color: #FEC434; }
.pt-columna-ultimas { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 16px 18px 6px; }
.pt-carril .pt-titulo-seccion { margin: 0; }

/* Programas: fila deslizable de tarjetas tipo afiche */
.pt-fila-programas .wp-block-post-template { display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(220px, 23%); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 0 12px; margin: 0; list-style: none; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.3) transparent; }
.pt-fila-programas .wp-block-post { scroll-snap-align: start; display: flex; }
.pt-fila-programas .pt-programa { width: 100%; background: linear-gradient(160deg, #0A2A5C 0%, #011837 100%); border: 1px solid rgba(255,255,255,.1); transition: transform .2s, border-color .2s; }
.pt-fila-programas .pt-programa:hover { transform: translateY(-3px); border-color: #FEC434; }
.pt-fila-programas .pt-programa .wp-block-post-featured-image img { aspect-ratio: 16/9; }
/* Programa sin afiche todavía: un recuadro con el triángulo de la marca en vez de un hueco */
.pt-fila-programas .pt-programa:not(:has(.wp-block-post-featured-image))::before { content: ""; display: block; aspect-ratio: 16/9; background: url(assets/img/isotipo-prisma.svg) center / 64px auto no-repeat, radial-gradient(circle at 50% 45%, #0A2A5C, #06244f); }
@media (max-width: 781px) { .pt-fila-programas .wp-block-post-template { grid-auto-columns: 72%; } }
@media (prefers-reduced-motion: reduce) { .pt-fila-programas .pt-programa, .pt-fila-programas .pt-programa:hover { transition: none; transform: none; } }

/* Firma del periodista */
.pt-firma-autor::before { content: "Por "; }
.pt-firma-autor { font-weight: 700; color: var(--wp--preset--color--tinta); }
.pt-tarjeta .pt-meta { margin-top: auto; }
.pt-ver-todo { white-space: nowrap; }
@media (max-width: 781px) {
	.pt-titulo-seccion.wp-block-heading { font-size: 1.125rem !important; }
	.pt-escenario__acciones a { font-size: .875rem; padding: 9px 14px; }
	.pt-columna-ultimas { padding: 12px 14px 4px; }
}
.pt-fila-programas .wp-block-post { margin: 0 !important; } /* WordPress separa cada ítem hacia abajo; en una fila los desalinea */
@media (max-width: 781px) {
	.pt-plataforma .pt-titulo-seccion.wp-block-heading.has-l-font-size, main .pt-titulo-seccion.wp-block-heading { font-size: 1.125rem !important; }
}
