/*
 * CollateralizedLoanObligations.com - Main Stylesheet
 * Performance-optimized, institutional design
 * System fonts only for zero CLS
 */

:root {
  --primary-blue: #003d82;
  --secondary-blue: #0056b3;
  --accent-gold: #b8860b;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --border-gray: #d4d4d4;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --link-blue: #0066cc;
  --link-hover: #004999;
  --success-green: #28a745;
  --warning-red: #dc3545;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: var(--primary-blue);
}

h1 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  border-bottom: 2px solid var(--border-gray);
  padding-bottom: 0.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
}

h4 {
  font-size: 1.1rem;
  margin-top: 1rem;
}

p {
  margin-bottom: 1rem;
}

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

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Header */
header {
  background-color: var(--primary-blue);
  color: var(--bg-white);
  padding: 1.5rem 0;
  border-bottom: 3px solid var(--accent-gold);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bg-white);
  margin-bottom: 0.5rem;
}

.site-tagline {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 400;
}

/* Navigation */
nav {
  background-color: var(--secondary-blue);
  border-bottom: 1px solid var(--border-gray);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-menu li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--bg-white);
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.nav-menu > li > a:hover {
  background-color: var(--primary-blue);
  text-decoration: none;
}

/* Dropdown menus */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--bg-white);
  min-width: 220px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  z-index: 1000;
  border: 1px solid var(--border-gray);
  top: 100%;
  left: 0;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  display: block;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--bg-light);
}

.dropdown-content a:hover {
  background-color: var(--bg-light);
  text-decoration: none;
}

/* Main Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

.main-content {
  min-width: 0;
}

/* Sidebar */
.sidebar {
  background-color: var(--bg-light);
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-gray);
  position: sticky;
  top: 80px;
}

.sidebar h3 {
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--primary-blue);
  border-bottom: 2px solid var(--accent-gold);
  padding-bottom: 0.5rem;
}

.sidebar p {
  font-size: 0.9rem;
  line-height: 1.5;
}

.sidebar ul {
  list-style: none;
  margin-top: 1rem;
}

.sidebar ul li {
  margin-bottom: 0.5rem;
}

.sidebar ul li a {
  font-size: 0.85rem;
  color: var(--link-blue);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.breadcrumbs a {
  color: var(--link-blue);
}

.breadcrumbs span {
  margin: 0 0.5rem;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  background-color: var(--bg-white);
  border: 1px solid var(--border-gray);
}

.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}

th {
  background-color: var(--primary-blue);
  color: var(--bg-white);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  border: 1px solid var(--secondary-blue);
}

td {
  padding: 0.75rem;
  border: 1px solid var(--border-gray);
}

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

tbody tr:hover {
  background-color: #e8f4f8;
}

/* Info Boxes */
.info-box {
  background-color: #e7f3ff;
  border-left: 4px solid var(--link-blue);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.warning-box {
  background-color: #fff3cd;
  border-left: 4px solid var(--accent-gold);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.disclaimer-box {
  background-color: #f8d7da;
  border-left: 4px solid var(--warning-red);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.info-box h4,
.warning-box h4,
.disclaimer-box h4 {
  margin-top: 0;
  font-size: 1rem;
}

/* Lists */
ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Code and formulas */
code {
  background-color: var(--bg-light);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.875em;
  color: var(--warning-red);
}

pre {
  background-color: var(--bg-light);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-gray);
}

pre code {
  background-color: transparent;
  padding: 0;
  color: var(--text-primary);
}

/* Footer */
footer {
  background-color: var(--primary-blue);
  color: var(--bg-white);
  margin-top: 4rem;
  padding: 2rem 0 1rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--accent-gold);
  font-size: 1rem;
  margin-bottom: 1rem;
  margin-top: 0;
}

.footer-section ul {
  list-style: none;
  margin: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.footer-section a:hover {
  color: var(--bg-white);
  text-decoration: underline;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* SVG Diagrams */
.diagram-container {
  margin: 2rem 0;
  text-align: center;
}

.diagram-container svg {
  max-width: 100%;
  height: auto;
}

.diagram-caption {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Comparison Cards */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.comparison-card {
  border: 1px solid var(--border-gray);
  padding: 1.5rem;
  border-radius: 4px;
  background-color: var(--bg-white);
}

.comparison-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--primary-blue);
}

/* Data Highlights */
.data-highlight {
  background-color: var(--bg-light);
  border: 2px solid var(--accent-gold);
  padding: 1rem;
  text-align: center;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.data-highlight .number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-blue);
  display: block;
}

.data-highlight .label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 968px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    margin-top: 2rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .nav-menu {
    flex-direction: column;
  }

  .nav-menu > li > a {
    padding: 0.6rem 1rem;
  }

  .dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--accent-gold);
    margin-left: 1rem;
  }

  .dropdown.active .dropdown-content {
    display: block;
  }

  .comparison-grid {
    grid-template-columns: 1fr;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem 0.75rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .site-title {
    font-size: 1.2rem;
  }
}

/* Print Styles */
@media print {
  header, nav, footer, .sidebar {
    display: none;
  }

  .main-content {
    max-width: 100%;
  }

  a {
    text-decoration: underline;
  }

  .info-box, .warning-box, .disclaimer-box {
    border: 1px solid #000;
  }
}
