/**
 * Shared Styles - Base styles, resets, typography
 * Part of the Services Documentation Hub
 * Author: Luke Steuber
 */

/* CSS Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #000;
  background-color: #fff;
  min-height: 100vh;
}

/* Typography Scale (8px grid) */
h1 {
  font-size: 2.5rem; /* 40px */
  line-height: 1.2;
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem; /* 32px */
  line-height: 1.25;
  margin-bottom: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.5rem; /* 24px */
  line-height: 1.33;
  margin-bottom: 16px;
  font-weight: 600;
}

h4 {
  font-size: 1.25rem; /* 20px */
  line-height: 1.4;
  margin-bottom: 8px;
  font-weight: 600;
}

h5 {
  font-size: 1rem; /* 16px */
  line-height: 1.5;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

h6 {
  font-size: 0.875rem; /* 14px */
  line-height: 1.5;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

p {
  margin-bottom: 16px;
  max-width: 65ch;
}

/* Links */
a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s ease;
}

a:hover {
  opacity: 0.7;
}

a:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Lists */
ul,
ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

li {
  margin-bottom: 8px;
}

/* Code */
code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.875em;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
}

pre {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  background: #f5f5f5;
  padding: 16px;
  margin-bottom: 16px;
  overflow-x: auto;
  border-radius: 4px;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
}

th {
  font-weight: 600;
  background: #f5f5f5;
}

tr:hover {
  background: #fafafa;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 32px 0;
}

/* Blockquotes */
blockquote {
  border-left: 4px solid #000;
  padding-left: 16px;
  margin: 24px 0;
  font-style: italic;
  color: #666;
}

/* Selection */
::selection {
  background: #000;
  color: #fff;
}

/* Focus styles for accessibility */
:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
}

.skip-to-main:focus {
  top: 0;
}

/* Screen reader only content */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: #666;
}

.text-small {
  font-size: 0.875rem;
}

.text-large {
  font-size: 1.125rem;
}

.font-mono {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
}

/* Spacing utilities (8px grid) */
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mt-64 { margin-top: 64px; }

.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }
.mb-64 { margin-bottom: 64px; }

.p-8 { padding: 8px; }
.p-16 { padding: 16px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }
.p-48 { padding: 48px; }
.p-64 { padding: 64px; }
