/* ==========================================================================
   IP Auto Services theme
   Brand: near-black #181818, white, cool grey #D0D8DD, logo blue #054CEB
   Type: Barlow Condensed (display), Barlow (body)
   ========================================================================== */

:root {
  --ink: #181818;
  --ink-deep: #0E0E0E;
  --white: #FFFFFF;
  --grey: #D0D8DD;
  --grey-soft: #EEF2F4;
  --grey-hover: #F2F5F7;
  --blue-logo: #054CEB;     /* exact logo blue: fills, buttons, lines */
  --blue: #4D84FF;          /* logo blue lifted for text/hover on dark (4.9:1 on #181818) */
  --blue-ink: #054CEB;      /* logo blue on white (6.5:1) */
  --blue-ink-hover: #033BB8;
  --text-muted: #4A5258;
  --text-soft: #3E464C;
  --on-dark-muted: #C9D1D6;
  --on-dark-faint: #9EA8AE;
  --font-display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --container: 1344px;      /* 1280px of content + 32px gutters */
  --gutter: 32px;
  --header-h: 84px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue-ink); }
a:hover { color: var(--blue-ink-hover); }
input, select, textarea, button { font: inherit; }
section[id] { scroll-margin-top: var(--header-h); }

.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px;
  overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; width: auto; margin: 0; z-index: 100000;
  left: 8px; top: 8px; padding: 12px 18px; background: var(--white); color: var(--ink);
}

.display { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; line-height: 0.9; margin: 0; }
.eyebrow {
  font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 28px;
  border: 0; text-decoration: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: 0.06em; text-transform: uppercase;
}
.btn--white { background: var(--white); color: var(--ink-deep); }
.btn--white:hover { background: var(--grey); color: var(--ink-deep); }
.btn--blue { background: var(--blue-logo); color: var(--white); }
.btn--blue:hover { background: var(--blue-ink-hover); color: var(--white); }
.btn--dark { background: var(--ink); color: var(--white); }
.btn--dark:hover { background: #2B2F32; color: var(--white); }

/* ---------- Header ---------- */
.site-header { background: var(--ink); z-index: 50; }
.site-header__inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header__logo { display: flex; align-items: center; }
.site-header__logo img { height: 46px; width: auto; display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 36px; align-items: center; }
.site-nav a {
  color: var(--white); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase;
}
.site-nav a:hover { color: var(--blue); }
.site-header__phone {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--white); text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: 0.02em;
}
.site-header__phone:hover { color: var(--blue); }

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--ink); color: var(--white); }
.hero-pin { position: relative; height: 100vh; max-height: 900px; min-height: 640px; overflow: hidden; background: var(--ink); }
.hero-media {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%;
  display: block; will-change: transform; max-width: none;
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(10,12,14,.78) 0%, rgba(10,12,14,.55) 40%, rgba(10,12,14,.12) 72%, rgba(10,12,14,0) 100%),
    linear-gradient(180deg, rgba(10,12,14,.45) 0%, rgba(10,12,14,.15) 50%, rgba(10,12,14,.25) 100%);
}
/* Text block centred in the space below the header */
.hero-copy { position: absolute; inset: 0; padding-top: var(--header-h); display: flex; align-items: center; will-change: transform, opacity; }
.hero-copy .container { width: 100%; }
.hero__title { font-family: var(--font-display); font-weight: 800; font-size: 88px; line-height: 0.9; letter-spacing: -0.005em; text-transform: uppercase; margin: 0; }
.hero__lede { margin: 20px 0 0; font-size: 19px; color: #F1F5F8; max-width: 620px; text-shadow: 0 1px 12px rgba(0,0,0,.45); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.icbc-badge { height: 36px; width: auto; display: block; }

/* ---------- Loading screen (homepage, first view) ----------
   template-parts/loader.php. Pure CSS: the logo builds itself (IP and AUTO rise,
   the lines draw outward, SERVICES opens from the centre), holds, then the whole
   screen slides up to reveal the hero. html.ipa-seen (set in <head>) skips it. */
.loader {
  position: fixed; inset: 0; z-index: 100000; background: var(--ink-deep);
  display: grid; place-items: center; pointer-events: none;
  animation: ipa-loader-out .85s cubic-bezier(.76,0,.24,1) 2.05s both;
}
.loader__logo { width: min(560px, 74vw); animation: ipa-logo-out .7s cubic-bezier(.6,0,.3,1) 1.95s both; }
.loader__svg { display: block; width: 100%; height: auto; overflow: visible; }
.loader__svg path { transform-box: fill-box; }
.loader .lg-ip { animation: ipa-rise .7s cubic-bezier(.2,.8,.2,1) .15s both; }
.loader .lg-auto { animation: ipa-rise .7s cubic-bezier(.2,.8,.2,1) .32s both; }
.loader .lg-lineL { transform-origin: 100% 50%; animation: ipa-draw .5s cubic-bezier(.65,0,.35,1) .8s both; }
.loader .lg-lineR { transform-origin: 0% 50%; animation: ipa-draw .5s cubic-bezier(.65,0,.35,1) .8s both; }
.loader .lg-services { animation: ipa-open .55s cubic-bezier(.65,0,.35,1) 1s both; }
.loader__img img { display: block; width: 100%; height: auto; animation: ipa-fade-up .9s cubic-bezier(.2,.8,.2,1) .2s both; }
@keyframes ipa-fade-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ipa-rise { from { transform: translateY(108%); } to { transform: none; } }
@keyframes ipa-draw { from { transform: scaleX(0); } to { transform: none; } }
@keyframes ipa-open { from { clip-path: inset(0 50%); opacity: 0; } to { clip-path: inset(0 0); opacity: 1; } }
@keyframes ipa-logo-out { to { transform: translateY(-48px); opacity: 0; } }
@keyframes ipa-loader-out { to { transform: translateY(-100%); visibility: hidden; } }

/* Front page: the header sits over the top of the hero, as before */
.home .site-header { position: fixed; top: 0; left: 0; right: 0; }
.home.admin-bar .site-header { top: 32px; }

/* What the loader reveals: the photo settles, the copy rises, the header drops in */
.home .hero-media { animation: ipa-settle 1.8s cubic-bezier(.2,.7,.2,1) 2.15s both; }
.home .hero-copy { animation: ipa-copy-in .9s cubic-bezier(.2,.8,.2,1) 2.55s both; }
.home .site-header__inner { animation: ipa-header-in .7s cubic-bezier(.2,.8,.2,1) 2.75s both; }
@keyframes ipa-settle { from { transform: scale(1.12); } to { transform: none; } }
@keyframes ipa-copy-in { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes ipa-header-in { from { transform: translateY(-24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Coming back from another page, a section link, or a booking redirect: no intro */
.ipa-seen .loader { display: none; }
.ipa-seen .home .hero-media, .ipa-seen .home .hero-copy, .ipa-seen .home .site-header__inner { animation: none; }

/* ---------- Booking bar ---------- */
.booking { background: var(--ink-deep); }
.booking__form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding-top: 24px; padding-bottom: 24px; }
.booking__field { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.booking__field--wide { flex: 2 1 220px; }
.booking__field label {
  font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--on-dark-muted);
}
.booking__field input, .booking__field select {
  width: 100%; min-width: 0; height: 52px; border: 0; border-radius: 0; padding: 0 14px;
  background: var(--white); color: var(--ink); font-size: 17px;
}
.booking__submit { flex: 1 1 160px; height: 52px; }
.booking__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.booking__notice { margin: 0; padding: 14px 0 0; font-size: 16px; color: var(--white); flex-basis: 100%; }
.booking__notice--ok { color: #9FD3A8; }
.booking__notice--error { color: #F2A99B; }

/* ---------- Languages ---------- */
.languages { border-bottom: 1px solid var(--grey); }
.languages .container { padding-top: 40px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 12px 40px; align-items: baseline; }
.languages__welcome { font-family: var(--font-display); font-weight: 800; font-size: 40px; text-transform: uppercase; }
.languages__word { font-weight: 700; font-size: 34px; }
.languages__note { font-size: 16px; color: var(--text-muted); flex-basis: 100%; margin: 0; }

/* ---------- Services ---------- */
.services .container { padding-top: 96px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 48px 64px; }
.services__intro { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.services__title { font-size: 72px; }
.services__lede { margin: 0; color: var(--text-soft); max-width: 360px; }
.services__media { flex: 1 1 auto; min-height: 360px; position: relative; overflow: hidden; background: var(--grey); }
.svc-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; max-width: none;
  opacity: 0; transform: scale(1.04); transition: opacity .5s ease, transform .9s ease;
}
.svc-img.is-on { opacity: 1; transform: scale(1); }
.services__list { flex: 2 1 560px; min-width: 0; border-top: 3px solid var(--ink); }
.svc { padding: 26px 8px; border-bottom: 1px solid var(--grey); color: var(--ink); cursor: pointer; }
.svc:hover, .svc.is-on { background: var(--grey-hover); }
.svc__title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1.05; text-transform: uppercase; }
.svc__btn {
  all: unset; display: block; width: 100%; cursor: pointer;
  font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; transition: color .2s ease;
}
.svc.is-on .svc__btn { color: var(--blue-ink); }
.svc__btn:focus-visible { outline: 2px solid var(--blue-ink); outline-offset: 4px; }
.svc__text { color: var(--text-muted); margin: 6px 0 0; }

/* ---------- ICBC ---------- */
.icbc { background: var(--ink); color: var(--white); }
/* Photo runs to the left edge of the screen; the text lines up with the page's right margin */
.icbc__inner { display: flex; flex-wrap: wrap; }
.icbc__media { flex: 0 0 50%; min-height: 560px; position: relative; overflow: hidden; background: #2B2F32; }
.icbc__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; display: block; max-width: none; }
.icbc__body { flex: 0 0 50%; min-width: 0; padding: 96px max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter))) 96px 64px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.icbc__badge { height: 48px; width: auto; align-self: flex-start; }
.icbc__title { font-size: 60px; line-height: 0.92; }
.icbc__text { margin: 0; color: var(--on-dark-muted); font-size: 18px; max-width: 460px; }
.icbc .btn { align-self: flex-start; }

/* ---------- Reviews ---------- */
.reviews .container { padding-top: 104px; padding-bottom: 104px; display: flex; flex-wrap: wrap; gap: 56px; }
.reviews__lead { flex: 3 1 560px; min-width: 0; margin: 0; }
.reviews__lead blockquote { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 52px; line-height: 1.02; text-transform: uppercase; }
.reviews__lead figcaption, .review figcaption { margin-top: 24px; font-weight: 600; }
.reviews__source { color: var(--text-muted); font-weight: 400; }
.reviews__more { flex: 2 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 32px; border-left: 3px solid var(--blue); padding-left: 32px; }
.review { margin: 0; }
.review blockquote { margin: 0; font-size: 18px; }
.review figcaption { margin-top: 10px; font-size: 15px; }
.reviews__link { font-weight: 600; }

/* ---------- Visit ---------- */
.visit { background: var(--grey-soft); }
.visit__grid { display: grid; grid-template-columns: 1fr minmax(0, 560px); gap: 48px 96px; align-items: start; padding-top: 96px; padding-bottom: 88px; }
.visit__where .eyebrow { color: var(--blue-ink); }
.visit__title { font-size: 88px; margin-top: 12px; }
.visit__city { margin: 10px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 28px; letter-spacing: 0.01em; text-transform: uppercase; color: var(--text-muted); }
.visit__btn { margin-top: 32px; }
.visit__info { display: grid; }
.visit__item { display: grid; grid-template-columns: 96px 1fr; gap: 24px; align-items: baseline; padding: 22px 0; border-top: 1px solid rgba(24,24,24,.14); }
.visit__item:last-child { border-bottom: 1px solid rgba(24,24,24,.14); }
.visit__item .eyebrow { font-size: 13px; }
.hours { margin: 0; display: grid; gap: 8px; }
.hours__row { display: flex; justify-content: space-between; gap: 24px; font-size: 17px; }
.hours dt { font-weight: 600; color: var(--ink); }
.hours dd { margin: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; text-align: right; }
.visit__phone { justify-self: start; font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1; color: var(--ink); text-decoration: none; }
.visit__phone:hover { color: var(--blue-ink); }
.visit__email { justify-self: start; font-size: 18px; font-weight: 500; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.visit__email:hover { color: var(--blue-ink); }
.visit__map { height: 380px; background: var(--grey); }
.visit__map iframe { display: block; width: 100%; height: 100%; border: 0; filter: grayscale(.35) contrast(1.05); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-deep); color: #AEB7BD; font-size: 14px; }
.site-footer__top { padding-top: 48px; padding-bottom: 48px; display: flex; flex-wrap: wrap; gap: 24px 48px; align-items: center; justify-content: space-between; }
.site-footer__top img { height: 40px; width: auto; }
.site-footer__about { margin: 0; flex: 1 1 420px; max-width: 620px; }
.site-footer a { color: var(--white); }
.site-footer__social { list-style: none; margin: 0 -11px; padding: 0; display: flex; gap: 8px; }
.site-footer__social a {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  color: var(--white); transition: color .2s;
}
.site-footer__social a:hover, .site-footer__social a:focus-visible { color: var(--blue); }
.site-footer__social svg { display: block; width: 24px; height: 24px; fill: currentColor; }
.site-footer__bottom { padding-top: 16px; padding-bottom: 28px; border-top: 1px solid #2A2E31; font-size: 13px; color: #8E989F; }

/* ---------- Inner pages (index.php fallback) ---------- */
.page-body .container { padding-top: 72px; padding-bottom: 96px; max-width: 860px; }
.page-body h1 { font-family: var(--font-display); font-weight: 800; font-size: 56px; text-transform: uppercase; line-height: .95; margin: 0 0 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .visit__grid { grid-template-columns: 1fr; gap: 40px; padding-top: 72px; padding-bottom: 64px; }
  .visit__city { font-size: 22px; }
  .icbc__media { flex: 0 0 100%; min-height: 0; aspect-ratio: 4 / 3; }
  .icbc__body { flex: 0 0 100%; padding: 64px var(--gutter); }
  .site-nav { display: none; }
  .hero__title { font-size: 64px; }
  .services__title, .icbc__title, .visit__title, .reviews__lead blockquote { font-size: 44px; }
  .hero-scrim { background: linear-gradient(180deg, rgba(10,12,14,.5) 0%, rgba(10,12,14,.72) 30%, rgba(10,12,14,.72) 75%, rgba(10,12,14,.35) 100%); }
}
@media (max-width: 600px) {
  .visit__item { grid-template-columns: 1fr; gap: 10px; }
  .hours__row { font-size: 16px; }
  :root { --header-h: 64px; }
  .site-header__inner { padding-left: 16px; padding-right: 16px; }
  .site-header__logo img { height: 36px; }
  .site-header__phone { font-size: 18px; }
  .loader__logo { width: 82vw; }
}
@media (max-width: 782px) {
  .home.admin-bar .site-header { top: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loader { display: none; }
  .hero-media, .hero-copy, .home .site-header__inner { animation: none !important; }
  .svc-img { transition: none; }
}
