/* Site styles that Bootstrap utilities cannot express; shared by all public pages. */

/* ---------- Fonts ---------- */

@font-face {
  font-family: 'Work Sans';
  src: url(../fonts/WorkSans-VariableFont_wght.ttf);
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Work Sans';
  src: url(../fonts/WorkSans-Italic-VariableFont_wght.ttf);
  font-style: italic;
  font-display: swap;
}

/* ---------- Brand values ---------- */

:root {
  --bs-primary: #274e82;
  --bs-primary-rgb: 39, 78, 130;
  --bs-body-font-family: 'Work Sans', Verdana, Roboto, sans-serif;
  --mv-bar-alpha: .98;
  --mv-bar-py: 10px;
  --mv-bar-px: 20px;
  --mv-logo: 100pt;
  --mv-title: 26px;
  /* Keeps anchor targets clear of the fixed top bar. */
  scroll-padding-top: 110px;
}

@media (max-width: 575.98px) {
  :root {
    --mv-logo: 60pt;
  }
}

/* ---------- Top bar ---------- */

#navbar {
  --bs-navbar-color: #fff;
  --bs-navbar-hover-color: rgba(255, 255, 255, .7);
  --bs-navbar-active-color: #fff;
  padding: var(--mv-bar-py) var(--mv-bar-px);
  background-color: rgba(var(--bs-primary-rgb), var(--mv-bar-alpha));
  transition: padding .3s, background-color .3s;
}

#navbar.nav-shrunk {
  /* Nearly opaque, so that the text under the bar does not show through; white text keeps 4.5:1. */
  --mv-bar-alpha: .95;
  --mv-bar-py: 4px;
  --mv-bar-px: 16px;
  --mv-logo: 54pt;
  --mv-title: 15px;
}

#navbar .nav-link {
  letter-spacing: .08em;
}

/* Bootstrap's pale blue focus ring does not show on the blue bar. */
#navbar .nav-link:focus-visible {
  box-shadow: 0 0 0 .2rem #fff;
}

#main-logo {
  width: var(--mv-logo);
  height: var(--mv-logo);
  padding: 10px 12px;
  object-fit: contain;
  transition: width .3s, height .3s;
}

.navbar-brand-text {
  font-size: var(--mv-title);
  letter-spacing: .06em;
  transition: font-size .3s;
}

.navbar-toggler[aria-expanded=false] .bi-x-lg,
.navbar-toggler[aria-expanded=true] .bi-list {
  display: none;
}

/* The ring marks keyboard focus only; after a tap on Android it would stay when the menu closes. */
.navbar-toggler:focus:not(:focus-visible) {
  box-shadow: none;
}

/* The menu hangs from the bar under the burger and follows the bar's transparency. */
#nav-menu {
  --bs-dropdown-bg: rgba(var(--bs-primary-rgb), var(--mv-bar-alpha));
  --bs-dropdown-min-width: 240px;
  --bs-dropdown-spacer: 0;
  --bs-dropdown-border-radius: 12px;
  --bs-dropdown-font-size: .875rem;
  --bs-dropdown-link-color: #fff;
  --bs-dropdown-item-padding-x: 22px;
  --bs-dropdown-item-padding-y: 11px;
  right: var(--mv-bar-px);
  letter-spacing: .05em;
}

/* Bootstrap marks a focused item only with a faint light background. */
#nav-menu .dropdown-item:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

body:has(#nav-menu.show)::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1029;
  background: rgba(0, 0, 0, .35);
}

/* ---------- Slideshow ---------- */

#slideshow,
#window {
  height: 100vh;
  height: 100svh;
}

@media (orientation: portrait) {
  #slideshow,
  #window {
    height: 50vh;
  }
}

/* The carousel fills the window, so the ring is drawn inside it. */
#slideshow:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
}

#slideshow-captions {
  transition-duration: .6s;
}

#slideshow-captions,
#slideshow .carousel-caption {
  text-shadow: 1px 2px 4px rgba(0, 0, 0, .75);
}

/* Hidden until slideshow.js has built the slides: a click before that would
   create the carousel with Bootstrap's default options. */
.carousel-inner:empty ~ .carousel-control-prev,
.carousel-inner:empty ~ .carousel-control-next {
  display: none;
}

/* A dark disc keeps the white arrows visible on light photos. */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  width: 3rem;
  height: 3rem;
  background-color: rgba(0, 0, 0, .5);
  background-size: 50%;
  border-radius: 50%;
}

.carousel-control-prev,
.carousel-control-next {
  opacity: .9;
}

/* Bootstrap removes the outline of the controls on focus. */
.carousel-control-prev:focus-visible .carousel-control-prev-icon,
.carousel-control-next:focus-visible .carousel-control-next-icon {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* A translucent disc over the photos; the utilities colour only backgrounds set by .bg-*. */
.slideshow-toggle {
  --bs-btn-bg: rgba(0, 0, 0, .5);
  --bs-btn-hover-bg: rgba(0, 0, 0, .75);
  --bs-btn-active-bg: rgba(0, 0, 0, .75);
  --bs-btn-focus-box-shadow: 0 0 0 .125rem #000, 0 0 0 .25rem #fff;
}

/* btn-close-white inverts the colours of the button, so the black focus ring shows white. */
.presentation-close {
  --bs-btn-close-opacity: .85;
  --bs-btn-close-focus-shadow: 0 0 0 .25rem #000;
}

@media (prefers-reduced-motion: reduce) {
  #navbar,
  #main-logo,
  .navbar-brand-text {
    transition: none;
  }
}

/* ---------- Content ---------- */

/* Nearly opaque for text contrast over the photos; the darker error text keeps 4.5:1. */
.section-card {
  --bs-card-bg: rgba(255, 255, 255, .97);
  --bs-form-invalid-color: var(--bs-danger-text-emphasis);
  max-width: 920px;
}

.heading {
  letter-spacing: .1em;
}

/* The paragraphs come from Markdown, so they cannot carry classes. */
#about-text p {
  margin-bottom: .6rem;
}

/* Field borders with 3:1 contrast against the card. */
#contact-form {
  --bs-border-color: var(--bs-gray-600);
}

/* Bootstrap's pale focus ring has under 3:1 against the card; the brand blue keeps
   the state visible. After a submit Bootstrap's green and red borders take over. */
#contact-form:not(.was-validated) .form-control:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .4);
}

#sponsors {
  margin: -48px 0;
  padding-top: 64px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0, #000 50%);
}
