/* =========================================================
   RV EMT — mobile RV repair, Texas Hill Country
   Hand-rolled CSS. No framework, no build step.
   ========================================================= */

:root {
  --red: #d02028;
  --red-dark: #a91820;
  --navy: #282878;
  --navy-dark: #1c1c56;
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --ink: #1c2333;
  --ink-muted: #4a5169;
  --border: #dfe2ee;
  --shadow: 0 4px 18px rgba(28, 35, 51, 0.08);
  --shadow-lg: 0 10px 30px rgba(28, 35, 51, 0.14);
  --radius: 10px;
  --radius-lg: 12px;
  --max-width: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset-ish base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

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

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

a:hover {
  color: var(--red);
}

h1,
h2,
h3,
h4 {
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 0.5em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2rem, 4vw + 1rem, 3.2rem);
}

h2 {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.2rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

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

/* Keep the checkbox/keyboard-focusable trick usable while visually offscreen */
.visually-hidden:focus,
.visually-hidden:focus-within {
  width: auto;
  height: auto;
  padding: 0.25em 0.5em;
  margin: 0;
  overflow: visible;
  clip: auto;
  background: var(--bg);
  border: 2px solid var(--red);
  z-index: 1000;
}

:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  background: var(--navy);
  color: #fff;
  padding: 0.6em 1em;
  border-radius: 0 0 8px 8px;
  z-index: 2000;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75em 1.5em;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.2;
}

.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--red-dark);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--navy);
  color: #fff;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--navy);
}

.brand img {
  height: 56px;
  width: auto;
}

.brand-text {
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1.1;
  color: var(--ink-muted);
}

.nav-toggle {
  display: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-menu a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.nav-menu a:hover,
.nav-menu a:focus-visible,
.nav-menu a[aria-current="page"] {
  color: var(--red);
}

.nav-menu .btn {
  padding: 0.5em 1.1em;
  font-size: 0.95rem;
}

.nav-toggle-label {
  display: none;
}

/* Hide toggle checkbox but keep it keyboard-operable */
#nav-toggle-checkbox {
  position: absolute;
  left: -9999px;
}

@media (max-width: 760px) {
  .nav-toggle-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 2px solid var(--navy);
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--navy);
  }

  #nav-toggle-checkbox:focus + .nav-toggle-label {
    outline: 3px solid var(--red);
    outline-offset: 2px;
  }

  .site-nav {
    width: 100%;
    order: 3;
  }

  .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0.25rem;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.2s ease;
  }

  /* Pure-CSS checkbox toggle: works identically with or without JS. */
  #nav-toggle-checkbox:not(:checked) ~ .site-nav .nav-menu {
    max-height: 0;
  }

  .nav-menu li {
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu .cta-item {
    border-bottom: none;
    padding-top: 0.75rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  background: var(--bg-alt);
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.hero-copy .eyebrow {
  color: var(--red);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}

.hero-copy p.lede {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: 46ch;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.hero-photo img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  height: auto;
  object-fit: cover;
}

@media (max-width: 820px) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-photo {
    order: -1;
    max-width: 380px;
    margin: 0 auto;
  }
}

/* ---------- EKG divider ---------- */
.ekg-divider {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
  background: var(--bg);
}

.ekg-divider svg {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block;
}

/* ---------- How it works ---------- */
.how-it-works {
  padding: 3rem 0;
}

.how-it-works h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step;
}

.steps li {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  position: relative;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  margin: 0 auto 1rem;
}

.steps h3 {
  margin-bottom: 0.4rem;
}

.steps p {
  color: var(--ink-muted);
  margin: 0;
}

@media (max-width: 760px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

/* ---------- Service cards ---------- */
.service-cards {
  padding: 1rem 0 3rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  height: 180px;
  width: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body p {
  color: var(--ink-muted);
  flex: 1;
}

.card-body .btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Badge ---------- */
.badge {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  margin-left: 0.5em;
  vertical-align: middle;
}

/* ---------- Credentials band ---------- */
.credentials {
  background: var(--bg-alt);
  padding: 3rem 0;
}

.credentials .container {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}

.credentials img {
  max-width: 140px;
}

@media (max-width: 640px) {
  .credentials .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .credentials img {
    margin: 0 auto;
  }
}

/* ---------- Service area ---------- */
.service-area {
  padding: 3rem 0;
}

.service-area .container {
  max-width: 760px;
  text-align: center;
  margin: 0 auto;
}

/* ---------- Closing CTA band ---------- */
.cta-band {
  background: var(--navy);
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}

.cta-band h2 {
  color: #fff;
}

.cta-band p {
  color: #d7d9ec;
  max-width: 50ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Page header (services / contact) ---------- */
.page-header {
  background: var(--bg-alt);
  padding: 2.5rem 0;
}

.page-header p {
  color: var(--ink-muted);
  max-width: 60ch;
}

/* ---------- Services page detail sections ---------- */
.service-detail {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.service-detail:last-of-type {
  border-bottom: none;
}

.service-detail .container {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2.5rem;
  align-items: start;
}

.service-detail img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  object-fit: cover;
}

.service-detail:nth-of-type(even) .container {
  direction: rtl;
}

.service-detail:nth-of-type(even) .container > * {
  direction: ltr;
}

@media (max-width: 820px) {
  .service-detail .container,
  .service-detail:nth-of-type(even) .container {
    grid-template-columns: 1fr;
    direction: ltr;
  }

  .service-detail img {
    max-width: 380px;
    margin: 0 auto;
  }
}

/* ---------- Contact page layout ---------- */
.contact-layout {
  padding: 3rem 0;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }
}

.contact-form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.form-row {
  margin-bottom: 1.25rem;
}

.form-row label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35em;
}

.form-row .hint {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.25em;
}

.form-row input[type="text"],
.form-row input[type="tel"],
.form-row input[type="email"],
.form-row select,
.form-row textarea {
  width: 100%;
  font: inherit;
  padding: 0.65em 0.75em;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--navy);
}

.form-row textarea {
  min-height: 120px;
  resize: vertical;
}

.required-mark {
  color: var(--red);
}

.field-error {
  color: var(--red-dark);
  font-size: 0.85rem;
  margin-top: 0.35em;
  display: none;
}

.form-row.has-error input,
.form-row.has-error select,
.form-row.has-error textarea {
  border-color: var(--red);
}

.form-row.has-error .field-error {
  display: block;
}

.form-status {
  border-radius: 8px;
  padding: 1em 1.25em;
  margin-bottom: 1.25rem;
  font-weight: 600;
  display: none;
}

.form-status.is-visible {
  display: block;
}

.form-status.status-success {
  background: #e6f4ea;
  color: #1e5b2f;
  border: 1px solid #b8dfc4;
}

.form-status.status-error {
  background: #fbe7e8;
  color: #7a1b20;
  border: 1px solid #f0bcbf;
}

.form-status.status-info {
  background: var(--bg-alt);
  color: var(--navy);
  border: 1px solid var(--border);
}

/* No-JS fallback: /api/contact 303s back here with #submit-sent or
   #submit-error, which reveals the matching static banner without any
   script. When JS runs, it removes these and uses #form-status instead. */
.static-banner:target {
  display: block;
}

.honeypot-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.contact-aside {
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
}

.contact-aside h2 {
  font-size: 1.15rem;
}

.contact-aside dl {
  margin: 0;
}

.contact-aside dt {
  font-weight: 700;
  color: var(--navy);
  margin-top: 1rem;
}

.contact-aside dt:first-child {
  margin-top: 0;
}

.contact-aside dd {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #d7d9ec;
  padding: 2.5rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
}

.footer-grid h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.footer-brand img {
  height: 44px;
  margin-bottom: 0.75rem;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 0.4rem;
}

.footer-grid a {
  color: #d7d9ec;
  text-decoration: none;
}

.footer-grid a:hover,
.footer-grid a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.85rem;
  color: #b7bad8;
}

@media (max-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
