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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: #000;
  /* pure black text */
  background: #fff;
  /* pure white background */
}

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

/* ---------- Header & Nav ---------- */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

#site-logo {
  max-height: 48px;
  width: auto;
}

.site-header nav {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.25rem;
}

.site-header nav a {
  color: #000;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem;
  position: relative;
}

.site-header nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  width: 0;
  background: #000;
  transition: width 0.2s ease-out;
}

.site-header nav a:hover::after {
  width: 100%;
}

/* ---------- Headings (preserved from previous version) ---------- */
@import url('https://fonts.cdnfonts.com/css/computer-modern-serif');

h1 {
  font-family: 'Computer Modern Serif', serif;
  font-weight: normal;
  font-size: 2rem;
  color: #000;
  margin-bottom: 0.1rem;
  text-align: center;
}

h2 {
  font-size: 1rem;
  color: #2c3e50;
  margin-bottom: 0.1rem;
  text-align: center;
}

/* ---------- Filters & Search ---------- */
.search-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  width: 100%;
}

#search {
  width: 100%;
  max-width: 600px;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border: 1px solid #000;
  border-radius: 4px;
  background: #fff;
  transition: border-color 0.2s;
}

#search:focus {
  outline: none;
  border-color: #3498db;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.filters input[type="text"],
.filters select {
  padding: 0.6rem 0.8rem;
  border: 1px solid #000;
  border-radius: 4px;
  background: #fff;
  min-width: 180px;
  transition: border-color 0.2s;
}

.filters input[type="text"]:focus,
.filters select:focus {
  outline: none;
  border-color: #000;
}

/* ---------- Column Selector ---------- */
#column-select {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  justify-content: center;
  color: #000;
}

#column-select label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ---------- Result Count ---------- */
#result-count {
  font-style: italic;
  margin-bottom: 0.75rem;
  text-align: center;
  color: #000;
}

/* ---------- Table ---------- */
#results-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #000;
  border-radius: 6px;
  overflow: hidden;
}

#results-table thead {
  background: #fff;
}

#results-table th,
#results-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #000;
  word-wrap: break-word;
  /* ensure long words break */
  overflow-wrap: break-word;
  max-width: 300px;
  /* default max-width to prevent extreme expansion */
}

#results-table th {
  font-weight: 600;
  color: #000;
  position: relative;
  min-width: 80px;
  /* prevent columns from collapsing too much */
}

/* The draggable handle */
#results-table th .resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  height: 100%;
  /* make it hit-testable but visually subtle */
  background: rgba(0, 0, 0, 0);
}

#results-table th .resizer:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Adaptive density classes */
#results-table.table-dense th,
#results-table.table-dense td {
  padding: 0.5rem 0.5rem;
  font-size: 0.95rem;
  max-width: 200px;
}

#results-table.table-compact th,
#results-table.table-compact td {
  padding: 0.25rem 0.25rem;
  font-size: 0.85rem;
  max-width: 150px;
}

#results-table tr:nth-child(even) td {
  background: #f9f9f9;
  /* light grey, still neutral */
}

#results-table tr:hover td {
  background: #eee;
}

#results-table a {
  color: #000;
  text-decoration: underline;
}

/* expanded detail rows */
.detail-row td {
  background: #fff;
  font-size: 0.9rem;
  padding-left: 2rem;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.pagination button {
  padding: 0.4rem 0.8rem;
  border: 1px solid #000;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  color: #000;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
  background: #f0f0f0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  #column-select {
    flex-direction: column;
    align-items: stretch;
  }

  #results-table th,
  #results-table td {
    padding: 0.5rem;
  }
}