/* ===================================
   Base Styles & Reset
   =================================== */

/* Box-sizing reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Remove default margins and paddings */
* {
  margin: 0;
  padding: 0;
}

/* HTML & Body */
html {
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-black);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
  color: var(--color-black);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover,
a:focus {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

/* Lists */
ul,
ol {
  list-style: none;
}

/* Buttons */
button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  outline: inherit;
}

/* Forms */
input,
textarea,
select {
  font: inherit;
  border: none;
  outline: none;
}

/* Tables */
table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: var(--spacing-md);
  font-weight: bold;
  line-height: var(--line-height-tight);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1rem;
}

/* Paragraphs */
p {
  margin-bottom: var(--spacing-md);
}

p.p-lg {
  font-size: 1.125rem;
  line-height: var(--line-height-loose);
}

/* Strong & Bold */
strong,
b {
  font-weight: bold;
}

/* Emphasis */
em,
i {
  font-style: italic;
}

/* Small text */
small {
  font-size: 0.875rem;
}

/* Code */
code,
pre {
  font-family: 'Courier New', monospace;
  background-color: #f5f5f5;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
}

pre {
  display: block;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-md);
  overflow-x: auto;
}

/* Blockquotes */
blockquote {
  margin: var(--spacing-lg) 0;
  padding: var(--spacing-md);
  border-left: 4px solid var(--color-primary);
  background-color: var(--bg-gray);
  font-style: italic;
}

/* Horizontal Rule */
hr {
  border: none;
  height: 1px;
  background-color: var(--color-gray-light);
  margin: var(--spacing-lg) 0;
}

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

.skip-link a {
  position: absolute;
  top: -40px;
  left: 6px;
  z-index: var(--z-modal);
  color: var(--color-white);
  background-color: var(--color-black);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: var(--border-radius-sm);
}

.skip-link a:focus {
  top: 6px;
}

/* Print Styles */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  img {
    page-break-inside: avoid;
  }

  h2,
  h3,
  p {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/* Focus styles */
:focus {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* Selection styles */
::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}