/* ==========================================================================
   29-headroom.css — ROOM ABOVE THE HEAD

   "please do not allow portraits heads especially in their progress circles,
    to be cut off it is alright to move them down a tad to fit their heads in
    with margin safe spacing."

   WHAT WAS HAPPENING

   A round card crops a rectangular photograph, and the crop had its origin at
   32% down the picture. The comment that set it reasoned: "crop dead centre
   and you take the chin, crop to the top and you take the forehead". The
   first half is right and the second is backwards -- `object-position: 50% 0%`
   lines the picture's TOP edge up with the frame's top edge, so it KEEPS the
   forehead and loses the feet. 32% was therefore a third of the way past the
   crown on anything upright, and the taller the photograph the more of the
   head it took.

   Photographed with a marker ruled across the crown, at every shape a speaker
   photograph actually arrives in:

       3 : 4   the crown line sits ON the ring, hair above it gone
       2 : 3   the crown line is not in the circle at all
       1 : 1   unaffected -- a square has no height to spare, so the crop
               origin does nothing
       4 : 3   unaffected, for the same reason

   So it is only upright photographs that lose a head, and the fix is to start
   the crop near the top of the picture instead of a third of the way down.

   WHY 4% AND NOT 0%

   0% is the only value that can never lose a pixel off the top, and it reads
   as a picture shoved against the ceiling. 4% was chosen by photographing
   32 / 16 / 12 / 8 / 4 / 0 against every shape and looking: 4% is the first
   value where the whole head, hair included, clears the circle on both
   upright shapes with air above it -- the "margin safe spacing" that was
   asked for -- while still framing the face rather than the background.

   A NOTE ON WHAT THE PERCENTAGE MEANS. It is a share of the OVERFLOW, not of
   the picture: at 4%, four per cent of whatever will not fit is taken off the
   top and the remaining ninety-six off the bottom. That is why it
   self-corrects as pictures get taller, and why a square or a wide photograph
   ignores it entirely -- there is no vertical overflow to share out.

   Every face in the app is set here rather than at its own rule, so there is
   one number to change and no surface can drift away from the others.
   ========================================================================== */

/* THE ROUND FACES. .speaker-portrait is the shared image built by
   speakerPortraitHtml() in js/03-utils.js, so this one selector reaches the
   dashboard rings, the calendar pills, the roster cards, the archive rows,
   the press kit and the pre-production header at once. */
.speaker-portrait,
.xp-pring .speaker-portrait {
  object-position: 50% 4%;
}

/* OPTIONS ▸ DASHBOARD CARDS. Its own 40px circle, built separately. */
.dc-thumb {
  object-position: 50% 4%;
}

/* SPEAKER MANAGEMENT. These two had no origin at all, so they were cropping
   dead centre -- the chin crop the original comment warned about, and worse
   than the 32% everything else was using. */
.sm-face img,
.sm-who-face img {
  object-position: 50% 4%;
}

/* THE SMALLEST FACES NEED THE MOST ROOM.

   A 40px circle on a 1x screen is about thirty real pixels across once the
   ring is taken off it. The head is then a dozen pixels tall and the circle
   clips its sides a pixel or two in, so the same 4% that looks generous at
   82px reads as a trim at 44px. These sizes start the crop at the very top:
   there is nothing above the head worth keeping at that scale, and a face
   that small is read as "a person" rather than looked at. */
.xp-pring[style*="width:48px"] .speaker-portrait,
.xp-pring[style*="width:44px"] .speaker-portrait,
.xp-pring[style*="width:40px"] .speaker-portrait,
.cal-pill-face .speaker-portrait,
.dc-thumb {
  object-position: 50% 2%;
}

/* PAPER AND THE EXPORT SHEET. Both strip the ring and print the portrait on
   its own, and a head cropped on screen is a head cropped in the binder. The
   value is repeated rather than inherited because css/05-export.css and
   css/08-print.css both rewrite .speaker-portrait wholesale. */
@media print {
  .speaker-portrait,
  .xp-pring .speaker-portrait { object-position: 50% 4% !important; }
}
.pdf-exp .speaker-portrait,
.pdf-exp .xp-pring .speaker-portrait { object-position: 50% 4% !important; }
