/* ============================================================
   BASE.CSS — Estilos globales para Laboratorio BIOBLAS
   Tipografia, colores, contenedores, secciones, utilidades
   ============================================================ */

/* --- Body --- */
body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-light);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
}

/* --- Selection --- */
::selection {
  background-color: rgba(var(--color-primary-rgb), 0.12);
  color: var(--color-primary);
}

/* --- Focus visible --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* --- Skip to content (accessibility) --- */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-to-content:focus {
  top: 0;
}


/* ============================================================
   HEADINGS
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  color: var(--color-primary);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-md);
}

h3 {
  font-size: var(--text-2xl);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-md);
}

h4 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-sm);
}

h5 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-sm);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* Responsive headings */
@media (max-width: 768px) {
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-xl);  }
}


/* ============================================================
   PARAGRAPHS & TEXT
   ============================================================ */
p {
  margin-bottom: var(--space-md);
  max-width: 72ch;
}

.text-sm     { font-size: var(--text-sm); }
.text-lg     { font-size: var(--text-lg); }
.text-xl     { font-size: var(--text-xl); }
.text-muted  { color: var(--color-text-muted); }
.text-light  { color: var(--color-text-light); }
.text-accent { color: var(--color-accent); }
.text-center { text-align: center; }
.text-right  { text-align: right; }


/* ============================================================
   LINKS
   ============================================================ */
a {
  color: var(--color-accent);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-light);
}


/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* Variante estrecha para textos */
.container--narrow {
  max-width: 800px;
}

/* Variante ancha para heros */
.container--wide {
  max-width: 1440px;
}


/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding-top: var(--space-5xl);
  padding-bottom: var(--space-5xl);
}

.section--sm {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

.section--alt {
  background-color: var(--color-surface-alt);
}

.section--dark {
  background-color: var(--color-primary-dark);
  color: var(--color-text-inverse);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark h5,
.section--dark h6 {
  color: var(--color-text-inverse);
}

.section--dark p {
  color: rgba(255, 255, 255, 0.8);
}

.section--dark a {
  color: var(--color-accent-light);
}

/* Section header */
.section__header {
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-3xl);
}

.section__subtitle {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

/* Responsive sections */
@media (max-width: 768px) {
  .section {
    padding-top: var(--space-3xl);
    padding-bottom: var(--space-3xl);
  }

  .section--sm {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-2xl);
  }

  .section__header {
    margin-bottom: var(--space-2xl);
  }
}


/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  width: 60px;
  height: 3px;
  background-color: var(--color-accent);
  border: none;
  border-radius: var(--radius-full);
  margin: var(--space-lg) 0;
}

.divider--center {
  margin-left: auto;
  margin-right: auto;
}


/* ============================================================
   PAGE HEADER (for inner pages)
   ============================================================ */
.page-header {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  padding-top: calc(var(--navbar-height) + var(--space-3xl));
  padding-bottom: var(--space-3xl);
  text-align: center;
}

.page-header h1 {
  color: var(--color-text-inverse);
  font-size: var(--text-5xl);
  margin-bottom: var(--space-sm);
}

.page-header p {
  color: rgba(255, 255, 255, 0.75);
  font-size: var(--text-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-md);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.6);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--color-text-inverse);
}

.breadcrumb__separator {
  font-size: var(--text-xs);
}

@media (max-width: 768px) {
  .page-header {
    padding-top: calc(var(--navbar-height) + var(--space-2xl));
    padding-bottom: var(--space-2xl);
  }

  .page-header h1 {
    font-size: var(--text-4xl);
  }
}


/* ============================================================
   SCREEN READER ONLY (accessibility)
   ============================================================ */
.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;
}


/* ============================================================
   PAGE FADE-IN
   ============================================================ */
.page-enter {
  animation: pageEnter 0.4s ease both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
