Which brings us to the debate over how much did our Navy know about the coming strike on Pearl? Considering the battleship Admirals swore an airplane was no threat to a battleship. And the carrier Admirals swore the battleship was obsolete, as it could not withstand an attack from the air.
Was it just a coincidence that the carriers sailed safely out into the open sea just before the attack?
The answer to Q1: Quite a bit, but not enough. Everyone from POTUS on down knew there would be an attack, but they did not know where. Pearl Harbor was considered an unlikely spot, because it was defended so well. An opposing view, that Pearl was ripe for attack, was not held by the guys calling the shots. The assumption was the initial attack would be at one of our lesser possessions in the Pacific, or a low-impact attack on the mainland's west coast. Another option was the Panama Canal.
In the days leading up to Dec 7, we knew a declaration of war was coming. The Japanese embassy was burning its codebooks. We figured we'd have an official declaration. We nearly did, but they fouled up the decoding and didn't get it to us in time.
Q2: The carriers
Let me quote from Wikipedia:
https://en.wikipedia.org/wiki/Pearl_Harbor_advance-knowledge_conspiracy_theoryNone of the three U.S. Pacific Fleet aircraft carriers were in Pearl Harbor when the attack came. This has been alleged by some to be evidence of advance knowledge of the attack by those in charge of their disposition; the carriers were supposedly away so as to save them (the most valuable ships) from attack.
In fact, the two carriers then operating with the Pacific Fleet, Enterprise and Lexington, were on missions to deliver fighters to Wake and Midway Islands, which were intended in part to protect the route used by planes (including B-17s) bound for the Philippines. (The third, Saratoga, was in routine refit in Puget Sound, at the Bremerton shipyard.) At the time of the attack, Enterprise was about 200 mi (170 nmi; 320 km) west of Pearl Harbor, heading back. In fact, Enterprise had been scheduled to be back on December 6, but was delayed by weather. A new arrival estimate put her arrival at Pearl around 07:00, almost an hour before the attack, but she was also unable to make that schedule.
Furthermore, at the time, aircraft carriers were classified as fleet scouting elements, and hence relatively expendable.[124] They were not capital ships. The most important vessels in naval planning even as late as Pearl Harbor were battleships (per the Mahan doctrine followed by both the U.S. and Japanese navies at the time).[125] Carriers became the Navy's most important ships only following the attack.
At the time, naval establishments all over the world regarded battleships, not carriers, as the most powerful and significant elements of naval power. Had the U.S. wanted to preserve its key assets from attack, it would almost certainly have focused on protecting battleships. It was the attack on Pearl Harbor itself that first helped vault the carrier ahead of the battleship in importance. The attack demonstrated the carrier's unprecedented ability to attack the enemy at a great distance, with great force and surprise. The U.S. would turn this ability against Japan. Elimination of battleships from the Pacific Fleet forced the Americans to rely on carriers for offensive operations.
This matches what I've read pretty well.
As it turned out, Pearl Harbor was a blessing in disguise in a lot of ways. Yes, we lost a lot of good men, but it was just this sort of punch in the nose that we needed to wake up and start fighting. The war lasted until 1945, but Japan was pretty much on the defensive in 6 months and well-nigh beaten in a year. If they'd been smart about it, they would have sued for peace long before 1945, but as they say: "Play stupid games; win stupid prizes."