/* IPIP Archive Unified Styles - Matching Main Site Aesthetic */

/* Style Toggle Button */
#style-toggle-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 99999;
  padding: 0.5rem 1rem;
  background-color: #2563eb;
  color: white;
  border: 2px solid white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

#style-toggle-btn:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 15px 20px -3px rgba(0, 0, 0, 0.4), 0 6px 8px -2px rgba(0, 0, 0, 0.3);
}

#style-toggle-btn:active {
  transform: translateY(0);
}

/* When styles are disabled */
body.no-custom-styles #style-toggle-btn {
  background-color: #059669;
  position: fixed !important;
  z-index: 99999 !important;
  display: block !important;
}

body.no-custom-styles #style-toggle-btn:hover {
  background-color: #047857;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: #111827;
  background-color: #f9fafb;
  padding: 0;
  margin: 0;
}

/* Header Styles */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e5e7eb;
}

h1 center,
h1 > center {
  display: block;
  text-align: center;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

/* Container */
body {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* Links */
a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

a:visited {
  color: #4f46e5;
}

/* Paragraphs */
p {
  margin-bottom: 1rem;
  color: #4b5563;
  line-height: 1.75;
}

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

li {
  margin-bottom: 0.5rem;
  line-height: 1.75;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

th {
  background-color: #f3f4f6;
  color: #111827;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e5e7eb;
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #4b5563;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background-color: #f9fafb;
}

/* Center elements */
center {
  display: block;
  text-align: center;
  margin: 1rem 0;
}

/* Bold text */
b, strong {
  font-weight: 600;
  color: #111827;
}

/* Code and pre */
code, pre {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
  background-color: #f3f4f6;
  padding: 0.125rem 0.25rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

/* Special content boxes */
blockquote,
.info-box {
  background-color: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

/* Warning/Notice boxes */
.warning {
  background-color: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

/* Navigation/Menu styles */
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav li {
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  body > * {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.125rem;
  }

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.5rem;
  }
}

/* Override old inline styles */
body[style]:not(.no-custom-styles) {
  color: #111827 !important;
  background-color: #f9fafb !important;
}

/* Disable all custom styles when toggled off */
body.no-custom-styles *:not(#style-toggle-btn) {
  all: revert !important;
}

body.no-custom-styles {
  all: revert !important;
  position: relative !important;
}

/* Legacy HTML cleanup */
font {
  font-family: inherit !important;
}

/* Tables should use full width */
table {
  max-width: 100%;
}
