/* =========================================================
   Neighborhood Market Analysis – Luxury Design
   Matches: "$2M+ Luxury Market Data" design spec
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&family=Montserrat:wght@400;500;600;700&display=swap');

:root {
  --nma-navy:        #1a3a5c;
  --nma-navy-light:  #2d5a8c;
  --nma-gold:        #b8965a;
  --nma-text:        #2c3e50;
  --nma-text-muted:  #7a8a9a;
  --nma-border:      #d8dfe8;
  --nma-bg:          #f7f9fc;
  --nma-white:       #ffffff;
  --nma-positive:    #2a6e4e;
  --nma-negative:    #a33030;
  --nma-radius:      6px;
  --nma-shadow:      0 2px 20px rgba(26,58,92,.08);
}

/* ── Wrapper ── */
.nma-luxury-wrap {
  font-family: 'Montserrat', -apple-system, sans-serif;
  color: var(--nma-text);
  background: var(--nma-white);
  border: 1px solid #e4e9f0;
  border-radius: 10px;
  padding: 48px 52px 36px;
  box-shadow: var(--nma-shadow);
  max-width: 1060px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* ── Header: Title + Divider ── */
.nma-luxury-header {
  text-align: center;
  margin-bottom: 30px;
}

.nma-luxury-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--nma-navy);
  margin: 0 0 18px;
  line-height: 1.3;
}

.nma-luxury-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.nma-luxury-divider span {
  display: block;
  width: 52px;
  height: 2px;
  background: var(--nma-navy);
  opacity: .35;
  border-radius: 2px;
}

/* ── Description / Body Copy ── */
.nma-luxury-description {
  text-align: center;
  margin-bottom: 40px;
  padding: 0 20px;
}
.nma-luxury-description p {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.0rem;
  line-height: 1.75;
  color: var(--nma-text);
  margin: 0;
  max-width: 800px;
  margin-inline: auto;
}

/* ── Body: Stats + Map side-by-side ── */
.nma-luxury-body {
  display: flex;
  gap: 48px;
  align-items: center;
  margin-bottom: 32px;
}
.nma-luxury-body--with-map .nma-luxury-stats {
  flex: 1 1 auto;
}
.nma-luxury-body:not(.nma-luxury-body--with-map) .nma-luxury-stats {
  width: 100%;
}

/* ── Map Image ── */
.nma-luxury-map {
  flex: 0 0 360px;
  width: 360px;
}
.nma-luxury-map img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(26,58,92,.15);
}

/* ── Stat Rows ── */
.nma-luxury-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nma-luxury-stat-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid #edf0f5;
}
.nma-luxury-stat-row:first-child {
  padding-top: 0;
}
.nma-luxury-stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ── Icons ── */
.nma-luxury-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  color: var(--nma-navy);
  opacity: .8;
}
.nma-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
}
.nma-icon-svg svg {
  width: 44px;
  height: 44px;
  display: block;
}

/* ── Stat Numbers + Labels ── */
.nma-luxury-stat-body {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: nowrap;
  line-height: 1;
}

.nma-luxury-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--nma-navy);
  letter-spacing: -.02em;
  line-height: 1;
  white-space: nowrap;
}

.nma-luxury-label {
  font-family: 'Montserrat', sans-serif;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--nma-navy);
  opacity: .65;
  white-space: normal;
  max-width: 200px;
  line-height: 1.4;
  align-self: center;
}

/* ── Footer ── */
.nma-luxury-footer {
  margin-top: 24px;
}

.nma-luxury-rule {
  border: none;
  border-top: 1px solid var(--nma-border);
  margin: 0 0 14px;
}

.nma-luxury-source {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: .8rem;
  color: var(--nma-text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.6;
}

/* ── Optional section (trend/sales) ── */
.nma-luxury-section {
  margin-bottom: 32px;
}
.nma-luxury-section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--nma-navy);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--nma-border);
}

/* ── Classic Stat Cards ([market_stats]) ── */
.nma-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.nma-card {
  background: var(--nma-white);
  border: 1px solid var(--nma-border);
  border-top: 3px solid var(--nma-navy);
  border-radius: var(--nma-radius);
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--nma-shadow);
  text-align: center;
}
.nma-card__value {
  font-family: 'Playfair Display', serif;
  font-size: 1.65rem;
  font-weight: 700;
  font-style: italic;
  color: var(--nma-navy);
  line-height: 1.1;
}
.nma-card__label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--nma-text-muted);
}

/* ── Trend chart ── */
.nma-trend {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.nma-trend__col {
  flex: 1;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.nma-trend__bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  padding: 0 3px;
}
.nma-trend__bar {
  width: 100%;
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background: var(--nma-navy);
  transition: background .2s;
  cursor: default;
}
.nma-trend__bar:hover { background: var(--nma-gold); }
.nma-trend__label {
  font-size: .62rem;
  color: var(--nma-text-muted);
  font-weight: 600;
  margin-top: 5px;
  white-space: nowrap;
}
.nma-trend__count {
  font-size: .58rem;
  color: var(--nma-text-muted);
}

/* ── Sales Table ── */
.nma-table-wrap {
  overflow-x: auto;
  border-radius: var(--nma-radius);
  border: 1px solid var(--nma-border);
  box-shadow: 0 1px 6px rgba(26,58,92,.06);
}
.nma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  background: var(--nma-white);
}
.nma-table thead tr { background: var(--nma-navy); color: #fff; }
.nma-table th {
  padding: 11px 14px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}
.nma-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--nma-border);
  vertical-align: middle;
}
.nma-table tbody tr:last-child td { border-bottom: none; }
.nma-table tbody tr:nth-child(even) { background: var(--nma-bg); }
.nma-table tbody tr:hover { background: #eef3f9; }
.nma-address { font-weight: 600; color: var(--nma-navy); }
.nma-price { font-weight: 700; }
.nma-over-list  { color: var(--nma-positive); }
.nma-under-list { color: var(--nma-negative); }

/* ── Utilities ── */
.nma-error, .nma-empty {
  padding: 12px 18px;
  background: var(--nma-bg);
  border-left: 3px solid var(--nma-gold);
  color: var(--nma-text-muted);
  font-size: .88rem;
  border-radius: 0 4px 4px 0;
}
.nma-error { border-color: var(--nma-negative); }
.nma-inline-stat { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700; color: var(--nma-navy); }

/* ── Responsive ── */
@media (max-width: 800px) {
  .nma-luxury-body { flex-direction: column; gap: 32px; }
  .nma-luxury-map  { flex: 1 1 auto; width: 100%; }
  .nma-luxury-wrap { padding: 32px 24px 28px; }
  .nma-luxury-value { font-size: 2rem; }
}

@media (max-width: 520px) {
  .nma-luxury-wrap { padding: 24px 16px 22px; }
  .nma-luxury-title { font-size: .88rem; letter-spacing: .18em; }
  .nma-luxury-stat-body { flex-wrap: wrap; gap: 6px; }
  .nma-luxury-value { font-size: 1.7rem; }
  .nma-luxury-label { max-width: 100%; }
  .nma-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
