/* =============================================================================
   BlocHost Design System - CSS Reset
   Modern CSS reset based on Josh Comeau's reset with additions
   ============================================================================= */

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

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

/* Prevent font size inflation on mobile */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

/* Set core root defaults */
html:focus-within {
  scroll-behavior: smooth;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  line-height: var(--line-height-normal);
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Remove list styles on ul, ol elements */
ul,
ol {
  list-style: none;
}

/* Set shorter line heights on headings and interactive elements */
h1, h2, h3, h4, h5, h6,
button,
input,
label {
  line-height: var(--line-height-tight);
}

/* Balance text wrapping on headings */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/* A elements that don't have a class get default styles */
a:not([class]) {
  text-decoration-skip-ink: auto;
  color: currentColor;
}

/* Make images easier to work with */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Inherit fonts for inputs and buttons */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Make sure textareas without a rows attribute are not tiny */
textarea:not([rows]) {
  min-height: 10em;
}

/* Anything that has been anchored to should have extra scroll margin */
:target {
  scroll-margin-block: 5ex;
}

/* Remove all animations, transitions and smooth scroll for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Remove default button styles */
button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

/* Remove default fieldset styles */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* Remove default legend styles */
legend {
  padding: 0;
}

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

/* Remove default hr styles */
hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: var(--spacing-4) 0;
}

/* Ensure hidden elements are hidden */
[hidden] {
  display: none !important;
}

/* Remove default summary styles */
summary {
  cursor: pointer;
}

/* Remove default dialog styles */
dialog {
  padding: 0;
  border: none;
  background: transparent;
}

/* Remove default search cancel button */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Remove spinner from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Improve consistency of default fonts in all browsers */
code,
kbd,
samp,
pre {
  font-family: var(--font-family-mono);
  font-size: 1em;
}

/* Remove default address styles */
address {
  font-style: normal;
}

/* Make sure blockquotes don't have margin */
blockquote {
  margin: 0;
}

/* Ensure mark has readable contrast */
mark {
  background-color: var(--color-warning-light);
  color: var(--color-warning-text);
  padding: 0.125em 0.25em;
  border-radius: var(--radius-sm);
}

/* Remove default abbr styles */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* Remove default b and strong styles - let inheritance work */
b,
strong {
  font-weight: var(--font-weight-bold);
}

/* Remove default small styles */
small {
  font-size: var(--font-size-sm);
}

/* Prevent sub and sup elements from affecting the line height */
sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}
