/* ===== Design tokens used by header/footer ===== */
:root{
  --color-bg:#f4f6f8;
  --color-panel:#fff;
  --color-accent:#043e52;
  --color-accent-dark:#065068;
  --color-red:#FC3E3E;
  --color-yellow:#FFC833;
  --color-green:#00BC57;
  --color-border:#e4e8f0;
  --color-shadow: 0 2px 16px rgba(27,41,90,.07);
  --radius:16px;
  --radius-btn:8px;
  --transition:.2s;
}

/* ===== Header / Navbar (desktop) ===== */
header{
  display:flex; align-items:center;
  padding:1.5rem 2rem;
  background:#fff;
  box-shadow:0 2px 4px rgba(0,0,0,.06);
  min-height:70px;
}
.logo{ height:44px; cursor:pointer; }
header nav{
  margin-left:2rem;
  display:flex; gap:1.2rem;
}
header nav a{
  text-decoration:none;
  color:#043E52;
  font-weight:500;
  font-size:1rem;
  padding:.5rem 1.2rem;
  border-radius:6px;
  transition:background var(--transition), color var(--transition);
}
header nav a.active,
header nav a:hover{ color:var(--color-accent); background:#f0f7f7; }

/* Hamburger (hidden on desktop) */
.nav-toggle{ display:none; }
.nav-overlay{ display:none; }

/* ===== Header / Navbar (mobile ≤900px) ===== */
@media (max-width:900px){
  header{
    position:sticky; top:0; z-index:1500;
    display:flex !important; flex-direction:row !important;
    align-items:center; justify-content:space-between;
    padding:10px 12px;
    background:#fff;
  }
  .logo{ margin-right:auto !important; height:32px; }

  .nav-toggle{
    display:inline-flex; margin-left:auto !important;
    width:40px; height:40px; border:1px solid var(--color-border);
    border-radius:8px; background:#fff; color:#49536b;
    align-items:center; justify-content:center; cursor:pointer;
  }

  /* Centered dropdown panel */
  header nav{
    position:fixed;
    top:var(--header-h,70px);
    left:50%; transform:translateX(-50%);
    width:min(92vw,420px);
    max-height:calc(100vh - var(--header-h,70px) - 24px);
    overflow:auto;
    display:none !important;
    flex-direction:column; gap:8px;
    background:#fff; padding:12px;
    border-radius:12px;
    box-shadow:0 12px 32px rgba(0,0,0,.18);
    z-index:1501;
    margin-left:0 !important;
  }
  header nav.is-open{ display:flex !important; }

  header nav a{
    display:block; text-align:center;
    padding:12px 14px; border-radius:8px;
    white-space:normal;
  }

  .nav-overlay{
    position:fixed; inset:0;
    background:rgba(0,0,0,.25);
    display:none; z-index:1400;
  }
  body.nav-open .nav-overlay{ display:block; }

  /* Small safe-area niceties */
  @supports (padding:max(0px)){
    header{ padding-left:max(12px,env(safe-area-inset-left));
            padding-right:max(12px,env(safe-area-inset-right)); }
    header nav{ width:min(calc(92vw - env(safe-area-inset-left) - env(safe-area-inset-right)),420px); }
  }
}

/* ===== Footer (shared) ===== */
.footer-main{
  width:100%;
  background:#075267;
  color:#fff;
  font-family: 'IBM Plex Sans', 'Segoe UI', Arial, sans-serif;
  margin-top:40px; padding-bottom:0;
}

/* Top section as responsive grid */
.footer-sections{
  display:grid !important;
  grid-template-columns:repeat(auto-fit, minmax(180px,1fr));
  gap:clamp(12px,4vw,85px);
  padding:clamp(18px,4vw,52px) clamp(12px,6vw,80px) 0 clamp(12px,6vw,80px);
  margin-bottom:clamp(24px,8vw,100px);
}
.footer-section{ min-width:200px; display:flex; flex-direction:column; gap:13px; }
.footer-section h4{ font-size:1.4rem; font-weight:700; margin-bottom:11px; }
.footer-divider{ height:1px; width:100%; background:#e0f2f7; border-radius:2px; margin-bottom:10px; }
.footer-section a{
  color:#fff; text-decoration:none; font-size:1.13rem;
  opacity:.93; margin-bottom:4px; transition:opacity .18s;
}
.footer-section a:hover{ opacity:1; text-decoration:underline; }

.social-links, .accessibility-links{ display:flex; gap:16px; align-items:center; }
.icon-link{
  display:inline-flex; align-items:center; justify-content:center;
  background:#16586C; border-radius:6px; padding:4px 8px;
  font-size:1.3rem; color:#fff; border:1px solid #ffffffcd;
  height:38px; width:38px; transition:background .2s;
}
.icon-link:hover{ background:#21708e; }

/* Bottom row */
.footer-bottom{
  display:grid; grid-template-columns:1fr auto;
  align-items:end; gap:clamp(10px,2vw,28px);
  padding:0 clamp(12px,6vw,80px) 32px clamp(12px,6vw,80px);
}
.footer-bottom-left{ display:flex; flex-direction:column; align-items:flex-start; min-width:330px; }
.footer-links-bottom{ display:flex; flex-direction:column; gap:6px; align-items:flex-start; margin-bottom:10px; }
.footer-links-bottom a{ color:#fff; font-size:1.13rem; text-decoration:underline; opacity:.93; }
.footer-bottom-text{
  font-size:1.09rem; line-height:1.55; margin-bottom:5px; margin-left:0;
  flex:1; min-width:220px; max-width:440px;
}
.footer-bottom-text strong{ display:block; font-size:1.17rem; margin-bottom:6px; }
.footer-bottom-logos{ display:flex; gap:16px; align-items:center; min-width:250px; justify-content:flex-end; margin-bottom:4px; }
.footer-bottom-logos img{ height:41px; background:transparent; }

/* Footer responsive */
@media (max-width:1100px){
  .footer-sections, .footer-bottom{ padding-left:18px; padding-right:18px; }
}
@media (max-width:800px){
  .footer-bottom{
    grid-template-columns:1fr;
    align-items:flex-start; gap:16px;
    padding:0 10px 16px 10px;
  }
  .footer-bottom-logos{ justify-content:flex-start; margin-top:14px; }
}

/* Scrollbar (optional, shared look) */
::-webkit-scrollbar{ width:8px; background:#e9f1f1; }
::-webkit-scrollbar-thumb{ background:#b2d7d7; border-radius:10px; }


/* ===== Mobile Navbar Styles ===== */
/* === Defaults (desktop) === */
.nav-toggle { display: none; }
.nav-overlay { display: none; }

/* Keep your existing desktop nav styles from main.css */

/* === Mobile rules === */
@media (max-width: 900px) {
  /* Header structure */
  header {
    position: sticky;
    top: 0;
    z-index: 1500;
    display: flex;           /* ensure flex on mobile too */
    align-items: center;
    gap: 8px;
    background: #fff;
  }

  /* Keep logo hard-left */
  .logo {
    display: block;
    margin-right: auto;      /* pushes the toggle to the far right */
    cursor: pointer;
  }

  /* Toggle button visible on mobile; don't push logo */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--color-border, #e4e8f0);
    border-radius: 8px;
    background: #fff;
    color: #49536b;
    cursor: pointer;
  }
  /* IMPORTANT: remove any margin-left:auto you had on .nav-toggle */
  .nav-toggle { margin-left: 0; }

  /* Hide nav by default on mobile, override your global nav display */
  header nav {
    position: fixed;
    top: var(--header-h, 70px);
    left: 0; right: 0;
    display: none !important;  /* force hidden until opened */
    flex-direction: column;
    gap: 6px;
    background: #fff;
    padding: 12px;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
    z-index: 1501;
  }
  header nav.is-open { display: flex !important; }

  /* Overlay when menu is open */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.25);
    display: none;
    z-index: 1400;
  }
  body.nav-open .nav-overlay { display: block; }

  /* Mobile link styles */
  header nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
  }
  header nav a:hover { background: #f0f7f7; }
}

/* === Mobile Nav Item list fixes === */
/* === MOBILE FIXES (≤900px) === */
@media (max-width: 900px) {
  /* Keep header in a single row; kill any earlier column rule */
  header {
    position: sticky;
    top: 0;
    z-index: 1500;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px !important;   /* override older small padding */
    background: #fff;
  }

  /* Logo pinned left */
  .logo {
    margin-right: auto !important;
    cursor: pointer;
    display: block;
  }

  /* Toggle pinned right */
  .nav-toggle {
    margin-left: auto !important;    /* pushes it to the far right */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border: 1px solid var(--color-border, #e4e8f0);
    border-radius: 8px;
    background: #fff;
    color: #49536b;
  }

  /* Centered dropdown panel (not full width) */
  header nav {
    /* override any desktop styles */
    margin-left: 0 !important;
    display: none !important;

    position: fixed;
    top: var(--header-h, 70px);
    left: 50%;
    transform: translateX(-50%);            /* CENTER horizontally */
    width: min(92vw, 420px);                 /* stay in viewport */
    max-height: calc(100vh - var(--header-h, 70px) - 24px);
    overflow: auto;

    flex-direction: column;
    align-items: stretch;                    /* buttons fill width */
    background: #fff;
    padding: 12px;
    gap: 8px;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    z-index: 1501;
  }
  header nav.is-open { display: flex !important; }

  /* Center the text inside the links */
  header nav a {
    display: block;
    text-align: center;
    padding: 12px 14px;
    border-radius: 8px;
    white-space: normal;                     /* wrap long labels */
  }

  /* Overlay stays behind the panel */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.25);
    display: none;
    z-index: 1400;
  }
  body.nav-open .nav-overlay { display: block; }

  /* iOS safe areas */
  @supports (padding: max(0px)) {
    header { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
    header nav { width: min(calc(92vw - env(safe-area-inset-left) - env(safe-area-inset-right)), 420px); }
  }
}



/*/ ===== AI Assistant StylesNew base ===== */
/* === Canonical Header / Navbar (desktop) === */
:root{
  --color-bg:#f4f6f8; --color-panel:#fff; --color-accent:#043e52;
  --color-border:#e4e8f0; --transition:.2s;
}
header{
  display:flex; align-items:center; justify-content:flex-start;
  gap:16px; padding:1.5rem 2rem; background:#fff;
  box-shadow:0 2px 4px rgba(0,0,0,.06); min-height:70px;
}
.logo{height:44px; display:block;}
header nav{
  margin-left:2rem; display:flex; align-items:center; gap:1.2rem;
}
header nav a{
  text-decoration:none; color:#043E52; font-weight:500; font-size:1rem;
  padding:.5rem 1.2rem; border-radius:6px; transition:background var(--transition), color var(--transition);
  display:inline-flex; align-items:center; line-height:1; /* keeps vertical centering */
}
header nav a.active, header nav a:hover{ color:var(--color-accent); background:#f0f7f7; }

/* Mobile toggles default hidden */
.nav-toggle{ display:none; }
.nav-overlay{ display:none; }

/* === Mobile (≤900px) — keep header in a single row, centered vertically === */
@media (max-width:900px){
  header{
    position:sticky; top:0; z-index:1500;
    padding:10px 12px; justify-content:space-between;
  }
  .logo{ height:32px; }
  /* Show hamburger, push it to far right */
  .nav-toggle{
    display:inline-flex; align-items:center; justify-content:center;
    width:40px; height:40px; border:1px solid var(--color-border);
    border-radius:8px; background:#fff; color:#49536b; cursor:pointer; margin-left:auto;
  }
  /* Centered dropdown panel */
  header nav{
    position:fixed; top:70px; left:50%; transform:translateX(-50%);
    width:min(92vw,420px); max-height:calc(100vh - 70px - 24px); overflow:auto;
    display:none; flex-direction:column; gap:8px; background:#fff; padding:12px;
    border-radius:12px; box-shadow:0 12px 32px rgba(0,0,0,.18); z-index:1501; margin-left:0;
  }
  header nav.is-open{ display:flex; }
  header nav a{ display:block; text-align:center; padding:12px 14px; border-radius:8px; white-space:normal; }

  .nav-overlay{
    position:fixed; inset:0; background:rgba(0,0,0,.25);
    display:none; z-index:1400;
  }
  body.nav-open .nav-overlay{ display:block; }
}

/* === HARD overrides to neutralize older conflicting rules === */
@media (max-width:900px){
  /* Some old CSS sets header to column at small widths — force row */
  header{ flex-direction:row !important; }
}
