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

:root {
  /* For sticky footer */
  height: 100%;

  --background: hsl(0, 0%, 100%);
  --foreground: hsl(240, 10%, 3.9%);
  --primary: hsl(346.8, 77.2%, 49.8%);
  --primary-foreground: hsl(355.7, 100%, 97.3%);
  --secondary: hsl(240, 4.8%, 95.9%);
  --secondary-dark: hsl(240, 4.8%, 95.9%, 0.8);
  --secondary-foreground: hsl(240, 5.9%, 10%);
  --card: hsl(0 0% 98%);
  --card-foreground: hsl(240 10% 3.9%);
  --muted: hsl(240, 4.8%, 95.9%);
  --muted-foreground: hsl(240, 3.8%, 46.1%);
  --accent: hsl(240, 4.8%, 95.9%);
  --accent-foreground: hsl(240, 5.9%, 10%);
  --destructive: hsl(0, 84.2%, 60.2%);
  --destructive-foreground: hsl(0, 0%, 98%);
  --success: hsl(148, 60%, 45%);
  --success-foreground: hsl(148, 85%, 95%);
  --border: hsl(240, 5.9%, 90%);
  --input: hsl(240, 5.9%, 90%);
  --ring: hsl(346.8, 77.2%, 49.8%);
  --link: hsl(224.3,76.3%,48%);
  --radius: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: hsl(20, 14.3%, 4.1%);
    --foreground: hsl(0, 0%, 95%);
    --primary: hsl(346.8, 77.2%, 49.8%);
    --primary-foreground: hsl(355.7, 100%, 97.3%);
    --secondary: hsl(240, 3.7%, 15.9%);
    --secondary-dark: hsl(240, 3.7%, 15.9%, 0.8);
    --secondary-foreground: hsl(0, 0%, 98%);
    --card: hsl(240 5.9% 10%);
    --card-foreground: hsl(0 0% 95%);
    --muted: hsl(0, 0%, 15%);
    --muted-foreground: hsl(240, 5%, 64.9%);
    --accent: hsl(12, 6.5%, 15.1%);
    --accent-foreground: hsl(0, 0%, 98%);
    --destructive: hsl(0, 69%, 39%);
    --destructive-foreground: hsl(0, 85.7%, 97.3%);
    --success: hsl(148, 40%, 40%);
    --success-foreground: hsl(148, 90%, 90%);
    --border: hsl(240, 3.7%, 15.9%);
    --input: hsl(240, 3.7%, 15.9%);
    --ring: hsl(346.8, 77.2%, 49.8%);
    --link: hsl(217.2,91.2%,59.8%);

  }
}

/* HTML ELEMENT STYLES */

a {
  text-decoration: none;
  color: inherit;
}

.button {
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: calc(0.75 * var(--radius));
  font-size: 0.875rem;
  font-weight: bold;
  transition: color 0.2s ease, background-color 0.2s ease;
  outline: none;
  transition: background-color 0.2s ease;

  padding-block: 8px;
  padding-inline: 16px;
  height: 2.5rem;

  &:hover {
    cursor: pointer;
  }

  &:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
  }

  &:disabled {
    pointer-events: none;
    opacity: 0.5;
  }

  svg {
    pointer-events: none;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
  }

  &.primary {
    background-color: var(--primary);
    color: var(--primary-foreground);

    &:hover {
      filter: brightness(115%);
    }
  }

  &.secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);

    &:hover {
      background-color: var(--secondary-dark);
    }
  }
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;

  /* For sticky footer */
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* HEADER */

header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background-color: var(--background);
}

.header-wrap {
  max-width: 80rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
}

.link-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  .text-container {
    font-size: 0.875rem;
    font-weight: bold;
    line-height: 1.25;
  }

  /* hide line break on larger screens */
  @media (min-width: 450px) {
    .hidden-xs {
      display: none;
    }
  }
}

/* MAIN CONTENT  */

main {
  /* For sticky footer */
  flex-grow: 1;

  padding-inline: 1rem;
  display: grid;
  place-items: center;
}

.content-wrap {
  max-width: 80rem;
  margin-inline: auto;
  padding-bottom: 2rem;
}

/* FOOTER */

footer {
  border-top: 1px solid var(--border);
}

.footer-wrap {
  margin-inline: auto;
  padding-inline: 1rem;
  padding-block: 1.5rem;
  max-width: 80rem;
  color: var(--muted-foreground);
  text-align: center;

  & .copyright-text {
    font-size: 0.75rem;
  }

  .links-container {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    margin-top: 0.75rem;

    .separator {
      margin-inline: 0.75rem;
      height: 0.25rem;
      width: 0.25rem;
      background-color: var(--muted-foreground);
      border-radius: 50%;
    }

    a:hover {
      text-decoration: underline;
    }
  }
}

@media (min-width: 640px) {
  header,
  main {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  header,
  main {
    padding-inline: 2rem;
  }
}
