/* Apollo Engineering Ltd. — shared stylesheet
   Brand: blue #2D89EF, gray #808080; dark slate for hero/footer contrast
   Canadian English site copy; vanilla CSS only */

:root {
  --brand-blue: #2D89EF;
  --brand-blue-hover: #1f6fd1;
  --brand-gray: #808080;
  --slate: #334155;
  --slate-dark: #1e293b;
  --slate-deeper: #0f172a;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --accent: var(--brand-blue);
  --accent-hover: var(--brand-blue-hover);
  --text: #1e293b;
  --text-muted: #5a5a5a;
  --max: 1100px;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(30, 41, 59, 0.08), 0 4px 12px rgba(30, 41, 59, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--slate-dark);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header / nav — white background for logo legibility */
.site-header {
  background: var(--white);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(45, 137, 239, 0.15);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.brand-logo:hover,
.brand-logo:focus-visible {
  text-decoration: none;
  opacity: 0.92;
}

.brand-logo img {
  display: block;
  height: auto;
  width: auto;
  max-height: 52px;
  max-width: min(280px, 70vw);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--brand-gray);
  color: var(--brand-gray);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  cursor: pointer;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--brand-gray);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--brand-blue);
  border-bottom-color: var(--brand-blue);
}

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--slate-deeper) 0%, var(--slate-dark) 55%, #243447 100%);
  color: var(--white);
  padding: 3.25rem 0 3.5rem;
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  line-height: 1.25;
  font-weight: 700;
  max-width: 38rem;
}

.hero .lede {
  margin: 0 0 1.75rem;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  line-height: 1.3;
}

.btn:hover,
.btn:focus-visible {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--white);
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.btn-outline {
  background: transparent;
  color: var(--brand-blue);
  border-color: var(--brand-blue);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--brand-blue);
  color: var(--white);
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section-alt {
  background: var(--bg);
}

.section-header {
  margin-bottom: 1.75rem;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: var(--slate-dark);
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
  max-width: 40rem;
}

h2 {
  font-size: 1.5rem;
  color: var(--slate-dark);
  margin: 0 0 1rem;
}

h3 {
  font-size: 1.15rem;
  color: var(--slate-dark);
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

p:last-child {
  margin-bottom: 0;
}

ul.plain {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

ul.plain li {
  margin-bottom: 0.35rem;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.card h3 {
  margin-top: 0;
}

.card p {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card .card-link {
  margin-top: 0.75rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
}

.card .card-link:hover {
  color: var(--accent-hover);
}

.card-accent {
  border-top: 3px solid var(--accent);
}

/* Also-offer strip */
.also-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: 1.25rem 1.35rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.also-strip p {
  margin: 0;
  color: var(--text-muted);
  flex: 1 1 16rem;
}

.also-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.also-tags li {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--brand-gray);
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

/* Credentials / meta strips */
.cred-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.cred-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
}

.cred-item strong {
  display: block;
  color: var(--slate-dark);
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}

.cred-item span {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.areas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.area-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.area-box h3 {
  margin-bottom: 0.4rem;
}

.area-box p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* CTA band */
.cta-band {
  background: var(--slate-dark);
  color: var(--white);
  padding: 2.5rem 0;
  text-align: center;
}

.cta-band h2 {
  color: var(--white);
  margin-bottom: 0.5rem;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.85);
  margin: 0 auto 1.25rem;
  max-width: 32rem;
}

/* Page hero (inner pages) */
.page-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 2.25rem 0 2rem;
}

.page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  color: var(--slate-dark);
}

.page-hero .lede {
  margin: 0;
  color: var(--text-muted);
  max-width: 40rem;
}

/* Service detail blocks */
.service-block {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.service-block:last-child {
  border-bottom: none;
}

.service-block h2 {
  margin-bottom: 0.75rem;
}

.service-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}

.service-meta > div {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
}

.service-meta h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-light);
  margin-bottom: 0.5rem;
}

.service-meta p,
.service-meta ul {
  margin: 0;
  font-size: 0.925rem;
  color: var(--text);
}

.service-meta ul {
  padding-left: 1.1rem;
}

.service-meta li {
  margin-bottom: 0.3rem;
}

.secondary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.secondary-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.secondary-card h3 {
  margin-bottom: 0.4rem;
}

.secondary-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.group-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 2rem 0 1rem;
}

.group-label:first-of-type {
  margin-top: 0.5rem;
}

/* About */
.prose {
  max-width: 42rem;
}

.prose h2 {
  margin-top: 2rem;
}

.license-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.license-list li {
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  background: var(--white);
}

.license-list strong {
  color: var(--slate-dark);
}

/* Licences & authorizations — province cards (About aside) */
.aside-box ul.lic-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.aside-box li.lic-card {
  margin: 0;
  font-size: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: var(--shadow);
}

.lic-logo {
  height: 44px;
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  box-sizing: content-box;
  border-bottom: 1px solid var(--border);
}

.lic-logo img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

/* PEO artwork has built-in padding (~30% of height); enlarge so its visible mark matches EGM/APEGS */
.lic-logo img.lic-logo-peo {
  height: 58px;
  margin: -7px 0 -7px -9px;
}

.aside-box .lic-province {
  margin: 0 0 0.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}

.lic-body {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--slate-dark);
}

.aside-box ul.lic-held {
  list-style: none;
  margin: 0;
  padding: 0;
}

.aside-box ul.lic-held li {
  position: relative;
  margin: 0 0 0.35rem;
  padding-left: 1.6rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.lic-held .nowrap {
  white-space: nowrap;
}

.aside-box ul.lic-held li:last-child {
  margin-bottom: 0;
}

.aside-box ul.lic-held li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--accent);
}

.aside-box ul.lic-held li::after {
  content: "";
  position: absolute;
  left: 0.36rem;
  top: calc(0.12em + 0.22rem);
  width: 0.3rem;
  height: 0.52rem;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.two-col {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: start;
}

.aside-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
}

.aside-box h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.aside-box ul {
  margin: 0;
  padding-left: 1.15rem;
}

.aside-box li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

/* Contact */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.contact-card dl {
  margin: 0;
}

.contact-card dt {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--slate-light);
  margin-top: 1rem;
}

.contact-card dt:first-child {
  margin-top: 0;
}

.contact-card dd {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
  color: var(--slate-dark);
}

.placeholder {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  background: #fff7ed;
  border: 1px dashed #fdba74;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.95em;
  color: #9a3412;
}

.note-box {
  background: var(--bg);
  border-left: 4px solid var(--brand-blue);
  padding: 1rem 1.15rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.note-box p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--slate-deeper);
  color: rgba(255, 255, 255, 0.75);
  padding: 2rem 0 1.5rem;
  font-size: 0.9rem;
  margin-top: auto;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
}

.footer-brand strong {
  display: block;
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
  color: var(--white);
  text-decoration: underline;
}

.footer-credentials {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  justify-content: space-between;
}

.footer-credentials-text {
  margin: 0;
  flex: 1 1 16rem;
  max-width: 36rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
}

.footer-cred-logos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

.footer-cred-logos li {
  margin: 0;
  background: var(--white);
  border-radius: 4px;
  padding: 0.4rem 0.65rem;
  line-height: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.footer-cred-logos img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.footer-meta {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  .cred-grid {
    grid-template-columns: 1fr 1fr;
  }

  .service-meta {
    grid-template-columns: 1fr;
  }

  .secondary-grid {
    grid-template-columns: 1fr;
  }

  .two-col,
  .contact-layout,
  .areas {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav {
    display: none;
    width: 100%;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 0.25rem;
  }

  .site-nav a {
    display: block;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a[aria-current="page"] {
    border-bottom-color: var(--accent);
  }

  .cred-grid {
    grid-template-columns: 1fr;
  }

  .footer-cred-logos img {
    height: 40px;
    max-width: 170px;
  }

  .hero {
    padding: 2.5rem 0 2.75rem;
  }

  .section {
    padding: 2.25rem 0;
  }
}

.area-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--slate-dark);
  line-height: 1.9;
}
