/* Earlier work grid (self-contained: works on brief.html and changing-stage-expanded.html). Markup: earlier-work-block*.html */
.ew{margin-top:8px}
.ew-group{margin-top:34px}
.ew-label{margin:0 0 12px;font-size:11px;letter-spacing:.04em;color:var(--muted)}
.ew-di .ew-img img,.ew-di .ew-ph{aspect-ratio:16/9}
.ew-group-note{margin:-4px 0 16px;max-width:62ch;font-size:12.5px;line-height:1.6;color:var(--muted)}
.ew-group-note a{color:inherit;text-underline-offset:2px;text-decoration-thickness:1px}
.ew-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 18px}
.ew-item{min-width:0}
.ew-media{position:relative}
.ew-img{display:block;color:inherit;text-decoration:none}
.ew-img img,.ew-ph{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:6px;background:color-mix(in srgb,var(--ink) 6%,transparent)}
.ew-ph{display:grid;place-items:center;padding:16px;box-sizing:border-box;text-align:center;font-size:12px;color:var(--muted);border:1px dashed color-mix(in srgb,var(--ink) 18%,transparent);background:transparent}
a.ew-img img,a.ew-img .ew-ph{transition:transform .2s cubic-bezier(.2,.8,.3,1)}
.ew-item.is-link:hover .ew-img img,.ew-item.is-link:hover .ew-img .ew-ph{transform:translateY(-3px)}
a.ew-img:focus-visible{outline:1.5px solid currentColor;outline-offset:4px;border-radius:6px}
.ew-cap{margin:8px 0 0;font-size:12px;line-height:1.4;color:var(--ink)}
.ew-cap a{color:inherit;text-decoration:none}
.ew-cap i{font-style:normal;color:var(--muted);transition:color .15s ease-out}
.ew-item.is-link:hover .ew-cap i{color:var(--ink)}
/* notes: on a mouse, a small card over the bottom of the image on hover/focus; on touch, a line under the caption */
.ew-note{--ew-note-bg:#f8f5ee;--ew-note-ink:#26302a;font-size:11.5px;line-height:1.5;color:var(--ew-note-ink)}
html[data-theme=dark] .ew-note{--ew-note-bg:#20262a;--ew-note-ink:#ece8dc}
.ew-note p{margin:0}
.ew-note p+p{margin-top:6px}
.ew-note a{color:inherit;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}
.ew-quote a{opacity:.7}
@media (hover:hover) and (pointer:fine){
  .ew-note{position:absolute;left:10px;right:10px;bottom:10px;padding:10px 12px;border-radius:6px;background:var(--ew-note-bg);box-shadow:0 1px 2px rgb(0 0 0/.08),0 6px 18px rgb(0 0 0/.12);opacity:0;transform:translateY(4px);pointer-events:none;transition:opacity .15s ease-out,transform .15s ease-out}
  .ew-item:hover .ew-note,.ew-item:focus-within .ew-note{opacity:1;transform:none;pointer-events:auto}
}

.ew-tap-hint{display:none}
.ew-say-touch{display:none}   /* Oct 11: the JLab group note names the notes by how you open them */
@media not ((hover:hover) and (pointer:fine)){
  /* touch: notes stay hidden until the tile is tapped (earlier-work.js toggles .open); a quiet hint under each group label */
  .ew-item{display:flex;flex-direction:column}
  .ew-item .ew-media{display:contents}
  .ew-img{order:1}.ew-cap{order:2}
  .ew-note{order:3;margin:6px 0 0;color:var(--muted);display:none}
  .ew-item.open .ew-note{display:block}
  .ew-item.has-note .ew-cap::after{content:" +";color:var(--muted)}
  .ew-item.has-note.open .ew-cap::after{content:" −"}
  .ew-say-hover{display:none}.ew-say-touch{display:inline}
  .ew-tap-hint{display:block;margin:-6px 0 12px;font-size:11.5px;color:var(--muted)}
}
@media (max-width:900px){.ew-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}}
@media (prefers-reduced-motion:reduce){a.ew-img img,a.ew-img .ew-ph,.ew-note{transition:none}}

/* projects whose product Brian didn't design: a quiet dark multiply over the image that lifts on hover/focus */
.ew-item.is-dim .ew-img{position:relative;border-radius:6px;overflow:hidden}
.ew-item.is-dim .ew-img::after{content:"";position:absolute;inset:0;background:#000;mix-blend-mode:multiply;opacity:.26;transition:opacity .2s ease-out;pointer-events:none}
.ew-item.is-dim:hover .ew-img::after,.ew-item.is-dim:focus-within .ew-img::after{opacity:0}
@media (prefers-reduced-motion:reduce){.ew-item.is-dim .ew-img::after{transition:none}}

.ew-item.is-warm .ew-img::after{background:#c49a6c;opacity:.38}
.ew-item.is-warm:hover .ew-img::after,.ew-item.is-warm:focus-within .ew-img::after{opacity:0}
/* closing text-only tile */
.ew-text .ew-txt{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:8px;padding:22px 24px;text-align:left;color:var(--ink)}
.ew-text .ew-txt b{font-weight:400;font-size:clamp(17px,1.5vw,21px)}
.ew-text .ew-txt span{font-size:12px;line-height:1.6;color:var(--muted);max-width:34ch}
