/* AJ Tyres Swindon — mobile-first, accessible stylesheet */
:root {
  --ink: #1f2228;             /* logo charcoal */
  --ink-2: #3e4148;
  --paper: #ffffff;
  --paper-2: #f4f4f1;
  --line: #dcdcd6;
  --muted: #555b62;          /* 7.0:1 on white */
  --accent: #c8202f;         /* AJ Tyres brand red — 5.9:1 with white */
  --accent-hover: #a51a27;
  --accent-ink: #ffffff;
  --gold: #e8a400;           /* review stars */
  --link: #0b57d0;           /* 6.3:1 on white */
  --ok: #1a7f37;
  --closed: #b42318;
  --radius: 12px;
  --max: 1120px;
  --gutter: 16px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

/* Focus — always visible for keyboard users */
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }
.hero :focus-visible, .page-hero :focus-visible, .site-footer :focus-visible, .mobile-bar :focus-visible { outline-color: #fff; }

.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;
}
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .75rem 1rem;
  font-weight: 700; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: var(--gutter); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header / nav ---------- */
.site-header {
  background: #fff; color: var(--ink);
  position: sticky; top: 0; z-index: 50;
  border-bottom: 4px solid var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; padding: 8px 0; }
.brand img { height: 44px; width: auto; }
@media (min-width: 860px) { .brand img { height: 52px; } }

.nav-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--ink); border: 2px solid var(--ink); border-radius: 8px;
  min-height: 44px; padding: 0 14px; font: inherit; font-weight: 700; cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

.site-nav { display: none; width: 100%; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 8px 0 16px; }
.site-nav a {
  display: flex; align-items: center; min-height: 48px; padding: 0 4px;
  color: var(--ink); text-decoration: none; font-weight: 700; border-bottom: 1px solid var(--line);
}
.site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a:hover { color: var(--accent); }
.btn.header-call { display: none; }

.header-inner { flex-wrap: wrap; }

@media (min-width: 860px) {
  .header-inner { flex-wrap: nowrap; }
  .nav-toggle { display: none; }
  .site-nav { display: block !important; width: auto; }
  .site-nav ul { display: flex; gap: 4px; padding: 0; }
  .site-nav a { border: 0; padding: 0 14px; min-height: 72px; position: relative; }
  .site-nav a[aria-current="page"]::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 4px; background: var(--accent);
  }
  .btn.header-call { display: inline-flex; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 10px;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: transform .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); }
.btn-outline { background: transparent; color: inherit; border-color: currentColor; }
.btn-outline-light { background: transparent; color: #fff; border-color: #fff; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row .btn { flex: 1 1 200px; }
@media (min-width: 600px) { .btn-row .btn { flex: 0 0 auto; } }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(90deg, rgba(20,22,26,.94) 0%, rgba(20,22,26,.82) 55%, rgba(20,22,26,.6) 100%),
    url("../img/shopfront.jpg") 72% 18% / cover no-repeat, var(--ink);
  color: #fff; padding: 48px 0 56px;
}
.hero .eyebrow { color: #ff8a93; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; font-size: .85rem; margin-bottom: .75rem; }
.hero p.lead { font-size: 1.2rem; color: #e3e5e8; max-width: 38ch; }
.hero-grid { display: grid; gap: 32px; }
@media (min-width: 900px) { .hero { padding: 80px 0; } .hero-grid { grid-template-columns: 1.4fr 1fr; align-items: center; } }

.page-hero { background: var(--ink); color: #fff; padding: 40px 0; }
.page-hero p { color: #e3e5e8; max-width: 60ch; margin: 0; font-size: 1.1rem; }

/* Info card in hero */
.info-card {
  background: #fff; color: var(--ink); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); border-top: 6px solid var(--accent);
}
.info-card h2 { font-size: 1.15rem; margin-bottom: .75rem; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: .75rem; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.status.open { color: var(--ok); }
.status.closed { color: var(--closed); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--paper-2); }
.section-head { max-width: 62ch; margin-bottom: 28px; }
.section-head p { color: var(--muted); }

.grid { display: grid; gap: 16px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); height: 100%;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p { color: var(--muted); margin: 0; }
.icon {
  width: 44px; height: 44px; border-radius: 10px; background: var(--accent); color: var(--accent-ink);
  display: inline-grid; place-items: center; flex: none;
}
.icon svg { width: 24px; height: 24px; }

.service-list { list-style: none; padding: 0; margin: 12px 0 0; color: var(--muted); }
.service-list li { padding-left: 22px; position: relative; margin-bottom: 4px; }
.service-list li::before { content: ""; position: absolute; left: 4px; top: .62em; width: 8px; height: 8px; background: var(--accent); border-radius: 2px; }

/* Hours table */
.hours { width: 100%; border-collapse: collapse; font-size: 1rem; }
.hours th, .hours td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours td { text-align: right; }
.hours tr.today th, .hours tr.today td { font-weight: 800; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }

/* CTA band */
.cta-band { background: var(--accent); color: var(--accent-ink); padding: 40px 0; }
.cta-band .container { display: grid; gap: 16px; align-items: center; }
.cta-band h2 { margin: 0; }
@media (min-width: 800px) { .cta-band .container { grid-template-columns: 1fr auto; } }

/* ---------- Reviews ---------- */
.rating-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 24px;
}
.rating-big { font-size: 3rem; font-weight: 800; line-height: 1; }
.rating-meta { color: var(--muted); }
.stars { display: inline-flex; gap: 2px; color: var(--gold); }
.stars svg { width: 20px; height: 20px; }
.stars .empty { color: #c9ccd1; }
.rating-summary .btn-row { margin-left: auto; }

.review-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
@media (min-width: 760px) { .review-list { grid-template-columns: repeat(2, 1fr); } }
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.review-head { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--paper-2); object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 800; color: var(--muted); }
.review-author { font-weight: 800; }
.review-author a { color: var(--ink); text-decoration: none; }
.review-author a:hover { text-decoration: underline; }
.review-date { color: var(--muted); font-size: .9rem; }
.review-text { margin: 0; white-space: pre-line; }
.review-text.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; align-self: flex-start; min-height: 32px; }
.attribution { color: var(--muted); font-size: .9rem; margin-top: 20px; }
.reviews-status { color: var(--muted); }
.skeleton { background: linear-gradient(90deg, #eee, #f6f6f6, #eee); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius); min-height: 160px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Small rating teaser (home) */
.rating-teaser { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); padding: 10px 14px; border-radius: 999px; margin-top: 20px; font-weight: 700; }
.rating-teaser:hover { background: rgba(255,255,255,.14); }

/* ---------- Contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 14px; }
.contact-list li { display: flex; gap: 12px; align-items: flex-start; }
.contact-list .icon { width: 40px; height: 40px; }
.contact-list strong { display: block; }
address { font-style: normal; }

.map-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--paper-2); aspect-ratio: 4 / 3; display: grid; place-items: center; text-align: center; padding: 20px; }
.map-wrap iframe { width: 100%; height: 100%; border: 0; }
.map-wrap.has-map { padding: 0; }
.map-wrap p { color: var(--muted); font-size: .95rem; max-width: 36ch; margin: 8px auto 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #d3d5d9; border-top: 4px solid var(--accent); padding: 40px 0 96px; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer h2 { color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } .site-footer { padding-bottom: 40px; } }
.footer-bottom { border-top: 1px solid #33383e; margin-top: 28px; padding-top: 20px; font-size: .85rem; }

/* Sticky mobile action bar */
.mobile-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px var(--gutter) calc(8px + env(safe-area-inset-bottom));
  background: var(--ink); border-top: 1px solid #33383e;
}
.mobile-bar .btn { min-height: 52px; }
@media (min-width: 760px) { .mobile-bar { display: none; } }

/* Utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.note { font-size: .9rem; color: var(--muted); }

/* ---------- Photos & media ---------- */
.media-split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 860px) { .media-split { grid-template-columns: 1fr 1fr; gap: 48px; } .media-split.reverse > :first-child { order: 2; } }
.photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--paper-2); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-tall { aspect-ratio: 4 / 5; }
.photo-wide { aspect-ratio: 4 / 3; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.gallery .photo { aspect-ratio: 3 / 4; }
.gallery .photo:first-child { grid-row: span 2; aspect-ratio: auto; }
.brands { border-radius: var(--radius); overflow: hidden; background: #111; }
.brands img { width: 100%; }
.check-list { list-style: none; padding: 0; margin: 0 0 1.25em; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 3px; }
.card-photo { margin: -22px -22px 18px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.badge { display: inline-block; background: #fdecee; color: #8f1520; font-weight: 800; font-size: .8rem; padding: 2px 10px; border-radius: 999px; margin-bottom: 10px; }
.inline-cta { font-weight: 700; }

/* Photo finish: soft inner frame + gentle zoom on hover (desktop only) */
.photo { position: relative; }
.photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); pointer-events: none; }
.photo img { transition: transform .5s ease; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) { .photo:hover img { transform: scale(1.03); } }

/* Phones: hero text sits over the whole photo, so darken it evenly for legibility */
@media (max-width: 899px) {
  .hero { background: linear-gradient(rgba(20,22,26,.86), rgba(20,22,26,.9)), url("../img/shopfront.jpg") 72% 18% / cover no-repeat, var(--ink); }
}
