/* ═══════════════════════════════════════════════════════
   ESTANCIAS VAGUBA — V2 — base.css
   Reset moderno + tipografía + utilidades + componentes
   transversales (nav, footer, botones, inputs).
   Depende de variables.css.
═══════════════════════════════════════════════════════ */

/* ─── 1. RESET ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

::selection { background: var(--terracota); color: var(--marfil); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

/* ─── 2. TIPOGRAFÍA ──────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); font-weight: 400; }
h6 { font-size: var(--fs-md); font-weight: 400; }

p { line-height: var(--lh-relaxed); }
p + p { margin-top: var(--space-sm); }

.lead {
  font-size: var(--fs-md);
  color: var(--text-soft);
  line-height: var(--lh-relaxed);
  max-width: var(--reading-max);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-xwide);
  color: var(--text-muted);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--mostaza);
}

.eyebrow--center { justify-content: center; }
.eyebrow--center::before { display: none; }
.eyebrow--center::after  { display: none; }

.eyebrow--lines {
  gap: var(--space-sm);
}
.eyebrow--lines::after {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--mostaza);
}

/* Cita / quote editorial */
.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: var(--fs-xl);
  line-height: 1.35;
  color: var(--text);
}

/* ─── 3. LAYOUT BASE ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}

.container--narrow { max-width: 880px; }
.container--reading { max-width: 720px; }

.section {
  padding-block: clamp(4rem, 8vw, 7rem);
}
.section--lg { padding-block: clamp(5rem, 10vw, 9rem); }
.section--sm { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--alt { background: var(--bg-alt); }
.section--elev { background: var(--bg-elev); }
.section--dark {
  background: var(--bg-dark);
  color: var(--marfil);
  position: relative;
  overflow: hidden;
}
.section--dark::before {
  /* Sutil patrón de azulejo tipo talavera — apenas perceptible, da textura */
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'><g fill='none' stroke='%23E8C98A' stroke-width='0.6' opacity='0.18'><path d='M40 4 L48 20 L40 36 L32 20 Z M40 44 L48 60 L40 76 L32 60 Z M4 40 L20 32 L36 40 L20 48 Z M44 40 L60 32 L76 40 L60 48 Z'/><circle cx='40' cy='40' r='3'/></g></svg>");
  background-size: 80px 80px;
  pointer-events: none;
  z-index: 0;
}
.section--dark > * { position: relative; z-index: 1; }
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--marfil); }
.section--dark .eyebrow { color: var(--ocre); }
.section--dark .eyebrow::before,
.section--dark .eyebrow::after { background: var(--ocre); }

/* Grid utilities */
.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-lg); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-lg); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-md); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
}

/* Flex */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); }

/* Helpers de espaciado */
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl{ margin-top: var(--space-2xl); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.text-center { text-align: center; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.hidden { display: none !important; }
.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;
}

/* ─── 4. DIVISORES DECORATIVOS ───────────────────────── */
.divider {
  height: 1px;
  background: var(--line);
  border: 0;
}
.divider--accent {
  width: 56px;
  height: 1px;
  background: var(--mostaza);
}
.divider--center { margin-inline: auto; }

/* Marca de coordenadas estilo logo — adorno */
.coord-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
}
.coord-mark::before,
.coord-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}
.coord-mark::after {
  inset: 4px;
  background: currentColor;
}

/* ─── 5. BOTONES ─────────────────────────────────────── */
.btn {
  --btn-pad-y: 0.95rem;
  --btn-pad-x: 1.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition:
    background var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out);
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--terracota);
  color: var(--marfil);
}
.btn--primary:hover {
  background: var(--terracota-d);
  box-shadow: var(--shadow-warm);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--carbon);
}
.btn--ghost:hover {
  background: var(--carbon);
  color: var(--marfil);
}

.btn--ghost-light {
  background: transparent;
  color: var(--marfil);
  border-color: rgba(255, 253, 249, 0.5);
}
.btn--ghost-light:hover {
  background: var(--marfil);
  color: var(--carbon);
  border-color: var(--marfil);
}

.btn--link {
  padding: 0;
  background: transparent;
  color: var(--text);
  border: 0;
  border-bottom: 1px solid var(--carbon);
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  font-size: var(--fs-xs);
  padding-bottom: 4px;
}
.btn--link:hover { color: var(--terracota); border-color: var(--terracota); }

.btn--sm { --btn-pad-y: 0.65rem; --btn-pad-x: 1.2rem; font-size: var(--fs-xs); }
.btn--lg { --btn-pad-y: 1.15rem; --btn-pad-x: 2.4rem; font-size: var(--fs-sm); }

.btn[disabled],
.btn--loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ─── 6. FORMULARIOS ─────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--space-2xs); }
.field__label {
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text-soft);
}
.field__input,
.field__textarea,
.field__select {
  width: 100%;
  padding: 0.95rem 1.1rem;
  font-size: var(--fs-base);
  background: var(--marfil);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.field__input::placeholder,
.field__textarea::placeholder { color: var(--niebla); }
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-color: var(--terracota);
  background: var(--marfil);
}
.field__textarea { resize: vertical; min-height: 140px; line-height: var(--lh-relaxed); }
.field__error {
  font-size: var(--fs-xs);
  color: var(--error);
}

/* ─── 7. NAVBAR ──────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              height var(--dur-base) var(--ease-out);
}
.nav.scrolled {
  background: var(--nav-bg-scrolled);
  border-bottom-color: var(--nav-border);
}

.nav__inner {
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}

.nav__logo {
  display: flex;
  align-items: center;
  height: 52px;
  flex-shrink: 0;
}
.nav__logo img { height: 100%; width: auto; display: block; }

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.nav__link {
  position: relative;
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--text);
  padding: var(--space-2xs) 0;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--terracota);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav__link:hover { color: var(--terracota); }
.nav__link:hover::after,
.nav__link.active::after { transform: scaleX(1); }
.nav__link.active { color: var(--terracota); }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0.4rem 0.7rem;
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  color: var(--text);
  background: transparent;
  border: 1px solid var(--carbon);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.lang-toggle:hover {
  background: var(--carbon);
  color: var(--marfil);
}

/* Hamburguesa */
.nav__hamburger {
  display: none;
  width: 36px;
  height: 36px;
  position: relative;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.nav__hamburger span {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 1.5px;
  background: var(--carbon);
  transition: all var(--dur-base) var(--ease-out);
}
.nav__hamburger span:nth-child(1) { top: 11px; }
.nav__hamburger span:nth-child(2) { top: 17px; }
.nav__hamburger span:nth-child(3) { top: 23px; }

.nav__hamburger.open span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.nav__hamburger.open span:nth-child(2) { opacity: 0; }
.nav__hamburger.open span:nth-child(3) { top: 17px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .nav { height: var(--nav-height-sm); }
  .nav__hamburger { display: block; }
  .nav__logo { height: 42px; }

  .nav__links {
    position: fixed;
    top: var(--nav-height-sm);
    left: 0; right: 0;
    flex-direction: column;
    gap: var(--space-xl);
    padding: var(--space-2xl) var(--container-pad);
    background: var(--crema);
    border-bottom: 1px solid var(--line);
    transform: translateY(-110%);
    transition: transform var(--dur-base) var(--ease-out);
    height: calc(100vh - var(--nav-height-sm));
    overflow-y: auto;
  }
  .nav__links.open { transform: translateY(0); }

  .nav__link { font-size: var(--fs-md); }
  .nav__link::after { display: none; }
}

/* Espaciador del nav para que el contenido no quede oculto */
.nav-spacer { height: var(--nav-height); }
@media (max-width: 900px) { .nav-spacer { height: var(--nav-height-sm); } }

/* ─── 8. FOOTER ──────────────────────────────────────── */
.footer {
  background: var(--teja);
  color: rgba(255, 253, 249, 0.88);
  padding-block: var(--space-3xl) var(--space-xl);
  margin-top: var(--space-3xl);
}
.footer h3 { color: var(--marfil); }

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
}
@media (max-width: 540px) {
  .footer__grid { grid-template-columns: 1fr; }
}

.footer__logo {
  display: inline-block;
  margin-bottom: var(--space-md);
}
.footer__logo img {
  display: block;
  width: 140px;
  height: auto;
  opacity: 0.95;
}
.footer__tagline {
  font-size: var(--fs-sm);
  color: rgba(255, 253, 249, 0.6);
  line-height: var(--lh-relaxed);
  max-width: 28ch;
}
.footer__heading {
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-xwide);
  color: var(--ocre);
  margin-bottom: var(--space-md);
}
.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}
.footer__link {
  font-size: var(--fs-sm);
  color: rgba(255, 253, 249, 0.78);
  transition: color var(--dur-fast) var(--ease-out);
}
.footer__link:hover { color: var(--ocre); }

.footer__bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 253, 249, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: rgba(255, 253, 249, 0.55);
  letter-spacing: 0.02em;
}

/* ─── 9. ANIMACIONES BASE ────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes evReveal {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes evFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes evDrawLine {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
