/**
 * base.css - Reset CSS y estilos base de Arrayanmed
 * Este archivo establece los estilos fundamentales y realiza un reset
 * para asegurar consistencia entre navegadores. Define los estilos base
 * para elementos HTML comunes sin clases específicas.
 */

/* ========== RESET ELEGANTE ========== */
/* Reset moderno que mantiene algunos defaults útiles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========== ELEMENTOS BASE ========== */
html {
    /* Scroll suave para toda la página */
    scroll-behavior: smooth;
    /* Mejora la renderización de texto */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
    /* Mejora la renderización de fuentes */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Tamaño de fuente base */
    font-size: var(--font-base);
    /* Mínima altura para cubrir toda la ventana */
    min-height: 100vh;
}

/* ========== TIPOGRAFÍA BASE ========== */
/* Estilos para encabezados */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-dark);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: var(--font-5xl);
    letter-spacing: -0.02em;
}

h2 {
    font-size: var(--font-4xl);
    letter-spacing: -0.01em;
}

h3 {
    font-size: var(--font-3xl);
}

h4 {
    font-size: var(--font-2xl);
}

h5 {
    font-size: var(--font-xl);
}

h6 {
    font-size: var(--font-lg);
}

/* Párrafos */
p {
    margin-bottom: var(--spacing-lg);
    color: var(--text-medium);
}

/* Enlaces */
a {
    color: var(--primary-green);
    text-decoration: none;
    transition: var(--transition-base);
}

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

/* Listas */
ul, ol {
    margin-bottom: var(--spacing-lg);
    padding-left: var(--spacing-xl);
}

li {
    margin-bottom: var(--spacing-sm);
}

/* ========== ELEMENTOS MULTIMEDIA ========== */
img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Mejora la calidad de imagen */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* SVGs inline */
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Videos y iframes responsivos */
video, iframe {
    max-width: 100%;
    height: auto;
}

/* ========== ELEMENTOS DE FORMULARIO ========== */
button {
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    border: none;
    background: none;
    padding: 0;
    transition: var(--transition-base);
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* ========== TABLAS ========== */
table {
    border-collapse: collapse;
    width: 100%;
}

/* ========== ELEMENTOS SEMÁNTICOS ========== */
main {
    display: block;
}

section {
    display: block;
}

article {
    display: block;
}

/* ========== UTILIDADES GLOBALES ========== */
/* Container principal */
.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Container más estrecho para contenido de lectura */
.container-narrow {
    max-width: 800px;
}

/* Container ancho para layouts grandes */
.container-wide {
    max-width: 1600px;
}

/* ========== CLASES DE ESTADO ========== */
/* Para elementos ocultos */
.hidden {
    display: none !important;
}

/* Para elementos visualmente ocultos pero accesibles */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Estados de carga */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loaded {
    opacity: 1;
    pointer-events: auto;
}

/* ========== MEJORAS DE ACCESIBILIDAD ========== */
/* Focus visible para navegación con teclado */
:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Solo mostrar outline en navegación con teclado */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: var(--z-modal);
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--primary-green);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-md);
}

.skip-to-content:focus {
    left: 50%;
    transform: translateX(-50%);
    top: var(--spacing-md);
}

/* ========== HELPERS DE TEXTO ========== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ========== SELECTION STYLES ========== */
/* Estilo personalizado para texto seleccionado */
::selection {
    background-color: var(--primary-green);
    color: white;
}

::-moz-selection {
    background-color: var(--primary-green);
    color: white;
}

/* Logo específico */
.logo-container img {
    max-width: 100%;
    height: auto;
    display: block;
}