/* ==========================================================================
   GUIAJOVEN.COM - ESTILOS EDITORIALES, MODO OSCURO & DECORACIÓN VISUAL
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --accent: #d97706;
  --text-dark: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --border-color: #e2e8f0;
  --card-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Merriweather', Georgia, serif;
  --disclaimer-bg: #fffbeb;
  --disclaimer-border: #fcd34d;
  --disclaimer-text: #92400e;
}

[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #1e293b;
  --accent: #fbbf24;
  --text-dark: #f8fafc;
  --text-body: #cbd5e1;
  --text-muted: #94a3b8;
  --bg-page: #0b0f19;
  --bg-card: #151d2f;
  --bg-header: #101726;
  --border-color: #222f47;
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --disclaimer-bg: #1e1b13;
  --disclaimer-border: #78350f;
  --disclaimer-text: #fde68a;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-body);
  background-color: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* AVISO OBLIGATORIO DE WEB NO OFICIAL */
.non-official-disclaimer {
  background: var(--disclaimer-bg);
  border-bottom: 1px solid var(--disclaimer-border);
  color: var(--disclaimer-text);
  font-size: 0.8rem;
  padding: 9px 16px;
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
}

.non-official-disclaimer strong {
  font-weight: 700;
}

/* Header */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
}

.logo-name strong {
  color: var(--primary);
}

.header-search {
  position: relative;
  flex: 1;
  max-width: 400px;
  display: none;
}

@media (min-width: 768px) {
  .header-search {
    display: block;
  }
}

.header-search input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  background: var(--bg-page);
  color: var(--text-dark);
  outline: none;
  transition: all 0.2s ease;
}

.header-search input:focus {
  background: var(--bg-card);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.5;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.main-nav {
  display: flex;
  gap: 14px;
}

.nav-link {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
}

/* Botón Modo Oscuro */
.theme-toggle-btn {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

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

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding-top: 28px;
  padding-bottom: 60px;
}

@media (min-width: 992px) {
  .main-layout {
    grid-template-columns: 2.3fr 1fr;
  }
}

/* Hero Banner con Decoración Visual */
.hero-portal-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--card-shadow);
  margin-bottom: 36px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-portal-card {
    grid-template-columns: 1.6fr 0.9fr;
  }
}

.hero-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  color: #fef08a;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 12px;
  letter-spacing: 0.04em;
}

.hero-portal-title {
  font-size: 1.95rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.hero-portal-desc {
  font-size: 1rem;
  color: #e0e7ff;
  line-height: 1.6;
}

.hero-graphic {
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-svg-badge {
  width: 140px;
  height: 140px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

/* Categorías y Filtros */
.categories-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.category-tab-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-tab-btn:hover,
.category-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Grid de Artículos */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.post-card:hover {
  border-color: var(--primary);
  box-shadow: var(--card-shadow);
  transform: translateY(-3px);
}

.post-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.post-thumb-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.post-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
}

.post-badge.identidad { background: #dbeafe; color: #1e40af; }
.post-badge.empleo { background: #dcfce7; color: #166534; }
.post-badge.ayudas { background: #fef3c7; color: #92400e; }
.post-badge.citas { background: #f3e8ff; color: #6b21a8; }

.post-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
}

.post-card h3 a {
  color: var(--text-dark);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--primary);
}

.post-card p {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 16px;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.text-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* Sidebar */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 14px;
  border-bottom: 2px solid var(--bg-page);
  padding-bottom: 8px;
}

.sidebar-widget p {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 12px;
}

.popular-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.popular-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
}

.rank-num {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.95rem;
  line-height: 1.2;
}

.popular-list a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  line-height: 1.4;
}

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

.btn-sub {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-sub:hover {
  background: var(--primary-hover);
}

/* ==========================================================================
   ESTILOS DE ARTÍCULO INDIVIDUAL
   ========================================================================== */
.single-article {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .single-article {
    padding: 44px 40px;
  }
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: var(--primary);
  width: 0%;
  z-index: 1000;
  transition: width 0.1s ease;
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.breadcrumbs span {
  margin: 0 4px;
}

.breadcrumbs .current {
  color: var(--text-dark);
  font-weight: 600;
}

.article-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.25;
  margin: 14px 0 20px 0;
  letter-spacing: -0.02em;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
  gap: 16px;
}

.author-snippet {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  font-size: 1.8rem;
}

.author-snippet strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.author-snippet span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.meta-stats {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

/* Aviso de cabecera de artículo */
.article-disclaimer-banner {
  background: var(--disclaimer-bg);
  border: 1px solid var(--disclaimer-border);
  color: var(--disclaimer-text);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.85rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.lead-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 18px 22px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-dark);
  margin-bottom: 32px;
}

/* Table of Contents */
.toc-card {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 36px;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.toc-toggle {
  font-size: 0.8rem;
  color: var(--primary);
  cursor: pointer;
}

.toc-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}

.toc-list a {
  color: var(--text-body);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Article Body Typography */
.article-body {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-body);
}

.article-body h2 {
  font-family: var(--font-sans);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-top: 40px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 24px;
  margin-bottom: 12px;
}

.article-body p {
  margin-bottom: 22px;
}

.article-body ul, .article-body ol {
  margin-bottom: 22px;
  padding-left: 24px;
}

.article-body li {
  margin-bottom: 8px;
}

.info-callout {
  font-family: var(--font-sans);
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 28px 0;
  font-size: 0.95rem;
  color: #166534;
}

[data-theme="dark"] .info-callout {
  background: #064e3b;
  color: #a7f3d0;
}

.warning-callout {
  font-family: var(--font-sans);
  background: var(--disclaimer-bg);
  border-left: 4px solid #d97706;
  padding: 18px 22px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 28px 0;
  font-size: 0.95rem;
  color: var(--disclaimer-text);
}

code {
  font-family: monospace;
  background: var(--bg-page);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--text-dark);
}

/* Social Sharing */
.article-footer-box {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  margin-top: 36px;
}

.share-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.share-buttons {
  display: flex;
  gap: 10px;
}

.share-btn {
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.share-btn:hover {
  opacity: 0.9;
}

.share-btn.whatsapp {
  background: #25d366;
  color: #ffffff;
}

.share-btn.copy {
  background: var(--bg-page);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

/* Related Posts */
.related-posts {
  margin-top: 40px;
}

.related-posts h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-card {
  background: var(--bg-page);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-card:hover {
  background: var(--bg-card);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.related-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
}

.related-card h4 {
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-top: 6px;
  line-height: 1.4;
}

/* Footer */
.site-footer {
  background: #0b0f19;
  color: #94a3b8;
  padding: 56px 0 32px 0;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1.2fr;
  }
}

.footer-logo {
  color: #ffffff;
  margin-bottom: 12px;
}

.footer-desc {
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 360px;
}

.footer-col h4 {
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-disclaimer-box {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 24px;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding-top: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: #64748b;
}

.footer-bottom a {
  color: #94a3b8;
}

/* Cookie Consent Banner */
.cookie-consent-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #0f172a;
  color: #f8fafc;
  padding: 16px 20px;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  border-top: 1px solid #334155;
}

.cookie-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .cookie-banner-content {
    flex-direction: row;
    gap: 24px;
  }
}

.cookie-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.cookie-text a {
  color: #60a5fa;
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s ease;
}

.cookie-btn.accept {
  background: var(--primary);
  color: #ffffff;
}

.cookie-btn.reject {
  background: #334155;
  color: #ffffff;
}

.cookie-btn:hover {
  opacity: 0.9;
}
