/* base.css -- visachileno.cl v2 Reset + Typography */

/* ========================================
   Reset
   ======================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-3xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-6);
}

h2 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: var(--space-16) 0 var(--space-6);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: var(--space-10) 0 var(--space-4);
}

h4 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: var(--space-8) 0 var(--space-4);
}

h5, h6 {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: var(--space-6) 0 var(--space-3);
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

ul, ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}

li {
  margin-bottom: var(--space-2);
}

code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface);
  padding: var(--space-4);
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 0 0 var(--space-4);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

blockquote {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-6);
  border-left: 4px solid var(--color-border);
  color: var(--color-text-secondary);
}

strong {
  font-weight: 600;
}

/* ========================================
   Accessibility
   ======================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 300;
  background: var(--color-primary);
  color: #ffffff;
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Focus Styles
   ======================================== */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  .site-header,
  .site-nav,
  .site-footer,
  .breadcrumb,
  .skip-link {
    display: none !important;
  }

  body {
    color: #000000;
    background: #ffffff;
  }

  a {
    color: #000000;
    text-decoration: underline;
  }

  * {
    box-shadow: none !important;
  }

  /* Phase 23: Hide non-essential sections for print */
  .partner-cta,
  .affiliate-card,
  .info-callout {
    display: none !important;
  }

  /* Tables: readable, no dark backgrounds */
  th {
    background: none !important;
    border-bottom: 2px solid #000000;
    font-weight: bold;
  }

  td, th {
    border-bottom: 1px solid #cccccc;
    padding: 6px 8px;
    color: #000000 !important;
  }

  /* Prevent tables and timeline steps from splitting across pages */
  tr,
  .process-timeline__step {
    page-break-inside: avoid;
  }

  /* Keep headings with their content */
  h2, h3, h4 {
    page-break-after: avoid;
  }

  /* Force white background on styled components */
  .process-timeline__step {
    background: none !important;
    border: none !important;
  }

  /* Show URLs after external links (except inline sources -- too noisy) */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666666;
  }

  .sources a::after {
    content: none;
  }

  /* Hide page-verified badge icon in print (checkmark not needed) */
  .page-verified__icon {
    display: none;
  }
}
