/*
Theme Name: Equacom News Magazine
Theme URI: https://equacom.news/
Author: Equacom Solutions
Author URI: https://equacom.solutions/
Description: Tema tipo revista digital moderna para WordPress. Periódico digital optimizado para SEO, publicidad inteligente, sliders de noticias, y diseño totalmente responsive. Modo día por defecto.
Version: 2.2.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: equacom-news
Tags: news, magazine, responsive, newspaper, seo-optimized, light-mode
*/

/* ============================================
   SISTEMA DE COLORES - MODO DÍA POR DEFECTO
   ============================================ */
:root {
  /* Modo claro (PREDETERMINADO) */
  --background: 210 30% 98%;
  --foreground: 222 84% 5%;
  --card: 0 0% 100%;
  --card-foreground: 222 84% 5%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 84% 5%;
  --primary: 210 100% 45%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 210 100% 38%;
  --secondary: 210 100% 92%;
  --secondary-foreground: 210 100% 45%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --accent: 190 100% 50%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 214 32% 91%;
  --input: 214 32% 91%;
  --ring: 210 100% 45%;
  --radius: 0.75rem;
  --shadow-news: 0 4px 20px hsl(210 100% 45% / 0.15);
  --shadow-card: 0 2px 8px hsl(210 100% 45% / 0.08);
  --shadow-hover: 0 8px 30px hsl(210 100% 45% / 0.2);
  --gradient-primary: linear-gradient(135deg, hsl(210, 100%, 45%), hsl(190, 100%, 50%));
  --gradient-overlay: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
}

/* MODO OSCURO AZUL - ALTERNATIVO */
.dark,
:root.dark,
html.dark {
  --background: 220 25% 8%;
  --foreground: 210 40% 96%;
  --card: 220 25% 12%;
  --card-foreground: 210 40% 96%;
  --popover: 220 25% 10%;
  --popover-foreground: 210 40% 96%;
  --primary: 210 100% 55%;
  --primary-foreground: 220 25% 8%;
  --primary-hover: 210 100% 60%;
  --secondary: 220 25% 18%;
  --secondary-foreground: 210 40% 96%;
  --muted: 220 25% 15%;
  --muted-foreground: 215 20% 60%;
  --accent: 190 100% 55%;
  --accent-foreground: 220 25% 8%;
  --destructive: 0 63% 45%;
  --destructive-foreground: 210 40% 96%;
  --border: 220 25% 20%;
  --input: 220 25% 18%;
  --ring: 210 100% 55%;
  --shadow-news: 0 4px 25px hsl(210 100% 55% / 0.3);
  --shadow-card: 0 2px 12px hsl(0 0% 0% / 0.4);
  --shadow-hover: 0 12px 40px hsl(210 100% 55% / 0.35);
  --gradient-primary: linear-gradient(135deg, hsl(210, 100%, 55%), hsl(190, 100%, 60%));
}

/* ============================================
   ESTILOS BASE
   ============================================ */
html { 
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { 
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif; 
  background-color: hsl(var(--background)); 
  color: hsl(var(--foreground));
  position: relative;
  line-height: 1.6;
  min-height: 100vh;
}

/* Fondo Equacom News sutil */
body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50vw;
  max-width: 400px;
  height: 50vw;
  max-height: 400px;
  background-image: url('screenshot.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
}

/* ============================================
   TIPOGRAFÍA
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded,
img[loading="eager"] {
  opacity: 1;
}

.text-gradient { 
  -webkit-background-clip: text !important; 
  background-clip: text !important; 
  -webkit-text-fill-color: transparent !important;
  background-image: var(--gradient-primary) !important; 
  font-weight: 700;
}

.bg-gradient-primary { background-image: var(--gradient-primary); }

/* ============================================
   ANIMACIONES DINÁMICAS - ESTILO BBC/CNN/EURONEWS
   Más vivas, más naturales, más atractivas
   ============================================ */
@keyframes fade-in { 
  from { opacity: 0; transform: translateY(20px); } 
  to { opacity: 1; transform: translateY(0); } 
}

@keyframes slide-up { 
  from { opacity: 0; transform: translateY(40px); } 
  to { opacity: 1; transform: translateY(0); } 
}

@keyframes slide-in-left { 
  from { opacity: 0; transform: translateX(-30px); } 
  to { opacity: 1; transform: translateX(0); } 
}

@keyframes slide-in-right { 
  from { opacity: 0; transform: translateX(30px); } 
  to { opacity: 1; transform: translateX(0); } 
}

@keyframes scale-in { 
  from { opacity: 0; transform: scale(0.9); } 
  to { opacity: 1; transform: scale(1); } 
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.02); opacity: 0.95; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px hsl(var(--primary) / 0.3); }
  50% { box-shadow: 0 0 20px hsl(var(--primary) / 0.6); }
}

@keyframes bounce-subtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes wave {
  0%, 100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(2px) translateY(-2px); }
  75% { transform: translateX(-2px) translateY(2px); }
}

.animate-fade-in { animation: fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slide-up { animation: slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slide-in-left { animation: slide-in-left 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-slide-in-right { animation: slide-in-right 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-scale-in { animation: scale-in 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.animate-pulse-soft { animation: pulse-soft 3s ease-in-out infinite; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-glow { animation: glow-pulse 2s ease-in-out infinite; }
.animate-bounce-subtle { animation: bounce-subtle 2s ease-in-out infinite; }

/* Shimmer effect para el logo */
.shimmer-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 3s infinite;
}

/* Staggered animations para listas */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* ============================================
   EFECTOS HOVER
   ============================================ */
.hover-lift { 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  cursor: pointer;
}
.hover-lift:hover { 
  transform: translateY(-8px) scale(1.02); 
  box-shadow: var(--shadow-hover); 
}

/* ============================================
   TARJETAS DE NOTICIAS
   ============================================ */
.news-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  background: hsl(var(--card));
  border-radius: 0.75rem;
  border: 1px solid hsl(var(--border));
  box-shadow: var(--shadow-card);
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, hsla(var(--primary), 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.news-card:hover::before {
  opacity: 1;
}

.news-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: hsl(var(--primary) / 0.3);
}

.news-card img {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-card:hover img {
  transform: scale(1.08);
}

/* Story link con underline animado */
.story-link {
  position: relative;
  display: inline-block;
  transition: color 0.3s ease;
}

.story-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: hsl(var(--primary));
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-link:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

/* Botones */
button, .button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover, .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px hsla(var(--primary), 0.3);
}

button:active, .button:active {
  transform: translateY(0);
}

/* Skeleton loading */
@keyframes skeleton-loading {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--muted-foreground) / 0.1) 50%, hsl(var(--muted)) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

/* Category badge */
.category-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
}

.category-badge:hover {
  background: hsl(var(--accent));
  transform: scale(1.05);
}

/* ============================================
   TÍTULOS - NUNCA CORTADOS
   ============================================ */
.news-card h3,
.news-card h2,
.news-card-featured h3,
.news-card-small h3,
article h1,
article h2 {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  line-height: 1.35 !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  hyphens: auto !important;
}

.news-card > div,
.news-card > a > div,
.news-card-featured > div,
.news-card-small > div {
  overflow: visible !important;
}

.news-card .p-3,
.news-card .p-4,
.news-card-small .p-2,
.news-card-small .p-3 {
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* ============================================
   ICONO DÍA/NOCHE
   ============================================ */
.theme-toggle-btn {
  position: relative;
  background: hsl(var(--card));
  border: 2px solid hsl(var(--border));
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle-btn:hover {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 20px hsl(var(--primary) / 0.3);
  transform: translateY(-2px) scale(1.05);
}

.theme-icon-sun,
.theme-icon-moon {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Estado dark mode */
.dark .theme-icon-sun {
  opacity: 0;
  transform: scale(0) rotate(180deg);
}

.dark .theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.dark .theme-toggle-btn {
  background: hsl(var(--card));
  border-color: hsl(var(--primary) / 0.5);
  box-shadow: 0 0 15px hsl(var(--primary) / 0.2);
}

/* Estado light mode */
:not(.dark) .theme-icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

:not(.dark) .theme-icon-moon {
  opacity: 0;
  transform: scale(0) rotate(-180deg);
}

/* Breaking News Scroll */
@keyframes scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.breaking-news-scroll {
  animation: scroll 30s linear infinite;
}

.breaking-news-scroll:hover {
  animation-play-state: paused;
}

/* ============================================
   SLIDER VERTICAL DE NOTICIAS
   ============================================ */
@keyframes slideVertical {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.sliding-news-vertical {
  overflow: hidden;
  height: 450px;
  position: relative;
}

.sliding-news-vertical .news-track {
  display: flex;
  flex-direction: column;
}

.sliding-news-vertical:hover .news-track {
  animation-play-state: paused;
}

.sliding-news-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.sliding-news-item:hover {
  background: hsl(var(--primary) / 0.1);
  transform: translateX(5px);
}

.sliding-news-item img {
  width: 80px;
  height: 64px;
  object-fit: cover;
  border-radius: 0.5rem;
  flex-shrink: 0;
  background: hsl(var(--muted));
}

/* ============================================
   PUBLICIDAD INTELIGENTE
   Solo se muestra si hay contenido
   ============================================ */
.ad-container {
  display: none; /* Oculto por defecto */
}

.ad-container.has-content {
  display: block; /* Solo visible si tiene contenido */
}

.widget-ad {
  transition: all 0.3s ease;
}

.widget-ad:hover {
  transform: scale(1.01);
}

.widget-ad img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  object-fit: cover;
}

/* ============================================
   RESPONSIVE - MÓVIL OPTIMIZADO
   ============================================ */
@media (max-width: 768px) {
  body::before {
    width: 70vw;
    height: 70vw;
    opacity: 0.02;
  }
  
  header .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .sliding-news-vertical {
    height: 350px;
  }
  
  .sliding-news-item {
    padding: 0.5rem;
  }
  
  .sliding-news-item img {
    width: 60px;
    height: 48px;
  }
  
  .news-card h3,
  .news-card-featured h3 {
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
  }
  
  .news-card-small h3 {
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
  }
  
  .category-badge {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
  }
  
  /* Logo más pequeño en móvil */
  .site-logo img {
    height: 2rem !important;
  }
  
  /* Categorías en scroll horizontal */
  .category-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .category-nav::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 480px) {
  .sliding-news-vertical {
    height: 300px;
  }
  
  .sliding-news-item img {
    width: 50px;
    height: 40px;
  }
  
  .news-card h3 {
    font-size: 0.8125rem !important;
  }
}

/* Hide scrollbar */
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ============================================
   BARRA DE CATEGORÍAS CON LOGO PEQUEÑO
   ============================================ */
.category-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.5rem 0;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.category-bar .logo-small {
  flex-shrink: 0;
  height: 1.75rem;
  width: auto;
}

.category-bar a {
  flex-shrink: 0;
  white-space: nowrap;
}

/* ============================================
   AUTORÍA CONSISTENTE
   ============================================ */
.author-byline {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.author-byline strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

/* ============================================
   SLOGAN Y RELOJ RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .slogan-text {
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  .slogan-text {
    display: none;
  }
}

/* ============================================
   PERIÓDICO DIGITAL - OPTIMIZADO PARA SEO
   ============================================ */
.newspaper-layout {
  max-width: 1400px;
  margin: 0 auto;
}

/* Sin verificación de bot - carga directa */
body {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Widgets respetados */
.widget-area {
  margin-bottom: 1.5rem;
}

.widget-ad img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   PANEL INSTITUCIONAL LOGO - 728x90
   ============================================ */
.equacom-logo-panel {
  background: linear-gradient(180deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%);
  position: relative;
  overflow: hidden;
}

.equacom-logo-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, hsl(var(--primary) / 0.03), transparent);
  pointer-events: none;
}

.institutional-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
}

.institutional-logo {
  filter: drop-shadow(0 2px 8px hsl(var(--primary) / 0.15));
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.institutional-logo:hover {
  filter: drop-shadow(0 4px 16px hsl(var(--primary) / 0.25));
  transform: scale(1.03);
}

/* Panel responsive */
@media (max-width: 768px) {
  .institutional-logo-container {
    max-width: 100% !important;
    height: auto !important;
    min-height: 50px;
    padding: 0.5rem 0;
  }
  
  .institutional-logo {
    max-height: 60px !important;
    width: auto;
  }
}

@media (max-width: 480px) {
  .institutional-logo-container {
    min-height: 40px;
  }
  
  .institutional-logo {
    max-height: 50px !important;
  }
}

/* ============================================
   ESTILO REVISTA DIGITAL MODERNO
   Inspirado en BBC, CNN, Euronews, ecomatin
   ============================================ */

/* Bloques informativos claros */
.news-block {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-block::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: hsl(var(--primary));
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.news-block:hover::before {
  transform: scaleY(1);
}

.news-block:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Jerarquía visual fuerte */
.headline-primary {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.headline-secondary {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.3;
}

.headline-tertiary {
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  font-weight: 600;
  line-height: 1.4;
}

/* Indicador de sección estilo CNN */
.section-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0;
  position: relative;
}

.section-indicator::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 0;
  bottom: 0;
  width: 10px;
  background: hsl(var(--primary));
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

/* Tarjetas con efecto glassmorphism suave */
.glass-card {
  background: hsl(var(--card) / 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid hsl(var(--border) / 0.5);
}

/* Líneas decorativas estilo BBC */
.accent-line {
  width: 60px;
  height: 4px;
  background: hsl(var(--primary));
  border-radius: 2px;
  margin-bottom: 1rem;
}

/* Hover effects más dinámicos */
.hover-reveal {
  position: relative;
  overflow: hidden;
}

.hover-reveal::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--accent)));
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-reveal:hover::after {
  transform: translateX(0);
}

/* Pulse para elementos importantes */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.live-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-soft 1.5s ease-in-out infinite;
}

/* Transiciones suaves globales */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

a, button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mejora de la experiencia táctil */
@media (hover: none) {
  .news-card:active {
    transform: scale(0.98);
  }
  
  .news-block:active {
    transform: scale(0.99);
  }
}

/* ============================================
   MODULARIDAD - SECCIONES ACTIVABLES
   ============================================ */
.section-conditional {
  display: none;
}

.section-conditional.has-content {
  display: block;
}

.widget-area:empty {
  display: none;
}

/* No espacios vacíos */
.ad-container:empty,
.widget-container:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
