/* ==========================================================================
   2027 Contractor Marketing Pricing Index
   Editorial / research-report styling. Restrained, data-first, no gradients.
   ========================================================================== */

:root {
  --color-bg: #faf9f6;
  --color-surface: #ffffff;
  --color-text: #1c1e21;
  --color-text-muted: #52565c;
  --color-border: #d8d5cd;
  --color-border-strong: #1c1e21;
  --color-accent: #7a1f1f;
  --color-accent-contrast: #ffffff;
  --color-table-head: #efece4;
  --color-table-stripe: #f5f3ee;

  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --max-width: 960px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  margin: 0.5rem 0 1rem;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border-strong);
}

h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.75rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--color-accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* -------------------------------------------------------------------------
   Header / Hero
   ------------------------------------------------------------------------- */

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 2.5rem 0 3rem;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 42em;
}

.stat-block {
  display: block;
  border: 1px solid var(--color-border-strong);
  background: var(--color-table-head);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  max-width: 26em;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin: 0.15rem 0;
}

.stat-note {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.hero-disclosure {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  border-left: 3px solid var(--color-accent);
  padding-left: 0.75rem;
  max-width: 42em;
}

.hero-cta {
  margin-top: 1.5rem;
}

.button,
button {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  border: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
button:hover {
  opacity: 0.9;
}

.button:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Sections
   ------------------------------------------------------------------------- */

main section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

main section:last-child {
  border-bottom: none;
}

.section-note {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  max-width: 42em;
}

/* -------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1rem;
  border: 1px solid var(--color-border-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 26rem;
  background: var(--color-surface);
}

caption {
  text-align: left;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}

thead th {
  background: var(--color-table-head);
  font-family: var(--font-sans);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border-bottom: 2px solid var(--color-border-strong);
}

tbody tr:nth-child(even) {
  background: var(--color-table-stripe);
}

tbody th[scope="row"] {
  font-family: var(--font-sans);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: none;
}

/* -------------------------------------------------------------------------
   Independence statement
   ------------------------------------------------------------------------- */

.independence-statement {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  border-left: 3px solid var(--color-accent);
  padding-left: 0.9rem;
}

/* -------------------------------------------------------------------------
   Lead form
   ------------------------------------------------------------------------- */

#lead-form {
  background: var(--color-surface);
}

form {
  max-width: 34em;
}

.form-row {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.req {
  color: var(--color-accent);
}

input,
select {
  font-family: var(--font-sans);
  font-size: 1rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.form-submit-row {
  margin-top: 1.5rem;
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border-strong);
  background: var(--color-table-head);
}

.form-status[data-state="error"] {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.site-footer {
  padding: 2rem 0 3rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.site-footer p {
  margin: 0 0 0.4rem;
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */

@media (min-width: 640px) {
  .form-row {
    flex-direction: row;
    align-items: center;
  }

  label {
    width: 12rem;
    flex-shrink: 0;
    margin-bottom: 0;
  }

  input,
  select {
    flex: 1;
  }

  .form-submit-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile-only: data tables (Roofing, HVAC, Remodeling, What Is Usually Not
   Included, Why Contractors Leave). Let headers/cells wrap and shrink so
   every table fits the viewport with no horizontal scrolling. Desktop
   table rules above are left untouched. */
@media (max-width: 600px) {
  .table-scroll {
    overflow-x: visible;
  }

  table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }

  th,
  td {
    padding: 0.45rem 0.5rem;
    font-size: 0.8rem;
    white-space: normal;
    word-break: break-word;
  }

  thead th {
    font-size: 0.68rem;
  }

  tbody th[scope="row"] {
    white-space: normal;
  }
}
