/* ==========================================================================
   Real estate, one listing (pages/estate.php, assets/js/estate.js), over the list's palette and cards
   (assets/css/estates.css). Five pictures in a block and a viewer for all of them; the price card stays beside the
   reading; the figures that matter sit on a strip of plan paper, the size under a dimension line like an
   architect's drawing; the full list of fields, the description, the map, the developer, more homes.
   ========================================================================== */
.ed-head, .ed-gallery, .ed-body, .ed-more { max-width: 1320px; margin-inline: auto; }
.ed-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "crumbs crumbs" "gone gone" "main price"; column-gap: 40px; align-items: end; }
.ed-head .crumbs { grid-area: crumbs; color: var(--r-ink-2); }
.ed-head__main { grid-area: main; min-width: 0; }
.ed-head__price { grid-area: price; display: flex; flex-direction: column; align-items: flex-end; margin: 0 0 4px; text-align: end; white-space: nowrap; }
.ed-head__price b { font-family: var(--font-display); font-size: clamp(26px, 2.8vw, 38px); font-weight: 800; line-height: 1.25; }
.ed-head__price span { color: var(--r-ink-2); font-size: 14px; }
.ed-head__price small { color: var(--r-ink-2); font-size: 13px; }
.ed-head .crumbs li:last-child { max-width: 32ch; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ed-gone { grid-area: gone; margin: 18px 0 0; padding: 12px 16px; border-radius: 14px; background: rgb(201 138 30 / .14); color: var(--ochre-ink); font-weight: 700; line-height: 1.8; }
.ed .es-eyebrow { flex-wrap: wrap; margin-top: 20px; color: var(--r-ink-2); font-weight: 600; }
.ed .es-eyebrow .es-deal { position: static; background: var(--ochre); color: #fff; }
.ed .es-eyebrow .es-deal--sale { background: var(--r-ink); }
.ed .es-eyebrow .es-deal--rent { background: #2C5E7A; }
.ed .es-eyebrow a { color: var(--r-ink); font-weight: 700; text-decoration: underline; text-decoration-color: rgb(31 34 48 / .3); text-underline-offset: 4px; }
.ed-title { max-width: 26em; margin: 12px 0 0; font-family: var(--font-display); font-size: clamp(26px, 3.2vw, 42px); font-weight: 800; line-height: 1.3; text-wrap: balance; }
.ed-addr { display: flex; align-items: flex-start; gap: 8px; max-width: 70ch; margin: 12px 0 0; color: var(--r-ink-2); font-size: 14px; line-height: 1.8; }
.ed-addr svg { flex: none; width: 18px; height: 18px; margin-top: 3px; fill: none; stroke: var(--ochre); stroke-width: 1.8; }

/* ---------- the pictures: one large and four small, all of them in the viewer ---------- */
.ed-gallery {
  position: relative; display: grid; gap: 8px; height: clamp(320px, 46vw, 560px); margin-top: 26px;
  grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr;
}
.ed-gallery--1 { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.ed-gallery--2 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr; }
.ed-gallery--3 { grid-template-columns: 2fr 1fr; }
.ed-gallery--4 { grid-template-columns: 2fr 1fr 1fr; }
.ed-gallery--4 .ed-shot:nth-of-type(4) { grid-column: span 2; }
.ed-shot { position: relative; padding: 0; overflow: hidden; border: 0; border-radius: 10px; background: var(--mist); cursor: zoom-in; }
.ed-shot:first-of-type { grid-row: span 2; border-start-start-radius: 26px; border-end-start-radius: 26px; }
.ed-gallery--1 .ed-shot:first-of-type, .ed-gallery--2 .ed-shot:first-of-type { grid-row: auto; }
.ed-gallery--1 .ed-shot { border-radius: 26px; }
.ed-gallery .ed-shot:nth-of-type(3), .ed-gallery--2 .ed-shot:nth-of-type(2) { border-start-end-radius: 26px; }
.ed-gallery .ed-shot:last-of-type:not(:first-of-type) { border-end-end-radius: 26px; }
.ed-gallery--3 .ed-shot:nth-of-type(2) { border-start-end-radius: 26px; }
.ed-gallery--3 .ed-shot:nth-of-type(3) { border-start-end-radius: 10px; }
.ed-shot img { display: block; width: 100%; height: 100%; object-fit: cover; transition: scale .8s var(--ease-out), filter .3s; }
.ed-shot:hover img { scale: 1.035; }
.ed-shot:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.ed-all {
  position: absolute; bottom: 16px; inset-inline-end: 16px; display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px;
  border: 0; border-radius: 999px; background: rgb(253 251 248 / .94); color: var(--r-ink); font: 700 13.5px var(--font-body); cursor: pointer;
  box-shadow: 0 10px 24px -12px rgb(31 34 48 / .6);
}
.ed-all svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* ---------- the reading and the price card ---------- */
.ed-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; margin-top: 34px; }
.ed-side { position: sticky; top: calc(var(--header-h, 76px) + 18px); }

/* the plan strip: plan paper (a faint grid), the size under a dimension line */
.ed-plan {
  display: flex; flex-wrap: wrap; gap: 0; padding: 22px 6px; border-radius: 24px;
  background:
    linear-gradient(rgb(31 34 48 / .045) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgb(31 34 48 / .045) 1px, transparent 1px) 0 0 / 22px 22px,
    var(--card);
  box-shadow: var(--es-shadow);
}
.ed-plan__i { flex: 1 1 120px; padding: 4px 20px; border-inline-start: 1px solid var(--r-line); }
.ed-plan__i:first-child { border: 0; }
.ed-plan__i p { margin: 0; }
.ed-plan__i b { font-family: var(--font-display); font-size: 30px; font-weight: 800; line-height: 1.25; }
.ed-plan__i span { color: var(--r-ink-2); font-size: 13px; font-weight: 600; }
.ed-plan__l { margin-top: 2px !important; color: var(--r-ink-2); font-size: 12.5px; }
.ed-plan__i--area { flex-grow: 1.6; }
.ed-dim { position: relative; display: block; height: 12px; margin-bottom: 8px; border-inline: 1.5px solid var(--ochre); }
.ed-dim::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--ochre); }
.ed-dim::after {   /* the arrowheads at both ends */
  content: ""; position: absolute; inset: 1px 1px; top: 50%; height: 8px; margin-top: -4px;
  background:
    linear-gradient(to top right, transparent 46%, var(--ochre) 48% 56%, transparent 58%) left top / 7px 4px no-repeat,
    linear-gradient(to bottom right, transparent 46%, var(--ochre) 48% 56%, transparent 58%) left bottom / 7px 4px no-repeat,
    linear-gradient(to top left, transparent 46%, var(--ochre) 48% 56%, transparent 58%) right top / 7px 4px no-repeat,
    linear-gradient(to bottom left, transparent 46%, var(--ochre) 48% 56%, transparent 58%) right bottom / 7px 4px no-repeat;
}

.ed-sec { margin-top: 40px; }
.ed-sec h2 { margin: 0 0 16px; font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.ed-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; margin: 0; }
.ed-fields div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 2px; border-bottom: 1px dashed rgb(31 34 48 / .16); }
.ed-fields dt { color: var(--r-ink-2); font-size: 14px; }
.ed-fields dd { margin: 0; font-weight: 700; font-size: 14.5px; text-align: end; }

.ed-text { color: var(--r-ink); font-size: 15.5px; line-height: 2; overflow-wrap: anywhere; }
.ed-text p { margin: 0 0 14px; }
.ed-text ul, .ed-text ol { margin: 0 0 14px; padding-inline-start: 22px; }
.ed-text a { color: var(--ochre-ink); }
.ed-spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 16px; }
.ed-spec div { padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--r-line); }
.ed-spec dt { color: var(--r-ink-2); font-size: 12.5px; line-height: 1.5; }
.ed-spec dd { margin: 2px 0 0; font-weight: 700; font-size: 15px; line-height: 1.5; }

.ed-map { position: relative; z-index: 0; height: 340px; border-radius: 24px; overflow: hidden; background: #E8E1DB; direction: ltr; box-shadow: inset 0 0 0 1px var(--r-line); }
.ed-map .leaflet-tile { filter: grayscale(.92) sepia(.22) contrast(.88) brightness(1.07); }
.ed-map .leaflet-control-attribution { background: rgb(246 238 233 / .8); color: var(--r-ink-2); font-size: 10.5px; }
.ed-map .leaflet-control-attribution a { color: inherit; }
.ed-map .leaflet-bar { border: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 20px -12px rgb(31 34 48 / .55); }
.ed-map .leaflet-bar a { background: rgb(253 251 248 / .94); color: var(--r-ink); }
html:not(.js) .ed-map { display: none; }
.ed-pin { position: absolute; left: 0; bottom: 9px; translate: -50% 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--ochre); box-shadow: 0 10px 20px -8px rgb(90 50 0 / .7); }
.ed-pin::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--mist-hi); }
.ed-pin-at { background: none; border: 0; }
.ed-pin-ring { position: absolute; left: 0; top: 0; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 1.5px dashed rgb(201 138 30 / .7); background: rgb(201 138 30 / .08); }
.ed-where { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin: 12px 0 0; color: var(--r-ink-2); font-size: 13.5px; line-height: 1.8; }

.ed-owner { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: center; padding: 22px; border-radius: 24px; background: var(--card); box-shadow: var(--es-shadow); }
.ed-owner h2 { margin: 2px 0 0; }
.ed-owner__art { display: grid; place-items: center; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; background: var(--mist); }
.ed-owner__art img { width: 100%; height: 100%; object-fit: cover; }
.ed-owner__art .m-bld { width: 92%; height: auto; }
.ed-owner .m-bld__fill > * { fill: var(--mist-hi); }
.ed-owner .m-bld__fill .hill { fill: #E2D8CF; }
.ed-owner .m-bld__lit > * { fill: var(--ochre); opacity: .35; }
.ed-owner .m-bld__ink { fill: none; stroke: var(--r-ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ed-owner .m-bld__bare { fill: none; stroke: var(--r-ink); stroke-width: 1.1; stroke-dasharray: 3 3; opacity: .55; }
.ed-owner__k { margin: 0; color: var(--ochre-ink); font-size: 12.5px; font-weight: 700; }
.ed-owner__about { margin: 8px 0 0; color: var(--r-ink-2); font-size: 14px; line-height: 1.9; }
.ed-owner .es-btn { margin-top: 16px; }
.ed-owner .es-btn i { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--ochre); font-size: 12px; }

/* the price card */
.ed-price { padding: 22px; border-radius: 26px; background: var(--card); box-shadow: 0 1px 0 rgb(255 255 255 / .75) inset, 0 30px 60px -40px rgb(31 34 48 / .6), inset 0 0 0 1px var(--r-line); }
.ed-price__k { margin: 0; color: var(--r-ink-2); font-size: 13px; font-weight: 600; }
.ed-price__v { margin: 6px 0 0; }
.ed-price__v b { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1.3; }
.ed-price__v span { color: var(--r-ink-2); font-size: 14px; }
.ed-price__v.is-ask { color: var(--ochre-ink); font-size: 20px; font-weight: 800; }
.ed-price__per { margin: 2px 0 0; color: var(--r-ink-2); font-size: 13px; }
.ed-terms { margin: 16px 0 0; padding: 12px 0 0; border-top: 1px dashed rgb(31 34 48 / .18); }
.ed-terms div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; }
.ed-terms dt { color: var(--r-ink-2); }
.ed-terms dd { margin: 0; font-weight: 700; }
.ed-cta { width: 100%; min-height: 54px; margin-top: 20px; font-size: 15px; }
.ed-cta svg { width: 22px; height: 22px; stroke-width: 1.6; }
.ed-call { width: 100%; margin-top: 8px; background: transparent; color: var(--r-ink); box-shadow: inset 0 0 0 1.5px rgb(31 34 48 / .2); }
.ed-call:hover { box-shadow: inset 0 0 0 1.5px var(--r-ink); }
.ed-price__note { margin: 16px 0 0; color: var(--r-ink-2); font-size: 12.5px; line-height: 1.9; }
.ed-price__code { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--r-line); color: var(--r-ink-2); font-size: 12.5px; }
.ed-price__code b { color: var(--r-ink); }
.ed-back { display: inline-flex; margin-top: 14px; padding: 6px 4px; color: var(--r-ink-2); font-size: 13.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* more homes */
.ed-more { margin-top: 64px; }
.ed-more h2 { margin: 0 0 18px; font-family: var(--font-display); font-size: 24px; font-weight: 800; }
.ed-more + .ed-more { margin-top: 44px; }

/* ---------- the viewer ---------- */
.ed-viewer {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(18 19 28 / .97); color: #F6EEE9; overflow: hidden;
}
.ed-viewer::backdrop { background: rgb(18 19 28 / .8); }
.ed-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ed-viewer__top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.ed-viewer__n { margin: 0; font: 600 14px var(--font-latin); letter-spacing: .04em; opacity: .8; }
.ed-viewer__x { width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .1); color: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
.ed-viewer__stage { display: grid; place-items: center; min-height: 0; margin: 0; padding: 0 76px; touch-action: pan-y; }
.ed-viewer__stage img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.ed-viewer__go {
  position: absolute; top: 50%; display: grid; place-items: center; width: 52px; height: 52px; margin-top: -26px; border: 0; border-radius: 50%;
  background: rgb(255 255 255 / .1); color: inherit; cursor: pointer; transition: background-color .2s;
}
.ed-viewer__go:hover { background: rgb(255 255 255 / .2); }
.ed-viewer__go svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
html[dir="ltr"] .ed-viewer__go svg { transform: scaleX(-1); }
.ed-viewer__go--prev { inset-inline-start: 14px; }
.ed-viewer__go--next { inset-inline-end: 14px; }
.ed-viewer__strip { display: flex; gap: 8px; margin: 0; padding: 14px 18px 18px; overflow-x: auto; list-style: none; scrollbar-width: none; justify-content: safe center; }
.ed-viewer__strip button { display: block; width: 84px; height: 58px; padding: 0; overflow: hidden; border: 0; border-radius: 10px; background: #000; opacity: .45; cursor: pointer; transition: opacity .2s, box-shadow .2s; }
.ed-viewer__strip button[aria-current="true"] { opacity: 1; box-shadow: 0 0 0 2px var(--ochre); }
.ed-viewer__strip img { width: 100%; height: 100%; object-fit: cover; }
.ed-viewer :focus-visible { outline: 2px solid var(--ochre); outline-offset: 2px; }

/* ---------- narrower ---------- */
@media (max-width: 1099px) {
  .ed-head { grid-template-columns: minmax(0, 1fr); grid-template-areas: "crumbs" "gone" "main"; }
  .ed-head__price { display: none; }
  .ed-body { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .ed-side { position: static; order: -1; }
  .ed-price { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .ed-price > :not(.ed-cta):not(.ed-call) { grid-column: 1; }
  .ed-cta, .ed-call { grid-column: 2; }
  .ed-cta { grid-row: 1 / span 3; align-self: end; margin: 0; }
  .ed-call { grid-row: 4; }
  .ed-back { display: none; }
}
@media (max-width: 760px) {
  .ed-title { font-size: 25px; }
  .ed-addr { font-size: 13px; }
  .ed-gallery { display: flex; gap: 8px; height: auto; margin-inline: -16px; padding: 0 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ed-shot { flex: none; width: 86%; aspect-ratio: 4 / 3; border-radius: 20px !important; scroll-snap-align: center; }
  .ed-all { display: none; }
  .ed-price { display: block; }
  .ed-cta { margin-top: 18px; }
  .ed-plan { padding: 10px 4px; }
  .ed-plan__i { flex-basis: 40%; padding: 12px 16px; }
  .ed-plan__i:nth-child(even) { border-inline-start: 0; }
  .ed-plan__i--area { flex-basis: 100%; border-bottom: 1px solid var(--r-line); }
  .ed-plan__i b { font-size: 25px; }
  .ed-fields { grid-template-columns: minmax(0, 1fr); }
  .ed-owner { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .ed-map { height: 260px; margin-inline: -6px; }
  .ed-viewer__stage { padding: 0 8px; }
  .ed-viewer__go { display: none; }
  .ed-more .es-grid { display: flex; gap: 12px; margin-inline: -16px; padding: 0 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .ed-more .es-card { flex: none; width: 78%; scroll-snap-align: center; }
}
