/* general.css */

/* --- Variables CSS (Personalización Fácil) --- */
:root {
    --primary-color: #8A2BE2; /* Morado Vibrante */
    --primary-dark: #6A1AAB;  /* Morado más oscuro para hover/active */
    --secondary-color: #00BFFF; /* Azul Cielo para acentos */
    --text-color: #333;       /* Gris oscuro para el texto principal */
    --text-light: #555;       /* Gris más claro para texto secundario */
    --bg-color: #F8F8F8;      /* Fondo claro casi blanco */
    --bg-dark: #E0E0E0;       /* Fondo oscuro para secciones sutiles */
    --border-color: #DDD;     /* Color de borde ligero */
    --font-family-body: 'Roboto', sans-serif;
    --font-family-heading: 'Montserrat', sans-serif;
    --max-width: 1200px;      /* Ancho máximo del contenido */
    --spacing-unit: 1rem;     /* Unidad base para espaciados */
}

/* --- Resets y Estilos Globales --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-body);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 0;
    margin: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2); /* Padding lateral */
}

/* --- Tipografía General --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    color: var(--primary-dark);
    line-height: 1.2;
    margin-bottom: var(--spacing-unit);
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--spacing-unit);
}

/* --- Enlaces --- */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* --- Listas --- */
ul, ol {
    margin-left: 1.5rem;
    margin-bottom: var(--spacing-unit);
}

ul li, ol li {
    margin-bottom: 0.5rem;
}

/* --- Imágenes --- */
img {
    max-width: 100%;
    height: auto;
    display: block; /* Elimina espacio extra debajo de las imágenes */
}

/* --- Separadores --- */
hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: calc(var(--spacing-unit) * 2) 0;
}

/* --- Citas (Blockquotes) --- */
blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: var(--spacing-unit);
    margin: calc(var(--spacing-unit) * 1.5) 0;
    color: var(--text-light);
    font-style: italic;
}

/* --- Código Inline y Bloques de Código --- */
code {
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    background-color: var(--bg-dark);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: #2D2D2D; /* Fondo oscuro para bloques de código */
    color: #F8F8F8;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 1.5);
    border-radius: 5px;
    overflow-x: auto; /* Para código que exceda el ancho */
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 1em; /* Restaurar tamaño para pre */
}

/* --- Tablas --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-unit) * 2;
}

th, td {
    border: 1px solid var(--border-color);
    padding: var(--spacing-unit);
    text-align: left;
}

th {
    background-color: var(--bg-dark);
    font-weight: bold;
    color: var(--text-color);
}

/* --- Inputs y Botones (Estilo base) --- */
button, input[type="submit"], input[type="button"] {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover, input[type="submit"]:hover, input[type="button"]:hover {
    background-color: var(--primary-dark);
}

/* --- Enlaces de ancla en títulos (para HeadingPermalinkExtension) --- */
.heading-permalink {
    opacity: 0; /* Oculto por defecto */
    margin-left: 0.5em;
    color: var(--secondary-color);
    text-decoration: none;
    transition: opacity 0.2s ease, color 0.2s ease;
}

h1:hover .heading-permalink,
h2:hover .heading-permalink,
h3:hover .heading-permalink,
h4:hover .heading-permalink,
h5:hover .heading-permalink,
h6:hover .heading-permalink {
    opacity: 1; /* Mostrar al pasar el ratón por el título */
}

.heading-permalink:hover {
    color: var(--primary-color); /* Cambiar color al pasar por el enlace */
}

/* Google Fonts - Importa estas fuentes en tu HTML o en este CSS si no las tienes */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Roboto:wght@400;700&display=swap');