/* Asbury AI Solutions — canonical first-party site shell
   Harbor Grit: warm paper, hard ink rules, signal-red action. */

:root {
  --shell-ink: #111111;
  --shell-paper: #f2efe8;
  --shell-surface: #f9f7f2;
  --shell-signal: #e6441f;
  --shell-line: #161616;
  --shell-muted: #5a5a5a;
  --shell-shadow: 8px 8px 0 #171717;
  --shell-wrap: 1120px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

/* Shared scroll-reveal — canonical version of the motion pattern several
   pages (services, store, homepage) already carry as a per-page inline
   copy. Centralized here so any page that tags an element `.reveal` gets
   it for free via site-shell.js, without duplicating CSS/JS per file. */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 380ms ease, transform 380ms ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Visually-hidden but screen-reader-accessible — for satisfying heading
   hierarchy (no h1->h3 skips) without changing any visible layout. */
.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;
}

body {
  overflow-wrap: break-word;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

img,
svg,
video,
canvas {
  height: auto;
}

:focus-visible {
  outline: 3px solid var(--shell-signal);
  outline-offset: 3px;
}

.skip-link {
  position: fixed !important;
  top: 0 !important;
  left: 1rem !important;
  z-index: 10000 !important;
  width: auto !important;
  height: auto !important;
  padding: 0.65rem 0.9rem !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: nowrap;
  border: 2px solid var(--shell-line) !important;
  background: var(--shell-signal) !important;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 120ms ease;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline-color: var(--shell-ink);
}

.topbar {
  border-bottom: 2px solid var(--shell-line) !important;
  background: var(--shell-surface) !important;
  position: sticky;
  top: 0;
  z-index: 1000 !important;
}

.topbar > .wrap {
  width: min(var(--shell-wrap), calc(100% - 2rem));
  min-height: 68px !important;
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.topbar .brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--shell-ink);
  text-decoration: none;
  font-weight: 700;
}

.topbar .brand-mark {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--shell-line) !important;
  border-radius: 0 !important;
  background: var(--shell-signal) !important;
  box-shadow: none !important;
}

.topbar .brand-mark img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}

.topbar .brand-name {
  color: var(--shell-ink) !important;
  font-family: "Archivo Black", Impact, sans-serif !important;
  font-size: 0.9rem !important;
  line-height: 1.1;
  letter-spacing: 0.02em !important;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  min-width: 48px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--shell-line) !important;
  border-radius: 0 !important;
  padding: 0.45rem 0.7rem !important;
  background: #fff !important;
  color: var(--shell-ink) !important;
  box-shadow: 4px 4px 0 var(--shell-line) !important;
  font: 700 0.82rem/1 "IBM Plex Sans", "Segoe UI", sans-serif !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--shell-line) !important;
}

.topbar .nav {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.1rem !important;
  flex-wrap: nowrap !important;
}

.topbar .nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 2px solid transparent;
  padding: 0.35rem 0.42rem !important;
  color: var(--shell-ink);
  font-size: clamp(0.72rem, 0.56rem + 0.16vw, 0.84rem) !important;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.topbar .nav a:hover,
.topbar .nav a:focus-visible,
.topbar .nav a[aria-current="page"] {
  border-color: var(--shell-line) !important;
  background: #fff !important;
  color: var(--shell-ink) !important;
  outline: none;
}

.topbar .nav a[aria-current="page"] {
  box-shadow: inset 0 -3px 0 var(--shell-signal);
}

.topbar .nav .cta-chip,
.topbar .nav .cta-chip:hover,
.topbar .nav .cta-chip:focus-visible {
  border-color: var(--shell-line) !important;
  background: var(--shell-signal) !important;
  color: #fff !important;
  box-shadow: none !important;
}

.footer {
  border-top: 2px solid var(--shell-line) !important;
  padding: 1.5rem 0 2rem !important;
  background: #171717 !important;
  color: #efefef !important;
}

.footer > .wrap,
.footer .footer-grid {
  width: min(var(--shell-wrap), calc(100% - 2rem));
  margin-inline: auto;
}

.footer-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 0.9fr) !important;
  gap: 1rem !important;
  align-items: start !important;
}

.footer h3 {
  margin: 0 0 0.3rem;
  color: #fff !important;
  font-family: "Archivo Black", Impact, sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.2;
  text-transform: uppercase;
}

.footer p {
  margin: 0 !important;
  color: #d4d4d4 !important;
  font-size: 0.88rem !important;
}

.footer a:not(.footer-links a) {
  color: #fff !important;
  overflow-wrap: anywhere;
}

.footer-links {
  display: flex !important;
  flex-flow: row wrap !important;
  align-items: flex-start;
  gap: 0.4rem !important;
}

.footer-links a {
  min-height: 40px;
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  margin: 0 !important;
  border: 2px solid #fff !important;
  border-radius: 0 !important;
  padding: 0.3rem 0.5rem !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 0.76rem !important;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  background: #fff !important;
  color: var(--shell-ink) !important;
  outline: none;
}

.table-wrap,
.comparison-box,
.article-body-content {
  max-width: 100%;
}

.article-body-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-body-content pre,
.article-body-content code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .topbar > .wrap {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 68px !important;
    padding-block: 0.35rem;
  }

  .nav-toggle {
    display: inline-flex !important;
  }

  .topbar .nav {
    position: absolute !important;
    top: calc(100% + 2px) !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1001;
    max-height: calc(100dvh - 84px);
    overflow-y: auto;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch !important;
    gap: 0.45rem !important;
    padding: 0.75rem 1rem 1rem !important;
    border-top: 0 !important;
    border-bottom: 2px solid var(--shell-line) !important;
    background: var(--shell-paper) !important;
    box-shadow: 0 6px 0 var(--shell-line);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
  }

  .topbar .nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }

  .topbar .nav a {
    width: 100%;
    min-height: 46px;
    justify-content: flex-start;
    border-color: var(--shell-line) !important;
    padding: 0.55rem 0.7rem !important;
    background: #fff !important;
    font-size: 0.86rem !important;
  }

  .topbar .nav .cta-chip {
    justify-content: center;
  }
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 76px;
  }

  .topbar > .wrap,
  .footer > .wrap,
  .footer .footer-grid {
    width: min(100% - 1.25rem, var(--shell-wrap));
  }

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

  .footer-links {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-links a {
    width: 100% !important;
  }
}

@media (max-width: 520px) {
  .topbar .brand-name {
    max-width: 15ch;
    white-space: normal;
  }

  .topbar .nav {
    grid-template-columns: 1fr;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal.in {
    opacity: 1 !important;
    transform: none !important;
  }
}
