@use "../base/typography" as *;
@use "../abstracts/variables" as *;

// ------------------------------------
// Base Styles
// ------------------------------------

// Set box-sizing globally
*,
*::before,
*::after {
  box-sizing: border-box;
}

// Set base font size and family (can override with variables)
html {
  font-size: 16px;
  font-family: $font-family-sans-serif;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// Remove default margins
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

// Set core body defaults
body {
  font-family: $font-family-base;
  font-size: $font-size-base;
  line-height: $line-height-base;
  color: $color-text;
  background-color: $color-body-bg;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
}

// Links
a {
  color: theme-color("primary");
  text-decoration: none;
  transition: color 0.2s ease;

  &:hover {
    color: theme-color("primary");
    text-decoration: underline;
  }
}

// Headings
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: $font-weight-bold;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

// Paragraphs
p {
  margin-bottom: spacer(2);
}

// Lists
ul,
ol {
  margin: 0;
  padding-left: 1.5rem;
}

// Images
img {
  max-width: 100%;
  display: block;
  height: auto;
}

// Buttons
button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

// Inputs, Textareas
input,
textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
}

// Disabled elements
[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

// Tables default style
table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  padding: spacer(1);
  border: 1px solid $color-border;
  text-align: left;
}

// Code blocks
code,
pre {
  font-family: $font-family-monospace;
  background-color: $color-white;
  padding: spacer(0.5);
  border-radius: $border-radius-sm;
  font-size: 0.9rem;
}

// Utility classes (optional)
// .sr-only for screen reader only text
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
