/* ═══════════════════════════════════════════════════════════════
   LUMA INMOBILIARIA — "La luz entra primero."
   Editorial de arquitectura. Papel, tinta y el salvia de la marca.
   Tipografías auto-hospedadas (OFL junto a los woff2): cero terceros.
   ═══════════════════════════════════════════════════════════════ */

@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrumentserif-400-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrumentserif-400-latin-ext.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Serif'; src: url('../fonts/instrumentserif-400-italic-latin.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrumentsans-400-latin.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrumentsans-400-latin-ext.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrumentsans-500-latin.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrumentsans-600-latin.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --papel:  #F6F4EF;
  --blanco: #FFFFFF;
  --tinta:  #1B1B19;
  --salvia: #8A8F6F;
  --salvia-hondo: #5F6449;
  --piedra: #D8D4CB;
  --humo:   #6E6E68;

  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans:  'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --m: clamp(20px, 5vw, 72px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--salvia); color: var(--blanco); }
:focus-visible { outline: 2px solid var(--salvia-hondo); outline-offset: 3px; }

.saltar { position: absolute; left: -9999px; top: 0; z-index: 300; background: var(--tinta); color: var(--papel); padding: .8em 1.2em; }
.saltar:focus { left: 0; }

/* ── Tipografía ────────────────────────────────────────────── */
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(42px, 6.6vw, 96px); line-height: 1.02; letter-spacing: -0.02em; }
.h2      { font-family: var(--serif); font-weight: 400; font-size: clamp(29px, 3.6vw, 52px); line-height: 1.1; letter-spacing: -0.015em; }
.h3      { font-family: var(--serif); font-weight: 400; font-size: clamp(22px, 2.2vw, 32px); line-height: 1.15; }
.etiqueta { font-family: var(--sans); font-weight: 500; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--salvia-hondo); }
.cuerpo  { color: var(--humo); max-width: 62ch; }
.italica { font-style: italic; }

/* ── Nav ───────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; height: var(--nav); padding-inline: var(--m);
  background: color-mix(in srgb, var(--papel) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--piedra); }
.nav__marca { display: flex; align-items: center; gap: 9px; }
.nav__marca svg { width: 22px; height: 22px; flex: none; }
.nav__marca b { font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: .3em; }
.nav__marca span { font-size: 9.5px; letter-spacing: .22em; color: var(--humo); display: block; margin-top: -3px; }
.nav__links { display: flex; align-items: center; gap: clamp(14px, 2.2vw, 30px); font-size: 14.5px; }
.nav__links a { position: relative; padding-block: 4px; }
.nav__links a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--tinta); transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__wa { border: 1px solid var(--tinta); padding: .5em 1.05em; font-size: 13.5px; transition: background 250ms var(--ease), color 250ms var(--ease); }
.nav__wa::after { display: none; }
.nav__wa:hover { background: var(--tinta); color: var(--papel); }
@media (max-width: 860px) { .nav__links a:not(.nav__wa) { display: none; } }

/* ── Sello de sincronización ───────────────────────────────── */
.sello { display: inline-flex; align-items: center; gap: 9px; font-family: var(--sans); font-size: 11.5px; letter-spacing: .1em; color: var(--humo); }
.sello__punto { width: 7px; height: 7px; border-radius: 50%; background: var(--salvia); flex: none; animation: latido 2.4s ease-in-out infinite; }
@keyframes latido { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sello__punto { animation: none; opacity: 1; } }

/* ── Secciones ─────────────────────────────────────────────── */
.sec { padding: clamp(64px, 9vh, 120px) var(--m); }
.sec--fino { padding-block: clamp(40px, 6vh, 72px); }
.cab { max-width: 900px; margin-bottom: clamp(34px, 5vh, 60px); }
.cab .etiqueta { display: block; margin-bottom: 14px; }
.cab .cuerpo { margin-top: 16px; }

/* ── Botones y enlaces ─────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; padding: .85em 1.5em; border: 1px solid var(--tinta); transition: background 250ms var(--ease), color 250ms var(--ease); }
.btn:hover { background: var(--tinta); color: var(--papel); }
.btn--relleno { background: var(--tinta); color: var(--papel); }
.btn--relleno:hover { background: var(--salvia-hondo); border-color: var(--salvia-hondo); }
.enlace-fino { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: gap 250ms var(--ease); }
.enlace-fino:hover { gap: 14px; }

/* ── Tarjeta de propiedad ──────────────────────────────────── */
.rejilla { display: grid; gap: clamp(18px, 2.4vw, 34px); grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.tarjeta { background: var(--blanco); border: 1px solid var(--piedra); display: flex; flex-direction: column; transition: border-color 300ms var(--ease); }
.tarjeta:hover, .tarjeta:focus-within { border-color: var(--salvia); }
.tarjeta__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--piedra); }
.tarjeta__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease); }
.tarjeta:hover .tarjeta__media img { transform: scale(1.04); }
.tarjeta__cuerpo { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.tarjeta__zona { font-weight: 500; font-size: 18px; line-height: 1.25; }
.tarjeta__precio { font-family: var(--serif); font-size: clamp(21px, 1.9vw, 27px); line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 2px; }
.tarjeta__precio small { font-family: var(--sans); font-size: 13px; color: var(--humo); }
.tarjeta__specs { font-size: 13.5px; color: var(--humo); margin-top: auto; padding-top: 8px; }
.tarjeta__contador { position: absolute; right: 10px; bottom: 10px; background: color-mix(in srgb, var(--tinta) 78%, transparent); color: var(--papel); font-size: 11.5px; letter-spacing: .06em; padding: .3em .6em; }

/* Lienzo tipográfico: propiedades cuyas fotos aún no están en el Drive */
.lienzo { position: absolute; inset: 0; display: grid; place-items: center; gap: 10px; background:
  linear-gradient(160deg, color-mix(in srgb, var(--piedra) 55%, var(--papel)), var(--papel)); }
.lienzo svg { width: 46px; height: 46px; opacity: .32; }
.lienzo span { font-family: var(--sans); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--humo); opacity: .8; }

/* ── Destacadas: rejilla editorial asimétrica ──────────────── */
.editorial { display: grid; gap: clamp(16px, 2vw, 26px); grid-template-columns: repeat(6, 1fr); }
.editorial > * { grid-column: span 2; }
.editorial > :nth-child(1) { grid-column: span 4; }
.editorial > :nth-child(1) .tarjeta__media { aspect-ratio: 16 / 10; }
.editorial > :nth-child(6) { grid-column: span 4; }
.editorial > :nth-child(6) .tarjeta__media { aspect-ratio: 16 / 10; }
@media (max-width: 1000px) { .editorial { grid-template-columns: repeat(2, 1fr); } .editorial > *, .editorial > :nth-child(1), .editorial > :nth-child(6) { grid-column: span 1; } }
@media (max-width: 560px) { .editorial { grid-template-columns: 1fr; } }

/* ── Filtros ───────────────────────────────────────────────── */
.filtros { display: flex; flex-wrap: wrap; gap: 22px 34px; align-items: flex-end; padding-bottom: 22px; border-bottom: 1px solid var(--piedra); margin-bottom: clamp(26px, 4vh, 44px); }
.filtro { display: flex; flex-direction: column; gap: 9px; }
.filtro > .etiqueta { color: var(--humo); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { background: none; border: 1px solid var(--piedra); padding: .45em .95em; font-size: 13.5px; cursor: pointer; transition: border-color 200ms var(--ease), background 200ms var(--ease), color 200ms var(--ease); }
.chip:hover { border-color: var(--salvia); }
.chip[aria-pressed="true"] { background: var(--tinta); border-color: var(--tinta); color: var(--papel); }
.filtro select { border: 1px solid var(--piedra); background: var(--blanco); padding: .55em .8em; font-size: 14px; }
.resultado { margin-left: auto; font-size: 14px; color: var(--humo); }
.vacio { padding: 60px 0; text-align: center; color: var(--humo); }

/* ── Ficha de propiedad ────────────────────────────────────── */
.ficha { padding: clamp(28px, 4vh, 48px) var(--m) clamp(64px, 9vh, 110px); }
.ficha__volver { display: inline-flex; gap: 8px; font-size: 14px; color: var(--humo); margin-bottom: 22px; }
.ficha__grid { display: grid; gap: clamp(26px, 4vw, 56px); grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); align-items: start; }
@media (max-width: 940px) { .ficha__grid { grid-template-columns: 1fr; } }
.galeria__principal { aspect-ratio: 3 / 2; background: var(--piedra); overflow: hidden; position: relative; }
.galeria__principal img { width: 100%; height: 100%; object-fit: cover; }
/* La galería acompaña al lector mientras baja por la ficha */
@media (min-width: 941px) { .ficha__grid > div:first-child { position: sticky; top: 92px; } }
/* Capa para el paseo lento entre fotos */
.galeria__fundido { position: absolute; inset: 0; opacity: 0; transition: opacity 1200ms var(--ease); }
.galeria__miniaturas { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 8px; }
.galeria__miniaturas button { padding: 0; border: 1px solid transparent; background: none; cursor: pointer; aspect-ratio: 4/3; overflow: hidden; }
.galeria__miniaturas img { width: 100%; height: 100%; object-fit: cover; opacity: .62; transition: opacity 250ms var(--ease); }
.galeria__miniaturas button[aria-current="true"] { border-color: var(--tinta); }
.galeria__miniaturas button:hover img, .galeria__miniaturas button[aria-current="true"] img { opacity: 1; }
.datos { display: grid; gap: 4px; }
.datos__precio { font-family: var(--serif); font-size: clamp(32px, 4vw, 46px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.datos__lista { margin-top: 22px; border-top: 1px solid var(--piedra); }
.datos__lista div { display: flex; justify-content: space-between; gap: 16px; padding: .7em 0; border-bottom: 1px solid var(--piedra); font-size: 14.5px; }
.datos__lista dt { color: var(--humo); }
.bloque { margin-top: 30px; }
.bloque h4 { font-family: var(--sans); font-weight: 600; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.bloque li { padding: .3em 0 .3em 18px; position: relative; font-size: 15px; color: var(--humo); }
.bloque li::before { content: ''; position: absolute; left: 0; top: .95em; width: 7px; height: 1px; background: var(--salvia); }

/* ── Video (TikTok / Instagram) ────────────────────────────── */
.videos { display: grid; gap: clamp(14px, 1.8vw, 22px); grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); }
.video { position: relative; aspect-ratio: 9 / 16; background: var(--tinta); border: 1px solid var(--piedra); overflow: hidden; cursor: pointer; padding: 0; display: block; width: 100%; }
.video img { width: 100%; height: 100%; object-fit: cover; opacity: .82; transition: opacity 400ms var(--ease), transform 700ms var(--ease); }
.video:hover img { opacity: 1; transform: scale(1.04); }
.video__capa { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; color: var(--papel); text-align: left;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,.06) 55%); }
.video__plat { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; }
.video__txt { font-size: 14px; line-height: 1.35; }
.video__play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border: 1px solid rgba(255,255,255,.85); border-radius: 50%; display: grid; place-items: center; }
.video__play::after { content: ''; border-left: 11px solid var(--papel); border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(20,20,18,.9); display: grid; place-items: center; padding: 20px; }
.lightbox[hidden] { display: none; }
.lightbox__caja { background: var(--papel); width: min(420px, 94vw); max-height: 92vh; overflow: auto; padding: 16px; }
.lightbox__cerrar { position: absolute; top: 18px; right: 22px; background: none; border: 0; color: var(--papel); font-size: 30px; line-height: 1; cursor: pointer; }

/* ── Puertas (venta/renta/terrenos) ────────────────────────── */
.puertas { display: grid; gap: 1px; background: var(--piedra); border: 1px solid var(--piedra); }
@media (min-width: 760px) { .puertas { grid-template-columns: repeat(3, 1fr); } }
.puerta { background: var(--papel); padding: clamp(26px, 4vw, 44px); display: flex; flex-direction: column; gap: 8px; transition: background 300ms var(--ease); }
.puerta:hover { background: var(--blanco); }
.puerta__n { font-family: var(--serif); font-size: clamp(34px, 4vw, 52px); line-height: 1; }
.puerta__t { font-weight: 500; font-size: 18px; }
.puerta__d { font-size: 14.5px; color: var(--humo); }
.puerta__ir { margin-top: 14px; font-size: 13.5px; color: var(--salvia-hondo); }

/* ── Pie ───────────────────────────────────────────────────── */
.pie { border-top: 1px solid var(--piedra); padding: clamp(40px, 6vh, 70px) var(--m) 30px; display: grid; gap: 30px; }
.pie__grid { display: grid; gap: 30px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.pie h4 { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }
.pie li, .pie a { font-size: 14.5px; color: var(--humo); padding-block: 3px; }
.pie a:hover { color: var(--tinta); }
.pie__legal { border-top: 1px solid var(--piedra); padding-top: 20px; font-size: 12px; color: var(--humo); display: flex; flex-wrap: wrap; gap: 8px 26px; }

/* ── Entradas en calma ─────────────────────────────────────── */
[data-entra] { opacity: 0; transform: translateY(10px); }
[data-entra].visible { opacity: 1; transform: none; transition: opacity 800ms var(--ease), transform 800ms var(--ease); }
[data-entra-img] img { opacity: 0; transform: scale(1.03); }
[data-entra-img].visible img { opacity: 1; transform: none; transition: opacity 900ms var(--ease), transform 900ms var(--ease); }
@media (prefers-reduced-motion: reduce) {
  [data-entra], [data-entra].visible, [data-entra-img] img, [data-entra-img].visible img { opacity: 1; transform: none; transition: none; }
  .tarjeta:hover .tarjeta__media img { transform: none; }
}

/* Subtítulos dentro de las listas de la ficha (Planta baja / Planta alta) */
.bloque__sub { list-style: none; font-weight: 600; color: var(--tinta); font-size: 13px;
  letter-spacing: .04em; margin-top: 12px; padding-left: 0 !important; }
.bloque__sub::before { display: none !important; }
.bloque__sub:first-child { margin-top: 0; }
