/* ==========================================================================
   Base — Reset, normalize, element defaults
   ========================================================================== */

/* Box model reset
   ---------------------------------------------------------------------- */

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

* {
  margin: 0;
  padding: 0;
}

/* Document
   ---------------------------------------------------------------------- */

html {
  background-color: var(--color-cream);
  color: var(--color-charcoal);
  font-family: var(--font-body);
  font-size: 100%; /* 16px */
  line-height: var(--leading-normal);
  font-feature-settings: 'lnum', 'pnum';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-weight: 400;
  min-height: 100vh;
}

/* Headings
   ---------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-feature-settings: 'lnum', 'pnum';
  margin-bottom: var(--space-md);
}

h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-2xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

h4 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
}

h5, h6 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

/* Body text
   ---------------------------------------------------------------------- */

p {
  margin-bottom: var(--space-md);
  font-weight: 400;
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--text-sm);
}

strong, b {
  font-weight: 500;
}

em, i {
  font-style: italic;
}

/* Links
   ---------------------------------------------------------------------- */

a {
  color: var(--color-charcoal);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-brass);
  text-decoration: underline;
}

/* Inline links in body content should be visibly underlined */
main a:not(.btn):not(.listing-card):not(.site-nav__link):not(.card-link):not(.resident-link):not(.breadcrumb a) {
  text-decoration: underline;
  text-decoration-color: var(--color-stone);
  text-underline-offset: 2px;
}

main a:not(.btn):not(.listing-card):not(.site-nav__link):not(.card-link):not(.resident-link):hover {
  text-decoration-color: var(--color-brass);
}

a:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Lists
   ---------------------------------------------------------------------- */

ul, ol {
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-xs);
}

li:last-child {
  margin-bottom: 0;
}

/* Media
   ---------------------------------------------------------------------- */

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* Forms — baseline
   ---------------------------------------------------------------------- */

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

fieldset {
  border: none;
}

/* Tables
   ---------------------------------------------------------------------- */

table {
  border-collapse: collapse;
  width: 100%;
}

/* Misc
   ---------------------------------------------------------------------- */

hr {
  border: none;
  border-top: 1px solid var(--color-pebble);
  margin: var(--space-2xl) 0;
}

::selection {
  background-color: var(--color-brass);
  color: var(--color-cream);
}

/* Reduced motion
   ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive base font sizing
   ---------------------------------------------------------------------- */

@media (min-width: 768px) {
  html {
    font-size: 106.25%; /* 17px */
  }
}

@media (min-width: 1024px) {
  html {
    font-size: 112.5%; /* 18px */
  }
}
