/* ═══════════════════════════════════════════════════════════════
   WMSU CE BATCH 2001 — SITE CHROME (shared header + footer)
   ASCE-inspired structure · CE'01 navy/gold identity · .ce2- scope
   Requires the CSS variables defined in styles.css (:root).
   ═══════════════════════════════════════════════════════════════ */

/* ── Utility bar — the engineering "title block" strip ────────── */
.ce2-topbar {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, .85);
  font-size: var(--fs-xs);
  transition: max-height .3s ease, opacity .3s ease;
  max-height: 44px;
  overflow: hidden;
}
.ce2-topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--space-3);
  display: flex; align-items: center; justify-content: space-between;
  min-height: 36px; gap: var(--space-2);
}
.ce2-topbar-motto {
  font-family: var(--font-display); font-style: italic;
  color: var(--gold); letter-spacing: .02em; white-space: nowrap;
}
.ce2-topbar-links { display: flex; align-items: center; gap: var(--space-3); }
.ce2-topbar-links a {
  color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 500;
  padding: .5rem 0; border-bottom: 2px solid transparent; transition: color var(--transition);
}
.ce2-topbar-links a:hover { color: var(--gold); }
.ce2-topbar-amsap { color: #fff !important; font-weight: 600 !important; }
.ce2-topbar-donate {
  background: var(--gold); color: var(--navy-deep) !important; font-weight: 700 !important;
  padding: .25rem .9rem !important; border-radius: 999px; border-bottom: none !important;
}
.ce2-topbar-donate:hover { background: var(--gold-deep); color: #fff !important; }
@media (max-width: 860px) { .ce2-topbar-motto { display: none; } .ce2-topbar-inner { justify-content: center; } }
@media (max-width: 560px) { .ce2-topbar-links a:not(.ce2-topbar-amsap):not(.ce2-topbar-donate) { display: none; } }

/* ── Sticky wrapper behavior ──────────────────────────────────── */
.ce2-chrome { position: sticky; top: 0; z-index: 400; }
.ce2-chrome.is-compact .ce2-topbar { max-height: 0; opacity: 0; }

/* ── Main header bar (white, ASCE-style) ──────────────────────── */
.ce2-header { background: #fff; box-shadow: var(--shadow-sm); }
.ce2-header-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--space-3);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); min-height: 86px;
  transition: min-height .25s ease;
}
.ce2-chrome.is-compact .ce2-header-inner { min-height: 66px; }
.ce2-keyline {
  height: 3px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-deep) 45%, var(--navy) 45%, var(--navy) 100%);
}

/* Brand lockup — shield overhangs the keyline (signature detail) */
.ce2-brand {
  display: flex; align-items: center; gap: .85rem; text-decoration: none;
  min-width: 0; flex-shrink: 1;
}
.ce2-logo {
  width: 72px; height: 72px; object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(13, 34, 71, .25));
  transition: width .25s ease, height .25s ease;
  margin-bottom: -14px; /* overhang below the keyline */
}
.ce2-chrome.is-compact .ce2-logo { width: 52px; height: 52px; margin-bottom: -8px; }
.ce2-brand-text { display: flex; flex-direction: column; min-width: 0; }
.ce2-brand-name {
  font-family: var(--font-display); font-weight: 700; color: var(--navy-deep);
  font-size: 1.06rem; line-height: 1.25; letter-spacing: .01em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.ce2-brand-sub {
  font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-deep); margin-top: .15rem;
}
@media (max-width: 1350px) { .ce2-brand-name { font-size: .95rem; white-space: normal; max-width: 240px; } }
@media (max-width: 480px)  { .ce2-brand-sub { letter-spacing: .1em; } .ce2-brand-name { max-width: 190px; } }

/* ── Primary nav ──────────────────────────────────────────────── */
.ce2-nav { display: flex; align-items: stretch; gap: .1rem; }
.ce2-nav > a, .ce2-dd-btn {
  display: flex; align-items: center; gap: .35rem;
  padding: 0 .95rem; min-height: 86px;
  font-family: var(--font-body); font-size: .92rem; font-weight: 600;
  color: var(--navy-deep); text-decoration: none;
  background: none; border: none; cursor: pointer;
  border-bottom: 3px solid transparent; transition: color var(--transition), border-color var(--transition);
}
.ce2-chrome.is-compact .ce2-nav > a,
.ce2-chrome.is-compact .ce2-dd-btn { min-height: 66px; }
.ce2-nav > a:hover, .ce2-dd-btn:hover,
.ce2-dd.open .ce2-dd-btn,
.ce2-nav > a[aria-current="page"],
.ce2-dd-btn.ce2-active { color: var(--gold-deep); border-bottom-color: var(--gold); }
.ce2-caret {
  width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform var(--transition);
}
.ce2-dd.open .ce2-caret { transform: rotate(225deg) translateY(-1px); }

/* Dropdown panels (ASCE mega-menu style) */
.ce2-dd { position: relative; display: flex; }
.ce2-dd-menu {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--gold);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-lg);
  display: flex; gap: var(--space-4); padding: var(--space-3) var(--space-4);
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease, visibility .18s;
  min-width: 420px; z-index: 50;
}
.ce2-dd-menu--slim { min-width: 260px; }
.ce2-dd.open .ce2-dd-menu,
.ce2-dd:focus-within .ce2-dd-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.ce2-dd-col { display: flex; flex-direction: column; min-width: 180px; }
.ce2-dd-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-faint); padding: .3rem .6rem .45rem; border-bottom: 1px solid var(--border);
  margin-bottom: .35rem;
}
.ce2-dd-col a {
  padding: .45rem .6rem; font-size: .88rem; color: var(--text); text-decoration: none;
  border-radius: var(--radius-sm); border-left: 3px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.ce2-dd-col a:hover { background: var(--gold-dim); color: var(--navy-deep); border-left-color: var(--gold); }

/* Keep dropdowns on-screen near the right edge */
.ce2-dd:nth-last-child(-n+2) .ce2-dd-menu { left: auto; right: 0; transform: translateY(8px); }
.ce2-dd:nth-last-child(-n+2).open .ce2-dd-menu,
.ce2-dd:nth-last-child(-n+2):focus-within .ce2-dd-menu { transform: translateY(0); }

/* ── Right-side actions ───────────────────────────────────────── */
.ce2-actions { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.ce2-search-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; color: var(--navy-deep); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.ce2-search-btn:hover { background: var(--navy-deep); color: var(--gold); border-color: var(--navy-deep); }
.ce2-cta {
  background: var(--navy); color: #fff; font-weight: 700; font-size: .9rem;
  padding: .6rem 1.35rem; border-radius: 999px; text-decoration: none;
  border: 2px solid var(--navy); transition: all var(--transition); white-space: nowrap;
}
.ce2-cta:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }

/* Hamburger (mobile) */
.ce2-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; padding: 0 9px;
}
.ce2-burger span { display: block; height: 2.5px; background: var(--navy-deep); border-radius: 2px; transition: all .25s ease; }
.ce2-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.ce2-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.ce2-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 1180px) {
  .ce2-nav { display: none; }
  .ce2-burger { display: flex; }
}
@media (max-width: 560px) { .ce2-cta { display: none; } }

/* ── Search overlay ───────────────────────────────────────────── */
/* Root-level layer: MUST outrank every page widget — sj- modals sit
   at z-1000 and the AMSAP quick-access button at z-950. */
.ce2-search-overlay {
  position: fixed; inset: 0; background: rgba(13, 34, 71, .6); backdrop-filter: blur(4px);
  z-index: 1300; display: none; padding: 12vh var(--space-3) var(--space-3);
}
.ce2-search-overlay.open { display: block; animation: ce2FadeIn .2s ease; }
@keyframes ce2FadeIn { from { opacity: 0; } to { opacity: 1; } }
.ce2-search-panel {
  max-width: 640px; margin: 0 auto; background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; border-top: 4px solid var(--gold);
}
.ce2-search-row {
  display: flex; align-items: center; gap: .8rem; padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border); color: var(--navy-deep);
}
.ce2-search-row input {
  flex: 1; border: none; outline: none; font-size: var(--fs-md); font-family: var(--font-body);
  color: var(--text); background: transparent; min-width: 0;
}
.ce2-search-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: #fff; cursor: pointer; color: var(--text-muted); flex-shrink: 0;
}
.ce2-search-close:hover { background: var(--gold-dim); color: var(--navy-deep); }
.ce2-search-results { max-height: 46vh; overflow-y: auto; padding: .5rem; }
.ce2-search-results a {
  display: block; padding: .7rem .9rem; border-radius: var(--radius-sm); text-decoration: none;
  border-left: 3px solid transparent;
}
.ce2-search-results a:hover, .ce2-search-results a.sel { background: var(--gold-dim); border-left-color: var(--gold); }
.ce2-search-results a strong { display: block; color: var(--navy-deep); font-size: .95rem; }
.ce2-search-results a small { color: var(--text-muted); font-size: .78rem; }
.ce2-search-empty { padding: var(--space-3); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }

/* ── Mobile drawer ────────────────────────────────────────────── */
.ce2-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(13, 34, 71, .55); z-index: 1240;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
.ce2-drawer-backdrop.open { opacity: 1; visibility: visible; }
.ce2-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); z-index: 1250;
  background: #fff; box-shadow: var(--shadow-lg); transform: translateX(100%); /* 100%, not 105% — 105% overflows the viewport */
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.ce2-drawer.open { transform: translateX(0); }
.ce2-drawer-head {
  display: flex; align-items: center; gap: .7rem; padding: var(--space-2) var(--space-3);
  background: var(--navy-deep); color: #fff; position: sticky; top: 0; z-index: 2;
}
.ce2-drawer-head strong { display: block; font-family: var(--font-display); font-size: .95rem; }
.ce2-drawer-head small { color: var(--gold); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; }
.ce2-drawer-head .ce2-logo { width: 48px; height: 48px; margin: 0; }
.ce2-drawer-close {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3);
  background: transparent; color: #fff; cursor: pointer; font-size: 1rem;
}
.ce2-drawer-nav { padding: var(--space-2) 0; flex: 1; }
.ce2-drawer-nav > a, .ce2-drawer-group-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: .85rem var(--space-3); font-size: .98rem; font-weight: 600; color: var(--navy-deep);
  text-decoration: none; background: none; border: none; border-bottom: 1px solid var(--border);
  cursor: pointer; font-family: var(--font-body); text-align: left;
}
.ce2-drawer-group-btn .ce2-caret { transition: transform .2s ease; }
.ce2-drawer-group.open .ce2-drawer-group-btn { color: var(--gold-deep); }
.ce2-drawer-group.open .ce2-drawer-group-btn .ce2-caret { transform: rotate(225deg); }
/* <details>-era: sub content visibility is native; never display:none it. */
.ce2-drawer-sub { display: block; background: var(--bg); border-bottom: 1px solid var(--border); }
.ce2-drawer-sub .ce2-dd-label { display: block; padding: .6rem var(--space-3) .2rem; border: none; margin: 0; }
.ce2-drawer-sub a {
  display: block; padding: .6rem var(--space-3) .6rem calc(var(--space-3) + .8rem);
  font-size: .9rem; color: var(--text); text-decoration: none; border-left: 3px solid transparent;
}
.ce2-drawer-sub a:hover { background: var(--gold-dim); border-left-color: var(--gold); color: var(--navy-deep); }
.ce2-drawer-utility {
  padding: var(--space-3); border-top: 2px solid var(--gold); display: grid; gap: .5rem;
  background: var(--bg);
}
.ce2-drawer-utility a {
  display: block; text-align: center; padding: .65rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; color: var(--navy-deep); text-decoration: none;
  border: 1px solid var(--border); background: #fff;
}
.ce2-drawer-donate { background: var(--gold) !important; border-color: var(--gold) !important; }
.ce2-drawer-register { background: var(--navy) !important; border-color: var(--navy) !important; color: #fff !important; }

/* ── Footer ───────────────────────────────────────────────────── */
.ce2-footer { background: var(--navy-deep); color: rgba(255, 255, 255, .8); margin-top: var(--space-10); }
.ce2-footer-inner { max-width: 1240px; margin: 0 auto; padding: 0 var(--space-3); }
.ce2-footer-quick { background: var(--navy); border-bottom: 1px solid rgba(168, 181, 192, .3); }
.ce2-footer-quick .ce2-footer-inner {
  display: flex; flex-wrap: wrap; gap: .25rem var(--space-2); justify-content: center;
  padding-top: .8rem; padding-bottom: .8rem;
}
.ce2-footer-quick a {
  color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600;
  padding: .35rem .9rem; border-radius: 999px; transition: all var(--transition);
}
.ce2-footer-quick a:hover { background: rgba(168, 181, 192, .18); color: var(--gold); }
.ce2-footer-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: var(--space-5);
  padding-top: var(--space-6); padding-bottom: var(--space-6);
}
.ce2-footer-brand img { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .4)); }
.ce2-footer-brand h3 { font-family: var(--font-display); color: #fff; font-size: var(--fs-lg); margin: var(--space-2) 0 .4rem; line-height: 1.3; }
.ce2-footer-motto { font-family: var(--font-display); font-style: italic; color: var(--gold); font-size: .92rem; line-height: 1.6; }
.ce2-footer-meta { font-size: .8rem; color: rgba(255, 255, 255, .55); margin-top: .6rem; line-height: 1.7; }
.ce2-footer-social { display: flex; gap: .5rem; margin-top: var(--space-2); }
.ce2-footer-social a {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 50%; color: #fff; text-decoration: none;
  font-size: .8rem; font-weight: 700; transition: all var(--transition);
}
.ce2-footer-social a:hover { background: var(--gold); border-color: var(--gold); color: var(--navy-deep); }
.ce2-footer-col h4 {
  color: var(--gold); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: var(--space-2); padding-bottom: .5rem; border-bottom: 1px solid rgba(168, 181, 192, .3);
}
.ce2-footer-col a {
  display: block; color: rgba(255, 255, 255, .78); text-decoration: none; font-size: .88rem;
  padding: .28rem 0; transition: color var(--transition), padding-left var(--transition);
}
.ce2-footer-col a:hover { color: var(--gold); padding-left: .35rem; }
.ce2-footer-legal { border-top: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .25); }
.ce2-footer-legal .ce2-footer-inner {
  display: flex; flex-wrap: wrap; gap: .5rem var(--space-3); align-items: center; justify-content: space-between;
  padding-top: .9rem; padding-bottom: .9rem; font-size: .78rem; color: rgba(255, 255, 255, .55);
}
.ce2-footer-legal a { color: rgba(255, 255, 255, .7); text-decoration: none; margin-left: var(--space-2); }
.ce2-footer-legal a:hover { color: var(--gold); }
.ce2-footer-legal-links a:first-child { margin-left: 0; }
@media (max-width: 980px) { .ce2-footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) {
  .ce2-footer-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .ce2-footer-legal .ce2-footer-inner { flex-direction: column; align-items: flex-start; }
}

/* ── Motion discipline ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .ce2-chrome *, .ce2-footer * { transition: none !important; animation: none !important; }
}
