/**
 * ==============================================================================
 * APORTACIONES FISCALES - Estilos Optimizados (user.css)
 * Específico para plantilla: Cassiopeia Extended (Joomla 4 / 5)
 * ==============================================================================
 */

/* 1. PALETA DE COLORES Y VARIABLES CORPORATIVAS (Sobrescribe Cassiopeia Extended) */
:root {
  /* Variables de Cassiopeia Extended */
  --headerbg: #0a2240 !important;              /* Azul marino formal */
  --headercolor: #ffffff !important;
  --link-color: #0284c7 !important;             /* Azul fiscal moderno */
  --link-hover-color: #0369a1 !important;
  --footerbg: #091a2f !important;              /* Pie de página oscuro formal */
  --footercolor: #cbd5e1 !important;
  --btnbg: #0284c7 !important;
  --btnbgh: #0369a1 !important;
  --template-bg-light: #f8fafc !important;
  --template-special-color: #0a2240 !important;

  /* Variables propias de Aportaciones Fiscales */
  --af-card-bg: #ffffff;
  --af-border: #e2e8f0;
  --af-radius: 12px;
  --af-radius-sm: 6px;
  --af-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --af-shadow-hover: 0 8px 24px rgba(10, 34, 64, 0.08);
}

/* 2. REGLAS GLOBALES Y PREVENCIÓN DE DESBORDAMIENTOS */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: #f8fafc !important;
  color: #1e293b !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

/* 3. CABECERA & IDENTIDAD DE MARCA */
header.header, .container-header {
  background: linear-gradient(135deg, #0a2240 0%, #0d3159 60%, #13467d 100%) !important;
  padding: 1.25rem 1rem !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid #0284c7;
}

/* Logotipo y Subtítulo */
header .navbar-brand {
  display: flex !important;
  align-items: center;
  gap: 15px;
  text-decoration: none !important;
}

header .navbar-brand img {
  max-height: 55px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.site-description {
  color: #93c5fd !important;
  font-size: 0.88rem !important;
  font-weight: 500;
  margin-top: 4px;
}

/* 4. BARRA DE REPRODUCTOR DE RADIO (Radio Aportaciones) */
#kesplayerbar, .kesplayerbar, div[class*="kesplayer"] {
  background: #06101c !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
}

/* 5. NAVEGACIÓN Y MENÚ HAMBURGUESA */
.container-nav {
  background: #ffffff !important;
  border-bottom: 1px solid var(--af-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.container-nav .metismenu > li > a,
.container-nav .mod-menu > li > a {
  color: #1e293b !important;
  font-weight: 600 !important;
  font-size: 0.95rem;
  padding: 0.75rem 1.25rem !important;
  border-radius: var(--af-radius-sm);
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.container-nav .metismenu > li > a:hover,
.container-nav .mod-menu > li > a:hover {
  background-color: #f1f5f9 !important;
  color: #0284c7 !important;
}

.container-nav .metismenu > li.active > a,
.container-nav .mod-menu > li.active > a {
  background-color: #e0f2fe !important;
  color: #0369a1 !important;
}

/* Botón Hamburguesa en Móvil */
button.navbar-toggler {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: var(--af-radius-sm) !important;
  padding: 0.4rem 0.65rem !important;
  margin: 0.5rem 0;
}

/* 6. CONTROL DE ANUNCIOS DE GOOGLE ADSENSE (Evitar desbordes y solapamientos) */
.google-auto-placed, ins.adsbygoogle {
  max-width: 100% !important;
  overflow: hidden !important;
  margin: 1.25rem auto !important;
  display: block !important;
  border-radius: var(--af-radius-sm);
}

header .google-auto-placed, header ins.adsbygoogle {
  max-height: 90px !important;
  margin: 0.5rem auto !important;
}

/* 7. TARJETAS DE ARTÍCULOS EN PORTADA (Diseño Revista) */
.blog-item, article.item, .com-content-category-blog__item {
  background: var(--af-card-bg) !important;
  border: 1px solid var(--af-border) !important;
  border-radius: var(--af-radius) !important;
  padding: 1.75rem !important;
  margin-bottom: 2rem !important;
  box-shadow: var(--af-shadow-sm) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-item:hover, article.item:hover {
  transform: translateY(-2px);
  box-shadow: var(--af-shadow-hover) !important;
}

/* Títulos de Artículos */
.page-header h2, article h2, .item-title {
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  margin-bottom: 0.75rem !important;
}

.page-header h2 a, article h2 a {
  color: #0a2240 !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.page-header h2 a:hover, article h2 a:hover {
  color: #0284c7 !important;
}

/* Bloque de Información del Artículo (Fecha, autor, visitas) */
.article-info, dl.article-info {
  background: #f8fafc !important;
  border: 1px solid #edf2f7;
  border-radius: var(--af-radius-sm);
  padding: 0.5rem 0.85rem !important;
  font-size: 0.82rem !important;
  color: #64748b !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 1.25rem !important;
}

.article-info dd {
  margin: 0 !important;
}

/* Botón "Leer más" Moderno */
.readmore, .btn-readmore {
  margin-top: 1.25rem;
}

.readmore a, .btn-readmore, a.btn[href*="article"] {
  background: #0284c7 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  padding: 0.5rem 1.15rem !important;
  border-radius: var(--af-radius-sm) !important;
  border: none !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.readmore a:hover, .btn-readmore:hover {
  background: #0369a1 !important;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
  transform: translateY(-1px);
}

/* Etiquetas (Tags) en Píldoras Limpias */
.tags, ul.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none !important;
  padding: 0 !important;
  margin: 1rem 0 !important;
}

.tags li a, a.badge {
  background-color: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 0.76rem !important;
  font-weight: 500 !important;
  padding: 0.25rem 0.65rem !important;
  border-radius: 9999px !important;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

.tags li a:hover, a.badge:hover {
  background-color: #0284c7 !important;
  color: #ffffff !important;
  border-color: #0284c7 !important;
}

/* 8. TABLAS RESPONSIVAS */
.item-page table, article table {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--af-border);
  border-radius: var(--af-radius-sm);
  margin: 1.5rem 0;
}

/* 9. BARRA LATERAL (Módulos de la derecha) */
.container-sidebar-right .card {
  border-radius: var(--af-radius) !important;
  border: 1px solid var(--af-border) !important;
  box-shadow: var(--af-shadow-sm) !important;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.container-sidebar-right .card-title,
.container-sidebar-right h3.mod-title {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  color: #0a2240 !important;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e0f2fe;
}

/* 10. PIE DE PÁGINA (Footer) */
footer.container-footer, .site-footer, footer {
  background: #091a2f !important;
  color: #94a3b8 !important;
  padding: 2.5rem 1rem 1.5rem !important;
  border-top: 4px solid #0284c7;
  margin-top: 3rem;
}

footer a {
  color: #38bdf8 !important;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* 11. AJUSTES PARA PANTALLAS MÓVILES */
@media (max-width: 768px) {
  .blog-item, article.item {
    padding: 1.25rem !important;
  }
  .page-header h2, article h2 {
    font-size: 1.15rem !important;
  }
}