html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Skip Navigation Link - WCAG Level A Requirement */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 12px;
  text-decoration: none;
  z-index: 1000;
  font-weight: 600;
  transition: top 0.2s ease, background-color 0.2s ease;
}

.skip-link:focus {
  top: 0;
  background: #003166;
  outline: 3px solid #fdb714;
  outline-offset: 2px;
}

/* Remove dotted underline from abbreviations */
abbr {
  text-decoration: none !important;
  border-bottom: none !important;
  cursor: inherit !important;
}

abbr[title] {
  text-decoration: none !important;
  border-bottom: none !important;
}

/* AAA Visual Presentation - Paragraph Spacing and Line Length */
p {
  margin-bottom: 1em;
  line-height: 1.5;
}

.content-wrapper,
.container p {
  max-width: 80ch;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Menu Button Accessibility - Line Height Fix */
.navbar-toggler {
  line-height: 1.5;
}

/* Official Banner - Text Width Constraint for Readability (AAA) */
.official-banner p {
  max-width: 75ch;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  background-color: #ffffff !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh;
}

main {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

.content-container {
  min-height: 100%;
  box-shadow: none !important;
}

/* Remove gap between hero and footer */
footer.footer,
footer.footer-basic {
  position: static !important;
  margin-top: 0 !important;
  transform: none !important;
  padding-bottom: 0 !important;
  bottom: auto !important;
  flex-shrink: 0 !important;
}

.footer-basic .links-wrapper {
  padding-top: 0 !important;
}

/* Navigation Link Hover States with Underline Animation */
.navbar-nav .nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: currentColor;
  transition: width 0.3s ease, left 0.3s ease;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link:focus::after {
  width: 100%;
  left: 0;
}

/* Button Hover Effects */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:focus,
.btn:active:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb, 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s ease;
}

/* Footer Link Hover States */
.footer a,
.footer-basic a {
  transition: color 0.3s ease, text-decoration-color 0.3s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
}

.footer a:hover,
.footer a:focus,
.footer-basic a:hover,
.footer-basic a:focus {
  text-decoration-color: currentColor;
}

.footer,
.footer-basic {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Official Banner Collapse Animation */
.official-banner .collapse,
.official-banner .collapsing {
  transition: height 0.35s ease;
}

.official-banner button .fa,
.official-banner button .fas {
  transition: transform 0.3s ease;
}

.official-banner button[aria-expanded="true"] .fa,
.official-banner button[aria-expanded="true"] .fas {
  transform: rotate(180deg);
}

/* Enhanced Focus Indicators */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
a:focus,
button:focus {
  transition: box-shadow 0.2s ease, outline 0.2s ease;
}

a:focus-visible {
  outline: 2px solid #258cfb;
  outline-offset: 3px;
  transition: outline-offset 0.2s ease;
}

/* Consistent Heading Spacing */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1.25em;
  line-height: 1.3;
}

h1 + p, h2 + p, h3 + p, h4 + p {
  margin-top: 0.75em;
}

p + p {
  margin-top: 1em;
}

/* Interior Page Hero Sections */
.interior-hero {
  background: linear-gradient(135deg, #003166 0%, #005a8c 100%);
  padding: 3rem 0;
  margin-bottom: 3rem;
  position: relative;
}

.interior-hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #fdb714 0%, #f58220 100%);
}

.interior-hero h1 {
  color: #ffffff;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.interior-hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  margin-bottom: 0;
  max-width: 70ch;
}

@media (max-width: 767px) {
  .interior-hero {
    padding: 2rem 0;
    margin-bottom: 2rem;
  }

  .interior-hero h1 {
    font-size: 1.75rem;
  }

  .interior-hero p {
    font-size: 1rem;
  }
}

/* Navbar Toggler Hover */
.navbar-toggler {
  transition: transform 0.2s ease;
}

.navbar-toggler:hover {
  transform: scale(1.05);
}

/* Tableau Viz Container */
.viz-container {
    width: 1002px;
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #dee2e6;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .viz-container {
        width: 100%;
        padding: 10px;
    }

    .viz-container tableau-viz {
        width: 100% !important;
        height: 800px !important;
    }
}

/* Section sub-navigation tabs */
.section-subnav {
  border-bottom: 2px solid #dee2e6;
  margin-bottom: 2rem;
}

.section-subnav .nav-link {
  color: #495057;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1rem;
  font-weight: 500;
}

.section-subnav .nav-link:hover {
  color: #003166;
  border-bottom-color: #005a8c;
}

.section-subnav .nav-link.active {
  color: #003166;
  border-bottom-color: #003166;
  font-weight: 600;
}

/* Reduced Motion Support - WCAG 2.2 AAA */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .btn:hover {
    transform: none !important;
  }
}
