/*
Theme Name: FinanzasPro
Theme URI: https://tudominio.com
Author: Tu Nombre
Author URI: https://tudominio.com
Description: Tema ultra-optimizado para blogs de finanzas personales. Enfocado en SEO técnico, Core Web Vitals, y monetización con Google AdSense. Diseño minimalista y profesional.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: finanzaspro
Tags: blog, one-column, two-columns, right-sidebar, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, rtl-language-support, sticky-post, threaded-comments, translation-ready, block-styles, wide-blocks
*/

/* ============================================================
   VARIABLES CSS - SISTEMA DE DISEÑO
   ============================================================ */
:root {
  /* Colores principales */
  --color-primary:        #1a56db;
  --color-primary-dark:   #1341a8;
  --color-primary-light:  #e8f0fe;
  --color-accent:         #059669;
  --color-accent-dark:    #047857;

  /* Texto */
  --color-text:           #111827;
  --color-text-secondary: #374151;
  --color-text-muted:     #6b7280;
  --color-text-inverse:   #ffffff;

  /* Fondos */
  --color-bg:             #ffffff;
  --color-bg-secondary:   #f9fafb;
  --color-bg-tertiary:    #f3f4f6;
  --color-border:         #e5e7eb;
  --color-border-dark:    #d1d5db;

  /* Tipografía */
  --font-body:    'Georgia', 'Times New Roman', Times, serif;
  --font-heading: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'Courier New', Courier, monospace;

  /* Tamaños de fuente (escala modular 1.25) */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1.0625rem;   /* 17px - óptimo para lectura larga */
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;

  /* Espaciado */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout */
  --container-max:    1200px;
  --content-max:      760px;
  --sidebar-width:    300px;
  --header-height:    64px;

  /* Bordes */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg:  0 10px 15px rgba(0,0,0,0.1);

  /* Transiciones */
  --transition: 0.2s ease;

  /* Line height óptimo para lectura */
  --line-height-body:    1.75;
  --line-height-heading: 1.3;
}

/* ============================================================
   RESET Y BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Skip link para accesibilidad */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
  transition: top var(--transition);
}
.skip-link:focus { top: var(--space-4); }

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
a:hover { color: var(--color-primary-dark); }
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.site-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.site-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding: var(--space-8) 0 var(--space-16);
}

/* Con sidebar */
.has-sidebar .site-main {
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  align-items: start;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  z-index: 100;
}

.site-header.is-sticky {
  position: sticky;
  top: 0;
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: var(--space-6);
}

/* Logo */
.site-branding {
  flex-shrink: 0;
}

.site-branding a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.custom-logo {
  height: 40px;
  width: auto;
  max-width: 180px;
}

.site-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.site-description {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  display: none;
}

/* Navegación principal */
.main-navigation {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: var(--space-1);
  align-items: center;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  display: block;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current-menu-ancestor > a {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* Dropdown */
.nav-menu .sub-menu {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-2));
  left: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  padding: var(--space-2);
  z-index: 200;
  list-style: none;
}

.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
  display: block;
}

.nav-menu .sub-menu a {
  border-radius: var(--radius-sm);
  white-space: normal;
}

/* Botón menú móvil */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  align-items: center;
  gap: var(--space-2);
  transition: background var(--transition);
}

.menu-toggle:hover { background: var(--color-bg-secondary); }

.menu-toggle-icon {
  width: 18px;
  height: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.menu-toggle-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:first-child {
  transform: translateY(5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:last-child {
  transform: translateY(-5px) rotate(-45deg);
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs-wrap {
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-3) 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.breadcrumb li::after {
  content: '/';
  color: var(--color-border-dark);
  font-size: var(--text-xs);
}

.breadcrumb li:last-child::after { display: none; }

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb .current { color: var(--color-text-secondary); font-weight: 500; }

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.content-area {
  min-width: 0; /* Previene desbordamiento en grid */
}

/* ============================================================
   TIPOGRAFÍA DE ARTÍCULOS - OPTIMIZADA PARA LECTURA
   ============================================================ */
.entry-content {
  max-width: var(--content-max);
}

.entry-content > * + * {
  margin-top: var(--space-6);
}

.entry-content h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: var(--line-height-heading);
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-top: var(--space-12);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border);
}

.entry-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: var(--line-height-heading);
  color: var(--color-text);
  margin-top: var(--space-10);
}

.entry-content h4 {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-top: var(--space-8);
}

.entry-content p {
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: var(--line-height-body);
}

.entry-content ul,
.entry-content ol {
  padding-left: var(--space-6);
  color: var(--color-text-secondary);
}

.entry-content li + li { margin-top: var(--space-2); }

.entry-content strong { color: var(--color-text); }

.entry-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--space-4) var(--space-6);
  background: var(--color-primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text-secondary);
}

.entry-content blockquote p { margin: 0; }

.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-tertiary);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.entry-content pre {
  background: var(--color-text);
  color: #f1f5f9;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.7;
}

.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
}

.entry-content th {
  background: var(--color-bg-secondary);
  font-weight: 600;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
}

.entry-content td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.entry-content tr:nth-child(even) td {
  background: var(--color-bg-secondary);
}

.entry-content a {
  font-weight: 500;
}

/* Imagen destacada */
.post-thumbnail {
  margin-bottom: var(--space-8);
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 16/9;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   ENCABEZADO DEL POST (ENTRY HEADER)
   ============================================================ */
.entry-header {
  margin-bottom: var(--space-8);
}

.entry-category-badge {
  display: inline-flex;
  align-items: center;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}
.entry-category-badge:hover { background: var(--color-primary); color: white; }

.entry-title {
  font-family: var(--font-heading);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl));
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-5);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.entry-meta a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 500;
}
.entry-meta a:hover { color: var(--color-primary); }

.entry-meta-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.reading-time-badge {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.reading-time-badge::before {
  content: '⏱';
  font-size: var(--text-sm);
}

.meta-separator {
  color: var(--color-border-dark);
}

/* ============================================================
   TABLA DE CONTENIDOS (TOC)
   ============================================================ */
.toc-wrapper {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--space-5) var(--space-6);
  margin: var(--space-8) 0;
}

.toc-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.toc-title::before { content: '📋'; }

.toc-list {
  list-style: none;
  counter-reset: toc-counter;
}

.toc-list li {
  counter-increment: toc-counter;
  margin-bottom: var(--space-2);
}

.toc-list a {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  transition: color var(--transition);
}

.toc-list a::before {
  content: counter(toc-counter) '.';
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
  min-width: 1.5em;
}

.toc-list a:hover { color: var(--color-primary); }

.toc-list .toc-subitem {
  padding-left: var(--space-5);
  margin-top: var(--space-1);
}

/* ============================================================
   ZONAS DE ANUNCIOS (ADSENSE) - NO NEGOCIABLES
   ============================================================ */

/* Zona: Después del título (before content) */
.ad-zone {
  margin: var(--space-8) 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px; /* Reserva espacio para CLS=0 */
}

/* Tamaños específicos por posición */
.ad-zone-header {
  min-height: 90px; /* Leaderboard 728×90 */
  background: var(--color-bg-secondary); /* Placeholder visual */
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-md);
}

.ad-zone-inline {
  min-height: 250px; /* Rectangle 300×250 */
}

.ad-zone-sidebar {
  min-height: 250px;
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
}

.ad-zone-footer {
  min-height: 90px;
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-8);
  margin-top: var(--space-8);
}

/* Label discreta para anuncios (requerido por AdSense) */
.ad-label {
  font-family: var(--font-heading);
  font-size: 10px;
  color: var(--color-text-muted);
  text-align: center;
  display: block;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Separador visual entre contenido y anuncio */
.ad-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-6) 0;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  min-width: 0;
}

.sidebar .widget {
  margin-bottom: var(--space-8);
}

.widget-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
  border-bottom: 2px solid var(--color-primary);
}

/* Widget: Posts recientes */
.widget_recent_entries ul {
  list-style: none;
}

.widget_recent_entries li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.widget_recent_entries li:last-child { border-bottom: none; }

.widget_recent_entries a {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  line-height: 1.4;
  display: block;
}
.widget_recent_entries a:hover { color: var(--color-primary); }

/* Widget: Categorías */
.widget_categories ul,
.widget_archive ul {
  list-style: none;
}

.widget_categories li,
.widget_archive li {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.widget_categories a,
.widget_archive a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.widget_categories a:hover,
.widget_archive a:hover { color: var(--color-primary); }

.widget_categories .post-count {
  background: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
}

/* ============================================================
   CARDS DE POSTS (ARCHIVE / HOME)
   ============================================================ */
.posts-grid {
  display: grid;
  gap: var(--space-8);
}

.has-sidebar .posts-grid {
  grid-template-columns: 1fr;
}

.post-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-5);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--color-border);
}

.post-card:last-child { border-bottom: none; }

.post-card-thumbnail {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/3;
  flex-shrink: 0;
}

.post-card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.post-card:hover .post-card-thumbnail img { transform: scale(1.03); }

.post-card-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.post-card-category {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
  text-decoration: none;
  display: block;
}
.post-card-title:hover { color: var(--color-primary); }

.post-card-excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: auto;
}

/* ============================================================
   PAGINACIÓN
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
  font-family: var(--font-heading);
}

.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  border: 1px solid var(--color-border);
  transition: all var(--transition);
}
.page-numbers:hover,
.page-numbers.current {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ============================================================
   POST FOOTER (TAGS, SHARE, AUTHOR BIO)
   ============================================================ */
.entry-footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-8);
  margin-top: var(--space-12);
}

/* Tags */
.entry-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.tag-badge {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition);
}
.tag-badge:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Bio del autor */
.author-bio-box {
  display: flex;
  gap: var(--space-5);
  padding: var(--space-6);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-xl);
  margin-top: var(--space-8);
}

.author-bio-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
}

.author-bio-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.author-bio-content p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* Posts relacionados */
.related-posts {
  margin-top: var(--space-12);
}

.related-posts-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

.related-post-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), transform var(--transition);
  display: block;
}
.related-post-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.related-post-card img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
}

.related-post-card-body {
  padding: var(--space-4);
}

.related-post-card-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

/* ============================================================
   COMENTARIOS
   ============================================================ */
.comments-area {
  margin-top: var(--space-12);
  border-top: 2px solid var(--color-border);
  padding-top: var(--space-8);
}

.comments-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
}

.comment-list {
  list-style: none;
  margin-bottom: var(--space-8);
}

.comment {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
}

.comment-author {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
}

.comment-meta {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.comment-content { font-size: var(--text-sm); }

/* Formulario de comentarios */
.comment-form-wrapper {
  background: var(--color-bg-secondary);
  padding: var(--space-8);
  border-radius: var(--radius-xl);
}

.comment-reply-title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-6);
}

.comment-form .form-group {
  margin-bottom: var(--space-5);
}

.comment-form label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--color-text-secondary);
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color var(--transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

.comment-form textarea { min-height: 120px; resize: vertical; }

.submit-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.submit-btn:hover { background: var(--color-primary-dark); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.7);
  padding: var(--space-12) 0 var(--space-6);
}

.footer-widgets {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-10);
  padding-bottom: var(--space-10);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-8);
}

.footer-widget-title {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}

.footer-widget-about .site-title {
  color: white;
  font-size: var(--text-xl);
  display: block;
  margin-bottom: var(--space-3);
}

.footer-widget p {
  font-size: var(--text-sm);
  line-height: 1.7;
}

.footer-nav {
  list-style: none;
}

.footer-nav li { margin-bottom: var(--space-2); }

.footer-nav a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  transition: color var(--transition);
}
.footer-nav a:hover { color: white; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xs);
}

.footer-legal-nav {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.footer-legal-nav a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-legal-nav a:hover { color: white; }

/* ============================================================
   PÁGINAS ESPECIALES
   ============================================================ */

/* Página 404 */
.error-404 {
  text-align: center;
  padding: var(--space-20) 0;
}

.error-404 .error-code {
  font-family: var(--font-heading);
  font-size: 8rem;
  font-weight: 900;
  color: var(--color-border);
  line-height: 1;
  display: block;
}

.error-404 h1 {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.error-404 p { color: var(--color-text-muted); margin-bottom: var(--space-8); }

.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  padding: var(--space-3) var(--space-8);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}
.btn-primary:hover { background: var(--color-primary-dark); color: white; }

/* Search results */
.search-header {
  padding: var(--space-8) 0;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}

.search-header h1 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
}

.search-header span {
  color: var(--color-primary);
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.text-center { text-align: center; }

.wp-block-image figcaption {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-2) 0;
}

/* Bloques Gutenberg */
.wp-block-separator {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ============================================================
   BARRA DE PROGRESO DE LECTURA
   ============================================================ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ============================================================
   RESPONSIVE - MOBILE FIRST
   ============================================================ */

/* Tablet: 768px */
@media (max-width: 1024px) {
  .has-sidebar .site-main {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-8);
  }

  .ad-zone-sidebar {
    position: static;
  }

  .footer-widgets {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --text-base: 1rem;
    --header-height: 56px;
  }

  .menu-toggle {
    display: flex;
  }

  .main-navigation .nav-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-bg);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-4);
    overflow-y: auto;
    border-top: 1px solid var(--color-border);
    gap: var(--space-1);
  }

  .main-navigation .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    font-size: var(--text-base);
    padding: var(--space-3) var(--space-4);
  }

  .nav-menu .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--color-border);
    border-radius: 0;
    padding-left: var(--space-4);
    display: block;
    margin-top: var(--space-1);
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .post-card-thumbnail {
    aspect-ratio: 16/9;
  }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  .footer-widgets {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .author-bio-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .entry-title {
    font-size: var(--text-2xl);
  }
}

@media (max-width: 480px) {
  .site-container { padding: 0 var(--space-3); }

  .related-posts-grid {
    grid-template-columns: 1fr;
  }

  .ad-zone {
    margin: var(--space-6) 0;
  }
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  .site-header,
  .sidebar,
  .site-footer,
  .ad-zone,
  .comments-area,
  .related-posts,
  .reading-progress {
    display: none !important;
  }

  .has-sidebar .site-main {
    grid-template-columns: 1fr;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  .entry-content a {
    text-decoration: underline;
  }

  .entry-content a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 10pt;
    color: #666;
  }
}
