/* =============================================================
   UNIBIT — global.css
   Reset, utilidades, variables, layout base
   ============================================================= */

/* --- Reset moderno --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--wp--preset--font-family--inter, 'Inter', sans-serif);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; }
p, li, dd { max-width: 70ch; }

/* =============================================================
   ASTRA OVERRIDES — liberar full-width en home
   ============================================================= */

/* Navbar: mantenemos contenedor normal */
.site-header .ast-container {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Home: contenido principal sin restricción de ancho */
.home .site-content > .ast-container,
.home #primary.content-area,
.home article.page {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}

.home .entry-content.clear {
  padding: 0 !important;
  margin: 0 !important;
}

/* Override Astra: data-ast-blocks-layout > * aplica max-width a todos los hijos directos */
.home .entry-content > section,
.home .entry-content > footer,
.home .entry-content > .wp-block-html,
.home .entry-content > div {
  max-width: 100% !important;
  width: 100% !important;
  margin-inline: 0 !important;
}

/* Eliminar padding extra que Astra agrega al entry-content */
.home .ast-page-builder-template .entry-content,
.home .entry-content {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Quitar el título de página Astra que queda en el flujo */
.home .ast-above-post-title,
.home .entry-header,
.home .ast-single-post-order,
.home .post-thumb { display: none !important; }

/* =============================================================
   CONTENEDORES INTERNOS
   ============================================================= */
.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.container-narrow {
  max-width: 780px;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

/* =============================================================
   SECCIÓN BASE
   ============================================================= */
.section {
  padding-block: var(--space-section);
  width: 100%;
}

.section--sm { padding-block: var(--space-component); }

/* =============================================================
   GRID UTILITIES
   ============================================================= */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1.5rem; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* =============================================================
   TIPOGRAFÍA UTILIDADES
   ============================================================= */
.text-xs     { font-size: 0.75rem; }
.text-sm     { font-size: 0.875rem; }
.text-base   { font-size: 1rem; }
.text-lg     { font-size: 1.125rem; }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }

/* =============================================================
   SECTION LABEL — etiqueta superior de sección
   ============================================================= */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-area, var(--color-desarrollo));
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  flex-shrink: 0;
}

/* =============================================================
   TÍTULOS DE SECCIÓN
   ============================================================= */
.section-header { margin-bottom: clamp(2rem, 4vw, 3.5rem); }

.section-title {
  font-family: var(--wp--preset--font-family--space-grotesk, 'Space Grotesk', sans-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-title span { color: var(--color-area, var(--color-desarrollo)); }

.section-title--center { text-align: center; }
.section-header--center { text-align: center; }
.section-header--center .section-subtitle { margin-inline: auto; }

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 58ch;
  line-height: 1.75;
}

/* =============================================================
   ANIMACIONES SCROLL
   ============================================================= */
.fade-in-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(.16,1,.3,1), transform 0.6s cubic-bezier(.16,1,.3,1);
}

.fade-in-up.is-visible { opacity: 1; transform: translateY(0); }

.fade-in-up:nth-child(2) { transition-delay: 0.1s; }
.fade-in-up:nth-child(3) { transition-delay: 0.2s; }
.fade-in-up:nth-child(4) { transition-delay: 0.3s; }

/* =============================================================
   UTILIDADES VARIAS
   ============================================================= */
.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;
}

.bg-area-subtle {
  background: color-mix(in srgb, var(--color-area, var(--color-desarrollo)) 6%, transparent);
}

/* =============================================================
   ALL INNER PAGES — Full-width sections, no page title
   ============================================================= */

/* 1. Ocultar título de página por defecto de Astra */
.page .entry-header,
.page .ast-above-post-title,
.page .entry-header .entry-title,
.page .post-thumb {
  display: none !important;
}

/* 2. Liberar el ast-container de su max-width (era 1200px → secciones con gaps) */
.page #content.site-content > .ast-container,
.page .site-content > .ast-container {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 3. Quitar margen/padding del #primary
   Astra agrega margin-top y margin-bottom: 60px en ast-plain-container */
.page #primary.content-area,
.page .site-main,
body.ast-plain-container .page #primary,
body.ast-plain-container.ast-no-sidebar .page #primary {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* 4. article.ast-article-single: sin padding lateral ni bordes */
.page .ast-article-single,
.page article.ast-article-single {
  padding: 0 !important;
  border: none !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* 5. entry-content: sin restricciones */
.page .entry-content.clear,
.page .entry-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  border: none !important;
  border-left: none !important;
}

/* 6. Hijos directos de entry-content: 100% ancho */
.page .entry-content > *,
.page .entry-content > section,
.page .entry-content > .wp-block-html,
.page .entry-content > footer,
.page .entry-content > div {
  max-width: 100% !important;
  width: 100% !important;
  margin-inline: 0 !important;
}

/* 7. Quitar blockquote border-left de Astra/Gutenberg */
.page .wp-block-quote:not(.has-text-align-right):not(.has-text-align-center),
.page blockquote,
.page .entry-content blockquote {
  border-left: none !important;
}

/* 8. Fondo del body/html consistente con nuestro design system */
html, body {
  background: var(--bg-primary) !important;
}

/* 9. Home page: fondo oscuro para que coincida con el footer y no queden franjas blancas */
body.home {
  background-color: #111218 !important;
}

/* Blog index: contenido principal sin restricción de ancho */
.blog .site-content > .ast-container,
.blog #primary.content-area,
.blog .site-main {
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
}
