/* Global Styles */
:root {
  scroll-behavior: smooth;
  --sqm-brand-color: #b838c6; /* WCAG AA compliant for white text: >4.5:1 contrast */
  --sqm-brand-color-hover: #a32eb2; /* WCAG AA compliant for white text: ~4.8:1 contrast with white text (meets AA for normal text but not AAA); not intended for normal text against dark backgrounds (≈3.2:1) */
}

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

body {
  margin: 0;
  background-color: var(--bs-body-bg, #121212);
}

.navbar-height {
  min-height: 75px;
}

.mt-nav {
  margin-top: 91px;
}

/* SQM Custom Classes */
.sqm-landing-text {
  text-align: center;
}

/* Doubled selector (.btn-brand.btn-brand) for specificity to override Bootstrap defaults without !important */
.btn-brand.btn-brand {
  background-color: var(--sqm-brand-color);
  border-color: var(--sqm-brand-color);
  color: white;
}

.btn-brand.btn-brand:hover,
.btn-brand.btn-brand:focus,
.btn-brand.btn-brand:active {
  background-color: var(--sqm-brand-color-hover);
  border-color: var(--sqm-brand-color-hover);
  color: white;
}

/* SQM Carousel Caption with higher specificity to avoid !important */
#sqm-carousel .sqm-carousel-caption {
  position: absolute;
  text-shadow: 0px 0px 3px black;
  font-size: 24px;
  width: 100%;
  max-width: 100%;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem 1rem 2.5rem 1rem;
  text-align: center;
  margin: 0;
  /* Gradient keeps a strong dark overlay behind caption text (~0–65%) and fades out towards the top (65–100%) so the image remains visible. */
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.5) 65%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 10;
}

/* Carousel indicators - ensure they remain visible on both dark and light images */
#sqm-carousel .carousel-indicators {
  filter: none;
  margin-bottom: 0.25rem; /* Move closer to bottom edge */
  z-index: 20; /* Ensure above caption and controls */
}

#sqm-carousel .carousel-indicators button {
  width: 24px; /* WCAG 2.2 Level AA target size (SC 2.5.8); does not meet WCAG 2.1 Level AAA (SC 2.5.5 requires 44×44px) */
  height: 24px;
  border-radius: 4px; /* Square with rounded corners */
  margin-left: 6px;
  margin-right: 6px;
  background-color: rgba(255, 255, 255, 0.5);
  /* Add a dark border and subtle outline so indicators are visible on light backgrounds */
  border: 2px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}

#sqm-carousel .carousel-indicators button.active {
  background-color: rgba(255, 255, 255, 1);
  border: 2px solid rgba(0, 0, 0, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8);
}

/* Visual indicator for carousel image when selected via tab navigation */
#sqm-carousel .carousel-item a:focus-visible {
  outline: none; /* Remove default outline to replace with custom on image */
}

#sqm-carousel .carousel-item a:focus-visible img {
  outline: 4px solid var(--sqm-brand-color);
  outline-offset: -4px; /* Draw outline inside the image to avoid clipping */
}

/* Ensure controls are above everything else if needed */
.carousel-control-prev,
.carousel-control-next {
  z-index: 15;
}

/* Spacer and Content Width */
.page-content {
  width: 75%;
}

@media (min-width: 768px) {
  .sqm-spacer {
    min-height: 100px;
  }
}

@media (max-width: 767px) {
  /* This rule targets viewports below the 768px breakpoint, complementing the min-width: 768px rule above. Note: integer max-width/min-width breakpoints can have theoretical 1px rounding nuances; Bootstrap’s breakpoint system handles this in practice. */
  .sqm-spacer {
    min-height: 50px;
  }
}

/* Accessibility: High Contrast Focus Indicators */
:focus-visible {
  outline: 2px solid var(--sqm-brand-color) !important;
  outline-offset: 2px !important;
}

/* Override Bootstrap's focus shadow for buttons and inputs to match brand */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(188, 60, 204, 0.5) !important; /* Semi-transparent brand color */
  border-color: var(--sqm-brand-color) !important;
}

/* Fallback navbar brand styling */
.navbar-brand-fallback {
  color: var(--sqm-brand-color);
  font-weight: bold;
  font-size: 1.5rem;
}
