/* ==========================================================================
   Newtown Garage — base styles
   Plain CSS, no framework. Mobile-first. System font stack (zero webfont
   requests) to keep the page light — a deliberate fix for the old site's
   37-stylesheet bloat.
   ========================================================================== */

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f2f6fb;
  --color-ink: #16202b;
  --color-ink-soft: #4b5a68;
  --color-ink-faint: #7c8ba0;

  /* Colors verified by sampling pixels straight off the live original site
     (its CSS is full of unused Elementor/WP defaults, so hex-grepping alone
     was unreliable). #5498e1 is its real button/heading blue; #282828 and
     #4c4c4c are its two dark section backgrounds (no orange appears
     anywhere on the real site, so that accent has been retired). */
  --color-primary: #2f6fb0;        /* deepened, contrast-safe version of the brand blue, for text/small buttons */
  --color-primary-dark: #1d4a78;   /* deep blue — hover state for primary/accent buttons */
  --color-primary-light: #5498e1;  /* the original site's actual brand blue */

  --color-slate-dark: #282828;     /* original's main dark surface — top bar, footer, dark callouts */
  --color-slate: #4c4c4c;          /* original's secondary dark surface — e.g. its "Key Services" section */

  --color-accent: #5498e1;
  --color-accent-hover: #2f6fb0;

  --color-border: #dbe4f0;
  --color-success-bg: #e7f5ec;
  --color-success-text: #1f6b3a;
  --color-error-bg: #fdeceb;
  --color-error-text: #b3261e;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-body);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(20, 24, 26, 0.08);
  --shadow-md: 0 8px 24px rgba(20, 24, 26, 0.12);

  --container-width: 1180px;
  --header-height: 116px;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin: 0 0 0.5em; color: var(--color-ink); }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--color-ink-soft); }
address { font-style: normal; }
button { font: inherit; }

.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--color-primary);
  color: #fff; padding: 0.75em 1.25em; z-index: 200; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75em 1.5em; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.95rem; border: 2px solid transparent;
  cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-hover); }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-ghost { background: transparent; color: var(--color-primary); border-color: var(--color-border); }
.btn-ghost:hover { border-color: var(--color-primary); }
.btn-block { width: 100%; }
.btn-lg { padding: 0.9em 1.9em; font-size: 1.05rem; }

/* ---- Top status bar ---- */
.top-bar { background: var(--color-slate-dark); color: #d6d8db; font-size: 0.85rem; }
.top-bar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.5rem; flex-wrap: wrap; }
.top-bar__status { display: flex; align-items: center; gap: 0.5em; margin: 0; color: #d6d8db; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-ink-faint); }
.is-open .status-dot { background: #59d98a; }
.is-closed .status-dot { background: #e08a6b; }
.top-bar__contact { margin: 0; color: #d6d8db; }
.top-bar__contact a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-block: 0.85rem;
}
.nav-panel { display: flex; align-items: center; gap: 1.75rem; flex: 1; justify-content: flex-end; }
.logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.logo img { display: block; height: 40px; width: auto; }
.logo--footer { display: inline-block; margin-bottom: 0.75rem; }
.logo--footer img { height: 34px; }

.main-nav > ul { display: flex; align-items: center; gap: 1.75rem; }
.main-nav a { font-weight: 600; font-size: 0.95rem; padding: 0.5rem 0; }
.main-nav a[aria-current="page"] { color: var(--color-primary); border-bottom: 2px solid var(--color-accent); }
.main-nav a:hover { color: var(--color-primary); }

.has-dropdown { position: relative; display: flex; align-items: center; }
.dropdown-toggle {
  background: none; border: none; padding: 0.5rem; cursor: pointer;
  color: var(--color-ink-soft);
}
.dropdown-toggle::after {
  content: ""; display: block; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); margin-top: -4px;
}
.dropdown {
  display: none;
  position: absolute; top: 100%; left: 0; min-width: 260px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  padding: 0.5rem; margin-top: 0.5rem;
}
/* Invisible bridge over the gap above the panel, so moving the mouse from
   the trigger down into the dropdown doesn't cross a dead zone and drop
   :hover mid-transit (the panel would otherwise snap shut before reaching it). */
.dropdown::before {
  content: ""; position: absolute; left: 0; right: 0; top: -0.5rem; height: 0.5rem;
}
.dropdown li a { display: block; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); font-weight: 500; }
.dropdown li a:hover { background: var(--color-bg-alt); }
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.has-dropdown.is-open .dropdown { display: block; }

.header-cta { display: flex; align-items: center; gap: 0.75rem; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; background: none; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--color-ink); margin-inline: auto; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--color-slate-dark), var(--color-primary-light));
  color: #fff; padding-block: 4rem;
}
.hero__inner { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { color: #fff; }
.hero p.lead { color: #d7e3da; font-size: 1.1rem; max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 1.5rem; }
.hero-checklist { display: grid; gap: 0.6rem; margin-top: 1.75rem; }
.hero-checklist li { display: flex; align-items: center; gap: 0.6em; color: #e7efe9; font-weight: 600; font-size: 0.95rem; }
.hero-checklist li::before { content: "✓"; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--color-accent); color: #fff; font-size: 0.75rem; flex-shrink: 0; }
.hero-media {
  background: rgba(255,255,255,0.08); border: 1px dashed rgba(255,255,255,0.35);
  border-radius: var(--radius-lg); min-height: 280px;
  display: flex; align-items: center; justify-content: center;
  text-align: center; color: #cfe0d5; font-size: 0.9rem; padding: 1.5rem;
}

/* ---- Page header (inner pages) ---- */
.page-header { background: var(--color-bg-alt); padding-block: 3rem; border-bottom: 1px solid var(--color-border); }
.page-header .eyebrow { color: var(--color-accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.breadcrumbs { font-size: 0.85rem; color: var(--color-ink-faint); margin-bottom: 0.75rem; }
.breadcrumbs a { color: var(--color-ink-faint); text-decoration: underline; }

/* ---- Sections ---- */
.section { padding-block: 4rem; }
.section-alt { background: var(--color-bg-alt); }
.section-header { max-width: 60ch; margin-bottom: 2.5rem; }
.section-header .eyebrow { color: var(--color-accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; display: block; margin-bottom: 0.5rem; }

/* ---- Grids / cards ---- */
.grid { display: grid; gap: 1.75rem; }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; height: 100%;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { flex-grow: 1; }
.card .btn { margin-top: 1rem; align-self: flex-start; }

.service-card__icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  background: var(--color-bg-alt); display: flex; align-items: center; justify-content: center;
  color: var(--color-primary); font-weight: 800; margin-bottom: 1rem;
}

/* Card with a full-bleed photo on top — the whole card is the link */
.card-photo {
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; height: 100%;
  text-decoration: none; color: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card-photo:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-photo .photo-wrap { overflow: hidden; }
.card-photo img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .3s ease; }
.card-photo:hover img { transform: scale(1.05); }
.card-photo__body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; flex-grow: 1; }
.card-photo__body h3 { margin-bottom: 0.35rem; font-size: 1.1rem; }
.card-photo__body p { flex-grow: 1; margin-bottom: 0.75rem; font-size: 0.92rem; }
.card-photo__cta { color: var(--color-primary); font-weight: 700; font-size: 0.9rem; }
.card-photo__cta span { display: inline-block; transition: transform .15s ease; }
.card-photo:hover .card-photo__cta span { transform: translateX(3px); }

.promise-list { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.promise-list li { display: flex; gap: 0.85rem; align-items: flex-start; }
.promise-list li::before {
  content: "✓"; flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--color-primary); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; margin-top: 2px;
}
.promise-list strong { display: block; color: var(--color-ink); }

/* ---- Media placeholder (fallback where no photo is assigned yet) ---- */
.media-placeholder {
  background: repeating-linear-gradient(45deg, var(--color-bg-alt), var(--color-bg-alt) 10px, #eceef0 10px, #eceef0 20px);
  border: 1px dashed var(--color-border); border-radius: var(--radius-lg);
  min-height: 220px; display: flex; align-items: center; justify-content: center;
  text-align: center; color: var(--color-ink-faint); font-size: 0.85rem; padding: 1.5rem;
}

/* ---- Photo (real content images) ---- */
.photo { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-lg); }
.hero-media.has-photo { background: none; border: none; padding: 0; overflow: hidden; }
.hero-media.has-photo .photo { aspect-ratio: 4 / 3; }

/* ---- CTA banner ---- */
.cta-banner {
  background: var(--color-slate); color: #fff; border-radius: var(--radius-lg);
  padding: 2.5rem; display: flex; flex-wrap: wrap; gap: 1.5rem;
  align-items: center; justify-content: space-between;
}
.cta-banner h2, .cta-banner p { color: #fff; margin: 0; }
.cta-banner .btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---- Trust bar ---- */
.trust-bar { border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); padding-block: 1.75rem; }
.trust-bar ul { display: flex; flex-wrap: wrap; gap: 2.5rem; justify-content: center; align-items: center; }
.trust-bar ul img { height: 32px; width: auto; object-fit: contain; }

/* ---- FAQ ---- */
.faq-item { border-bottom: 1px solid var(--color-border); padding-block: 1.25rem; }
.faq-item h3 { margin-bottom: 0.5rem; }

/* ---- Testimonials ---- */
.testimonial { border-left: 4px solid var(--color-accent); padding-left: 1.25rem; }
.testimonial p.quote { font-size: 1.05rem; font-style: italic; color: var(--color-ink); }
.testimonial cite { display: block; font-style: normal; font-weight: 700; margin-top: 0.5rem; color: var(--color-ink-soft); font-size: 0.9rem; }

/* ---- Forms ---- */
.form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-field--full { grid-column: 1 / -1; }
label { font-weight: 700; font-size: 0.9rem; }
input, select, textarea {
  font: inherit; padding: 0.7em 0.85em; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: #fff; color: var(--color-ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--color-primary); outline-offset: 1px; }
textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: 0.8rem; color: var(--color-ink-faint); }
.hp-field { position: absolute; left: -9999px; }

.form-alert { border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-bottom: 1.5rem; font-weight: 600; }
.form-alert--success { background: var(--color-success-bg); color: var(--color-success-text); }
.form-alert--error { background: var(--color-error-bg); color: var(--color-error-text); }
.form-alert ul { list-style: disc; padding-left: 1.25em; margin-top: 0.4em; font-weight: 500; }

/* ---- Map / find us ---- */
.map-frame { border: 0; width: 100%; height: 100%; min-height: 320px; border-radius: var(--radius-lg); }
.map-wrap { border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--color-border); min-height: 320px; }

/* ---- Footer ---- */
.site-footer { background: var(--color-slate-dark); color: #d6d8db; padding-top: 3.5rem; }
.site-footer h2 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }
.site-footer p, .site-footer address { color: #b7bbc1; }
.footer-grid { display: grid; gap: 2.5rem; grid-template-columns: 1.4fr 1fr 1fr 1fr; padding-bottom: 2.5rem; }
.footer-col ul { display: grid; gap: 0.6rem; }
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-col .social-list { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }
.social-list a {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  transition: background-color .15s ease, border-color .15s ease;
}
.social-list a:hover { background: var(--color-primary-light); border-color: var(--color-primary-light); }
.social-list svg { width: 18px; height: 18px; fill: #d6d8db; }
.social-list a:hover svg { fill: #fff; }
.hours { line-height: 1.7; }

.footer-partners { border-top: 1px solid rgba(255,255,255,0.12); padding-block: 1.5rem; }
.footer-partners__label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.footer-partners ul { display: flex; flex-wrap: wrap; gap: 1.75rem; align-items: center; }
.footer-partners ul img { height: 36px; width: auto; object-fit: contain; }

/* Solid blue bar for the copyright strip — mirrors the original site's footer */
.footer-bottom { background: var(--color-primary-light); padding-block: 1.25rem; font-size: 0.85rem; }
.footer-bottom p { margin: 0; color: #fff; }

/* ---- Responsive ---- */
@media (min-width: 760px) {
  .hero__inner { grid-template-columns: 1.1fr 0.9fr; }
}

@media (max-width: 900px) {
  .nav-panel { display: none; }
  .nav-toggle { display: flex; }

  .site-header.is-nav-open .nav-panel {
    display: flex; flex-direction: column; align-items: stretch; gap: 1rem;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--color-bg); border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md); padding: 1rem 1.25rem 1.5rem;
  }
  .site-header.is-nav-open .main-nav > ul { flex-direction: column; align-items: stretch; gap: 0.25rem; }
  .site-header.is-nav-open .main-nav a { display: block; padding: 0.75rem 0; }
  .site-header.is-nav-open .header-cta { flex-direction: column; align-items: stretch; }
  .site-header.is-nav-open .dropdown { position: static; box-shadow: none; margin: 0.25rem 0 0; border: none; padding-left: 0.75rem; }

  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .top-bar__inner { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
}
