/* ===========================================================================
   Projects — page-specific layout only.

   Light throughout until the close: the head carries the lede and the six
   jobs run beneath it as one rule-separated list, in the register of the
   applications list on the services page and the principles on the about
   page. Text-led for now: the client's photographs return once there is one
   distinct image per job. Everything here builds on site.css; nothing in it
   is overridden.
   =========================================================================== */

.work { padding: clamp(1rem, 2vw, 1.5rem) 0 clamp(3.5rem, 7vw, 6rem); }

.jobs {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--rule);
}
/* On a phone the place sits under the title and the body follows. From 640px
   the place takes the first column beside the title, the body beneath the
   title; from 900px the body moves alongside both, so six jobs read as one
   scan down the page. Small type never sits above large. */
.jobs li {
  display: grid; gap: .45rem 1.6rem;
  grid-template-areas: "h" "place" "p";
  padding: clamp(1.5rem, 3vw, 2.2rem) 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 640px) {
  .jobs li {
    grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr);
    grid-template-areas: "place h" "place p"; align-items: start;
  }
  .jobs .place { padding-top: .35rem; }
}
@media (min-width: 900px) {
  .jobs li {
    grid-template-columns: minmax(9rem, 13rem) minmax(14rem, 22rem) minmax(0, 1fr);
    grid-template-areas: "place h p"; align-items: baseline;
  }
  .jobs .place { padding-top: 0; }
}
.jobs h2 {
  grid-area: h; margin: 0; font-family: var(--head); font-weight: 300; font-synthesis: none;
  /* light, so never under 20px: the floor for the light weight */
  font-size: clamp(1.25rem, 1.9vw, 1.5rem); letter-spacing: -0.012em; line-height: 1.18;
}
/* the deep green: the brand green is under 4.5:1 at this size on the light ground */
.jobs .place {
  grid-area: place; font-family: var(--mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--kevin-mid);
}
.jobs p { grid-area: p; margin: 0; color: var(--ink-soft); max-width: 52ch; }

/* --- the photographs, when they come ---------------------------------------
   Each entry takes <img src="images/…" width height alt loading="lazy"> as its
   first child. It spans the row above the words on a phone and takes its own
   column on the left from 640px; minmax(0, …) on the columns above keeps a
   photograph from holding its column open. Nothing here paints until an <img>
   is present. */
.jobs li > img {
  grid-area: img; display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px;
  filter: saturate(.85) contrast(1.04);
}
.jobs li:has(> img) { grid-template-areas: "img" "h" "place" "p"; }
@media (min-width: 640px) {
  .jobs li:has(> img) {
    grid-template-columns: minmax(0, 11rem) minmax(9rem, 13rem) minmax(0, 1fr);
    grid-template-areas: "img place h" "img place p";
  }
}
@media (min-width: 900px) {
  .jobs li:has(> img) {
    grid-template-columns: minmax(0, 11rem) minmax(9rem, 13rem) minmax(14rem, 22rem) minmax(0, 1fr);
    grid-template-areas: "img place h p"; align-items: start;
  }
}

/* --- the sector tabs over the reel ------------------------------------------
   The header's current-page pill brought down to the page: the chosen sector
   is the mid green with white on it (6.3:1), the rest are the same spec type
   with no fill, and a hairline ring under the pointer shows the pill each
   would become. The radio behind each is visually hidden (.vh) and keeps the
   focus, so the ring is drawn on the pill beside it. A 33px pill in a 45px
   row: the label's own padding makes up the target. The pills stand flush
   with the lede's left edge, so the filled one sits in its column. */
.sectors {
  display: flex; flex-wrap: wrap; gap: 0 .35rem;
  border: 0; margin: 0 0 clamp(1.4rem, 2.6vw, 2rem); padding: 0; min-width: 0;
}
.sectors[hidden] { display: none; }   /* display above is an author rule; [hidden]'s is the browser's */
.work-lede:has(+ .sectors:not([hidden])) { margin-bottom: 1rem; }
.sectors label { position: relative; display: block; padding: .375rem 0; cursor: pointer; }
.sectors span {
  display: block; padding: .78em 1.15em; border-radius: 999px;
  line-height: 1.2; color: var(--ink);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .16s ease;
}
@media (hover: hover) {
  .sectors label:hover input:not(:checked) + span { box-shadow: inset 0 0 0 1px var(--rule-strong); }
}
.sectors label:active span { transform: scale(.97); }
/* On a phone the four ran 424px against a 337px column and Commercial went
   to a line of its own. The type steps down as the header's row does on a
   phone (.68rem), the tracking and the pill's sides close up, and the four
   hold one line down to a 360px screen; below that they wrap. */
@media (max-width: 479px) {
  .sectors { gap: 0 .15rem; font-size: .68rem; letter-spacing: .08em; }
  .sectors span { padding: .85em .66em; }
}
.sectors input:checked + span { background: var(--kevin-mid); color: #fff; }
.sectors input:focus-visible + span { outline: 3px solid var(--kevin); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .sectors span { transition: none; }
  .sectors label:active span { transform: none; }
}
