/* =========================================================
   IL REGISTRO — private search & price barometer.
   Same house rules: sharp corners everywhere, hairlines as
   structure, one claret accent, no pure black, no glow.
   ========================================================= */

/* ---------- header trigger ---------- */
.brand-group { display: flex; align-items: baseline; gap: clamp(1.2rem, 3vw, 2.6rem); }
.registro-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--grot);
  font-size: 0.6563rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-bottom: 0.3em;
  box-shadow: 0 1px 0 var(--claret);
  transition: color 0.4s var(--ease-lux);
}
.registro-trigger:hover { color: var(--claret); }
.registro-trigger svg { width: 15px; height: 15px; display: block; }
.registro-trigger--nav { display: none; }
@media (max-width: 1180px) { .registro-trigger .rt-long { display: none; } }
@media (max-width: 900px) {
  .site-header > .brand-group .registro-trigger { display: none; }
  .registro-trigger--nav { display: inline-flex; font-size: 0.85rem; }
}

/* ---------- overlay shell ---------- */
.registro-overlay {
  position: fixed;
  inset: 0;
  z-index: 6500;
  background: var(--parchment);
  color: var(--ink);
  display: none;
  flex-direction: column;
}
.registro-overlay.is-open { display: flex; }

.registro-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.4rem var(--gutter) 1.2rem;
  border-bottom: var(--hairline);
  flex: none;
}
.registro-bar .rb-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.registro-bar .rb-title i { font-style: normal; color: var(--claret); }
.registro-close {
  font-family: var(--grot);
  font-size: 0.6563rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-bottom: 0.3em;
  box-shadow: 0 1px 0 var(--claret);
}
.registro-close:hover { color: var(--claret); }

.registro-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.registro-stage {
  padding: clamp(2rem, 5vh, 3.5rem) var(--gutter) clamp(4rem, 8vh, 6rem);
}

/* ---------- the auction sheet (search form) ---------- */
.registro-lede { max-width: 44em; margin-bottom: clamp(2rem, 5vh, 3rem); }
.registro-lede h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.9rem, 3.6vw, 3.1rem);
  line-height: 1.1;
  margin-bottom: 0.9rem;
}
.registro-lede h2 em { color: var(--claret); }
.registro-lede p { font-style: italic; opacity: 0.85; }

.sheet { border-top: var(--hairline); }
.sheet-row {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1.5rem 2.5rem;
  padding: clamp(1.1rem, 2.4vh, 1.7rem) 0;
  border-bottom: var(--hairline);
  align-items: start;
}
.sheet-row > .label { padding-top: 0.5em; }
@media (max-width: 760px) { .sheet-row { grid-template-columns: 1fr; gap: 0.8rem; } }

/* flat inputs — claret hairline at focus, never a glow */
.sheet input[type='text'],
.sheet input[type='number'],
.sheet input[type='email'] {
  width: 100%;
  max-width: 30rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(23, 35, 28, 0.35);
  font-family: var(--body);
  font-size: 1.05rem;
  color: var(--ink);
  padding: 0.4em 0 0.55em;
  transition: border-color 0.45s var(--ease-lux);
}
.sheet input:focus { outline: none; border-bottom-color: var(--claret); }
.sheet ::placeholder { color: var(--greige); font-style: italic; }

/* square toggles & chips */
.chiprow { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  font-family: var(--grot);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.7em 1.1em;
  border: 1px solid rgba(23, 35, 28, 0.35);
  background: transparent;
  color: var(--ink);
  transition: background-color 0.4s var(--ease-lux), color 0.4s var(--ease-lux), border-color 0.4s var(--ease-lux);
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed='true'] {
  background: var(--racing-green);
  border-color: var(--racing-green);
  color: var(--parchment);
}

/* zone autocomplete */
.zone-wrap { position: relative; max-width: 30rem; display: flex; gap: 1.6rem; align-items: baseline; }
.zone-wrap .zone-input-wrap { position: relative; flex: 1; }
.zone-suggest {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--parchment);
  border: var(--hairline);
  border-top: 0;
  z-index: 20;
  display: none;
}
.zone-suggest.is-open { display: block; }
.zone-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7em 1em;
  font-family: var(--grot);
  font-size: 0.6563rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(185, 175, 156, 0.4);
}
.zone-suggest button:last-child { border-bottom: 0; }
.zone-suggest button:hover { background: var(--stone); color: var(--claret); }
.radius-wrap { display: flex; align-items: baseline; gap: 0.7rem; white-space: nowrap; }
.radius-wrap input { width: 4.5rem; text-align: right; }

/* dual sliders — hairline track, square handles */
.range-dual { max-width: 30rem; }
.range-vals {
  display: flex;
  justify-content: space-between;
  font-family: var(--serif);
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
}
.range-track {
  position: relative;
  height: 26px;
}
.range-track::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: rgba(23, 35, 28, 0.35);
}
.range-fill {
  position: absolute;
  top: calc(50% - 1px);
  height: 3px;
  background: var(--racing-green);
}
.range-track input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  inset: 0;
  width: 100%;
  background: transparent;
  pointer-events: none;
  margin: 0;
}
.range-track input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px; height: 13px;
  background: var(--ink);
  border: 1px solid var(--parchment);
  pointer-events: auto;
  cursor: ew-resize;
  margin-top: 0;
}
.range-track input[type='range']::-moz-range-thumb {
  width: 13px; height: 13px;
  background: var(--ink);
  border: 1px solid var(--parchment);
  border-radius: 0;
  pointer-events: auto;
  cursor: ew-resize;
}
.range-track input[type='range']:focus-visible::-webkit-slider-thumb { outline: 1px solid var(--claret); outline-offset: 3px; }

/* square steppers */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid rgba(23, 35, 28, 0.35); }
.stepper button {
  width: 2.4rem;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.1rem;
  transition: background-color 0.35s, color 0.35s;
}
.stepper button:hover { background: var(--ink); color: var(--parchment); }
.stepper .st-val {
  min-width: 3.2rem;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 1.05rem;
  border-left: 1px solid rgba(23, 35, 28, 0.35);
  border-right: 1px solid rgba(23, 35, 28, 0.35);
  padding: 0.5em 0.4em;
}
.stepper-row { display: flex; gap: 2.4rem; flex-wrap: wrap; }
.stepper-row .label { display: block; margin-bottom: 0.55rem; }

.sheet-cta {
  display: flex;
  align-items: baseline;
  gap: 2.5rem;
  padding-top: clamp(1.8rem, 4vh, 2.6rem);
  flex-wrap: wrap;
}
.registro-note { font-size: 0.85rem; opacity: 0.6; font-style: italic; max-width: 34em; }

/* ---------- results layout ---------- */
.registro-stage.is-results {
  display: grid;
  grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 4.5rem);
  align-items: start;
}
.registro-stage.is-results .registro-lede { display: none; }
.registro-stage.is-results .sheet-panel { position: sticky; top: 0; }
.registro-stage.is-results .sheet-row { grid-template-columns: 1fr; gap: 0.7rem; padding: 1.1rem 0; }
.registro-stage.is-results .sheet input[type='text'] { max-width: none; }
.registro-stage.is-results .range-dual { max-width: none; }
.registro-stage.is-results .sheet-cta { display: none; }
.sheet-panel .sp-title { display: none; }
.registro-stage.is-results .sheet-panel .sp-title {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
}
@media (max-width: 980px) {
  .registro-stage.is-results { grid-template-columns: 1fr; }
  .registro-stage.is-results .sheet-panel { position: static; }
  .registro-stage.is-results .sheet-panel .sheet { display: none; }
  .registro-stage.is-results .sheet-panel.is-expanded .sheet { display: block; }
  .sp-title { cursor: pointer; box-shadow: 0 1px 0 var(--claret); display: inline-block; }
}

/* summary line */
.registro-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem 2.2rem;
  border-bottom: var(--hairline);
  padding-bottom: 1.1rem;
  margin-bottom: clamp(1.6rem, 3.5vh, 2.4rem);
}
.registro-summary .rs-n {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  line-height: 1;
}
.registro-summary .rs-n b { font-weight: 400; color: var(--claret); }
.registro-summary .rs-avg { font-style: italic; opacity: 0.8; }
.registro-summary .rs-demo { margin-left: auto; font-size: 0.72rem; opacity: 0.55; font-style: italic; }

/* results grid */
.registro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: clamp(1.6rem, 3vw, 2.8rem);
}

/* listing card */
.annuncio {
  display: block;
  text-align: left;
  border-bottom: var(--hairline);
  padding-bottom: 1.4rem;
}
.annuncio .an-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  margin-bottom: 1rem;
}
.annuncio .an-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.78) sepia(0.1) contrast(0.97);
  transition: transform 1.3s var(--ease-lux);
}
.annuncio:hover .an-img img { transform: scale(1.05); }
.annuncio .an-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(199, 165, 157, 0.1), rgba(23, 35, 28, 0.14));
  pointer-events: none;
}
.an-src {
  position: absolute;
  top: 0; left: 0;
  background: rgba(23, 35, 28, 0.85);
  color: var(--parchment);
  font-family: var(--grot);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.5em 0.9em;
}
.an-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.an-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.2;
}
.an-price {
  font-family: var(--serif);
  font-size: 1.2rem;
  white-space: nowrap;
}
.an-price small { display: block; font-family: var(--grot); font-size: 0.55rem; letter-spacing: 0.14em; text-transform: uppercase; text-align: right; opacity: 0.6; }
.an-meta { margin: 0.4rem 0 0.9rem; }
.an-meta .label { display: inline; }
.an-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.85rem;
  opacity: 0.85;
  border-top: 1px solid rgba(185, 175, 156, 0.45);
  padding-top: 0.7rem;
}

/* ---------- the barometer ---------- */
.gauge-block { margin-top: 1rem; }
.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.gauge-name { font-size: 0.55rem; opacity: 0.6; }
.gauge-fascia { font-family: var(--grot); font-size: 0.6563rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; }
.gauge-fascia.f-ottimo, .gauge-fascia.f-buono { color: var(--racing-green); }
.gauge-fascia.f-equo { color: var(--slate); }
.gauge-fascia.f-sopra, .gauge-fascia.f-molto_sopra { color: var(--claret); }

.gauge {
  position: relative;
  height: 8px;
  display: flex;
  gap: 2px;
}
.gauge .seg { flex: 1; height: 100%; opacity: 0.28; transition: opacity 0.6s var(--ease-lux); }
.gauge .seg-1 { background: var(--racing-green); }
.gauge .seg-2 { background: var(--pine); }
.gauge .seg-3 { background: var(--greige); }
.gauge .seg-4 { background: var(--claret); opacity: 0.18; }
.gauge .seg-5 { background: var(--claret); }
.gauge .seg.is-lit { opacity: 1; }
.gauge-needle {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  background: var(--ink);
  transform: translateX(-1px);
}
.gauge-needle::after {
  content: '';
  position: absolute;
  top: -4px; left: -3px;
  width: 8px; height: 4px;
  background: var(--ink);
}
.gauge-micro {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  font-style: italic;
  opacity: 0.75;
}
.gauge-nodata { font-size: 0.8rem; font-style: italic; opacity: 0.6; border-top: 1px solid rgba(185, 175, 156, 0.45); padding-top: 0.7rem; margin-top: 1rem; }
.gauge-how {
  margin-top: 0.4rem;
  font-family: var(--grot);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 1px 0 var(--claret);
  padding-bottom: 0.25em;
}
.gauge-how:hover { color: var(--claret); }
.gauge-how-body {
  display: none;
  margin-top: 0.7rem;
  font-size: 0.82rem;
  font-style: italic;
  opacity: 0.75;
  border-left: 1px solid var(--claret);
  padding-left: 0.9rem;
}
.gauge-how-body.is-open { display: block; }

/* loading — the drawing ridge, centred over the whole grid */
.registro-loading {
  grid-column: 1 / -1;
  padding: clamp(3rem, 10vh, 6rem) 0;
  text-align: center;
  color: var(--ink);
}
.registro-loading .label { display: block; margin-top: 1.4rem; }

/* skeletons — kept for slower per-card refreshes */
.skel { border-bottom: var(--hairline); padding-bottom: 1.4rem; }
.skel .sk-img { aspect-ratio: 4 / 3; background: var(--stone); }
.skel .sk-line { height: 0.9rem; background: var(--stone); margin-top: 0.9rem; }
.skel .sk-line.short { width: 55%; }
.skel .sk-img, .skel .sk-line { animation: skpulse 1.6s var(--ease-lux) infinite; }
@keyframes skpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* empty + load more */
.registro-empty { padding: clamp(2.5rem, 8vh, 5rem) 0; max-width: 34em; }
.registro-empty h3 {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  margin-bottom: 0.8rem;
}
.registro-empty p { font-style: italic; opacity: 0.8; }
.registro-more-wrap { display: flex; justify-content: center; padding-top: clamp(2rem, 5vh, 3rem); }

/* ---------- detail view ---------- */
.registro-detail .rd-back { margin-bottom: clamp(1.6rem, 4vh, 2.6rem); }
.rd-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 4.5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 900px) { .rd-grid { grid-template-columns: 1fr; } }
.rd-imgs .rd-hero { aspect-ratio: 4 / 3; overflow: hidden; position: relative; }
.rd-imgs .rd-hero img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.78) sepia(0.1) contrast(0.97); }
.rd-imgs .rd-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(199, 165, 157, 0.1), rgba(23, 35, 28, 0.12)); }
.rd-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.rd-thumbs button { aspect-ratio: 4 / 3; overflow: hidden; border: 1px solid transparent; }
.rd-thumbs button.is-active { border-color: var(--claret); }
.rd-thumbs img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.78) sepia(0.1) contrast(0.97); }

.rd-title { font-family: var(--serif); font-weight: 300; font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.08; }
.rd-place { margin-top: 0.7rem; }
.rd-desc { margin-top: 1.1rem; max-width: 38em; font-size: 1.02rem; }
.rd-price { font-family: var(--serif); font-size: 1.6rem; margin-top: 1.3rem; }
.rd-price small { font-size: 0.9rem; font-style: italic; opacity: 0.7; }
.rd-gauge { margin: 1.6rem 0 0; border-top: var(--hairline); padding-top: 1.3rem; }
.rd-specs { margin-top: 1.6rem; border-top: var(--hairline); }
.rd-specs .spec-row { padding: 0.85rem 0; }
.rd-sources { margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.8rem 1.8rem; align-items: baseline; }
.rd-map {
  margin-top: 1.8rem;
  border: var(--hairline);
  padding: 0.8rem;
}
.rd-map svg { width: 100%; height: auto; display: block; }
.rd-map .rm-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-top: 0.7rem; }
.rd-enquiry { margin-top: 2.2rem; border-top: var(--hairline); padding-top: 1.6rem; }
.rd-enquiry h4 { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; margin-bottom: 0.5rem; }
.rd-enquiry .re-note { font-style: italic; opacity: 0.75; margin-bottom: 1.4rem; font-size: 0.95rem; }
.rd-enquiry .form-field label { opacity: 0.7; }
.rd-enquiry input, .rd-enquiry textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(23, 35, 28, 0.35);
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  padding: 0.45em 0 0.6em;
}
.rd-enquiry input:focus, .rd-enquiry textarea:focus { outline: none; border-bottom-color: var(--claret); }
.rd-enquiry textarea { min-height: 5em; resize: vertical; }
.rd-enquiry .form-field { margin-bottom: 1.5rem; }

/* entrance state for cards (removed the same tick they animate in) */
html.js .registro-overlay .rv-clip { clip-path: inset(0 0 100% 0); }

/* the article-cards behave as links */
.annuncio { cursor: pointer; }

/* detail state hides the sheet and the grid */
.registro-stage.is-detail .sheet-panel,
.registro-stage.is-detail .registro-results,
.registro-stage.is-detail .registro-lede { display: none; }

@media (prefers-reduced-motion: reduce) {
  html.js .registro-overlay .rv-clip { clip-path: none; }
  .skel .sk-img, .skel .sk-line { animation: none; }
}
