Special Relativity can be summed up in two postulates; everything else from the theory follows directly from them.
1: The laws of physics are the same for all inertial reference frames.
2: The speed of light, c, is the same for all observers.
You correctly identified that, for the observer in the stationary reference frame of Clock A, they would measure the distance of the photon of clock B to be moving a larger distance per clock tick than for Clock A. Time as measured by Clock A from the observer's perspective is called the proper time; time as measured in the rest frame of an event. Any time measured from something moving with respect to that frame will show a GREATER time; i.e. time dilation. To see why in this example, note from your observation that Photon B travels farther per tick from the observers frame because Clock B is moving with respect to the observer's reference frame. But, since the clocks measure time by the "ticks" of the photons, which move at the speed of light, by <PERSON>'s second postulate (the speed of light is measured the same for observers of any reference frame), both photons move with the same speed between ticks. Thus:
$$ c\, =\, \frac{s_A}{t_A}$$ $$ c\, =\, \frac{s_B}{t_B}$$
where
$$s_B > s_A$$
Thus:
$$\frac{s_B}{c} > \frac{s_A}{c}$$
and
$$t_B > t_A$$
This comes about because the photons both travel at the same speed, but photon B travels more distance than photon A in one tick in the reference frame of the observer. The only way they could travel the same speed but B could cover more distance than A is if it took longer for photon B to make one "tick". A good way to think about these situations is to remember that the shortest time that can be measured in Special Relativity is proper time, which is the time measured in the rest frame of an event (an event is something that occurs at a given position and time; i.e. a point in spacetime). Any time interval measured for events in a reference frame that is moving with respect to a reference frame will have time that moves slower for an observer; a dilated time. How much time dilation is given by the <PERSON> transformations. Something important to note that many people don't realize at first is the symmetry between frames. While what I wrote holds true for observer A in reference frame A, by the same reasoning from an observer B in reference frame B, Clock A would be moving slowly in reference frame B by the same amount that A sees Clock B moving slowly in reference frame A. Which is correct? BOTH! By <PERSON>'s first postulate, the laws of physics (and their results) are the same for all observers in inertial reference frames.
As far as your question about causality, this is best explained by <PERSON> diagrams. 562
On these diagrams are geometric regions called light cones. The specific event the diagram refers to is the event in spacetime at the apexes of the cones. Any events within these cones are timelike separated, meaning these events occur within spacetime in which light can travel between these events. A more accurate name for the speed of light is the speed of causality; the maximum speed which which interactions can be connected within spacetime. Light happens to move at the speed of causality, and it was discovered first, so we usually refer to this speed as the speed of light (you may hear things such as, "Gravitational waves travel at the speed of light.") Any events on a <PERSON> diagram that fall outside of the lightcone of an event means that, at a given time, even something moving at the speed of light (and more importantly the speed of causality) could not traverse in spacetime to connect these events. These events outside of the event's lightcone is called spacelike separated. You may wonder what would happen to the <PERSON> diagram for an event if we transformed by the <PERSON> transformations into another interial reference frame. Would events look different in that reference frame??? YES! however, the light cones shift under such a transformation. However, there is a special property of events withing the lightcone. These events NEVER change in such a way where events become causally flipped. If event A takes place before event B in the lightcone, it will for all inertial reference frames. This is NOT true for spacelike separated events. There are different references frames where event A and event C's order switches based on reference frame. Does this break causality? NO! Because these events are spacelike separated; i.e. they were NEVER causally connected. 562