/*
Theme Name:   Primicia IA Child
Theme URI:    https://primiciaia.com
Description:  Child theme de Jannah para Primicia IA — medio de noticias de IA en español para LATAM. Tokens de marca, fuentes self-hosted y estilos editoriales.
Author:       Primicia IA
Template:     jannah
Version:      1.0.0
Text Domain:  primicia-ia-child
*/

/* ==========================================================================
   BRAND TOKENS — Primicia IA
   Fuente de verdad: brand.json en la raíz del repo.
   Nunca hardcodear estos valores en otros archivos: usar las variables.
   ========================================================================== */

:root {
  /* Colores */
  --pia-negro-neural: #0B0D12;   /* base editorial, fondos oscuros */
  --pia-cian-senal: #00C2D8;     /* color de marca: links, acentos, cifras */
  --pia-ambar-primicia: #F59E0B; /* EXCLUSIVO breaking news / última hora */
  --pia-blanco: #FFFFFF;
  --pia-gris-prensa: #6B7280;    /* metadatos, bylines, texto secundario */
  --pia-gris-linea: #E5E7EB;     /* bordes y separadores en fondo claro */

  /* Tipografía */
  --pia-font-titulares: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --pia-font-cuerpo: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ==========================================================================
   FUENTES SELF-HOSTED (subset latin, woff2, font-display: swap)
   ========================================================================== */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/inter-latin-700-normal.woff2') format('woff2');
}

/* ==========================================================================
   APLICACIÓN TIPOGRÁFICA
   ========================================================================== */

body {
  font-family: var(--pia-font-cuerpo);
}

h1, h2, h3, h4, h5, h6,
.post-title, .entry-title,
.mag-box-title h3,
.the-global-title {
  font-family: var(--pia-font-titulares);
  letter-spacing: -0.01em;
}

/* Numerales tabulares — innegociable en cifras, tablas y datos */
.entry-content table,
.pia-cifra,
.pia-dato,
time,
.date {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ==========================================================================
   ACENTOS DE MARCA
   ========================================================================== */

.entry-content a {
  color: var(--pia-cian-senal);
  text-decoration-color: rgba(0, 194, 216, 0.4);
}
.entry-content a:hover {
  text-decoration-color: var(--pia-cian-senal);
}

/* Cifras destacadas dentro de notas: <span class="pia-cifra">72%</span> */
.pia-cifra {
  color: var(--pia-cian-senal);
  font-family: var(--pia-font-titulares);
  font-weight: 700;
}

/* ==========================================================================
   BREAKING / ÚLTIMA HORA — ámbar exclusivo
   Uso: agregar la clase .pia-ultima-hora al ítem de menú o al badge.
   Espejo del patrón .ecn-en-vivo de EcomNoticias.
   ========================================================================== */

.pia-ultima-hora > a,
.pia-badge-breaking {
  background: var(--pia-ambar-primicia) !important;
  color: var(--pia-negro-neural) !important;
  font-family: var(--pia-font-titulares);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pia-badge-breaking {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 0.75rem;
  animation: pia-pulse 2s ease-in-out infinite;
}

@keyframes pia-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Cursor parpadeante de marca (logo / claim): <span class="pia-cursor"></span> */
.pia-cursor::after {
  content: '\258C'; /* ▌ */
  color: var(--pia-cian-senal);
  animation: pia-blink 1.1s steps(1) infinite;
}
@keyframes pia-blink {
  50% { opacity: 0; }
}

/* ==========================================================================
   BLOQUES EDITORIALES DE NOTA
   Uso en el cuerpo de cada nota (patrón del medio):
   <div class="pia-por-que-importa">...</div>
   <div class="pia-que-sigue">...</div>
   ========================================================================== */

.pia-por-que-importa,
.pia-que-sigue {
  border-left: 4px solid var(--pia-cian-senal);
  background: #F3FBFC;
  padding: 16px 20px;
  margin: 24px 0;
}

.pia-por-que-importa::before,
.pia-que-sigue::before {
  display: block;
  font-family: var(--pia-font-titulares);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pia-negro-neural);
  margin-bottom: 8px;
}

.pia-por-que-importa::before { content: 'Por qu\00E9 te importa'; }
.pia-que-sigue::before { content: 'Qu\00E9 sigue'; }

.pia-que-sigue {
  border-left-color: var(--pia-gris-prensa);
  background: #F7F8FA;
}

/* Bloque de fuentes al pie de nota */
.pia-fuentes {
  border-top: 1px solid var(--pia-gris-linea);
  margin-top: 32px;
  padding-top: 16px;
  font-size: 0.9rem;
  color: var(--pia-gris-prensa);
}
.pia-fuentes::before {
  content: 'Fuentes';
  display: block;
  font-family: var(--pia-font-titulares);
  font-weight: 700;
  color: var(--pia-negro-neural);
  margin-bottom: 8px;
}

/* Responsive: los bloques editoriales respiran en móvil */
@media (max-width: 600px) {
  .pia-por-que-importa,
  .pia-que-sigue {
    padding: 12px 14px;
    margin: 18px 0;
  }
}
