/* Elm City Explorer, article pages (property record, ownership group, and the
   Findings notes). Tokens, buttons and close buttons come from /css/tokens.css.
   These pages used to carry three drifting copies of the same rules. */

body { min-height: 100vh; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 920px; margin: 0 auto; padding: 24px 24px 80px; }

/* ── Top bar ── */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 48px; padding: 8px 20px;
  background: var(--bg-1); border-bottom: 1px solid var(--border-1);
}
.topnav .brand { font-size: 15px; font-weight: 600; color: var(--text-1); }
.topnav .brand:hover { text-decoration: none; color: var(--text-1); }
.topnav .brand-sub { font-size: var(--text-sm); color: var(--text-3); margin-left: 10px; }
.topnav a.back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--btn-border); border-radius: var(--radius-control);
  background: var(--btn-bg); color: var(--text-1); font-size: var(--text-sm); font-weight: 500; white-space: nowrap;
}
.topnav a.back:hover { background: var(--bg-3); text-decoration: none; }

/* ── Page header ── */
.dossier-header { padding: 20px 0 20px; border-bottom: 1px solid var(--border-1); margin-bottom: 24px; }
.dossier-label, .eyebrow { font-size: var(--text-xs); color: var(--text-3); margin-bottom: 8px; }
.prop-title, .group-title, .page-title {
  font-size: clamp(24px, 2vw + 14px, 32px); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em;
  color: var(--text-1); margin-bottom: 8px; overflow-wrap: anywhere;
  display: flex; align-items: center; gap: 10px;
}
.prop-title .group-dot, .group-title .group-dot { width: 12px; height: 12px; border-radius: 2px; flex-shrink: 0; }
.prop-subtitle, .group-subtitle, .dek { font-size: var(--text-base); color: var(--text-2); }
.prop-header, .group-header { margin-bottom: 8px; }
.group-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; vertical-align: middle; }

/* ── Stat row ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 28px; }
.stat-cell { background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-control); padding: 12px 14px; text-align: left; }
.stat-val { font-size: var(--text-xl); font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; line-height: 1.15; overflow-wrap: anywhere; }
.stat-lbl { font-size: var(--text-xs); color: var(--text-3); margin-top: 4px; }

/* ── Sections ── */
.section { margin-bottom: 32px; }
.section-header { font-size: var(--text-md); font-weight: 600; color: var(--text-1); padding: 6px 0 8px; border-bottom: 1px solid var(--border-1); margin-bottom: 14px; }
.section-header span { white-space: nowrap; }

/* Key-value pairs */
.detail-grid { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: var(--text-sm); padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-control); }
.detail-grid dt { font-size: var(--text-xs); color: var(--text-3); padding-top: 2px; }
.detail-grid dd { color: var(--text-1); overflow-wrap: anywhere; }
.detail-grid dd .muted { color: var(--text-3); font-size: var(--text-xs); }

.status-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px; font-weight: 500; }
.status-active { background: var(--success-soft); color: var(--success); }
.status-inactive { background: var(--error-soft); color: var(--error); }

/* Tables */
.sales-table, .prop-table, .data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.sales-table th, .prop-table th, .data-table th {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border-2);
  font-size: var(--text-xs); color: var(--text-3); font-weight: 500;
}
.sales-table td, .prop-table td, .data-table td { padding: 8px 12px; border-bottom: 1px solid var(--border-1); color: var(--text-2); }
.sales-table th.num, .prop-table th.num, .data-table th.num,
.sales-table td.num, .prop-table td.num, .data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sales-table td.num, .prop-table td.num, .data-table td.num { color: var(--text-1); }
.prop-table tr:hover td { background: var(--bg-2); }
.prop-addr { color: var(--text-1); font-weight: 500; }
.prop-owner { color: var(--text-3); font-size: var(--text-xs); }
.prop-sale { color: var(--text-2); }
.table-scroll { overflow-x: auto; margin: 20px 0; }
.sales-table-hint { display: none; }

/* Group banner on a property page */
.group-banner { background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-control); padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 12px; }
.group-banner .label { font-size: var(--text-xs); color: var(--text-3); margin-bottom: 4px; }
.group-banner .name { font-size: var(--text-md); font-weight: 600; color: var(--text-1); display: flex; align-items: center; gap: 8px; }
.group-banner .stat { font-size: var(--text-sm); color: var(--text-2); margin-top: 4px; }
.group-banner a.dossier-link, .actions a, footer .f-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--btn-border); border-radius: var(--radius-control);
  background: var(--btn-bg); color: var(--text-1); font-size: var(--text-sm); font-weight: 500; white-space: nowrap;
}
.group-banner a.dossier-link:hover, .actions a:hover, footer .f-cta:hover { background: var(--bg-3); text-decoration: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.actions a.primary { background: var(--btn-primary-bg); border-color: var(--btn-primary-bg); color: var(--btn-primary-fg); font-weight: 600; }
.actions a.primary:hover { background: var(--btn-primary-hover); border-color: var(--btn-primary-hover); }

/* Neighborhood block */
.hood-block { background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-control); padding: 14px 16px; }
.hood-block .name { font-size: var(--text-base); font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.hood-block .stats { font-size: var(--text-sm); color: var(--text-2); margin-bottom: 10px; }
.hood-block .stats strong { color: var(--text-1); font-variant-numeric: tabular-nums; }

/* Group overview and entity cards */
.overview { background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-control); padding: 14px 18px; font-size: var(--text-base); color: var(--text-1); line-height: 1.65; max-width: 72ch; }
.entity-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.entity-card { background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-control); padding: 12px 14px; transition: border-color var(--transition); }
.entity-card:hover { border-color: var(--border-3); }
.entity-name { font-size: var(--text-sm); color: var(--text-1); font-weight: 500; margin-bottom: 4px; overflow-wrap: anywhere; }
.entity-name a { color: var(--link); }
.entity-meta { font-size: var(--text-xs); color: var(--text-3); }
.network-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.network-col { background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-control); padding: 14px 16px; }
.network-col h4 { font-size: var(--text-sm); font-weight: 600; color: var(--text-1); margin-bottom: 10px; }
.network-item { font-size: var(--text-sm); padding: 5px 0; color: var(--text-2); border-bottom: 1px solid var(--border-1); display: flex; justify-content: space-between; gap: 8px; }
.network-item:last-child { border-bottom: none; }
.network-item .name { min-width: 0; overflow-wrap: anywhere; }
.network-item .count { color: var(--text-3); font-size: var(--text-xs); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* States */
.loading { text-align: center; padding: 80px 20px; color: var(--text-3); font-size: var(--text-sm); }
.error { background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-control); padding: 20px; color: var(--text-2); }
.error strong { color: var(--error); display: block; margin-bottom: 6px; font-size: var(--text-sm); }
.notice { margin: 0 0 32px; padding: 14px 18px; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--radius-control); font-size: var(--text-base); color: var(--text-2); line-height: 1.6; }
.notice strong { color: var(--text-1); }
/* Scroll-reveal is gone; the class stays because scripts and tests look for it. */
.reveal { opacity: 1; transform: none; }

/* Footer */
footer {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border-1);
  font-size: var(--text-xs); color: var(--text-3); line-height: 1.6;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px;
}
footer a { color: var(--link); }

@media (max-width: 640px) {
  .wrap { padding: 16px 16px calc(60px + env(safe-area-inset-bottom, 0px)); }
  .topnav { padding: 8px 16px; padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }
  .topnav .brand-sub { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-val { font-size: var(--text-lg); }
  .detail-grid { grid-template-columns: 1fr; gap: 10px; }
  .detail-grid dt { padding-top: 0; }
  .network-summary { grid-template-columns: 1fr; }
  .entity-list { grid-template-columns: 1fr; }
  .sales-table { min-width: 560px; font-size: var(--text-xs); }
  .sales-table-hint { display: block; margin-bottom: 8px; color: var(--text-3); font-size: var(--text-xs); }
  .sales-table th, .sales-table td { padding: 8px 10px; }
  .actions a { min-height: 44px; flex: 1 1 auto; }
}
