/* RenoRoofers.com — site stylesheet */

:root {
  --terracotta: #C4552D;
  --terracotta-dark: #A34423;
  --ink: #2B2320;
  --ink-soft: #5C524C;
  --paper: #FAF6F0;
  --card: #FFFFFF;
  --line: #E7DDD3;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Header (floating translucent bar, sitewide) ---------- */

:root {
  --header-clear: 5.4rem; /* bar height + top inset — content slides under it */
  --accent-orange: #D65A31;
  --accent-orange-link: #E8683A;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.9rem 1.1rem 0;
  margin-bottom: calc(-1 * var(--header-clear));
}

.header-bar {
  max-width: 80rem;
  margin: 0 auto;
  min-height: 4rem;
  border-radius: 16px;
  background: rgba(17, 19, 28, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1.25rem;
  padding: 0.5rem 1.4rem;
}

.wordmark {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span { color: var(--accent-orange-link); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.4rem;
  flex: 1 1 auto;
}

.site-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.25rem 0;
}

.site-nav a:hover,
.site-nav a[aria-current="true"] {
  color: var(--accent-orange-link);
}

.header-cta {
  border: 1.5px solid var(--accent-orange);
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  white-space: nowrap;
  transition: background 140ms ease;
}

.header-cta:hover {
  background: var(--accent-orange);
  color: #fff;
}

/* ---------- Main / article ---------- */

main {
  padding-top: 2.5rem;
  padding-bottom: 3.5rem;
}

/* Interior pages need extra top padding to clear the floating header. */
main.article { padding-top: calc(var(--header-clear) + 2.25rem); }

.article { max-width: none; }
.article > * { max-width: 70ch; margin-left: auto; margin-right: auto; }
.article > table { max-width: min(70ch, 100%); }

h1, h2, h3 {
  line-height: 1.25;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: 0 auto 1rem; }

h2 {
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  margin-top: 2.5rem;
  padding-top: 0.5rem;
  color: var(--terracotta-dark);
}

h3 { font-size: 1.15rem; margin-top: 1.75rem; }

a { color: var(--terracotta-dark); }
a:hover { color: var(--terracotta); }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5rem auto;
}

blockquote {
  margin: 1.5rem auto;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--terracotta);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

code {
  background: #F1EAE2;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

img { max-width: 100%; height: auto; }

/* ---------- Tables (heavily used) ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem auto;
  background: var(--card);
  font-size: 0.95rem;
  border: 1px solid var(--line);
  display: block;
  overflow-x: auto;
}

@media (min-width: 640px) {
  table { display: table; overflow-x: visible; }
}

th, td {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

thead th, tr:first-child th {
  background: var(--terracotta);
  color: #fff;
  font-weight: 700;
}

tbody tr:nth-child(even) { background: #FBF8F4; }

/* ---------- Email capture card ---------- */

.email-capture {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--terracotta);
  border-radius: 10px;
  padding: 1.4rem 1.5rem;
  margin: 2.5rem auto;
  max-width: 70ch;
}

.email-capture .ec-title {
  margin: 0 0 0.35rem;
  padding: 0;
  font-size: 1.15rem;
  color: var(--ink);
}

.email-capture .ec-sub {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.ec-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.ec-form input[type="email"] {
  flex: 1 1 14rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--paper);
}

.ec-form input[type="email"]:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}

.ec-form button {
  padding: 0.65rem 1.3rem;
  border: 0;
  border-radius: 8px;
  background: var(--terracotta);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ec-form button:hover { background: var(--terracotta-dark); }
.ec-form button:disabled { opacity: 0.6; cursor: default; }

.ec-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}

.ec-err { color: #A32014; font-size: 0.9rem; margin: 0.6rem 0 0; }
.ec-done { color: #1E7A3C; font-weight: 600; margin: 0.6rem 0 0; }

/* ---------- Estimate form (/estimate/) ---------- */

.lead-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.6rem 1.5rem 1.75rem;
  margin: 2rem auto;
}

.lead-card h2 { margin-top: 0; padding-top: 0; }

.lf-progress { margin: 0.75rem 0 1.25rem; }

.lf-track {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.lf-fill {
  height: 100%;
  width: 0;
  background: var(--terracotta);
  border-radius: 3px;
  transition: width 200ms ease;
}

.lf-label {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.lf-step { display: none; }
.lf-step.active { display: block; }

.lf-q { font-weight: 700; font-size: 1.1rem; margin: 0.25rem 0 0.9rem; }
.lf-subq { font-weight: 600; margin: 1.25rem 0 0.6rem; color: var(--ink-soft); }

.lf-choices {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.lf-choice {
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.lf-choice:hover { border-color: var(--terracotta); }

.lf-choice.selected {
  border-color: var(--terracotta);
  background: #FBEDE6;
}

.lead-card input[type="text"],
.lead-card input[type="tel"],
.lead-card input[type="email"] {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: var(--paper);
  margin-bottom: 0.9rem;
}

.lead-card input:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}

.lf-flabel {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.lf-hint { font-size: 0.88rem; color: var(--ink-soft); margin: 0.5rem 0 0; }

.lf-err {
  display: none;
  color: #A32014;
  font-size: 0.92rem;
  margin: 0.75rem 0 0;
}

.lf-err.show { display: block; }

.lf-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.lf-back {
  background: none;
  border: 0;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0;
}

.lf-back:hover { color: var(--terracotta-dark); }

.lf-next {
  padding: 0.75rem 1.6rem;
  border: 0;
  border-radius: 8px;
  background: var(--terracotta);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lf-next:hover { background: var(--terracotta-dark); }
.lf-next:disabled { opacity: 0.6; cursor: default; }

.lf-consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem 0.9rem;
  margin: 0.5rem 0 0;
}

.lf-consent input { margin-top: 0.3rem; }

.lf-consent label {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.lf-success { text-align: center; padding: 1rem 0 0.5rem; }
.lf-success h2 { color: #1E7A3C; }
.lf-success p { color: var(--ink-soft); }
.lf-success .email-capture { text-align: left; margin-top: 2rem; }

/* ---------- Homepage ---------- */

.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 0.75rem; }

.hero p {
  color: var(--ink-soft);
  max-width: 42rem;
  margin: 0 auto;
  font-size: 1.15rem;
}

.section-block { margin-top: 2.75rem; }

.section-block > h2 {
  border-bottom: 2px solid var(--terracotta);
  display: inline-block;
  padding-bottom: 0.25rem;
  margin-bottom: 0.35rem;
}

.section-block > p { color: var(--ink-soft); margin-top: 0.25rem; }

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  margin-top: 1.25rem;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  transition: border-color 120ms ease, transform 120ms ease;
}

.card:hover {
  border-color: var(--terracotta);
  transform: translateY(-2px);
}

.card a {
  text-decoration: none;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 0.35rem;
}

.card a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }

.card a:hover { color: var(--terracotta-dark); }

.card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.5;
}

.card--featured { border-left: 5px solid var(--terracotta); }

/* ---------- Footer (near-black, centered logo | divider | stacked nav) ---------- */

.site-footer {
  background: #262626;
  color: #C9C9C9;
  margin-top: 2rem;
  padding: 3.25rem 0 1.75rem;
  font-size: 0.9rem;
}

.footer-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding-bottom: 2.25rem;
}

.wordmark--footer { font-size: 1.5rem; }

.footer-divider {
  width: 1px;
  align-self: stretch;
  min-height: 9rem;
  background: #4A4A4A;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
}

.footer-nav a {
  color: #E6E6E6;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.footer-nav a:hover,
.footer-nav a[aria-current="true"] { color: var(--accent-orange-link); }

.footer-disclosure {
  max-width: 78ch;
  color: #9A9A9A;
  margin: 0 auto 1.75rem;
  line-height: 1.55;
  font-size: 0.82rem;
  text-align: center;
}

.footer-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6rem 1.5rem;
  border-top: 1px solid #383838;
  padding-top: 1.25rem;
}

.footer-copy { color: #8F8F8F; margin: 0; font-size: 0.85rem; }

.footer-independent {
  color: #BFBFBF;
  font-weight: 600;
  margin: 0;
  font-size: 0.85rem;
  text-align: center;
  flex: 1 1 auto;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: flex-end;
}

.footer-legal a {
  color: #C9C9C9;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.footer-legal a:hover { color: var(--accent-orange-link); }

@media (max-width: 720px) {
  :root { --header-clear: 8.6rem; }
  .header-bar { justify-content: center; text-align: center; padding: 0.6rem 0.9rem; }
  .site-nav { gap: 0.15rem 0.9rem; order: 3; flex-basis: 100%; }
  .site-nav a { font-size: 0.84rem; }
  .footer-center { flex-direction: column; gap: 1.25rem; }
  .footer-divider { min-height: 1px; width: 6rem; }
  .footer-bottom { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .footer-legal { justify-content: center; }
}
