/* NbS Banking Report — Research Report Stylesheet */

:root {
  --color-primary: #1a365d;
  --color-primary-light: #2c5282;
  --color-accent: #2b6cb0;
  --color-bg: #ffffff;
  --color-bg-alt: #f7fafc;
  --color-text: #1a202c;
  --color-text-light: #4a5568;
  --color-border: #e2e8f0;
  --color-border-dark: #cbd5e0;
  --nav-width: 260px;
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.75;
  display: flex;
  min-height: 100vh;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  overflow-y: auto;
  background: var(--color-primary);
  color: #fff;
  padding: 1.5rem 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.nav-header {
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 0.75rem;
}

.nav-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-toggle {
  display: none;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

nav a {
  display: block;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

nav a.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid #63b3ed;
  padding-left: calc(1.25rem - 3px);
}

/* Main content */
main {
  margin-left: var(--nav-width);
  flex: 1;
  max-width: 900px;
  padding: 3rem 3rem 5rem;
}

article {
  max-width: 100%;
}

/* Typography */
h1 {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0 0 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

h2 {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-border);
  line-height: 1.3;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary-light);
  margin: 2rem 0 0.5rem;
  line-height: 1.35;
}

h4 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 1.5rem 0 0.5rem;
}

h5, h6 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin: 1.25rem 0 0.4rem;
}

p {
  margin: 0 0 1rem;
  text-align: justify;
  hyphens: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

blockquote {
  border-left: 4px solid var(--color-accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--color-bg-alt);
  color: var(--color-text-light);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists */
ul, ol {
  margin: 0 0 1rem 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

li > ul, li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  line-height: 1.5;
  font-family: var(--font-sans);
}

thead {
  background: var(--color-primary);
  color: #fff;
}

thead th {
  padding: 0.65rem 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--color-border);
}

tbody tr:nth-child(even) {
  background: var(--color-bg-alt);
}

tbody tr:hover {
  background: #edf2f7;
}

td {
  padding: 0.55rem 0.75rem;
  vertical-align: top;
}

/* Make tables horizontally scrollable on narrow screens */
table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

thead, tbody, tr, th, td {
  /* Reset display for proper table rendering */
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: 0.15em 0.35em;
}

pre {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
  font-size: 0.85rem;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Mermaid diagrams */
pre.mermaid {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  text-align: center;
  padding: 1.5rem;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1rem 0;
}

/* Footnotes / References */
sup {
  font-size: 0.75em;
  line-height: 0;
}

/* Responsive */
@media (max-width: 900px) {
  nav {
    position: fixed;
    width: 100%;
    height: auto;
    flex-direction: column;
  }

  .nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.25rem;
    margin-bottom: 0;
    border-bottom: none;
  }

  .nav-toggle {
    display: block;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
  }

  .nav-links {
    display: none;
    padding-bottom: 0.5rem;
  }

  nav.open .nav-links {
    display: flex;
  }

  main {
    margin-left: 0;
    margin-top: 3.5rem;
    padding: 1.5rem 1.25rem 3rem;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  table {
    font-size: 0.8rem;
  }

  thead th, td {
    padding: 0.4rem 0.5rem;
  }
}

/* Print styles */
@media print {
  nav {
    display: none;
  }

  main {
    margin-left: 0;
    max-width: 100%;
    padding: 0;
  }

  body {
    font-size: 11pt;
  }

  h2 {
    page-break-after: avoid;
  }

  table {
    page-break-inside: avoid;
  }

  pre.mermaid {
    page-break-inside: avoid;
  }
}
