/* ============================================================
   Hanna Sánchez Verea · Escultura
   Paleta tomada del catálogo y del logo de Habitarte.
   ============================================================ */
:root {
  --papel: #F7F4ED;
  --arena: #EBE3D5;
  --arena-2: #E0D5C2;
  --tinta: #3A3027;
  --suave: #6E5F50;
  --bronce: #8C6B48;
  --linea: rgba(58, 48, 39, .16);

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --pad: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1360px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--tinta); outline-offset: 4px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- barra de revisión (?revision) ---------- */
.revision-bar {
  background: var(--tinta); color: var(--papel);
  font: 500 .8125rem/1.4 var(--sans);
  padding: .6rem var(--pad);
}

/* ---------- encabezado ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; max-width: var(--max); margin: 0 auto;
  padding: 1.1rem var(--pad);
}
.brand img { height: 56px; width: auto; }
.site-header nav { display: flex; gap: 2rem; font: 400 .9375rem var(--sans); }
.site-header nav a { text-decoration: none; padding: .35rem 0; border-bottom: 1px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--bronce); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) var(--pad) clamp(3rem, 7vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}
.hero-text h1 {
  margin: 0 0 1.75rem;
  font-weight: 300;
  font-size: clamp(3rem, 7.6vw, 6.75rem);
  line-height: .95;
  letter-spacing: -.025em;
  font-optical-sizing: auto;
}
.lede { max-width: 30rem; margin: 0 0 2.25rem; font-size: 1.25rem; line-height: 1.55; color: var(--suave); }
.hero-photo {
  margin: 0; background: var(--arena);
  aspect-ratio: 4 / 5; max-height: 78vh; width: 100%;
  overflow: hidden; justify-self: end;
  animation: unveil 1.3s cubic-bezier(.2, .7, .2, 1) both;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-photo.vacio { display: grid; place-items: center; }
.hero-photo.vacio::after {
  content: "Foto de portada por agregar"; font: 400 .875rem var(--sans); color: var(--suave);
}
@keyframes unveil { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }

.btn {
  display: inline-block; text-decoration: none;
  font: 500 .9375rem var(--sans);
  padding: .95rem 1.7rem;
  background: var(--tinta); color: var(--papel);
  border: 1px solid var(--tinta);
  transition: background-color .2s, color .2s;
}
.btn:hover { background: transparent; color: var(--tinta); }
.btn.secundario { background: transparent; color: var(--tinta); border-color: var(--linea); }
.btn.secundario:hover { border-color: var(--tinta); }

/* ---------- filtros ---------- */
.filters-wrap {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--papel) 94%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--linea);
  border-bottom: 1px solid var(--linea);
}
.filters {
  max-width: var(--max); margin: 0 auto;
  padding: .3rem var(--pad);
  display: flex; gap: clamp(1rem, 3vw, 2.25rem);
  overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: .9rem 0; white-space: nowrap;
  font: 400 .9375rem var(--sans); color: var(--suave);
}
.filters button:hover { color: var(--tinta); }
.filters button[aria-selected="true"] { color: var(--tinta); border-bottom-color: var(--bronce); }
.filters .n { font-size: .75rem; margin-left: .35rem; opacity: .7; }

/* ---------- cuadrícula ---------- */
.grid {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4.5rem) var(--pad) clamp(3rem, 6vw, 6rem);
  display: flex; align-items: flex-start;
  gap: clamp(1.25rem, 3.2vw, 3.25rem);
}
.col { flex: 1 1 0; min-width: 0; }
.card {
  display: block; width: 100%;
  margin: 0 0 clamp(2rem, 4.5vw, 3.75rem);
  padding: 0; border: 0; background: none; text-align: left;
}
.frame {
  display: block; position: relative; overflow: hidden;
  background: var(--arena); aspect-ratio: 4 / 5;
}
.frame img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}
.card:hover .frame img { transform: scale(1.035); }
.frame.vacio { display: grid; place-items: center; background: var(--arena); }
.frame.vacio::after {
  content: "Foto por agregar"; font: 400 .8125rem var(--sans); color: var(--suave);
}
.cap {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; padding-top: .85rem;
}
.name { font-size: 1.2rem; line-height: 1.25; font-weight: 400; }
.price { font: 400 .875rem var(--sans); color: var(--suave); white-space: nowrap; }
.price small { font-size: .75rem; margin-left: .25rem; }
.price.consultar { font-style: normal; }
.badges { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.badge {
  font: 500 .6875rem var(--sans); padding: .15rem .5rem;
  background: var(--tinta); color: var(--papel);
}

/* ---------- contacto ---------- */
.contacto { background: var(--arena); }
.contacto-inner {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) var(--pad);
}
.contacto h2 {
  margin: 0 0 1rem; font-weight: 300;
  font-size: clamp(2.25rem, 5vw, 4rem); line-height: 1.05; letter-spacing: -.02em;
}
.contacto p { max-width: 34rem; margin: 0 0 2rem; font-size: 1.15rem; color: var(--suave); }
.contacto-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.site-footer {
  max-width: var(--max); margin: 0 auto;
  padding: 2.5rem var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.site-footer img { height: 44px; width: auto; }
.site-footer p { margin: 0; font: 400 .875rem var(--sans); color: var(--suave); }

/* ---------- ventana de detalle ---------- */
dialog {
  border: 0; padding: 0; margin: auto;
  width: min(1180px, 94vw); height: min(800px, 92vh);
  background: var(--papel); color: var(--tinta);
  overflow: hidden;
}
dialog[open] { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); animation: aparecer .28s ease-out; }
dialog::backdrop { background: rgba(43, 34, 26, .62); backdrop-filter: blur(3px); }
@keyframes aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.dlg-media {
  background: var(--arena);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.dlg-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; }
.dlg-stage img {
  position: absolute; inset: clamp(1rem, 3vw, 2.5rem);
  width: calc(100% - 2 * clamp(1rem, 3vw, 2.5rem));
  height: calc(100% - 2 * clamp(1rem, 3vw, 2.5rem));
  object-fit: contain;
}
.dlg-stage .vacio-msg { font: 400 .9375rem var(--sans); color: var(--suave); }
.dlg-thumbs { display: flex; gap: .6rem; padding: 0 1.25rem 1.25rem; justify-content: center; }
.dlg-thumbs:empty, .dlg-thumbs:has(button:only-child) { display: none; }
.dlg-thumbs button {
  width: 64px; height: 64px; padding: 0; border: 1px solid transparent;
  background: var(--arena-2); opacity: .65; overflow: hidden;
}
.dlg-thumbs button[aria-current="true"] { opacity: 1; border-color: var(--tinta); }
.dlg-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.dlg-info { position: relative; display: flex; flex-direction: column; min-height: 0; }
.dlg-close {
  position: absolute; top: 1rem; right: 1.25rem; z-index: 2;
  background: var(--papel); border: 0; padding: .4rem .2rem;
  font: 400 .9375rem var(--sans); border-bottom: 1px solid var(--linea);
}
.dlg-close:hover { border-bottom-color: var(--tinta); }
.dlg-body { flex: 1; overflow-y: auto; padding: clamp(1.75rem, 3.5vw, 3rem); padding-top: 3.25rem; }
.dlg-body h2 {
  margin: 0; font-weight: 300; font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05; letter-spacing: -.02em;
}
.dlg-sub { margin: .8rem 0 0; font-style: italic; color: var(--suave); font-size: 1.1rem; line-height: 1.45; }
.dlg-sub span { display: block; }

.facts { margin: 1.75rem 0 0; }
.facts div {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem;
  padding: .7rem 0; border-top: 1px solid var(--linea);
  font-size: 1rem;
}
.facts div:last-child { border-bottom: 1px solid var(--linea); }
.facts dt { font: 400 .875rem var(--sans); color: var(--suave); padding-top: .12rem; }
.facts dd { margin: 0; }
.facts dd.pendiente { color: var(--suave); font-style: italic; }
.facts .precio dd { font-size: 1.15rem; }

.dlg-texto { margin-top: 2.25rem; }
.dlg-texto h3 { margin: 0 0 .9rem; font: 500 .9375rem var(--sans); color: var(--bronce); }
.dlg-texto p { margin: 0 0 1rem; max-width: 38rem; line-height: 1.7; font-size: 1.075rem; }
.dlg-nota {
  margin-top: 1.75rem; padding: .8rem 1rem;
  border: 1px dashed var(--bronce); font: 400 .8125rem/1.5 var(--sans); color: var(--suave);
}
.dlg-cta { margin-top: 2rem; display: flex; gap: .7rem; flex-wrap: wrap; }
.dlg-cta .btn { padding: .85rem 1.4rem; }

.dlg-nav {
  display: flex; justify-content: space-between;
  padding: .9rem clamp(1.75rem, 3.5vw, 3rem);
  border-top: 1px solid var(--linea);
}
.dlg-nav button { background: none; border: 0; padding: .3rem 0; font: 400 .9375rem var(--sans); color: var(--suave); }
.dlg-nav button:hover { color: var(--tinta); }

/* ---------- adaptación ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero-photo { justify-self: stretch; aspect-ratio: 4 / 4.4; max-height: none; }
}
@media (max-width: 820px) {
  dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; }
  dialog[open] { grid-template-columns: 1fr; grid-template-rows: minmax(0, 42dvh) minmax(0, 1fr); }
  .dlg-thumbs { padding-bottom: .6rem; }
  .dlg-info { position: static; }
  .dlg-close { top: .75rem; right: .75rem; padding: .45rem .8rem; border: 0; }
  .facts div { grid-template-columns: 6.5rem 1fr; }
}
@media (max-width: 560px) {
  .site-header nav { gap: 1.25rem; }
  .brand img { height: 46px; }
  .name { font-size: 1.05rem; }
  .cap { flex-direction: column; gap: .15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-photo, dialog[open] { animation: none; }
  .frame img { transition: none; }
  .card:hover .frame img { transform: none; }
}
