/*
Theme Name: Equacom News Magazine
Theme URI: https://equacom.news/
Author: Equacom Solutions
Author URI: https://equacom.solutions/
Description: Tema periódico digital moderno para WordPress. Optimizado para Google News, SEO avanzado, diseño responsive y rendimiento máximo. Estilo BBC/CNN/Euronews.
Version: 3.0.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, google-news, light-mode
*/

/* ============================================
   SISTEMA DE COLORES - TEMA CLARO MODERNO
   ============================================ */
:root {
  /* Modo claro (PREDETERMINADO) - Diseño limpio tipo BBC */
  --background: 0 0% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 47% 11%;
  --primary: 210 100% 45%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 210 100% 38%;
  --secondary: 210 40% 96%;
  --secondary-foreground: 222 47% 11%;
  --muted: 210 40% 96%;
  --muted-foreground: 215 16% 47%;
  --accent: 190 90% 45%;
  --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.5rem;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, hsl(210, 100%, 45%), hsl(190, 90%, 45%));
  --gradient-dark: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
}

/* MODO OSCURO */
.dark,
:root.dark,
html.dark {
  --background: 222 47% 8%;
  --foreground: 210 40% 98%;
  --card: 222 47% 11%;
  --card-foreground: 210 40% 98%;
  --popover: 222 47% 10%;
  --popover-foreground: 210 40% 98%;
  --primary: 210 100% 55%;
  --primary-foreground: 222 47% 8%;
  --primary-hover: 210 100% 60%;
  --secondary: 222 47% 16%;
  --secondary-foreground: 210 40% 98%;
  --muted: 222 47% 14%;
  --muted-foreground: 215 20% 60%;
  --accent: 190 90% 50%;
  --accent-foreground: 222 47% 8%;
  --destructive: 0 63% 45%;
  --destructive-foreground: 210 40% 98%;
  --border: 222 47% 18%;
  --input: 222 47% 16%;
  --ring: 210 100% 55%;
}

/* ============================================
   ESTILOS BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html { 
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { 
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
  background-color: hsl(var(--background)); 
  color: hsl(var(--foreground));
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
}

/* ============================================
   TIPOGRAFÍA
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  color: hsl(var(--foreground));
}

p {
  margin-bottom: 1rem;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   IMÁGENES
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

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

/* ============================================
   UTILIDADES
   ============================================ */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.text-gradient { 
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

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

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   ANIMACIONES - SUAVES Y PROFESIONALES
   ============================================ */
@keyframes fade-in { 
  from { opacity: 0; transform: translateY(10px); } 
  to { opacity: 1; transform: translateY(0); } 
}

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

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

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

.animate-fade-in { animation: fade-in 0.4s ease-out; }
.animate-slide-up { animation: slide-up 0.5s ease-out; }
.animate-slide-in-right { animation: slide-in-right 0.4s ease-out; }
.animate-scale-in { animation: scale-in 0.3s ease-out; }

/* Stagger animations */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }

/* ============================================
   TARJETAS DE NOTICIAS
   ============================================ */
.news-card,
.news-card-small {
  transition: all 0.3s ease;
  background: hsl(var(--card));
  border-radius: var(--radius);
  overflow: hidden;
}

.news-card:hover,
.news-card-small:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.news-card img,
.news-card-small img {
  transition: transform 0.5s ease;
}

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

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

/* ============================================
   NAVEGACIÓN
   ============================================ */
.nav-link {
  position: relative;
  transition: all 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background: hsl(var(--primary));
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

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

/* ============================================
   TOGGLE DE TEMA
   ============================================ */
.theme-toggle-btn {
  position: relative;
  transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
  border-color: hsl(var(--primary));
}

/* Light mode - show sun, hide moon */
.theme-icon-sun { display: flex; }
.theme-icon-moon { display: none; }

/* Dark mode - show moon, hide sun */
.dark .theme-icon-sun { display: none; }
.dark .theme-icon-moon { display: flex; }

/* ============================================
   SLIDER
   ============================================ */
.slider-dot {
  transition: all 0.3s ease;
}

.slider-dot.active {
  width: 1.5rem;
  background: white;
}

/* ============================================
   FORMULARIOS
   ============================================ */
input, button, textarea, select {
  font-family: inherit;
}

input:focus, 
textarea:focus, 
select:focus {
  outline: none;
  ring: 2px solid hsl(var(--primary) / 0.5);
}

button {
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

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

/* ============================================
   PUBLICIDAD - SOLO VISIBLE SI HAY CONTENIDO
   ============================================ */
.ad-container:empty,
.widget-ad:empty {
  display: none !important;
}

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

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
}

@media (max-width: 768px) {
  /* Reducir animaciones en móvil */
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-in-right {
    animation-duration: 0.3s;
  }
}

/* ============================================
   LOGO INSTITUCIONAL
   ============================================ */
.equacom-logo-panel {
  background: hsl(var(--card));
}

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

@media (max-width: 768px) {
  .institutional-logo-container {
    height: 60px !important;
  }
  
  .institutional-logo {
    max-height: 55px !important;
  }
}

/* ============================================
   WORDPRESS CLASSES
   ============================================ */
.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.wp-caption {
  max-width: 100%;
}

.wp-caption-text {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.5rem;
}

/* Pagination */
.nav-links {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-links a,
.nav-links span {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  transition: all 0.2s ease;
}

.nav-links a:hover {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.nav-links .current {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  header, footer, .ad-container, .widget-ad, nav {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
  }
}
