/*
  Shared site nav + search overlay. Standalone so pages that don't load
  site.css (quiz, calculators) can use it; site.css @imports it too.
*/
.mast-nav, .search-overlay {
  --bg-deep: #060F0B;
  --gold: #B8912F;
  --gold-bright: #D9B15A;
  --cream: #F5F1E6;
  --body-copy: #C7D0C9;
  --muted-label: #8FA096;
  --footnote: #6E7D74;
  --card-bg: #0F241A;
  --card-border: rgba(184, 145, 47, 0.22);
  --font-head: 'Gelasio', Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Liberation Sans', Arial, sans-serif;
}
.mast-nav, .mast-nav * { box-sizing: border-box; }
.mast-nav ul { list-style: none; }
.mast-nav a { text-decoration: none; }
.mast-nav button { font-family: inherit; }

/* ============================== SITE NAV (shared; same on every page) ============================== */
.mast-nav { font-family: var(--font-body); color: var(--cream); }
.mast-nav a { color: inherit; }
.mast-nav .mast-inner { max-width: 1240px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
/* Level 1 - navigation (lightest of the three) */
.mast-nav { background: #1f4630; border-bottom: 1px solid var(--card-border); position: sticky; top: 0; z-index: 40; transition: transform .35s ease; box-shadow: 0 4px 18px rgba(0,0,0,0.25); }
.mast-nav.nav-hidden { transform: translateY(-101%); }
.mast-top { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 12px; gap: 20px; }
.mast-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mast-logo img { width: 44px; height: 44px; border-radius: 50%; display: block; object-fit: cover; }
.mast-logo-text { font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: 0.02em; line-height: 1.15; color: var(--cream); }
.mast-util { display: flex; align-items: center; gap: 22px; }
.mast-policies { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 500; color: var(--body-copy); }
.mast-policies a:hover { color: var(--gold-bright); }
.mast-policies .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-label); }
.mast-rule { width: 1px; height: 28px; background: var(--card-border); }
.mast-sub-btn { display: inline-block; background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: var(--bg-deep) !important; font-family: var(--font-head); font-weight: 700; font-size: 14.5px; padding: 10px 24px; border-radius: 999px; transition: filter .2s, transform .2s; }
.mast-sub-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.mast-menu { display: flex; align-items: center; justify-content: space-between; }
.mast-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.mast-links a { display: block; padding: 12px 20px 13px 0; margin-right: 18px; font-size: 15px; font-weight: 600; color: var(--body-copy); border-bottom: 3px solid transparent; transition: color .2s, border-color .2s; }
.mast-links a:hover { color: var(--gold-bright); }
.mast-links a.active { color: var(--cream); border-bottom-color: var(--gold-bright); }
.mast-dd { position: relative; }
.mast-dd-toggle { display: flex !important; align-items: center; gap: 7px; }
.mast-dd-toggle svg { transition: transform .2s; }
.mast-dd:hover .mast-dd-toggle, .mast-dd:focus-within .mast-dd-toggle { color: var(--gold-bright); }
.mast-dd:hover .mast-dd-toggle svg, .mast-dd:focus-within .mast-dd-toggle svg { transform: rotate(180deg); }
.mast-dd-menu { list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: -14px; min-width: 260px; background: #1a3c29; border: 1px solid var(--card-border); border-top: 3px solid var(--gold-bright); border-radius: 0 0 14px 14px; box-shadow: 0 18px 36px rgba(0,0,0,0.4); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 60; }
.mast-dd:hover .mast-dd-menu, .mast-dd:focus-within .mast-dd-menu { opacity: 1; visibility: visible; transform: none; }
.mast-links .mast-dd-menu a { display: block; margin: 0; padding: 11px 14px; font-size: 14.5px; font-weight: 500; border: none; border-radius: 9px; color: var(--body-copy); white-space: nowrap; }
.mast-links .mast-dd-menu a:hover { background: rgba(217,177,90,0.12); color: var(--gold-bright); }
.mast-search { background: none; border: none; color: var(--body-copy); cursor: pointer; padding: 10px; display: flex; border-radius: 8px; }
.mast-search:hover { color: var(--gold-bright); }
.mast-search svg { width: 20px; height: 20px; }
.mast-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.mast-toggle span { display: block; width: 22px; height: 2px; background: var(--cream); border-radius: 2px; }
.mast-panel { display: none; flex-direction: column; background: #1f4630; padding: 4px 20px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--card-border); max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.mast-panel.open { display: flex; }
.mast-panel a { padding: 11px 2px; font-size: 16px; font-weight: 600; color: var(--body-copy); border-bottom: 1px solid rgba(143,160,150,0.14); }
.mast-panel a.sub { padding: 8px 2px 8px 22px; font-size: 14.5px; font-weight: 500; color: var(--muted-label); border-left: 2px solid var(--card-border); margin-left: 4px; }
.mast-panel a.sub:hover { color: var(--gold-bright); }
.mast-panel a.small { font-size: 14px; font-weight: 500; color: var(--muted-label); }


@media (max-width: 720px) {
  .mast-nav .mast-inner { padding-left: 20px; padding-right: 20px; }
  .mast-policies, .mast-rule, .mast-menu { display: none; }
  .mast-top { padding-top: 12px; padding-bottom: 12px; }
  .mast-logo img { width: 38px; height: 38px; }
  .mast-logo-text { font-size: 15.5px; }
  .mast-sub-btn { padding: 9px 18px; font-size: 13.5px; }
  .mast-util { gap: 8px; }
  .mast-toggle { display: flex; }
}
.mast-panel a.active { color: var(--gold-bright); }

/* ---------- Search overlay ---------- */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 15, 11, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 90px 16px 40px;
  overflow-y: auto;
}

.search-overlay.open { display: flex; justify-content: center; }

.search-panel {
  width: 100%;
  max-width: 560px;
  height: fit-content;
  background: linear-gradient(180deg, var(--card-bg-alt) 0%, var(--card-bg) 100%);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.search-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 14px;
  margin-bottom: 12px;
  color: var(--muted-label);
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
}

.search-input:focus { outline: none; }
.search-input::placeholder { color: var(--footnote); }

.search-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--muted-label);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 2px 4px;
}

@media (hover: hover) {
  .search-close:hover { color: var(--gold-bright); }
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 60vh;
  overflow-y: auto;
}

.search-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 10px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

@media (hover: hover) {
  .search-result:hover { background: rgba(255,255,255,0.05); }
}

.search-result-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.search-result-type {
  flex-shrink: 0;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--bg-deep);
  background: var(--mint);
  padding: 2px 7px;
  border-radius: 999px;
}

.search-result-title {
  font-family: var(--font-head);
  font-size: 15px;
  color: var(--cream);
}

.search-result-desc {
  font-size: 12.5px;
  color: var(--muted-label);
  line-height: 1.55;
}

.search-empty {
  font-size: 13px;
  color: var(--footnote);
  text-align: center;
  padding: 22px 10px;
  margin: 0;
}

.search-panel .search-input { background: none; border: none; box-shadow: none; border-radius: 0; padding: 0; width: auto; }
