/* Affordable Auto Parts Ltd. — shared styles */

/* Hex fallbacks first; oklch upgrades where supported (Chrome 111+, Safari 15.4+, FF 113+). */
:root {
  --bg: #f5f5f2;
  --bg-alt: #efefe9;
  --ink: #16181c;
  --muted: #44474d;
  --muted-2: #5c6066;
  --meta: #6d7075;
  --line: #e2e2db;
  --line-2: #dcdcd4;
  --accent: #1f6cb0;
  --accent-hover: #004e90;
  --on-dark: #b7bbc2;
  --on-dark-bright: #e9ebef;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: 'Archivo', system-ui, sans-serif;

  --wrap: 1120px;
}

@supports (color: oklch(0.52 0.13 250)) {
  :root {
    --accent: oklch(0.52 0.13 250);
    --accent-hover: oklch(0.42 0.13 250);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent); color: #fff; }

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

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Visible only to screen readers — skip link and section labels. */
.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: 8px; top: -48px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 2px;
  font-family: var(--mono); font-size: 13px; transition: top 0.15s;
}
.skip-link:focus { top: 8px; color: #fff; }

/* ---------- Type ---------- */
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.label {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--meta);
}
h1, h2 { font-family: var(--display); letter-spacing: -0.02em; }
.page-title { font-weight: 800; font-size: 44px; margin: 0 0 18px; text-wrap: balance; }
.lede { font-size: 18px; color: var(--muted); max-width: 44em; margin: 0 0 44px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-family: var(--mono); font-size: 13px;
  letter-spacing: 0.04em; text-transform: uppercase; padding: 15px 24px;
  border-radius: 2px; white-space: nowrap; border: 1px solid transparent;
}
.btn-accent { color: #fff; background: var(--accent); }
.btn-accent:hover { color: #fff; background: var(--accent-hover); }
.btn-outline { color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { color: #fff; background: var(--ink); }
.btn-light { color: var(--ink); background: #fff; }
.btn-light:hover { color: var(--ink); background: var(--on-dark-bright); }
.btn-ghost-dark { color: #fff; border-color: #4a4d54; }
.btn-ghost-dark:hover { color: var(--ink); background: #fff; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--ink); color: #c9ccd1;
  font-family: var(--mono); font-size: 12px;
}
.topbar .wrap {
  padding-top: 9px; padding-bottom: 9px;
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  align-items: center; justify-content: space-between;
}
.topbar-contact { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; }
.topbar a { color: var(--on-dark-bright); }
.topbar a:hover { color: #fff; }
.topbar-hours { opacity: 0.7; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(245, 245, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  padding-top: 16px; padding-bottom: 16px;
  display: flex; flex-wrap: wrap; gap: 16px 32px;
  align-items: center; justify-content: space-between;
}
.brand { display: flex; flex-direction: column; gap: 2px; }
.brand:hover { color: inherit; }
.brand-name {
  font-family: var(--display); font-weight: 800; font-size: 19px;
  letter-spacing: -0.01em; color: var(--ink); line-height: 1;
}
.brand-tag {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.22em; color: var(--accent);
}
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.nav-link {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 6px 0; color: var(--ink);
  border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--accent); }
.nav-link[aria-current='page'] { color: var(--accent); border-bottom-color: var(--accent); }
.nav .btn { padding: 10px 16px; font-size: 12px; }

main { flex: 1; }

/* ---------- Placeholder image boxes ---------- */
/* Swap each .ph for <img src="..." alt="..."> once real photos exist. */
.ph {
  background: repeating-linear-gradient(45deg, #e9e9e3, #e9e9e3 11px, var(--line) 11px, var(--line) 22px);
  border: 1px solid var(--line-2); border-radius: 3px;
  display: flex; align-items: flex-end; padding: 12px;
}
.ph span {
  font-family: var(--mono); font-size: 11px; color: #7a7d80;
  background: var(--bg); padding: 4px 7px; border-radius: 2px;
}
.ph-4x3 { aspect-ratio: 4 / 3; }
.ph-16x10 { aspect-ratio: 16 / 10; }

/* ---------- Home: hero ---------- */
.hero {
  padding-top: 72px; padding-bottom: 40px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}
.hero h1 {
  font-weight: 800; font-size: 56px; line-height: 1.02;
  margin: 0 0 22px; text-wrap: balance;
}
/* Typography here is keyed to explicit classes, never `.section p` / `.section h2`.
   A descendant selector like `.hero p` outranks `.eyebrow` and silently resizes
   the labels that sit inside these sections. */
.hero-lede { font-size: 18px; color: var(--muted); max-width: 30em; margin: 0 0 32px; }
.hero .ph { padding: 14px; }
.hero .ph span { font-size: 12px; padding: 4px 8px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Home: stats ---------- */
.stats { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 28px 20px; border-left: 1px solid var(--line); }
.stat-big { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
.stat-label { margin-top: 4px; }

/* ---------- Home: two-column blurb ---------- */
.blurb { padding-top: 64px; padding-bottom: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.blurb-title { font-weight: 700; font-size: 30px; letter-spacing: -0.01em; margin: 0 0 16px; }
.blurb-body { font-size: 17px; color: var(--muted); margin: 0 0 16px; }
.blurb-body:last-child { margin-bottom: 0; }
.blurb-subhead { margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  font-family: var(--mono); font-size: 13px; color: var(--ink);
  background: var(--bg-alt); border: 1px solid var(--line);
  padding: 7px 12px; border-radius: 2px;
}

/* ---------- Dark CTA band ---------- */
.band { background: var(--ink); color: #f2f3f5; }
.band .wrap {
  padding-top: 56px; padding-bottom: 56px;
  display: flex; flex-wrap: wrap; gap: 28px 40px;
  align-items: center; justify-content: space-between;
}
.band h2 { font-weight: 700; font-size: 28px; letter-spacing: -0.01em; margin: 0 0 8px; }
.band p { margin: 0; color: var(--on-dark); font-size: 17px; }

/* ---------- Visit / contact detail grids ---------- */
.visit { padding-top: 64px; padding-bottom: 64px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: start; }
.visit h2 { font-weight: 700; font-size: 26px; letter-spacing: -0.01em; margin: 0 0 20px; }
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 16px; margin: 0; }
.detail-grid dt { padding-top: 3px; }
.detail-grid dd { margin: 0; }
.map { border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.map iframe { border: 0; display: block; width: 100%; height: 100%; }
.map-home { height: 300px; }
.map-contact { height: 480px; }

/* ---------- Parts ---------- */
.parts-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); margin-bottom: 52px;
}
.part { background: var(--bg); padding: 22px 24px; }
.part-name { font-family: var(--display); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.part-desc { color: var(--muted-2); font-size: 15px; }
.gallery-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 52px; }
.note {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 3px;
  padding: 32px; display: flex; flex-wrap: wrap; gap: 20px;
  align-items: center; justify-content: space-between;
}
.note p { font-size: 17px; color: var(--muted); max-width: 36em; margin: 0; }

/* ---------- About ---------- */
.about { padding-top: 64px; padding-bottom: 64px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: start; }
.about-body { font-size: 17px; color: var(--muted); margin: 0 0 16px; }
.about-body:last-child { margin-bottom: 0; }
.gallery-stack { display: grid; gap: 14px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: start; }
.contact-list { display: grid; gap: 22px; margin: 0; }
.contact-list dt { margin-bottom: 4px; }
.contact-list dd { margin: 0; font-size: 18px; }
.contact-phone { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--ink); }
.contact-phone:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark); font-size: 14px; }
.footer-top {
  padding-top: 48px; padding-bottom: 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
}
.footer-brand { font-family: var(--display); font-weight: 800; font-size: 17px; color: #fff; margin-bottom: 8px; }
.footer-top p { margin: 0; max-width: 28em; }
.footer-head {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--meta); margin-bottom: 12px;
}
.footer-links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; list-style: none; margin: 0; padding: 0; }
.footer-links a, .footer-contact a { color: var(--on-dark); }
.footer-links a:hover, .footer-contact a:hover { color: #fff; }
.footer-contact { display: flex; flex-direction: column; gap: 8px; }
.footer-contact a { color: var(--on-dark-bright); }
.footer-bottom { border-top: 1px solid #2a2d33; }
.footer-bottom .wrap { padding-top: 18px; padding-bottom: 18px; font-family: var(--mono); font-size: 12px; color: var(--meta); }

/* ---------- Responsive ----------
   The original design had no breakpoints; it was authored at a fixed 1200px
   preview. These collapse the multi-column grids for tablet and phone. */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .hero h1 { font-size: 40px; }
  .page-title { font-size: 34px; }
  .blurb, .visit, .about, .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .stats .wrap { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .gallery-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-top > :first-child { grid-column: 1 / -1; }
  .map-contact { height: 380px; }
}

@media (max-width: 640px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .site-header { position: static; }
  .site-header .wrap { gap: 14px; }
  .nav { gap: 6px 16px; }
  .hero h1 { font-size: 32px; }
  .hero p, .lede { font-size: 16px; }
  .page-title { font-size: 28px; }
  .stats .wrap { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: none; }
  .parts-grid, .gallery-3 { grid-template-columns: 1fr; }
  .band h2 { font-size: 24px; }
  .note { padding: 24px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .btn { display: block; text-align: center; }
  .nav .btn { display: inline-block; }
  .cta-row { flex-direction: column; align-items: stretch; }
}

@media print {
  .topbar, .site-header, .band, .map, .ph { display: none; }
  body { background: #fff; }
}
