/* ==========================================
   RESET CSS & BASE STYLES
   Modern CSS Reset + Base Configuration
   ========================================== */

/* ===== IMPORTAR FUENTE INTER DE GOOGLE FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ===== BOX SIZING RESET ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===== ROOT & HTML ===== */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

/* ===== BODY ===== */
body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--g-700);
    background-color: var(--g-50);
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--navbar-height);
}

/* Responsive padding for mobile */
@media (max-width: 991px) {
    body {
        padding-top: var(--navbar-height-mobile);
    }
}

/* ===== HEADINGS ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-extrabold);
    line-height: 1.2;
    color: var(--g-black);
    margin-bottom: 1rem;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: var(--font-black);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.75rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

h5 {
    font-size: var(--font-xl);
}

h6 {
    font-size: var(--font-lg);
}

/* ===== PARAGRAPHS ===== */
p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

p:last-child {
    margin-bottom: 0;
}

.lead {
    font-size: 1.35rem;
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--g-600);
}

/* ===== LINKS ===== */
a {
    color: var(--color-verde);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-verde-oscuro);
}

a:focus-visible {
    outline: 2px solid var(--color-verde);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* ===== LISTS ===== */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ===== IMAGES ===== */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== BUTTONS ===== */
button {
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    background: none;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== FORMS ===== */
input,
textarea,
select {
    font-family: var(--font-family);
    font-size: var(--font-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--color-verde);
    outline-offset: 2px;
}

/* ===== TABLES ===== */
table {
    border-collapse: collapse;
    width: 100%;
}

/* ===== HR ===== */
hr {
    border: none;
    border-top: 1px solid var(--g-200);
    margin: 2rem 0;
}

/* ===== CODE ===== */
code,
pre {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

code {
    background-color: var(--g-100);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-xs);
    color: var(--g-800);
}

pre {
    background-color: var(--g-100);
    padding: 1rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
}

pre code {
    background: none;
    padding: 0;
}

/* ===== SCROLLBAR CUSTOM (Webkit) ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--g-100);
}

::-webkit-scrollbar-thumb {
    background: var(--g-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--g-500);
}

/* ===== SELECTION ===== */
::selection {
    background-color: var(--color-verde);
    color: var(--g-white);
}

::-moz-selection {
    background-color: var(--color-verde);
    color: var(--g-white);
}

/* ===== FOCUS VISIBLE ===== */
:focus-visible {
    outline: 2px solid var(--color-verde);
    outline-offset: 2px;
}

/* ===== SKIP TO CONTENT (Accesibilidad) ===== */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-verde);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: var(--z-tooltip);
}

.skip-to-content:focus {
    top: 0;
}

/* ===== UTILITY CLASSES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===== CONTAINER ===== */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (min-width: 1400px) {
    .container {
        max-width: var(--container-xxl);
    }
}

.container-fluid {
    width: 100%;
    padding: 0 1.5rem;
}

/* ===== SECTION SPACING ===== */
section {
    padding: var(--spacing-4xl) 0;
}

@media (max-width: 768px) {
    section {
        padding: var(--spacing-3xl) 0;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }

    img {
        page-break-inside: avoid;
    }

    p,
    h2,
    h3 {
        orphans: 3;
        widows: 3;
    }

    h2,
    h3 {
        page-break-after: avoid;
    }
}
