/* ==========================================================================
   Universal Page Baseline Setup
   ========================================================================== */
html {
  box-sizing: border-box;
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth; /* Gives a premium, smooth scrolling feel */
}

*, *:before, *:after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font-family: Verdana, sans-serif;
  font-size: 1rem; 
  line-height: 1.5;
  color: #1a202c; /* Deep Charcoal text */
  background-color: #ffffff;
}

/* Typography elements with relative sizes (rem) */
h1 { font-size: 2.75rem; color: #0a3663; font-weight: 700; letter-spacing: -0.02em; } 
h2 { font-size: 2rem; color: #0a3663; border-bottom: 2px solid #005a9c; padding-bottom: 0.5rem; margin-top: 3rem; }
h3 { font-size: 1.35rem; color: #005a9c; } 
h4 { font-size: 1.2rem; color: #005a9c; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

h1, h2, h3, h4, h5, h6 {
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  margin: 1rem 0 0.5rem 0;
}

hr {
  box-sizing: content-box;
  height: 0;
  overflow: visible;
  border: 0;
  border-top: 1px solid #dae1e7;
  margin: 2.5rem 0;
}

/* ==========================================================================
   Responsive Left Sidebar / Right Content Grid Layout
   ========================================================================== */

/* Left Sidebar Frame Layout */
.w3-sidebar-left {
  height: 100%;
  width: 260px;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  background-color: #0a3663; /* Your Deep Navy Brand Background */
  padding-top: 2rem;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar-brand {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  padding: 0 24px 2rem 24px;
  letter-spacing: -0.02em;
}

/* Accessible Interactive Items (3:1 Contrast and Clear Click Boundaries) */
.w3-sidebar-item {
  display: block;
  padding: 14px 24px;
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 500;
  border-left: 4px solid transparent;
  transition: all 0.2s ease;
}

/* Hover and Focus Rules optimized to pass strict scanner audits */
.w3-sidebar-item:hover, 
.w3-sidebar-item:focus-visible {
  background-color: #002244 !important; /* Darker navy focus accent */
  color: #ff9900 !important;            /* Safety amber active indicator text */
  border-left-color: #ff9900 !important; /* Elegant vertical active line marker */
  outline: none;
}

/* Right Content Main Container Layout */
.main-content-right {
  margin-left: 260px; /* Perfectly offsets the width of your sidebar */
  padding: 3rem 4rem;
  max-width: 1200px;
  background-color: #ffffff;
  min-height: 100vh;
}

/* Responsive Mobile Screen Fallback Loop */
@media (max-width: 992px) {
  .w3-sidebar-left {
    position: relative;
    width: 100%;
    height: auto;
    padding-bottom: 1rem;
  }
  .sidebar-brand {
    padding-bottom: 0.5rem;
  }
  .w3-sidebar-item {
    float: left;
    width: auto;
    border-left: none;
    border-bottom: 3px solid transparent;
    padding: 10px 16px;
  }
  .w3-sidebar-item:hover, 
  .w3-sidebar-item:focus-visible {
    border-bottom-color: #ff9900 !important;
  }
  .main-content-right {
    margin-left: 0;
    padding: 2rem 1.5rem;
  }
}

/* ==========================================================================
   Buttons and Call-to-Action Elements
   ========================================================================== */
.w3-btn, .w3-button {
  border: 2px solid #0a3663 !important; 
  display: inline-block;
  padding: 12px 24px;
  vertical-align: middle;
  overflow: visible;
  text-decoration: none;
  color: #ffffff;
  background-color: #005a9c; /* Vivid Action Blue */
  text-align: center;
  cursor: pointer;
  white-space: normal;
  font-weight: bold;
  border-radius: 4px;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.w3-btn:hover, .w3-button:hover {
  background-color: #004578 !important;
  border-color: #002244 !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Accessible focus ring indicators for keyboard navigation */
.w3-btn:focus-visible, .w3-button:focus-visible, a:focus-visible {
  outline: 3px solid #ff9900; /* Safety amber ring */
  outline-offset: 3px;
}

/* Cards & Layout Containers */
.w3-card {
  background-color: #ffffff;
  border-top: 4px solid #005a9c; /* Brand accent strip */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* Styled Lists */
.w3-ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}
.w3-ul li {
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.w3-ul li:last-child { border-bottom: none; }

/* Callout Highlights */
.w3-panel-callout {
  background-color: #f0f4f8; /* Soft blue layout backdrop */
  border-left: 6px solid #0a3663;
  padding: 1.25rem;
  margin-top: 1.5rem;
  border-radius: 0 4px 4px 0;
}

/* Document Grid Foundations */
.w3-container { padding: 0.01em 16px; }
.w3-auto { max-width: 1140px; margin-left: auto; margin-right: auto; }
.w3-row-padding { padding: 0 8px; }
.w3-third { float: left; width: 33.33333%; padding: 0 8px; }
.w3-half { float: left; width: 50%; padding: 0 8px; }
.w3-right { float: right; }

@media (max-width: 768px) {
  .w3-third, .w3-half { width: 100%; float: none; margin-bottom: 1.5rem; }
  .w3-right { float: none !important; }
}

.w3-container:after, .w3-row-padding:after { content: ""; display: table; clear: both; }

/* Footer Design */
footer {
  background-color: #0f172a; /* Slate Dark Navy */
  color: #f8fafc;
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.95rem;
  margin-top: 5rem;
}

/* Hidden by default, positioned off-screen */
.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  background-color: #ff9900; /* Uses your safety amber accent */
  color: #000000;
  padding: 12px 24px;
  z-index: 9999;
  font-weight: bold;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s ease;
}

/* Snaps into view when a user tabs onto it */
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid #0a3663;
  outline-offset: 2px;
}

/* Force W3.CSS Sidebar to behave like a standard top menu on mobile */
@media screen and (max-width: 992px) {
    /* 1. Fix the menu container appearance and position */
    .w3-sidebar-left, 
    nav.w3-sidebar-left, 
    [class*="w3-sidebar"] { 
        display: block !important; 
        visibility: visible !important;
        position: relative !important;
        transform: none !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        clear: both !important;
        z-index: 9999 !important;
        background-color: #222222 !important; /* Forces a dark grey background behind the white links */
        padding: 15px !important;
    }

    /* 2. Fix the link text colors inside the mobile menu */
    nav.w3-sidebar-left a,
    .w3-sidebar-left a {
        color: #ffffff !important; /* Forces the text links to be stark white */
        display: block !important;
        padding: 10px 0 !important;
    }

    /* 3. Stop the menu from bleeding into the main content */
    main, #main, .w3-main, .content-container {
        margin-left: 0 !important;
        margin-top: 20px !important;
        display: block !important;
        clear: both !important;
    }
}
.hidden-trap-link {
    display: none !important;
    visibility: hidden !important;
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
