/* CSS Variables */
:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --accent-color: #3b82f6;
  --text-color: #2d3748;
  --bg-color: #f8f9fa;
  --section-bg: #ffffff;
  --border-radius: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: "Roboto", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.container {
  width: 100%;
  margin: 0;
  padding: 2rem 0;
  text-align: center;
}

/* Header Styles */
header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  padding-top: 2rem;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-radius: 25px;
  transition: all 0.3s ease;
  font-weight: 500;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Content Sections */
.content-section {
  background: var(--section-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin: 2rem 2rem;
  padding: 2.5rem;
  text-align: left;
}

.content-section h2 {
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--accent-color);
}

h3,
h4,
h5 {
  color: var(--primary-color);
  margin: 1.25rem 0 0.75rem;
}

h4,
h5 {
  color: var(--primary-color);
  margin-top: 2rem;
  margin-bottom: 0.1rem;
}

/* Table Styles */
.table-container {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--section-bg);
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

tr:nth-child(even) {
  background-color: #f8fafc;
}

/* References Section */
.references {
  background: #f8fafc;
  border-left: 4px solid var(--accent-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: var(--border-radius);
}

.references ul {
  list-style: none;
}

.references li {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 1rem 0;
  }

  nav ul {
    flex-direction: column;
    text-align: center;
  }

  nav a {
    display: block;
    width: 100%;
  }

  .content-section {
    padding: 1.5rem;
  }

  th,
  td {
    padding: 0.75rem;
  }
}

img.right-medium {
  float: right;
  width: 50%;
  max-width: 300px;
  margin: 0 0 1rem 1rem;
}

/* make 2-col/3-col & prevention grids collapse on mobile */
.grid-2col,
.grid-3col,
.prevention-grid {
  display: grid;
  gap: 1rem;
}
.grid-2col {
  grid-template-columns: repeat(2, 1fr);
}
.grid-3col {
  grid-template-columns: repeat(3, 1fr);
}
.prevention-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
  /* collapse all grids to one column */
  .grid-2col,
  .grid-3col,
  .prevention-grid {
    grid-template-columns: 1fr !important;
  }

  /* full-width, centered images */
  img.right-medium {
    float: none;
    display: block;
    width: 90%;
    max-width: none;
    margin: 0 auto 1rem;
  }

  /* tighten up padding & font sizes */
  .content-section {
    padding: 1rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }
  p,
  li {
    font-size: 1rem;
    line-height: 1.4;
  }

  /* nav tweaks */
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
  nav a {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }
}

@media (max-width: 768px) {
  /* Mobile header layout */
  header .container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1rem;
  }

  /* Mobile nav styles */
  nav {
    width: 100%;
    margin-top: 0.5rem;
  }
  nav ul {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
  }
  nav a {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* Shrink main headline */
  h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }
}
