Another possibility is that during the hike your toes got jammed against the inside of your shoe, causing a bruise under the nail. This is most likely to happen when you're walking downhill. Prevention includes making sure that your toenails are cut short enough, that the shoes you hike in are long enough for your feet, and that they're laced tightly enough to keep your foot from slipping forward in the shoe.
I don't know how long it normally takes for a bruise like that to clear up. If you're concerned that it's not improving fast enough you might want to consult a podiatrist.
|