/* =============================================
   BSA Troop 128 — Base Design System CSS
   All CDD (core design document) styles:
   tokens, reset, global, shared components.
   ============================================= */

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

:root {
  --navy:       #1D3461;
  --navy-dark:  #0F1E3A;
  --navy-light: #274585;
  --gold:       #0284C7;
  --gold-lt:    #0EA5E9;
  --red:        #8B1A1A;
  --green:      #2A5C2E;
  --cream:      #F7F4EE;
  --light:      #EDE8DF;
  --white:      #FFFFFF;
  --text:       #1C1C1C;
  --muted:      #5A5A5A;
  --border:     #D5CFC4;
  --shadow:     0 2px 10px rgba(0,0,0,0.09);
  --shadow-lg:  0 6px 28px rgba(0,0,0,0.14);
  --f-head:     'Montserrat', sans-serif;
  --f-body:     'Open Sans', sans-serif;
  --max:        1200px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--f-body); color: var(--text); background: #fff; line-height: 1.65; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ── TOP PROGRESS BAR (page-load indicator, public + admin) ── */
.top-progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.top-progress-bar--active { opacity: 1; }
.top-progress-bar-fill {
  height: 100%;
  width: 40%;
  margin-left: -40%;
  background: linear-gradient(90deg, var(--gold), var(--gold-lt));
  box-shadow: 0 0 8px rgba(2,132,199,0.6);
}
.top-progress-bar--active .top-progress-bar-fill {
  animation: top-progress-sweep 1.1s ease-in-out infinite;
}
@keyframes top-progress-sweep {
  0%   { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* ── TOP BAR ── */
.topbar { background: var(--navy-dark); padding: 0.5rem 0; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.tb-group { display: flex; align-items: center; gap: 1.5rem; }
.tb-item { display: flex; align-items: center; gap: 0.4rem; font-family: var(--f-head); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.04em; color: rgba(255,255,255,0.68); }
.tb-item svg { width: 13px; height: 13px; flex-shrink: 0; opacity: 0.7; }

/* ── SITE NAV ── */
.site-nav { background: var(--navy); position: sticky; top: 0; z-index: 500; box-shadow: 0 3px 16px rgba(0,0,0,0.28); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.nav-brand { display: flex; align-items: center; gap: 0.85rem; flex-shrink: 0; }
.nav-emblem {
  width: 46px; height: 46px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.nav-emblem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-title { font-family: var(--f-head); font-size: 1.08rem; font-weight: 800; color: white; letter-spacing: 0.02em; line-height: 1.2; }
.nav-sub { font-size: 0.62rem; color: rgba(255,255,255,0.52); text-transform: uppercase; letter-spacing: 0.07em; }

.nav-menu { display: flex; align-items: center; gap: 0.1rem; }
.nav-menu li a {
  display: block; padding: 0.5rem 0.9rem;
  font-family: var(--f-head); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255,255,255,0.8); border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
.nav-menu li a:hover, .nav-menu li a.active { color: white; background: rgba(255,255,255,0.13); }
.nav-menu li.nav-cta a { background: var(--gold); color: var(--navy-dark); font-weight: 700; margin-left: 0.5rem; }
.nav-menu li.nav-cta a:hover { background: var(--gold-lt); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 38px; height: 38px; padding: 8px;
  background: rgba(255,255,255,0.1); border: none; border-radius: 4px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: white; border-radius: 2px; transition: all 0.28s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none; background: var(--navy-dark);
  border-top: 2px solid var(--gold); padding: 0.25rem 0 0.75rem;
}
.nav-mobile.open { display: block; }
.nav-mobile a {
  display: block; padding: 0.8rem 1.5rem;
  font-family: var(--f-head); font-size: 0.83rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06); transition: color 0.2s;
}
.nav-mobile a:last-child { border: none; }
.nav-mobile a:hover, .nav-mobile a.active { color: var(--gold); }

/* ── PAGE HERO ── */
.page-hero { background: var(--navy); padding: 3rem 0 2.8rem; border-bottom: 4px solid var(--gold); }
.page-hero--image { background-size: cover; background-position: center; }
.page-hero h1 { font-family: var(--f-head); font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; color: white; line-height: 1.15; }
.breadcrumb { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-family: var(--f-head); color: rgba(255,255,255,0.5); margin-top: 0.55rem; }
.breadcrumb a { color: var(--gold); }
.breadcrumb .sep { opacity: 0.4; }

/* ── BUTTONS ── */
.btn {
  display: inline-block; font-family: var(--f-head); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase; padding: 0.75rem 1.8rem;
  border-radius: 3px; transition: all 0.2s; cursor: pointer; border: none; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: var(--navy-dark); }
.btn-gold:hover { background: var(--gold-lt); }
.btn-outline { background: transparent; color: var(--navy); border: 2px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: white; }
.btn-outline-white { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.65); }
.btn-outline-white:hover { background: white; color: var(--navy); }
.btn-sm { padding: 0.55rem 1.2rem; font-size: 0.71rem; }
.btn-lg { padding: 1rem 2.4rem; font-size: 0.84rem; }

/* ── SECTION HEADERS ── */
.sec-hd { text-align: center; margin-bottom: 3rem; }
.eyebrow {
  display: inline-block; font-family: var(--f-head); font-size: 0.65rem;
  font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 0.55rem;
}
.sec-hd h2 { font-family: var(--f-head); font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; color: var(--navy); }
.sec-hd p { margin-top: 0.65rem; color: var(--muted); font-size: 0.95rem; max-width: 520px; margin-left: auto; margin-right: auto; line-height: 1.75; }
.gold-rule { width: 42px; height: 3px; background: var(--gold); margin: 0.8rem auto 0; border-radius: 2px; }

/* ── CARDS ── */
.card { background: white; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow); transition: transform 0.22s, box-shadow 0.22s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* ── SITE FOOTER ── */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,0.8); padding: 4.5rem 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem; padding-bottom: 3rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.footer-about .nav-brand { margin-bottom: 1.1rem; }
.footer-about p { font-size: 0.84rem; line-height: 1.8; opacity: 0.58; max-width: 270px; }
.ft-col h4 { font-family: var(--f-head); font-size: 0.71rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); margin-bottom: 1.1rem; }
.ft-col li { font-size: 0.82rem; opacity: 0.6; margin-bottom: 0.6rem; display: flex; align-items: flex-start; gap: 0.4rem; }
.ft-col a { transition: opacity 0.2s, color 0.2s; }
.ft-col a:hover { opacity: 1 !important; color: var(--gold); }
.footer-bot { padding: 1.4rem 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.72rem; opacity: 0.38; font-family: var(--f-head); }

/* ── TAGS ── */
.tag { display: inline-block; font-family: var(--f-head); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.3rem 0.75rem; border-radius: 2px; }
.tag-gold { background: var(--gold); color: var(--navy-dark); }
.tag-navy { background: var(--navy); color: white; }
.tag-green { background: var(--green); color: white; }
.tag-red { background: var(--red); color: white; }

/* ── NAV LOGIN BUTTON ── */
.nav-menu li.nav-login { margin-left: 0.4rem; display: flex; align-items: center; }
.nav-menu li.nav-login button {
  font-family: var(--f-head); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.28); border-radius: 4px;
  padding: 0.45rem 0.9rem; cursor: pointer; transition: all 0.2s;
}
.nav-menu li.nav-login button:hover { background: rgba(255,255,255,0.18); color: white; border-color: rgba(255,255,255,0.5); }

.nav-mobile-login {
  display: block; width: 100%; padding: 0.8rem 1.5rem; text-align: left;
  font-family: var(--f-head); font-size: 0.83rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.8);
  background: none; border: none; border-bottom: 1px solid rgba(255,255,255,0.06);
  cursor: pointer; transition: color 0.2s;
}
.nav-mobile-login:hover { color: var(--gold); }

/* ── LOGIN DIALOG ── */
.login-dialog { min-width: 340px; }

.login-dialog-header { display: flex; align-items: center; gap: 0.75rem; }
.login-dialog-header .nav-emblem { width: 36px; height: 36px; flex-shrink: 0; }
.login-dialog-title-text { font-family: var(--f-head); font-size: 1rem; font-weight: 800; color: white; }

.login-dialog-body { padding: 0.25rem 0; }
.login-field { margin-bottom: 1rem; }

.login-forgot-wrap { text-align: right; margin-top: -0.5rem; margin-bottom: 0.25rem; }
.login-forgot-link {
  font-family: var(--f-head);
  font-size: 0.72rem; font-weight: 600;
  color: var(--muted); text-decoration: none;
  transition: color 0.15s;
}
.login-forgot-link:hover { color: var(--navy); }

.login-error {
  background: #fef2f2; border: 1px solid #fca5a5; border-radius: 3px;
  color: var(--red); font-family: var(--f-head); font-size: 0.75rem;
  font-weight: 600; padding: 0.55rem 0.85rem; margin-bottom: 1rem;
}

.login-cancel-btn { margin-right: auto; }

/* MudDialog header override for navy branding */
.login-dialog .mud-dialog-title { background: var(--navy) !important; padding: 1rem 1.4rem !important; margin: 0 !important; }
.login-dialog .mud-dialog-content { padding: 1.5rem 1.4rem !important; }
.login-dialog .mud-dialog-actions { padding: 0.5rem 1.4rem 1.2rem !important; gap: 0.5rem; display: flex; align-items: center; }

/* ── MudBlazor global overrides ── */
.mud-tooltip { background-color: var(--navy-dark) !important; font-family: var(--f-head) !important; font-size: 0.72rem !important; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .nav-menu { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .footer-about p { max-width: 100%; }
}
@media (max-width: 600px) {
  .tb-group.tb-right { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-about { grid-column: auto; }
  .footer-bot { flex-direction: column; gap: 0.4rem; text-align: center; }
}
