/* ==========================================================================
   Hi-Tech Mufflers & Auto Services - style guide
   Palette sampled from the Bourke Street shopfront. See site.md section 3.
   ========================================================================== */

/* --- Design tokens ------------------------------------------------------ */
:root {
  /* Brand. Blue and yellow are taken off the building.
     RULE: yellow NEVER carries white text - it is a dark-text surface only. */
  --c-blue:        #0b63b0;  /* 6.1:1 on white; white text on it is 6.1:1   */
  --c-blue-dark:   #084c88;
  --c-blue-deep:   #06375f;
  --c-blue-ink:    #041f37;
  --c-yellow:      #f5b921;  /* ink on yellow = 10.1:1                      */
  --c-yellow-dark: #d89f0b;
  --c-yellow-tint: #ffdf8f;  /* small text on --c-blue: 4.7:1. Full yellow is only 3.5:1 there. */
  --c-red:         #b4161b;  /* signage red. Detail only, never on yellow.  */

  /* Neutrals */
  --c-ink:          #14181f;
  --c-body:         #3b4250;
  --c-muted:        #5a6172;
  --c-line:         #dde2e9;
  --c-line-blue:    #17557f;
  --c-surface:      #ffffff;
  --c-surface-2:    #f3f6fa;
  --c-on-dark:      #ffffff;
  --c-on-dark-soft: #c6d8ea;

  /* Type */
  --f-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --t-xs:   0.8125rem;
  --t-sm:   0.9375rem;
  --t-base: 1.0625rem;
  --t-lg:   1.1875rem;
  --t-xl:   clamp(1.35rem, 1.1rem + 1.1vw, 1.75rem);
  --t-2xl:  clamp(1.65rem, 1.25rem + 1.9vw, 2.35rem);
  --t-3xl:  clamp(2rem, 1.4rem + 3vw, 3.15rem);

  /* Spacing */
  --s-1: 0.25rem; --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 3rem;    --s-8: 4.5rem;

  /* Structure */
  --wrap: 68rem;
  --radius: 6px;
  --radius-lg: 10px;
  --ring: 3px;
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--c-body);
  background: var(--c-surface);
}
h1, h2, h3 { color: var(--c-ink); line-height: 1.2; margin: 0 0 var(--s-4); text-wrap: balance; }
h1 { font-size: var(--t-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.015em; }
h3 { font-size: var(--t-lg); letter-spacing: -0.005em; }
p  { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }
ul { margin: 0 0 var(--s-4); padding-left: 1.15rem; }
a { color: var(--c-blue-dark); }
a:hover { color: var(--c-blue); }
img { max-width: 100%; height: auto; display: block; }
address { font-style: normal; }

/* Icon sprite: defines <symbol>s only, never rendered itself. */
.sprite { display: none; }

/* --- Accessibility ------------------------------------------------------ */
:focus-visible { outline: var(--ring) solid var(--c-yellow-dark); outline-offset: 2px; border-radius: 2px; }
.hero :focus-visible, .site-header :focus-visible, .site-footer :focus-visible,
.section--blue :focus-visible { outline-color: var(--c-yellow); }
.skip-link {
  position: absolute; left: var(--s-4); top: -100%; z-index: 100;
  padding: var(--s-3) var(--s-5); background: var(--c-ink); color: var(--c-on-dark);
  text-decoration: none; border-radius: 0 0 var(--radius) var(--radius);
}
.skip-link:focus { top: 0; color: var(--c-on-dark); }
.nowrap { white-space: nowrap; }  /* stops brand names breaking at their hyphen */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* --- Layout primitives -------------------------------------------------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-5); }
.section { padding-block: var(--s-8); }
.section--alt  { background: var(--c-surface-2); border-block: 1px solid var(--c-line); }
.section--blue { background: var(--c-blue-deep); color: var(--c-on-dark-soft); }
.section--blue h2, .section--blue h3 { color: var(--c-on-dark); }
.section__lede { max-width: 46rem; font-size: var(--t-lg); color: var(--c-muted); }
.section--blue .section__lede { color: var(--c-on-dark-soft); }
.grid { display: grid; gap: var(--s-5); }
@media (min-width: 40rem) { .grid--2 { grid-template-columns: repeat(2, 1fr); } .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 58rem) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

/* Yellow rule under section headings - echoes the shopfront pilasters. */
.section h2::after, .hero h2::after {
  content: ""; display: block; width: 3.5rem; height: 4px;
  background: var(--c-yellow); border-radius: 2px; margin-top: var(--s-4);
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-5); font-size: var(--t-base); font-weight: 700;
  line-height: 1.3; text-decoration: none; border: 2px solid transparent;
  border-radius: var(--radius); transition: background-color .15s ease, color .15s ease;
}
/* Yellow CTA with ink text: highest-contrast pairing in the palette. */
.btn--primary { background: var(--c-yellow); color: var(--c-ink); }
.btn--primary:hover { background: var(--c-yellow-dark); color: var(--c-ink); }
.btn--ghost { border-color: var(--c-line); color: var(--c-ink); background: var(--c-surface); }
.btn--ghost:hover { background: var(--c-surface-2); color: var(--c-ink); }
.hero .btn--ghost, .section--blue .btn--ghost {
  background: transparent; border-color: #4d7ea9; color: var(--c-on-dark);
}
.hero .btn--ghost:hover, .section--blue .btn--ghost:hover { background: rgba(255,255,255,.12); color: var(--c-on-dark); }
.btn__icon { flex: none; width: 1.15em; height: 1.15em; }

/* --- Header ------------------------------------------------------------- */
.site-header { background: var(--c-blue); color: var(--c-on-dark); border-bottom: 4px solid var(--c-yellow); }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-5); padding-block: var(--s-3); }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--c-on-dark); margin-right: auto; }
.brand:hover { color: var(--c-on-dark); }
.brand__name { font-size: var(--t-base); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; }
.brand__strap { font-size: var(--t-xs); color: var(--c-yellow-tint); text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: 0; padding: 0; list-style: none; }
.site-nav a { color: #dce9f5; text-decoration: none; font-size: var(--t-sm); font-weight: 500; }
.site-nav a:hover { color: var(--c-on-dark); text-decoration: underline; }
@media (max-width: 63.99rem) { .site-nav { order: 3; width: 100%; border-top: 1px solid var(--c-line-blue); padding-top: var(--s-3); } }

/* --- Hero --------------------------------------------------------------- */
.hero { position: relative; background: var(--c-blue-ink); color: var(--c-on-dark-soft); padding-block: var(--s-8); overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(4,31,55,.95) 0%, rgba(4,31,55,.88) 46%, rgba(6,55,95,.62) 100%);
}
.hero__inner { position: relative; z-index: 1; max-width: 50rem; }
.hero h1 { color: var(--c-on-dark); margin-bottom: var(--s-5); }
.hero__brand { display: block; }
.hero__strap { display: block; font-size: var(--t-xl); font-weight: 600; color: var(--c-yellow); margin-top: var(--s-2); letter-spacing: 0; }
.hero__lede { font-size: var(--t-lg); margin-bottom: var(--s-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* --- Trust strip -------------------------------------------------------- */
.trust { background: var(--c-yellow); color: var(--c-ink); }
.trust ul { display: grid; gap: var(--s-2) var(--s-5); margin: 0; padding: var(--s-4) 0; list-style: none; font-size: var(--t-sm); font-weight: 700; }
@media (min-width: 46rem) { .trust ul { grid-template-columns: repeat(4, 1fr); } }
.trust li { display: flex; align-items: flex-start; gap: var(--s-2); }
.trust svg { flex: none; width: 1.1em; height: 1.1em; margin-top: .2em; }

/* --- Cards -------------------------------------------------------------- */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-top: 3px solid var(--c-blue); border-radius: var(--radius-lg); padding: var(--s-5); }
.card__icon { display: block; width: 1.75rem; height: 1.75rem; color: var(--c-blue); margin-bottom: var(--s-3); }
.card h3 { margin-bottom: var(--s-2); }
.card p { font-size: var(--t-sm); color: var(--c-muted); }
/* Cards keep a light surface inside blue sections, so the inherited
   heading colour must be overridden or headings go white-on-white. */
.section--blue .card h3 { color: var(--c-ink); }
.section--blue .card p  { color: var(--c-muted); }

/* --- Media rows (image beside text) ------------------------------------- */
.media { display: grid; gap: var(--s-6); align-items: center; margin-bottom: var(--s-7); }
@media (min-width: 52rem) {
  /* Text takes the wider column. --flip reverses the ratio as well as the order,
     so the image stays the narrower column whichever side it sits on. */
  .media { grid-template-columns: 1.15fr 0.85fr; }
  .media--flip { grid-template-columns: 0.85fr 1.15fr; }
  .media--flip .media__text { order: 2; }
}
.media__fig { margin: 0; border-radius: var(--radius-lg); overflow: hidden; border: 3px solid var(--c-yellow); }
.media__fig img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* --- Gallery ------------------------------------------------------------ */
.gallery { display: grid; gap: var(--s-4); margin: var(--s-6) 0 0; padding: 0; list-style: none; }
@media (min-width: 44rem) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-lg); }
.gallery figcaption { font-size: var(--t-sm); color: var(--c-muted); margin-top: var(--s-2); }
.section--blue .gallery figcaption { color: var(--c-on-dark-soft); }

/* --- Service area ------------------------------------------------------- */
/* Text column is pinned to the lede's own max-width rather than a fraction, so
   the paragraph keeps its ~70-character measure and the photo takes exactly the
   space that was previously dead. Splits only on wide screens. */
.area { display: grid; gap: var(--s-6); }
@media (min-width: 62rem) {
  .area { grid-template-columns: minmax(0, 46rem) 1fr; align-items: start; }
}
.area__fig img { aspect-ratio: 1 / 2; }   /* tall and narrow, to sit level with the chip list */

.suburbs { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-5) 0 0; padding: 0; list-style: none; }
.suburbs li { font-size: var(--t-sm); padding: var(--s-1) var(--s-3); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 999px; }
.suburbs b { font-weight: 600; color: var(--c-ink); }
.suburbs span { color: var(--c-muted); }

/* --- FAQ ---------------------------------------------------------------- */
.faq { max-width: 48rem; }
.faq h3 { margin-bottom: var(--s-2); }
.faq > div + div { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--c-line); }

/* --- Visit / contact ---------------------------------------------------- */
.visit { display: grid; gap: var(--s-6); }
@media (min-width: 46rem) { .visit { grid-template-columns: 1fr 1fr; } }
.hours { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.hours th, .hours td { text-align: left; padding: var(--s-2) 0; border-bottom: 1px solid var(--c-line); }
.hours th { font-weight: 600; color: var(--c-ink); }
.hours td { text-align: right; color: var(--c-muted); }
.contact-list { list-style: none; margin: 0 0 var(--s-5); padding: 0; }
.contact-list li { display: flex; gap: var(--s-3); margin-bottom: var(--s-4); }
.contact-list svg { flex: none; width: 1.25rem; height: 1.25rem; color: var(--c-blue); }
/* Address row: icon aligns to the first line of the block. */
.contact-list--stack { align-items: flex-start; }
.contact-list--stack svg { margin-top: .22em; }
/* Phone row: icon centres on the single large line, so no nudge. */
.contact-list--inline { align-items: center; }
.contact-list--inline svg { width: 1.5rem; height: 1.5rem; }
.addr-link { color: var(--c-ink); text-decoration: none; }
.addr-link:hover { color: var(--c-blue-dark); text-decoration: underline; }
.addr-link strong { display: block; }
.phone-big { font-size: var(--t-xl); font-weight: 800; color: var(--c-ink); text-decoration: none; line-height: 1.2; }
.phone-big:hover { color: var(--c-blue-dark); text-decoration: underline; }
.ext-note { font-size: var(--t-xs); color: var(--c-muted); }

/* --- Footer ------------------------------------------------------------- */
.site-footer { background: var(--c-blue-ink); color: var(--c-on-dark-soft); padding-block: var(--s-6); font-size: var(--t-sm); border-top: 4px solid var(--c-yellow); }
.site-footer a { color: var(--c-on-dark-soft); }
.site-footer a:hover { color: var(--c-on-dark); }
.site-footer__inner { display: grid; gap: var(--s-5); }
@media (min-width: 46rem) { .site-footer__inner { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer h2 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .09em; color: var(--c-yellow); margin-bottom: var(--s-3); }
.site-footer h2::after { display: none; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: var(--s-2); }
.colophon { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--c-line-blue); font-size: var(--t-xs); }
