/* ============================================================
   style.css — Blog CheckMyIP (Versión Clean White & Violet)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  /* Fondo: Blanco puro para máxima limpieza */
  --bg-primary:       #ffffff; 
  --bg-secondary:     #f8f9ff; /* Un lila/azul muy tenue para fondos secundarios */
  --bg-card:          #ffffff;
  
  /* Acentos: Violeta Profundo y Vibrante para contrastar sobre blanco */
  --accent:           #6200ee; 
  --accent-light:     #bb86fc;
  --accent-dim:       rgba(98, 0, 238, 0.05);
  --accent-gradient:  linear-gradient(135deg, #6200ee, #7c4dff);
  
  /* Textos: Negro suave para evitar fatiga (no negro puro) */
  --text-primary:     #1a1a1b; 
  --text-secondary:   #4a4a4e;
  --text-muted:       #75757a;
  --text-heading:     #000000;

  /* Bordes y Sombras: El secreto del diseño "limpio" */
  --border:           #e1e4f3;
  --shadow-soft:      0 10px 30px rgba(98, 0, 238, 0.06);
  --shadow-hover:     0 15px 45px rgba(98, 0, 238, 0.12);
  
  --radius:           16px;
  --font-body:        'Inter', sans-serif; /* Cambiada a Inter para máxima legibilidad en claro */
  --font-heading:     'Space Grotesk', sans-serif;
  --reading-max:      72ch;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-heading);
  text-decoration: none;
}

.header-logo span { color: var(--accent); }

/* Language Select - Adaptado al blanco */
#lang-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  background: white;
  color: var(--text-primary);
  font-size: 0.9rem;
}

/* Layout */
.page-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 50px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

@media (min-width: 950px) {
  .page-wrapper { grid-template-columns: 1fr 320px; gap: 60px; }
}

/* Article Cards - Ahora son blancas con sombra suave */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 35px;
  margin-bottom: 25px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-light);
}

.article-card-title {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  color: var(--text-heading);
  margin-bottom: 12px;
  line-height: 1.2;
}

.article-card-summary {
  color: var(--text-secondary);
}

/* Article Detail */
.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--accent);
  margin: 50px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-dim);
}

.article-body p { margin-bottom: 25px; color: var(--text-secondary); }

.article-body a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-dim);
}

.article-body a:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Sidebar */
.sidebar-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.recent-list a {
  font-size: 0.95rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 12px 0;
  display: block;
  border-bottom: 1px solid var(--border);
}

.recent-list a:hover {
  color: var(--accent);
  padding-left: 5px;
}

/* El botón con degradado potente que querías */
.back-to-tool {
  display: block;
  background: var(--accent-gradient);
  color: #ffffff;
  text-align: center;
  padding: 16px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(98, 0, 238, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

/* --- Estilos para el Botón CTA del Artículo --- */
.article-cta-container {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.back-to-tool-cta {
    display: inline-block;
    background: var(--accent-gradient); /* Usa tu degradado violeta */
    color: #ffffff !important;         /* Texto siempre blanco */
    padding: 18px 36px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(98, 0, 238, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
}

.back-to-tool-cta:hover {
    transform: translateY(-2px); /* Un movimiento más sutil es más elegante */
    
    /* Eliminamos el degradado y ponemos el azul oscuro uniforme */
    background: #2563eb !important; 
    
    /* Forzamos el blanco puro para el texto */
    color: #ffffff !important; 
    
    /* Sombra azulada más suave para que no parezca sucio */
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
    
    filter: none; /* Quitamos el brightness para que el color sea sólido y puro */
    transition: all 0.2s ease-in-out;

}

/* Estilo para la frase de interlinking que pondremos en el JSON */
.interlinking {
    display: block;
    margin: 40px 0 20px;
    padding: 15px;
    background: var(--accent-dim); /* Fondo lila muy tenue */
    border-left: 4px solid var(--accent);
    color: var(--text-secondary);
    font-style: italic;
    font-size: 0.95rem;
}

.interlinking a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.interlinking a:hover {
    text-decoration: underline;
}

.back-to-tool:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(98, 0, 238, 0.4);
}

/* Footer */
footer {
  margin-top: 100px;
  padding: 60px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
}

.footer-links a { color: var(--accent); text-decoration: none; margin: 0 15px; font-weight: 500; }

/* --- Mejoras del Footer --- */
.main-footer {
    background: var(--bg-secondary);
    padding: 60px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.social-links {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.4rem;
    transition: color 0.3s ease, transform 0.2s;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.x-icon {
    font-family: Arial, sans-serif;
    font-weight: 800;
    font-size: 1.2rem;
}

.agency-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

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

.separator {
    color: var(--border);
    margin: 0 5px;
}

/* --- Tablas en artículos --- */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.article-table thead tr {
    background: var(--accent-gradient);
    color: #ffffff;
    text-align: left;
}

.article-table th {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.article-table td {
    padding: 12px 18px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.article-table tbody tr:last-child td {
    border-bottom: none;
}

.article-table tbody tr:nth-child(even) {
    background: var(--accent-dim);
}

.article-table td a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}

.article-table td a:hover {
    text-decoration: underline;
}

/* --- CTA en artículos --- */
.cta-container {
    margin-top: 40px;
    padding: 30px;
    background: var(--accent-dim);
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--border);
}

.cta-container p {
    margin-bottom: 18px;
    font-weight: 500;
    color: var(--text-primary) !important;
}

.cta-button {
    display: inline-block;
    background: var(--accent-gradient);
    color: #ffffff !important;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none !important;
    border-bottom: none !important;
    box-shadow: 0 4px 15px rgba(98, 0, 238, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(98, 0, 238, 0.4);
    background: var(--accent-gradient) !important;
    color: #ffffff !important;
    border-bottom: none !important;
}

/* Helpers */
.article-detail { display: none; }
.article-detail.active { display: block; }
.article-list-view.hidden { display: none; }