/* San Antonio Emergency Home Services — styles.css
   Design: Local utility, high trust, mobile-first.
   City of San Antonio brand tones (see BRAND-COLORS.md).
   Monochrome-safe. No gradient sludge. Big tap targets.
   Operative initiative.
*/

/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* City of SA brand */
  --sa-corazon:      #8B0E04; /* Corazón Red */
  --sa-mercado:      #CF4240; /* Mercado Rose */
  --sa-pecan:        #551900; /* Pecan Brown */
  --sa-mission:      #333333; /* Mission Bell Grey */

  --color-bg:        #ffffff;
  --color-surface:   #f7f4f1; /* warm off-white, slight pecan cast */
  --color-border:    #d4ccc4;
  --color-text:      #333333; /* Mission Bell Grey */
  --color-muted:     #5c534c;
  --color-accent:    #8B0E04; /* Corazón Red — primary emergency accent */
  --color-accent-dk: #551900; /* Pecan Brown — deeper interactive */
  --color-accent-lt: #CF4240; /* Mercado Rose — hover / soft */
  --color-badge-bg:  #333333;
  --color-badge-fg:  #ffffff;
  --color-phone-bg:  #8B0E04; /* call CTA = Corazón action */
  --color-phone-fg:  #ffffff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 4px;
  --max-w: 960px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover, a:focus { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Site Header ──────────────────────────────────────── */
.site-header {
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.85rem 0;
  border-bottom: 3px solid var(--color-accent);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-logo {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.site-logo span { color: var(--color-accent); }
.site-logo:hover { text-decoration: none; opacity: 0.9; }

.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.site-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.site-nav a:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.4); text-decoration: none; }

/* ── Hero / Page Title ───────────────────────────────── */
.hero {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 2.5rem 0 2rem;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}
.hero p {
  font-size: 1.05rem;
  color: var(--color-muted);
  max-width: 52ch;
}

/* ── Trade Chips ─────────────────────────────────────── */
.trade-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.chip {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text);
  text-decoration: none;
  background: var(--color-bg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover, .chip:focus, .chip.active {
  background: var(--color-accent); /* Corazón Red */
  color: #fff;
  border-color: var(--color-accent);
  text-decoration: none;
}
.chip.active { pointer-events: none; }

/* ── Section Heading ─────────────────────────────────── */
.section-heading {
  padding: 1.75rem 0 0.75rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
}
.section-heading h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Listing Grid ────────────────────────────────────── */
.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--color-border);
  border: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Listing Card ────────────────────────────────────── */
.listing-card {
  background: var(--color-bg);
  padding: 1.1rem 1.1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border: 1px solid transparent;
}
.listing-card:hover { background: var(--color-surface); }
.listing-card--premium {
  background: linear-gradient(180deg, #fff8f5 0%, #ffffff 55%);
  border: 1.5px solid var(--color-accent);
  box-shadow: 0 2px 10px rgba(139, 14, 4, 0.10);
  position: relative;
}
.listing-card--premium:hover { background: #fff4ef; }
.listing-card--premium .listing-card-name a { color: var(--color-accent-dk); }

.listing-card-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}
.listing-card-name a {
  color: var(--color-text);
  text-decoration: none;
}
.listing-card-name a:hover { color: var(--color-accent); text-decoration: none; }

.listing-card-meta {
  font-size: 0.8rem;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-trade {
  background: var(--color-badge-bg);
  color: var(--color-badge-fg);
}
.badge-247 {
  background: var(--color-accent);
  color: #fff;
}
.badge-rating {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}
.badge-premium {
  background: var(--color-accent); /* Corazón Red */
  color: #fff;
  letter-spacing: 0.08em;
  box-shadow: 0 0 0 1px var(--color-accent-dk);
}
.badge-verified {
  background: var(--sa-pecan, #551900);
  color: #fff;
  letter-spacing: 0.04em;
}
.badge-verified-3 {
  background: var(--sa-pecan, #551900);
  border: 1px solid var(--color-accent);
}
.badge-verified-2 {
  background: #6b2a12;
}
.badge-verified-1 {
  background: #7a5a3a;
  font-weight: 600;
}
.badge-unverified {
  background: transparent;
  border: 1px dashed var(--color-border);
  color: var(--color-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.verify-meaning {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  margin-top: 0.2rem;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Verification ladder section ─────────────────────── */
.verify-section {
  padding: 0.5rem 0 2rem;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.verify-section--compact {
  padding: 0.25rem 0 1.75rem;
}
.verify-section .section-heading {
  border-bottom-color: var(--color-border);
}
.section-sub {
  margin-top: 0.4rem;
  color: var(--color-muted);
  font-size: 0.95rem;
  max-width: 40rem;
}
.verify-intro {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin: 0.75rem 0 1rem;
}
.verify-ladder {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
@media (min-width: 720px) {
  .verify-ladder {
    grid-template-columns: 1fr 1fr;
  }
}
@media (min-width: 1000px) {
  .verify-ladder {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}
.verify-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.verify-card--l3 {
  border-color: var(--color-accent);
  box-shadow: 0 2px 10px rgba(139, 14, 4, 0.08);
  background: linear-gradient(180deg, #fff8f5 0%, #fff 60%);
}
.verify-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.15rem;
}
.verify-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.verify-card-lead {
  font-size: 0.82rem;
  color: var(--color-accent-dk);
  font-weight: 600;
}
.verify-card p {
  font-size: 0.85rem;
  color: var(--color-muted);
  line-height: 1.45;
}
.verify-footnote {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}
.verify-owner-cta {
  margin-top: 1.5rem;
  padding: 1.1rem 1.15rem;
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius);
  background: #fff8f5;
}
.verify-owner-cta h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.verify-owner-cta p {
  font-size: 0.92rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}

.listing-card-phone a {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  padding: 0.4rem 0;
  text-decoration: none;
}
.listing-card-phone a:hover { color: var(--color-accent); text-decoration: none; }

/* ── Listing Detail Page ─────────────────────────────── */
.listing-detail {
  padding: 2rem 0 3rem;
}
.listing-detail-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.listing-detail-header h1 {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}
.listing-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }

.listing-phone-cta {
  margin: 1.25rem 0;
}
.btn-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-phone-bg);
  color: var(--color-phone-fg);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  text-decoration: none;
  letter-spacing: -0.01em;
  min-height: 52px;
  transition: background 0.15s;
}
.btn-phone:hover { background: var(--color-accent-dk); /* Pecan Brown */ text-decoration: none; color: #fff; }
.btn-phone svg { flex-shrink: 0; }

.listing-info {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}
.listing-info-row {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
}
.listing-info-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  min-width: 90px;
  flex-shrink: 0;
}
.listing-info-value {
  font-size: 0.95rem;
  color: var(--color-text);
}
.listing-info-value a {
  color: var(--color-accent);
  word-break: break-all;
}

.listing-description {
  background: var(--color-surface);
  border-left: 3px solid var(--color-border);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--color-muted);
}

.listing-cta {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.listing-cta p {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0.6rem;
}
.listing-cta-link {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 1px;
}
.listing-cta-link:hover { color: var(--color-accent); text-decoration: none; }

/* ── Trade Index ─────────────────────────────────────── */
.trade-page-intro {
  padding: 0.5rem 0 1.25rem;
}
.trade-page-intro p {
  color: var(--color-muted);
  max-width: 52ch;
}

/* ── Breadcrumb ──────────────────────────────────────── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 0.75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.breadcrumb a { color: var(--color-muted); text-decoration: none; border-bottom: 1px solid var(--color-border); }
.breadcrumb a:hover { color: var(--color-text); border-bottom-color: var(--color-text); text-decoration: none; }
.breadcrumb-sep { color: var(--color-border); }

/* ── About Page ──────────────────────────────────────── */
.about-content {
  padding: 2rem 0 3rem;
  max-width: 64ch;
}
.about-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
  letter-spacing: -0.01em;
}
.about-content p, .about-content li {
  color: var(--color-muted);
  margin-bottom: 0.6rem;
  font-size: 0.97rem;
}
.about-content ul { padding-left: 1.25rem; }
.about-content li { margin-bottom: 0.3rem; }

/* ── Pagination / Trade list page ───────────────────── */
.trade-listing-list {
  list-style: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}
.trade-listing-item {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}
.trade-listing-item:last-child { border-bottom: none; }
.trade-listing-item:hover { background: var(--color-surface); }
.trade-listing-item--premium {
  background: linear-gradient(90deg, #fff8f5 0%, #ffffff 70%);
  border-left: 4px solid var(--color-accent);
  padding-left: calc(1rem - 4px);
}
.trade-listing-item--premium:hover { background: #fff4ef; }
.listing-detail--premium .listing-detail-header {
  border: 1.5px solid var(--color-accent);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  background: #fff8f5;
  margin-bottom: 1rem;
}

.trade-listing-name {
  font-weight: 600;
  font-size: 0.97rem;
}
.trade-listing-name a { color: var(--color-text); text-decoration: none; }
.trade-listing-name a:hover { color: var(--color-accent); text-decoration: none; }

.trade-listing-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.trade-listing-phone {
  font-size: 0.9rem;
  font-weight: 700;
}
.trade-listing-phone a {
  color: var(--color-text);
  text-decoration: none;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  display: inline-block;
}
.trade-listing-phone a:hover { background: var(--color-text); color: #fff; border-color: var(--color-text); text-decoration: none; }

/* ── Footer ──────────────────────────────────────────── */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.75rem 0 2.5rem;
  margin-top: 2rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}
.footer-disclosure {
  font-size: 0.8rem;
  color: var(--color-muted);
  max-width: 52ch;
  line-height: 1.5;
}
.footer-disclosure a { color: var(--color-muted); border-bottom: 1px solid var(--color-border); }
.footer-disclosure a:hover { color: var(--color-text); text-decoration: none; }

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.footer-nav a {
  font-size: 0.83rem;
  color: var(--color-muted);
  text-decoration: none;
  border-bottom: none;
}
.footer-nav a:hover { color: var(--color-text); }

/* ── Utility ─────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ── No-script / fallback chip filter ───────────────── */
.js-only { display: none; }
body.js-ready .js-only { display: initial; }
body.js-ready .noscript-hint { display: none; }

/* ── Rating stars (text fallback) ───────────────────── */
.rating {
  font-size: 0.82rem;
  color: var(--color-muted);
}
.rating-star { color: var(--color-text); }
