/*
 * A photograph behind each of the seventeen category squares.
 *
 * The images come from the Graphic Design Agent, sized down to 800px WebP
 * (607 KB for all seventeen, from 5 MB). Each tile names its own image in
 * --photo on the markup. This file draws it.
 *
 * Kept out of palette.css, which is colors only, so either can be changed or
 * removed without touching the other.
 *
 * The image is set only once the tile has the .in class that the page's
 * reveal-on-scroll already adds. So a visitor who never scrolls down to the
 * categories never downloads the photographs.
 */

.svc.has-photo{
  position:relative;
  overflow:hidden;
  background-color:#17120A;   /* shows for the moment before the photo loads */
  color:#FFFFFF;
}

/* The photograph. */
.svc.has-photo::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  background-size:cover;
  background-position:center;
}
.svc.has-photo.in::before{background-image:var(--photo)}

/* A dark wash, heaviest at the bottom where the name and the description sit,
   so the white type reads over any photograph. */
.svc.has-photo::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:linear-gradient(180deg,
    rgba(23,18,10,.10) 0%,
    rgba(23,18,10,.30) 45%,
    rgba(23,18,10,.86) 100%);
}

/* The tile's own content sits above both. */
.svc.has-photo > *{position:relative;z-index:2}

.svc.has-photo .num{color:var(--sun)}
.svc.has-photo h3{color:#FFFFFF}
.svc.has-photo p{color:rgba(255,255,255,.9)}

/* palette.css turns a plain tile pale yellow on hover. Over a photograph that
   color is hidden anyway; the dark ground stays so the edges don't flash. */
.svc.has-photo:hover{background-color:#17120A}
