/* ── ProMOST Site Navigation ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --nav-width: 200px;
  --nav-bg: #1a2535;
  --nav-border: #2d3f58;
  --nav-accent: #4a9eff;
  --nav-accent-soft: rgba(74,158,255,0.12);
  --nav-text: #c8d8ec;
  --nav-text-muted: #6a84a0;
  --nav-active: #ffffff;
  --nav-hover-bg: rgba(74,158,255,0.08);
  --section-bg: #0f1924;
}

/* ── Main layout reset ───────────────────────────────────────────────── */
body {
  margin: 0;
  font-family: 'DM Sans', verdana, sans-serif;
  background-color: #31567a;
}

#page {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  margin: 0 60px;
  background: #ffffff;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  position: relative;
}

/* ── Side nav panel ─────────────────────────────────────────────────── */
#sectionnav {
  position: sticky;
  top: 0;
  left: 0;
  width: var(--nav-width);
  min-width: var(--nav-width);
  max-width: var(--nav-width);
  min-height: 100vh;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  padding: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-self: flex-start;
  position: sticky;
  top: 0;
}

/* Logo area */
#sectionnav .nav-logo {
  padding: 24px 18px 16px;
  border-bottom: 1px solid var(--nav-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
#sectionnav .nav-logo img {
  height: 38px;
  width: auto;
  opacity: 0.95;
}
#sectionnav .nav-logo-text {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--nav-accent);
  letter-spacing: 0.03em;
  line-height: 1.3;
}
#sectionnav .nav-logo-sub {
  font-size: 9px;
  color: var(--nav-text-muted);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav section labels */
#sectionnav .nav-section-label {
  padding: 16px 18px 6px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nav-text-muted);
  font-family: 'DM Sans', sans-serif;
}

/* Nav links */
#sectionnav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  color: var(--nav-text);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: 'DM Sans', sans-serif;
  line-height: 1.3;
}
#sectionnav a:hover {
  background: var(--nav-hover-bg);
  color: var(--nav-active);
  border-left-color: var(--nav-accent);
}
#sectionnav a.active {
  background: var(--nav-accent-soft);
  color: var(--nav-active);
  border-left-color: var(--nav-accent);
  font-weight: 500;
}

/* Sub-links (for LaTeX sections) */
#sectionnav a.sub {
  padding-left: 28px;
  font-size: 12px;
  color: var(--nav-text-muted);
}
#sectionnav a.sub:hover,
#sectionnav a.sub.active {
  color: var(--nav-accent);
}

/* Divider */
#sectionnav .nav-divider {
  height: 1px;
  background: var(--nav-border);
  margin: 8px 18px;
}

/* ── Content area ────────────────────────────────────────────────────── */
#main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Header strip */
#site-header {
  padding: 20px 40px 14px;
  border-bottom: 1px solid #e8edf3;
  display: flex;
  align-items: center;
  gap: 16px;
}
#site-header img.header-logo {
  height: 56px;
  width: auto;
}
#site-header h1 {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-style: italic;
  font-weight: 300;
  color: #1a2535;
  position: static;
  left: auto;
  top: auto;
}

#content {
  margin: 0;
  padding: 32px 48px 40px;
  position: relative;
}

/* ── Background (LaTeX) page iframe wrapper ──────────────────────────── */
#latex-frame-wrapper {
  display: flex;
  height: 100%;
}

/* ── Latex subnav (inside bgnd.html) ────────────────────────────────── */
#latex-subnav {
  width: 210px;
  min-width: 210px;
  background: var(--section-bg);
  border-right: 1px solid var(--nav-border);
  padding: 0;
  box-sizing: border-box;
  overflow-y: auto;
}
#latex-subnav .subnav-header {
  padding: 20px 18px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--nav-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--nav-border);
}
#latex-subnav a {
  display: block;
  padding: 9px 18px;
  color: var(--nav-text);
  font-size: 12.5px;
  text-decoration: none;
  border-left: 2px solid transparent;
  font-family: 'DM Sans', sans-serif;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.4;
}
#latex-subnav a:hover,
#latex-subnav a.active {
  background: var(--nav-hover-bg);
  color: var(--nav-active);
  border-left-color: var(--nav-accent);
}
#latex-subnav .sec-num {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--nav-text-muted);
  margin-right: 4px;
}

#latex-content {
  flex: 1;
  padding: 32px 40px;
  overflow-x: auto;
  background: #fff;
}

/* ── Footer ──────────────────────────────────────────────────────────── */
#footer {
  text-align: center;
  color: #999;
  font-size: 11px;
  margin-top: 40px;
  padding: 16px;
  border-top: 1px solid #e0e0e0;
}
#footer a { color: #5a70b0; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 800px) {
  #page { margin: 0; flex-direction: column; }
  #sectionnav { width: 100%; min-width: 0; position: relative; min-height: auto; flex-direction: row; flex-wrap: wrap; }
  #content { padding: 20px; }
}
