/* DirectMatSolutions — materials library, spec cards, city pages & listing grids.
   Uses the styles.css design tokens (--steel #2568a8, --accent #e85d04). */

.mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 22px;
  margin-bottom: 48px;
}
.mat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.mat-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.mat-card h3 { margin: 0 0 8px; font-size: 20px; }
.mat-card p { color: var(--muted); margin: 0 0 10px; line-height: 1.55; }
.mat-card .mat-links { margin: 0 0 6px; }

.mat-text { max-width: 780px; line-height: 1.65; color: var(--ink); }
.mat-calc-link {
  max-width: 780px;
  background: var(--steel-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--steel);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 26px 0;
  line-height: 1.55;
}

.spec-wrap { overflow-x: auto; max-width: 100%; margin: 14px 0 30px; }
.spec-table { border-collapse: collapse; width: 100%; min-width: 0; background: var(--surface); }
.spec-table th, .spec-table td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
  overflow-wrap: break-word;
}
.spec-table th { width: 30%; background: var(--bg-soft); font-weight: 600; }

.mat-list { max-width: 780px; line-height: 1.6; padding-left: 22px; margin: 10px 0 28px; }
.mat-list li { margin-bottom: 6px; }
.mat-list.checklist li::marker { color: var(--accent); }
.city-cats { columns: 2; column-gap: 40px; max-width: 900px; }
@media (max-width: 640px) { .city-cats { columns: 1; } }

/* Live listing cards (rendered by materials.js from /api/listings) */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 20px;
  margin: 18px 0 34px;
}
.listing-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.listing-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.listing-card a { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.listing-photo { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--bg-soft); }
.listing-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.listing-badge {
  align-self: flex-start;
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--steel-dark); background: var(--steel-soft);
  border-radius: 999px; padding: 3px 10px;
}
.listing-badge.sell { color: var(--accent-hover); background: var(--accent-soft); }
.listing-title { font-size: 17px; font-weight: 700; line-height: 1.35; overflow-wrap: break-word; }
.listing-price { font-size: 18px; font-weight: 800; color: var(--steel); }
.listing-meta { color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: break-word; }
.listing-empty, .listing-error {
  grid-column: 1 / -1;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  background: var(--surface);
}
.listing-empty a, .listing-error a { color: var(--steel); font-weight: 600; }
