/* ====================== DEMO ANALYSIS BLOG BLOCKS ======================
   Blog posts render on the light theme (styles.css), but these blocks
   reuse the dark "instrument card" look built for the homepage's product
   section (parity.css .p-rentiq-card / .p-readout expect a dark ancestor
   background — .p-plate provides that there). .da-card supplies the same
   dark backdrop here so those shared classes render correctly. */

.da-card {
  position: relative;
  overflow: hidden;
  background: #2a5043;
  color: #fff;
  border-radius: 20px;
  padding: clamp(22px, 3.4vw, 34px) clamp(20px, 3vw, 30px);
  margin: 28px 0;
}
.da-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(300px 200px at 102% -15%, rgba(111, 211, 171, 0.16), transparent 68%);
}
.da-card > * { position: relative; z-index: 1; }
.da-card .p-rentiq-card-head { margin-bottom: 14px; }

/* Block title (a real article h2) and its badge share one line above the
   card, on the light page background. */
.da-heading-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 16px; margin: 2.5rem 0 1rem;
}
.post-content .da-heading-row .da-heading { margin: 0; }
.da-heading-row + .da-card { margin-top: 0; }
.da-heading-badge {
  font-family: var(--p-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-glow);
  border: 1px solid rgba(61, 142, 114, 0.3);
  border-radius: var(--p-radius-pill); padding: 4px 10px;
}

/* .post-content (styles.css) styles bare h2/h3/img/a inside blog body
   copy — those rules are more specific than a single .da-* class, so
   anything using those tags here must be scoped under .da-card to win. */
.da-card img { margin: 0; max-height: none; }

/* ── title / chips (general block; .da-title is also the city hub's) ── */

.da-card .da-title { margin: 0 0 6px; font-size: clamp(19px, 2.2vw, 24px); font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.da-star { font-family: Arial, sans-serif; color: #f5b400; }
.da-loc { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; font-size: 13.5px; color: rgba(255, 255, 255, 0.6); }
.da-loc-icon { font-size: 8px; color: #6fd3ab; }

.da-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.da-chip {
  font-size: 12.5px; color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--p-radius-pill); padding: 5px 12px;
}

.da-readout { margin-bottom: 16px; }
/* Lift the readout over later card children so its tooltip isn't painted
   under the chart (every .da-card child is its own z-index: 1 layer). */
.da-card > .da-readout { z-index: 2; }

/* "i" icon next to a readout label; the tooltip opens on hover or tap. */
.da-has-info { position: relative; }
.da-info {
  display: inline-grid; place-items: center;
  width: 14px; height: 14px; margin-left: 6px; padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 50%;
  background: none; color: rgba(255, 255, 255, 0.7);
  font: italic 600 9px/1 Georgia, serif; text-transform: none;
  vertical-align: 1px; cursor: help;
}
.da-info:hover, .da-info:focus-visible { color: #fff; border-color: #6fd3ab; outline: none; }
.da-info-tip {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  padding: 10px 12px; border-radius: 8px;
  background: #0f231c; color: rgba(255, 255, 255, 0.88);
  font-size: 12px; line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0; visibility: hidden; transition: opacity 0.15s ease;
}
.da-has-info:hover .da-info-tip,
.da-has-info:focus-within .da-info-tip { opacity: 1; visibility: visible; }
@media (max-width: 720px) {
  .da-info-tip { right: auto; width: min(260px, 75vw); }
}

.da-metric-list { border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 4px; }
.da-metric-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; font-size: 13.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.da-metric-row:last-child { border-bottom: none; }
.da-metric-row span { color: rgba(255, 255, 255, 0.6); }
.da-metric-row b { font-family: var(--p-mono); color: #fff; }
.da-metric-row a { color: #6fd3ab; text-decoration: none; word-break: break-all; }
.da-metric-row a:hover { text-decoration: underline; }

/* ── rental block ── */
.da-rental-headline { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; }
.da-rental-headline b { font-size: clamp(24px, 2.8vw, 30px); font-weight: 700; font-family: var(--p-mono); }
.da-rental-headline span { color: rgba(255, 255, 255, 0.55); font-size: 13px; }

.da-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.da-stat {
  display: flex; flex-direction: column; gap: 4px; text-align: center;
  padding: 12px 8px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.da-stat b { font-family: var(--p-mono); font-size: 15px; color: #fff; }
.da-stat i { font-style: normal; font-size: 10px; color: rgba(255, 255, 255, 0.5); }

.da-chart-wrap { margin: 8px 0 16px; }
.da-chart-label { font-family: var(--p-mono); font-size: 11px; color: rgba(255, 255, 255, 0.5); margin-bottom: 8px; }
.da-chart { width: 100% !important; max-height: 260px; }

.da-range-labels {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.da-range-labels b { font-family: var(--p-mono); }
.da-range-labels i { font-style: normal; display: block; color: rgba(255, 255, 255, 0.45); font-size: 10.5px; margin-top: 2px; }

.da-empty { font-size: 13px; color: rgba(255, 255, 255, 0.5); padding: 16px 0; }
.da-empty--map { padding: 40px 0; text-align: center; background: rgba(255, 255, 255, 0.03); border-radius: 10px; }

/* ── comparables block ──
   The map must stay square (aspect-ratio) regardless of how long the list
   is, so it opts out of the grid's stretch below. The list's max-height is
   synced to the map's actual rendered height in JS (initComparablesMaps) —
   this fallback only covers the instant before that JS runs. */
.da-comparables-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.da-bcomps { display: flex; flex-direction: column; gap: 10px; max-height: 400px; overflow-y: auto; padding-right: 4px; }
.da-bcomp {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-size: 12px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
/* Hovering a map pin (or vice versa — see the JS) highlights the matching
   row so the two panels read as one linked view, not two separate ones. */
.da-bcomp--active {
  background: rgba(111, 211, 171, 0.14);
  box-shadow: inset 0 0 0 1px rgba(111, 211, 171, 0.4);
}
.da-bcomp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.da-bcomp-t { color: rgba(255, 255, 255, 0.75); line-height: 1.4; }
.da-bcomp-t b { color: #fff; }
.da-bcomp-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.da-bcomp-meta-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.da-bcomp-m { font-size: 10.5px; color: #6fd3ab; }
.da-bcomp-d { font-size: 10.5px; color: rgba(255, 255, 255, 0.45); }
.da-bcomp-v { font-family: var(--p-mono); color: #fff; white-space: nowrap; }

.da-map {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.da-map .leaflet-container { background: #eef5f1; font-family: var(--font, inherit); }
/* Tints the map to the site's own sage-green palette (see the SVG filter
   def in deal_page.html) instead of a generic neutral basemap gray. */
.da-map .leaflet-tile-pane { filter: url(#da-map-duotone); }

/* Leaflet's default light chrome (zoom buttons) clashes with the dark
   card — restyle it to match instead of standing out as a mismatched
   white box. (No attribution control is added — see the JS — matching
   the main app's own map.) */
.da-map .leaflet-control-zoom {
  border: none;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  overflow: hidden;
}
.da-map .leaflet-control-zoom a {
  width: 32px; height: 32px; line-height: 32px;
  background: rgba(12, 23, 19, 0.9);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.da-map .leaflet-control-zoom a:last-child { border-bottom: none; }
.da-map .leaflet-control-zoom a:hover { background: rgba(12, 23, 19, 1); }

/* Price tags sit permanently next to each marker (no click-to-open popup,
   nothing to dismiss) — a small pill, not a speech-bubble-with-close-X.
   Deep sage instead of near-black so the tag reads as part of the card
   rather than a harsh cutout against the (also sage-tinted) map. */
.da-price-tag.leaflet-tooltip {
  display: inline-flex;
  align-items: center;
  background: #2c6650;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--p-radius-pill, 999px);
  padding: 3px 9px;
  font-family: var(--p-mono);
  font-size: 11px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  cursor: default;
}
.da-price-tag.leaflet-tooltip::before { display: none; }

/* With 20 comparables the tags stack tightly and clip each other — raise
   whichever one is being read (via :hover or the list-linked state) above
   its neighbors so the expanded match/distance text isn't cut off. */
.da-price-tag.leaflet-tooltip:hover,
.da-price-tag.leaflet-tooltip.da-price-tag--linked {
  z-index: 10000 !important;
}

/* The price is always visible; match %/distance sit collapsed here and
   only expand on hover (or when the matching list row is hovered — the
   --linked class mirrors :hover so both trigger points look identical). */
.da-price-tag-extra {
  display: inline-block;
  max-width: 0;
  margin-left: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.75);
  transition: max-width 0.2s ease, opacity 0.15s ease, margin-left 0.2s ease;
}
.da-price-tag.leaflet-tooltip:hover .da-price-tag-extra,
.da-price-tag.leaflet-tooltip.da-price-tag--linked .da-price-tag-extra {
  max-width: 200px;
  opacity: 1;
  margin-left: 7px;
}

.da-price-tag--subject.leaflet-tooltip {
  background: #f5b400;
  color: #0c1713;
  border-color: #f5b400;
  font-weight: 700;
}

@media (max-width: 720px) {
  /* Stacked single column — map and list are separate rows now, so the
     list needs its own explicit cap (stretch has nothing to match here). */
  .da-comparables-layout { grid-template-columns: 1fr; }
  .da-bcomps { max-height: 320px; }
  .da-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ── renovation block ── */
.da-renovation-intro { margin: 0 0 16px; font-size: 14.5px; color: rgba(255, 255, 255, 0.75); }
.da-renovation-caption { margin: 0 0 4px; font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }
.da-renovation-caption b { color: rgba(255, 255, 255, 0.85); }
.da-renovation-caption .da-renovation-cost { font-family: var(--p-mono); color: rgba(255, 255, 255, 0.6); }
.da-renovation-sentence {
  margin: 16px 0 0; font-size: 14px; line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  border-left: 2px solid #6fd3ab; padding-left: 14px;
}
.da-renovation-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 16px 0 0; padding: 10px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12.5px; color: rgba(255, 255, 255, 0.6);
}
.da-renovation-total b { font-family: var(--p-mono); color: #fff; font-size: 14px; }
.da-room-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.da-room-list li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 8px 0; font-size: 12.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.da-room-list li b { flex-shrink: 0; color: #fff; }
.da-room-list li span { flex: 1; color: rgba(255, 255, 255, 0.6); }
.da-room-list li em {
  flex-shrink: 0; font-style: normal; font-family: var(--p-mono);
  color: rgba(255, 255, 255, 0.6);
}

/* before/after slider — generalized version of parity.css's .p-ba (which
   is a page-singleton); same visuals, supports many instances per page. */
.da-ba {
  position: relative;
  aspect-ratio: 1200 / 717;
  border-radius: 10px;
  overflow: hidden;
  margin: 4px 0 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  cursor: ew-resize;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.da-ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.da-ba-after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.da-ba-divider {
  position: absolute; top: 0; bottom: 0; left: var(--pos, 50%);
  width: 2px; margin-left: -1px; z-index: 3;
  background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.da-ba-handle {
  position: absolute; top: 50%; left: var(--pos, 50%);
  transform: translate(-50%, -50%); z-index: 4;
  width: 46px; height: 46px; border-radius: 50%; padding: 0;
  background: #fff; border: none; cursor: ew-resize;
  display: flex; align-items: center; justify-content: center;
  color: var(--p-accent-deep, #2c6650);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(255, 255, 255, 0.55);
  transition: transform 0.12s ease;
}
.da-ba-handle:hover { transform: translate(-50%, -50%) scale(1.06); }
.da-ba-handle:active { transform: translate(-50%, -50%) scale(0.97); }
.da-ba-handle:focus-visible { outline: 3px solid #71c9a6; outline-offset: 3px; }
.da-ba-handle svg { width: 22px; height: 22px; }
.da-ba-tag {
  position: absolute; bottom: 14px; z-index: 2;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: #fff; background: rgba(12, 23, 19, 0.6);
  padding: 5px 11px; border-radius: var(--p-radius-pill, 999px);
  pointer-events: none;
}
.da-ba-tag--b { left: 14px; }
.da-ba-tag--a { right: 14px; }

@media (prefers-reduced-motion: reduce) {
  .da-ba-handle { transition: none; }
}

/* ── strengths & weaknesses block ── */
/* The grid lives on an inner wrapper: on the card itself it clipped the
   card's ::before glow. */
.da-pc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
/* Same neutral surface as the readout cells; colour only on the markers. */
.da-pc-col {
  --pc: #6fd3ab;
  padding: 16px 18px 6px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.da-pc-col--con { --pc: #f2a1a1; }
.da-pc-title {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-family: var(--p-mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.5);
}
.da-pc-title::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pc); }
.da-pc-title span { color: rgba(255, 255, 255, 0.35); font-weight: 500; }
.da-card .da-pc-list { list-style: none; margin: 0; padding: 0; }
.da-card .da-pc-list li {
  display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 0;
  font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.da-card .da-pc-list li:last-child { border-bottom: none; }
.da-pc-icon {
  flex-shrink: 0; display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  font-size: 10px; font-weight: 700; color: var(--pc);
  background: rgba(255, 255, 255, 0.06);
}
