/* Branding helpers and accessibility-focused overrides. */

/* ---------- Global accessibility helpers ---------- */
html {
  color-scheme: light;
}

::selection {
  background: rgba(19, 115, 68, 0.18);
  color: var(--navy);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Brand artwork ---------- */

.brand-wordmark {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
}

.brand-wordmark::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / 3;
  width: 42px;
  height: 44px;
  background: url("../assets/branding/umnotho-emblem.webp") center / contain no-repeat;
}

.brand-wordmark .brand-name,
.brand-wordmark .brand-subname {
  grid-column: 2;
}

.brand-wordmark .brand-name { grid-row: 1; align-self: end; }
.brand-wordmark .brand-subname { grid-row: 2; align-self: start; }

.footer-brand-badge > a {
  display: grid;
  width: max-content;
  grid-template-columns: 52px auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
}

.footer-brand-badge > a::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / 3;
  width: 52px;
  height: 55px;
  background: url("../assets/branding/umnotho-emblem.webp") center / contain no-repeat;
}

.footer-brand-name,
.footer-brand-subname {
  grid-column: 2;
}

.footer-brand-name { grid-row: 1; align-self: end; }
.footer-brand-subname { grid-row: 2; align-self: start; }

/* ---------- Navigation and focus states ---------- */

.nav-whatsapp {
  white-space: nowrap;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(12, 73, 135, 0.42);
  outline-offset: 4px;
}

.btn:focus-visible,
.gallery-arrow:focus-visible,
.lightbox-arrow:focus-visible,
.lightbox-close:focus-visible,
.menu-toggle:focus-visible {
  outline-color: var(--bright-green);
}

.nav-link[aria-current="location"] {
  color: var(--navy);
}

.site-header {
  -webkit-backdrop-filter: blur(16px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    background: rgba(255, 255, 255, 0.99);
  }
}

/* ---------- Motion preferences ---------- */

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

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

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

/* ---------- Responsive branding ---------- */

@media (max-width: 720px) {
  .brand-wordmark {
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 8px;
  }

  .brand-wordmark::before {
    width: 38px;
    height: 40px;
  }

}

@media (max-width: 420px) {
  .service-chip {
    max-width: calc(100vw - 38px);
  }
}
