/* ==========================================================================
   ESTILOS PERSONALIZADOS - RSE ARGENTINA
   Color Principal: #702552 (Rosa RSE)
   ========================================================================== */

/* 1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
  --rse-primary: #702552;       /* Color Principal / Fuerza */
  --rse-secondary: #2c3e50;     /* Azul oscuro para contraste */
  --rse-accent: #e74c3c;
  --rse-success: #27ae60;
  --rse-warning: #f39c12;
  --rse-light: #ecf0f1;
  --rse-dark: #34495e;
  --rse-white: #ffffff;
  
  /* Sobrescribir variables de Bootstrap para Quarto */
  --bs-primary: var(--rse-primary) !important;
  --bs-link-color: var(--rse-primary) !important;
  --bs-link-hover-color: var(--rse-secondary) !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  line-height: 1.6;
  transition: background-color 0.3s ease;
}

/* 2. TIPOGRAFÍA Y ENLACES
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600 !important;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h1, .quarto-html h1 {
  color: var(--rse-secondary) !important;
  border-bottom: 3px solid var(--rse-primary) !important;
  padding-bottom: 0.5rem;
}

h2 { color: var(--rse-dark) !important; margin-top: 2.5rem; }

a, .quarto-html a:not(.nav-link) {
  color: var(--rse-primary) !important;
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--rse-secondary) !important;
  text-decoration: underline;
}

/* 3. NAVEGACIÓN (NAVBAR)
   ========================================================================== */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  padding: 1rem 0;
  background-color: var(--rse-white) !important;
}

.navbar-brand, .navbar-title {
  font-weight: 700 !important;
  font-size: 1.5rem !important;
  color: var(--rse-primary) !important;
}

.navbar-nav .nav-link {
  color: var(--rse-dark) !important;
}

.navbar-nav .nav-link:hover {
  color: var(--rse-primary) !important;
}

/* 4. COMPONENTES (BOTONES, CARDS, CALLOUTS)
   ========================================================================== */

/* Botones */
.btn-primary, .quarto-html .btn-primary {
  background-color: var(--rse-primary) !important;
  border-color: var(--rse-primary) !important;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--rse-secondary) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,.2);
}

/* Hex Card Personalizada */
.hex-card {
  background: linear-gradient(135deg, #ffffff, #fdf1f4);
  border-radius: 20px;
  padding: 25px;
  margin: 30px 0;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--rse-primary);
}

/* Variante horizontal amplia de la hex-card */
.hex-card-wide {
  background: linear-gradient(135deg, #ffffff, #fdf1f4);
  border-radius: 20px;
  padding: 30px;
  margin: 20px 0;
  width: 100%;           /* Ocupa todo el ancho del contenedor */
  display: flex;         /* Permite alinear contenido horizontalmente si quieres */
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--rse-primary);
}

/* Callouts (Avisos) */
.callout {
  margin: 2rem 0;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid !important;
}

.callout-note { background-color: #f3e5ef !important; border-left-color: var(--rse-primary) !important; }
.callout-tip { background-color: #e8f5e9 !important; border-left-color: var(--rse-success) !important; }
.callout-warning { background-color: #fff3cd !important; border-left-color: var(--rse-warning) !important; }

/* 5. SECCIÓN HERO (HOMEPAGE)
   ========================================================================== */
.hero {
  background: linear-gradient(135deg, var(--rse-secondary) 0%, var(--rse-primary) 100%);
  color: white;
  padding: 4rem 0;
  margin: -2rem -2rem 2rem -2rem;
  text-align: center;
}

.hero h1 {
  color: white !important;
  border: none !important;
  font-size: 2.5rem;
}

/* Color principal para las negritas */
strong, b {
  color: var(--rse-primary) !important;
  font-weight: 700; /* Asegura que se vea bien robusto */
} 

/* 6. ELEMENTOS DE CONTENIDO (TABLAS, CÓDIGO)
   ========================================================================== */
code:not(pre > code) {
  background-color: #f8f9fa;
  color: var(--rse-primary) !important;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}

table th {
  background-color: var(--rse-light);
  border-bottom: 2px solid var(--rse-primary) !important;
}

/* TOC (Tabla de contenidos Quarto) */
.sidebar nav[role="doc-toc"] ul > li > a.active {
  border-left-color: var(--rse-primary) !important;
  color: var(--rse-primary) !important;
}

/* 7. RESPONSIVIDAD Y MODO OSCURO
   ========================================================================== */

/* Grid Adaptable */
.grid {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
}

/* Ajustes Móvil */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2rem; }
}

/* Modo Oscuro (Preferencia de Sistema) */
@media (prefers-color-scheme: dark) {
  body { background-color: #1a1a1a; color: #e0e0e0; }
  
  :root {
    --rse-primary: #a87391;
    --rse-light: #2c3e50;
    --rse-dark: #ecf0f1;
    --rse-white: #1a1a1a;
  }

  .navbar { background-color: #222 !important; }
  .hex-card { background: #2d2d2d; color: white; }
  code:not(pre > code) { background-color: #2d2d2d; }
}