/* ============================================================
   shared/styles.css — brand tokens + site base + component classes
   + mobile. Linked from each project's index.html.
   ============================================================ */

@import "tokens/fonts.css";
@import "tokens/colors.css";
@import "tokens/typography.css";
@import "tokens/layout.css";

:root {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

p {
  margin: 0;
}

/* site base */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

a {
  color: var(--nolab-blue, #3a2ff2);
  text-decoration: none;
}
a:hover {
  color: #2c22c9;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* lead form inputs — sit on dark photography */
.lead-field {
  background: rgba(245, 244, 241, 0.06);
  border: 1px solid rgba(245, 244, 241, 0.28);
  border-radius: 4px;
  color: var(--porcelain, #f5f4f1);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 14px 16px;
  width: 100%;
  box-sizing: border-box;
}
.lead-field:focus-visible {
  outline: 2px solid var(--porcelain, #f5f4f1);
  outline-offset: 2px;
}
.lead-field::placeholder {
  color: rgba(245, 244, 241, 0.62);
}
.lead-field:user-invalid {
  border-color: #f0a08f;
}

/* buttons — primary (charcoal outline on porcelain) and paper-ghost (porcelain outline on dark) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  box-sizing: border-box;
  white-space: nowrap;
  font-style: normal;
}
.btn--md {
  height: 40px;
  padding: 0 18px;
  font-size: 13px;
}
.btn--lg {
  height: 44px;
  padding: 0 26px;
  font-size: 14px;
}

.btn--primary {
  background: var(--porcelain, #f5f4f1);
  color: var(--charcoal, #12171b);
  border: 1.5px solid var(--charcoal, #12171b);
}
.btn--primary:hover {
  background: var(--charcoal, #12171b);
  color: var(--porcelain, #f5f4f1);
}

.btn--paper-ghost {
  background: transparent;
  color: var(--porcelain, #f5f4f1);
  border: 1.5px solid rgba(245, 244, 241, 0.55);
}
.btn--paper-ghost:hover {
  background: rgba(245, 244, 241, 0.1);
}

/* badges — status pill (frosted, over photography) and inline label */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  text-transform: uppercase;
  white-space: nowrap;
  box-sizing: border-box;
}
.badge--status {
  height: 40px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: #fff;
  background: var(--glass-status-bg, rgba(20, 25, 30, 0.32));
  backdrop-filter: var(--glass-status-blur, blur(6px));
  -webkit-backdrop-filter: var(--glass-status-blur, blur(6px));
  border: var(--glass-status-border, 1px solid rgba(217, 215, 210, 0.16));
  border-radius: var(--glass-status-radius, 999px);
  gap: 6px;
}
.badge--presale::before,
.badge--luxury::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  flex: none;
}
.badge--presale::before {
  background: var(--forest-500, #2f4a3e);
}
.badge--luxury::before {
  background: var(--terracotta-500, #9e654e);
}

.badge--label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-muted, #6e7578);
}

/* editorial label — small uppercase caption */
.editorial-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #535a5d;
  white-space: nowrap;
}

/* sticky bar — fixed, slides in on scroll past 700px (toggled by shared/app.js) */
.sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(245, 244, 241, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(18, 23, 27, 0.08);
  transform: translateY(-100%);
  opacity: 0;
  transition:
    transform 260ms cubic-bezier(0.2, 0.7, 0.3, 1),
    opacity 260ms;
}
.sticky-bar.is-stuck {
  transform: translateY(0);
  opacity: 1;
}

/* mobile floating CTA — pill at the bottom; opacity toggled by shared/app.js */
@media (max-width: 720px) {
  .float-cta {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    z-index: 100;
    padding: 16px 20px;
    background: var(--text-strong, #12171b);
    color: var(--porcelain, #f5f4f1);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    text-decoration: none;
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(18, 23, 27, 0.32);
    transition:
      opacity 220ms ease,
      transform 220ms ease;
  }
}

/* container — max-width + horizontal padding; vertical padding stays inline per section.
   width:100% is required so flex children (e.g. hero .container) don't shrink-wrap
   when margin:auto cancels align-items:stretch. */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-left: 48px;
  padding-right: 48px;
  box-sizing: border-box;
}

/* generic grid — column ratio via inline --cols, gap via inline style. Mobile collapses to 1fr. */
.grid {
  display: grid;
  grid-template-columns: var(--cols, 1fr 1fr);
}
.grid--line {
  gap: 1px;
  background: rgba(245, 244, 241, 0.16);
}
.grid--line > * {
  background: var(--surface-inverse, #12171b);
}

/* gallery hover-zoom — scoped to the gallery section */
.gallery .gallery-cell {
  overflow: hidden;
}
.gallery .gallery-cell img {
  transition: transform 400ms cubic-bezier(0.2, 0.7, 0.3, 1);
}
.gallery .gallery-cell:hover img {
  transform: scale(1.04);
}

/* full-viewport hero — opt-in; beats default mobile max-height */
.hero--viewport {
  min-height: 100vh;
  min-height: 100dvh;
}

/* lead form name/apellido row */
.lead-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ============================================================
   Mobile — class-based overrides.
   ============================================================ */
@media (max-width: 720px) {
  .m-hide {
    display: none !important;
  }
  .sticky-bar {
    display: none !important;
  }

  .hero {
    min-height: 90vh;
    max-height: 640px;
  }
  /* !important beats common inline type sizes in project HTML */
  h1 {
    font-size: 38px !important;
    max-width: none !important;
    line-height: 1.04 !important;
  }
  h2 {
    font-size: 28px !important;
  }
  section {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  .grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }
  /* keep 1px gap + tint so stacked cards get horizontal hairlines */
  .grid--line {
    gap: 1px !important;
  }
  .col-sticky {
    position: static !important;
  }
  .gallery .gallery-cell {
    grid-row: auto !important;
  }
  .lead-name-row {
    grid-template-columns: 1fr !important;
  }

  .gallery-hero-img,
  .location-img {
    height: 300px !important;
  }
  .gallery-side-img {
    height: 200px !important;
  }

  .residency-card {
    padding: 28px 22px !important;
  }
  .price-hero {
    font-size: 30px !important;
  }
  .lead-field {
    padding: 12px 14px !important;
  }
}
