/**
 * content/custom/css/entry-lead-image.css
 *
 * Cap the height of a hero rendered from the `lead_image` field.
 *
 * The problem
 * -----------
 * An entry page can get its hero from either of two shared blocks, and
 * they emit different markup:
 *
 *   entry_auto_image  →  <figure class="enc-hero enc-hero-full …">
 *   entry_image       →  <figure class="enc-hero">
 *
 * The 460px cap lives on `.enc-hero-full img`, which only the first of
 * those carries. `.enc-hero img` on its own is `height: auto`, so a
 * lead_image hero renders at the photograph's full natural height —
 * 3648px tall on the 5472x3648 originals here — pushing every scrap of
 * page content below the fold.
 *
 * That did not matter while nothing on the site set `lead_image`. The
 * duplicate-image dedup changed that: where a class page's convention
 * file was the copy removed, the page's hero was restored by pointing
 * `lead_image` at the surviving file, which switched those 12 class
 * pages onto the uncapped path.
 *
 * Why the fix is here and shaped like this
 * ----------------------------------------
 * The real fix is one word — `enc-hero-full` in blockEntryImage's class
 * list — but that block is in lib/EncyclopediaRenderer.php, which is
 * shared across every site this CMS serves. This restores the same
 * visual result from the site's own stylesheet instead.
 *
 * Scoped by the image's folder rather than applied to every bare
 * `.enc-hero img`, because `entry_image` is also the block behind
 * `designers.portrait` and `railway-companies.logo`. Those are portraits
 * and logos: cropping them to a 460px letterbox with `object-fit: cover`
 * would be wrong. Both are currently unpopulated, so a blanket rule
 * would look harmless today and quietly disfigure the first portrait
 * anyone uploads. Matching on `/media/locomotives/` and
 * `/media/preserved-locomotives/` keeps the cap to the banner-style
 * photographs it is right for.
 *
 * The float and centered hero variants are excluded: they deliberately
 * keep their natural aspect ratio, and their own rules already cap them
 * at 600px.
 *
 * Values are copied from `.enc-hero-full img` in
 * template/css/encyclopedia.css so the two paths render identically.
 * If that rule's 460px ever changes, change it here too.
 */

figure.enc-hero:not(.enc-hero-full):not(.enc-hero-float-right):not(.enc-hero-float-left):not(.enc-hero-centered-small) > img[src*="/media/locomotives/"],
figure.enc-hero:not(.enc-hero-full):not(.enc-hero-float-right):not(.enc-hero-float-left):not(.enc-hero-centered-small) > img[src*="/media/preserved-locomotives/"] {
    max-height: 460px;
    object-fit: cover;
    object-position: center;
}
