﻿/* =========================================================
   BangTech base styles  (v4)
   Mobile-first. Desktop rules live in the media queries
   at the bottom of each section.
   ========================================================= */

/* --- Root Variables --- */
:root {
  --primary: #212f54;
  --primary-dark: #18223e;
  --primary-light: #B6E8FF;
  --accent: #13b1e7;
  --accent-hover: #0e8db9;
  --link: #0a7bb0;            /* accent darkened for readable text links */
  --text-dark: #2b2f36;
  --text-muted: #5f6b7a;
  --text-light: #fff;
  --bg-light: #f4f7f6;
  --bg-card: #fff;
  --border: #e1e6ea;
  --radius: 10px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --content-width: 1100px;
  --nav-height: 60px;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

html,
body {
  min-height: 100%;
}

body {
  font-family: 'Lato', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-dark);
  background-color: var(--bg-light);
  display: flex;
  flex-direction: column; /* sticky footer */
  min-height: 100vh;
  overflow-x: hidden;
}

img,
video,
svg {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

h1,
h2,
h3,
h4 {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary);
}

a {
  color: var(--link);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* --- Navigation --- */
.navWrap {
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--nav-height);
  background-color: var(--primary);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo {
  display: block;
  height: 40px;
  width: auto;
}

/* Menu toggle: visually hidden but still reachable by keyboard */
input#navToggle {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.navToggleLabel {
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  z-index: 1001;
  -webkit-tap-highlight-color: transparent;
}

#navToggle:focus-visible + .navToggleLabel {
  outline: 3px solid var(--accent);
}

.navToggleLabel span,
.navToggleLabel span::before,
.navToggleLabel span::after {
  content: "";
  display: block;
  background: #fff;
  height: 2px;
  width: 24px;
  border-radius: 2px;
  position: relative;
  transition: transform 0.3s ease, background 0.3s ease, top 0.3s ease;
}

.navToggleLabel span::before {
  position: absolute;
  top: -8px;
}

.navToggleLabel span::after {
  position: absolute;
  top: 8px;
}

#navToggle:checked ~ .navToggleLabel span {
  background: transparent;
}

#navToggle:checked ~ .navToggleLabel span::before {
  top: 0;
  transform: rotate(45deg);
}

#navToggle:checked ~ .navToggleLabel span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Nav links: mobile slide-down panel */
nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--primary);
  max-height: calc(100vh - var(--nav-height));
  max-height: calc(100dvh - var(--nav-height));
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

#navToggle:checked ~ nav {
  visibility: visible;
  opacity: 1;
  transform: none;
}

nav ul {
  list-style: none;
  padding: 0.5rem 1rem 1.25rem;
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  display: block;
  padding: 0.8rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

nav ul li a:hover,
nav ul li a:focus-visible {
  color: var(--primary-light);
}

nav .btn {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  text-align: center;
  border: none;
  margin-top: 1rem;
  font-weight: 700;
}

nav .btn:hover,
nav .btn:focus-visible {
  background: var(--accent-hover);
  color: #fff;
}

/* Search box in the navigation (mobile: full width at top of menu) */
nav .navSearch {
  padding: 0.75rem 0 0.5rem;
}

nav .navSearch form {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease;
}

nav .navSearch form:focus-within {
  background: #fff;
  border-color: var(--accent);
}

nav .navSearch input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 0 0 1rem;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1rem; /* 16px+ stops iOS zooming in on focus */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

nav .navSearch input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

nav .navSearch form:focus-within input {
  color: var(--text-dark);
}

nav .navSearch form:focus-within input::placeholder {
  color: var(--text-muted);
}

nav .navSearch input::-webkit-search-cancel-button {
  cursor: pointer;
}

nav .navSearch button {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

nav .navSearch form:focus-within button {
  color: var(--accent-hover);
}

nav .navSearch button:focus-visible {
  outline-offset: -3px;
}

/* --- Header / Hero --- */
header.hero {
  background:
    radial-gradient(circle at 85% 20%, rgba(19, 177, 231, 0.18), transparent 55%),
    linear-gradient(135deg, #e9f7fe 0%, var(--primary-light) 100%);
  text-align: center;
  width: 100%;          /* always span the full window width */
  max-width: none;
  margin: 0;
  align-self: stretch;
  padding: 2.25rem 1.25rem;
  border-bottom: 1px solid rgba(33, 47, 84, 0.08);
}

/* Pages that leave the headline region empty get no empty band */
header.hero:not(:has(*)) {
  display: none;
}

.hero h1 {
  font-size: clamp(1.6rem, 4.5vw + 0.5rem, 2.75rem);
  margin: 0 auto;
  color: var(--primary);
}

.hero .subtitle,
.hero p {
  max-width: 760px;
  margin: 0.75rem auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 1vw + 0.8rem, 1.2rem);
}

.mission-header {
  text-align: center;
  margin-bottom: 50px;
}

.mission-header h1 {
  color: var(--primary);
  font-size: 2.5rem;
  margin-bottom: 15px;
}

.mission-header p {
  max-width: 800px;
  margin: 0 auto;
  color: #666;
  font-size: 1.1rem;
}

/* --- Main Content --- */
main {
  flex: 1 0 auto; /* keeps footer at the bottom */
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

/* Comfortable reading rhythm for plain content pages */
main p,
main ul,
main ol,
main table,
main form,
main iframe {
  margin-bottom: 1rem;
}

main h2 {
  font-size: clamp(1.35rem, 2vw + 0.9rem, 1.75rem);
  margin: 1.75rem 0 0.75rem;
}

main h3 {
  font-size: 1.2rem;
  margin: 1.25rem 0 0.5rem;
}

main > h2:first-child,
main section > h2:first-child,
main .main-content > h2:first-child {
  margin-top: 0;
}

main ul,
main ol {
  padding-left: 1.4rem;
}

main li {
  margin-bottom: 0.35rem;
}

main li > ul,
main li > ol {
  margin: 0.35rem 0 0.25rem;
}

main hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Generic white content panel used by most inner pages */
.main-content,
main > table.MS_MasterFrame {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.main-content > :last-child {
  margin-bottom: 0;
}

/* Layout tables left over from older pages */
main table {
  border-collapse: collapse;
  max-width: 100%;
}

main td,
main th {
  vertical-align: top;
}

main > table.MS_MasterFrame {
  display: block;            /* lets the panel padding apply */
  border-collapse: separate;
  border-spacing: 0;
}

table.MS_MasterFrame td {
  padding-bottom: 1rem;
}

table.MS_MasterFrame tr:last-child td {
  padding-bottom: 0;
}

/* Responsive embeds (YouTube, maps…) */
main iframe {
  display: block;
  max-width: 100%;
  border: 0;
}

main iframe[src*="youtube"],
main iframe[src*="youtu.be"],
main iframe[src*="vimeo"] {
  width: 100%;
  max-width: 760px;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #000;
}

/* Forms */
main input[type="text"],
main input[type="email"],
main input[type="tel"],
main input[type="number"],
main input[type="search"],
main select,
main textarea {
  font: inherit;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c8d0d8;
  border-radius: 6px;
  background: #fff;
}

main button,
main input[type="submit"],
main input[type="button"] {
  font: inherit;
  cursor: pointer;
}

/* Section cards (step-by-step guides, checklists) */
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}

.section > :last-child {
  margin-bottom: 0;
}

.label {
  color: var(--primary);
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* --- Footer --- */
footer {
  background: var(--primary);
  color: #fff;
  padding: 1.75rem 1rem;
  text-align: center;
}

.footer-nav p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.25rem 0;
  color: rgba(255, 255, 255, 0.5);
}

.footer-nav a {
  color: #fff;
  text-decoration: none;
  display: inline-block;
  padding: 0.4rem 0.75rem; /* comfortable tap target */
}

.footer-nav a:hover {
  color: var(--accent);
}

.copy {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* --- Tablet and up --- */
@media screen and (min-width: 700px) {
  main {
    padding: 2.5rem 1.5rem 3.5rem;
  }

  header.hero {
    padding: 3.5rem 2rem;
  }

  .main-content,
  main > table.MS_MasterFrame,
  .section {
    padding: 2rem;
  }
}

/* --- Desktop navigation (9 links need room) --- */
@media screen and (min-width: 1024px) {
  .navWrap {
    padding: 0.5rem 2rem;
  }

  .navToggleLabel {
    display: none;
  }

  nav {
    position: static;
    visibility: visible;
    opacity: 1;
    transform: none;
    max-height: none;
    overflow: visible;
    background: transparent;
    box-shadow: none;
    transition: none;
  }

  nav ul {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 0;
  }

  nav ul li a {
    padding: 0.35rem 0;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
  }

  nav ul li a:hover {
    color: #fff;
    border-bottom-color: var(--accent);
  }

  nav .btn {
    margin-top: 0;
    padding: 0.5rem 1.1rem;
    border-bottom: none;
  }

  nav .btn:hover {
    border-bottom: none;
  }

  /* Search sits at the right end of the bar on desktop */
  nav .navSearch {
    order: 99;
    padding: 0;
  }

  nav .navSearch input {
    width: 110px;
    height: 36px;
    padding-left: 0.85rem;
    font-size: 0.95rem;
    transition: width 0.25s ease;
  }

  nav .navSearch input:focus {
    width: 150px;
  }

  nav .navSearch button {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .mission-header {
    display: flex;
    align-items: center;
    text-align: left;
    gap: 40px;
  }

  .mission-header h1 {
    margin-bottom: 0;
    flex-shrink: 0;
    border-right: 4px solid var(--accent);
    padding-right: 30px;
  }
}

/* --- Small desktops: tighter menu so the search box fits --- */
@media screen and (min-width: 1024px) and (max-width: 1199px) {
  .navWrap {
    padding: 0.5rem 1.25rem;
  }

  nav ul {
    gap: 1.1rem;
  }

  nav .navSearch input,
  nav .navSearch input:focus {
    width: 100px;
  }
}

/* --- Phones: let wide tables scroll instead of breaking the page --- */
@media screen and (max-width: 699px) {
  main table:not(.MS_MasterFrame) {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Accessibility / print --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

@media print {
  .navWrap,
  footer,
  .cm-widget {
    display: none !important;
  }

  body {
    background: #fff;
  }

  header.hero {
    background: none;
    padding: 0 0 1rem;
  }

  .main-content,
  .section {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}
