/* ============================================================
   Aberturas Chajarí — Base & Reset
   ============================================================ */

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-heading);
  text-wrap: balance;
  font-feature-settings: "liga", "dlig";
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.03em; }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }

/* On dark backgrounds headings breathe slightly more */
.page-hero h1, .hero-title, .bento-card h2, .bento-card h3,
.cta-banner h2, .cta-banner h3 {
  line-height: 1.2;
}

p { text-wrap: pretty; }

/* --- Prose reading width --- */
.prose {
  max-width: 65ch;
}

/* --- Layout helpers --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-prose {
  max-width: var(--container-prose);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 480px) {
  .container,
  .container-prose,
  .container-narrow { padding: 0 var(--space-4); }
}

/* --- Spacing helpers --- */
.section      { padding: var(--space-20) 0; }
.section-sm   { padding: var(--space-12) 0; }
.section-lg   { padding: var(--space-24) 0; }

/* --- Section title --- */
.section-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--color-heading);
  margin-bottom: var(--space-2);
}
.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-bottom: var(--space-12);
  max-width: 65ch;
  line-height: var(--leading-relaxed);
}
.section-title + .section-subtitle { margin-top: var(--space-4); }

.section-header {
  margin-bottom: var(--space-12);
}
.section-header--center {
  text-align: center;
}
.section-header--center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* --- Eyebrow label --- */
.eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-text);
  display: block;
  margin-bottom: var(--space-3);
}

.prose a,
.site-footer a,
.form-legal a {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

/* --- Title accent ---
   Doble uso: (a) <span class="title-accent">texto</span> dentro de h1/h2 → texto en color primario.
              (b) <div class="title-accent"></div> vacío → barra divisoria 56×4px.
   :empty distingue entre ambos. */
.title-accent { color: var(--color-primary); }
.title-accent:empty {
  display: block;
  width: 56px;
  height: 4px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  margin-top: var(--space-4);
}
.title-accent--center {
  margin-left: auto;
  margin-right: auto;
}

/* --- Grid helpers --- */
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(1rem, 2vw + 0.5rem, var(--space-8)); }
.grid-2    { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(1.5rem, 3vw + 0.5rem, var(--space-12)); }
.grid-3    { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(1rem, 2vw + 0.5rem, var(--space-8)); }

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  padding: var(--space-2) var(--space-5);
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; }

/* --- Visually hidden (accesibilidad) --- */
.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;
}
