  /* ---- the library ----
     A masonry wall, built with CSS columns.

     Columns rather than grid, and no JavaScript layout at all. The photographs
     are a mix of 16:9 and 9:16 straight off a phone, and a vertical downspout
     is that shape for a reason - a grid of equal cells would have to crop every
     portrait shot to a landscape box and throw away the subject. Columns let
     each picture keep its own height.

     The trade is reading order: columns fill top-to-bottom, so the eye goes
     down one column then back up. For a wall of photographs with no captions
     and no sequence that costs nothing, and it is the reason this layout is
     fine here and would be wrong for anything that reads as a list.

     break-inside is what stops a figure being sliced across the column break,
     which is the one way a column layout fails badly. */
  .lib{
    columns:3;
    column-gap:clamp(10px,1.2vw,16px);
  }
  .lib-item{
    margin:0 0 clamp(10px,1.2vw,16px);
    break-inside:avoid;
    -webkit-column-break-inside:avoid;
  }

  /* The whole card is the button: the hit area is the picture, which is what
     anyone will aim at. */
  .lib .gal-shot{
    display:block;width:100%;padding:0;border:0;background:none;
    cursor:zoom-in;border-radius:4px;overflow:hidden;
    background:var(--navy-lift);
    position:relative;
  }
  .lib .gal-shot img{
    display:block;width:100%;height:auto;
    transition:transform .5s cubic-bezier(.16,1,.3,1),opacity .3s ease;
  }
  .lib .gal-shot:hover img,
  .lib .gal-shot:focus-visible img{transform:scale(1.04)}

  /* A wash that deepens on hover. Without it the wall is a flat contact sheet;
     with it each photograph lifts when it is the one being looked at. */
  .lib .gal-shot::after{
    content:'';position:absolute;inset:0;pointer-events:none;
    background:linear-gradient(180deg, rgba(6,12,32,0) 55%, rgba(6,12,32,.45) 100%);
    opacity:0;transition:opacity .3s ease;
  }
  .lib .gal-shot:hover::after,
  .lib .gal-shot:focus-visible::after{opacity:1}
  .lib .gal-shot:focus-visible{outline:3px solid var(--stripe);outline-offset:3px}

  /* Empty is the default state of a wall whose photographs have not arrived.
     Same mechanism as the galleries: :empty on the container, with the note
     taking its place. */
  .lib-empty{
    display:none;
    padding:clamp(26px,4vw,38px);
    border:1px dashed var(--navy-edge);border-radius:4px;
    background:var(--navy-lift);color:#A6B0C6;font-size:15.5px;
  }
  .lib:empty{display:none}
  .lib:empty + .lib-empty{display:block}

  /* Three columns need a wide page to be worth having; below that the pictures
     get too small to read at a glance, which defeats the point of a library. */
  @media (max-width:900px){
    .lib{columns:2}
  }
  @media (max-width:520px){
    .lib{columns:1}
  }

  /* The lift is decoration. The lightbox is the content. */
  @media (prefers-reduced-motion:reduce){
    .lib .gal-shot img{transition:none}
    .lib .gal-shot:hover img,
    .lib .gal-shot:focus-visible img{transform:none}
  }
