/* ============================================================
   ProjectTelemetry — Photos
   assets/photos.css   ·   patch 173

   Builds on .co-* (change-orders.css), .cd-* (curves-dash.css /
   production.css), the drawer families in issues.css and the bar rows in
   cde.css. Only what a photo grid needs lives here.
   ============================================================ */

.cd-list-hd.ph-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cd-list-hd.ph-hd h4 { margin: 0; font: inherit; letter-spacing: inherit; }
.cd-list-hd.ph-hd .cd-soft { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px; }

/* ── tags ────────────────────────────────────────────────── */
.ph-tag {
  --tc: #64748B;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; font-weight: 650; line-height: 1;
  padding: 4px 7px; border-radius: 999px; white-space: nowrap;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc) 24%, transparent);
}
.ph-tag.more { color: var(--ink-faint); background: var(--bg2); border-color: var(--bd); }
.ph-tag.pick { cursor: pointer; }
.ph-tag.pick span { font-weight: 500; opacity: .65; font-variant-numeric: tabular-nums; }
.ph-tag.pick:hover { background: color-mix(in srgb, var(--tc) 20%, transparent); }
.ph-tag.pick.on { background: var(--tc); color: #fff; border-color: var(--tc); }
.ph-tag.pick.on span { opacity: .8; }

.ph-tagbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.ph-tagnote { margin: 0 0 14px; max-width: 68ch; line-height: 1.55; }

/* ── the grid ────────────────────────────────────────────── */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }

.ph-card {
  position: relative; margin: 0; border: 1px solid var(--bd); border-radius: 10px;
  background: var(--white); overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
}
.ph-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.ph-card.on { outline: 2px solid var(--accent); outline-offset: -2px; }
.ph-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg2); }

.ph-card figcaption { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px 9px; }
.ph-cap  { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-meta { font-size: 11px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-tags { display: flex; gap: 4px; margin-top: 3px; overflow: hidden; }

/* The badges say what has been done to a photo without opening it. */
.ph-badges { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.ph-badges i {
  font-size: 12px; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 6px; color: #fff; background: rgba(15,23,42,.62); backdrop-filter: blur(2px);
}
.ph-badges .ti-star-filled { color: #FBBF24; }

.ph-check {
  position: absolute; top: 6px; left: 6px; width: 22px; height: 22px;
  border-radius: 6px; border: 1px solid rgba(255,255,255,.65); background: rgba(15,23,42,.42);
  color: transparent; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .12s;
}
.ph-card:hover .ph-check, .ph-card.on .ph-check { opacity: 1; }
.ph-check i { font-size: 13px; }
.ph-card.on .ph-check { background: var(--accent); border-color: var(--accent); color: #fff; }

.ph-shown { margin-top: 14px; text-align: center; }

/* ── timeline ────────────────────────────────────────────── */
.ph-timeline { display: flex; flex-direction: column; gap: 22px; }
.ph-day > header {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px;
  padding-bottom: 6px; border-bottom: 1px solid var(--bd);
}
.ph-day > header h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }

/* ── albums ──────────────────────────────────────────────── */
.ph-albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ph-album {
  position: relative; border: 1px solid var(--bd); border-radius: 12px; overflow: hidden;
  background: var(--white); box-shadow: var(--shadow); cursor: pointer; transition: transform .12s;
}
.ph-album:hover { transform: translateY(-2px); }
.ph-album img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg2); }
.ph-album-blank { aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--bg2); color: var(--ink-faint); }
.ph-album-blank i { font-size: 28px; }
.ph-album-b { padding: 10px 12px 12px; }
.ph-album-b h4 { margin: 0 0 2px; font-size: 13px; font-weight: 650; color: var(--ink); }
.ph-album-b p  { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-soft); line-height: 1.5; }
.ph-album-a { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.ph-album:hover .ph-album-a { opacity: 1; }
.ph-album-a .co-ico { background: rgba(255,255,255,.92); }

/* ── uploader ────────────────────────────────────────────── */
.ph-drop {
  border: 2px dashed var(--bd); border-radius: 12px; background: var(--bg2);
  padding: 28px 20px; text-align: center; cursor: pointer; transition: border-color .12s, background .12s;
}
.ph-drop:hover, .ph-drop.over { border-color: var(--accent); background: var(--accent-bg); }
.ph-drop i { font-size: 30px; color: var(--ink-faint); }
.ph-drop.over i { color: var(--accent); }
.ph-drop p { margin: 8px 0 4px; font-size: 13px; color: var(--ink); }

.ph-queue { margin-top: 12px; }
.ph-qhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 12px; font-weight: 600; }
.ph-q {
  display: grid; grid-template-columns: 1fr auto 26px; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 7px; font-size: 12px;
}
.ph-q:nth-child(odd) { background: var(--bg2); }
.ph-q > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-q-st { font-size: 11px; color: var(--ink-faint); }
.ph-q-st.ok  { color: #15803D; font-weight: 650; }
.ph-q-st.bad { color: #B91C1C; font-weight: 650; }

/* ── bulk bar ────────────────────────────────────────────── */
.ph-bulk {
  position: sticky; top: 8px; z-index: 5;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 14px; border-radius: 10px;
  background: var(--ink); color: var(--white); box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.ph-bulk > span { font-size: 12.5px; margin-right: 4px; }
.ph-bulk .btn-ghost { color: var(--white); border-color: rgba(255,255,255,.28); background: transparent; }
.ph-bulk .btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ── lightbox ────────────────────────────────────────────── */
.ph-lb {
  position: fixed; inset: 0; z-index: 1200; display: grid;
  grid-template-columns: 1fr 340px; background: rgba(9,12,20,.92);
}
.ph-lb-fig { margin: 0; display: grid; place-items: center; padding: 32px; min-width: 0; }
.ph-lb-fig img { max-width: 100%; max-height: calc(100vh - 64px); object-fit: contain; border-radius: 6px; }

.ph-lb-side { background: var(--white); overflow-y: auto; border-left: 1px solid var(--bd); }
.ph-lb-body { padding: 20px; }
.ph-lb-body h3 { margin: 0 0 8px; font-size: 15px; font-weight: 650; color: var(--ink); line-height: 1.4; }
.ph-lb-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.ph-lb-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.ph-lb-comments { border-top: 1px solid var(--bd); padding-top: 12px; }
.ph-lb-comments > label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-faint); margin-bottom: 8px;
}
.ph-lb-cadd { display: flex; gap: 6px; margin-top: 10px; }
.ph-lb-cadd input { flex: 1; }

.ph-lb-x, .ph-lb-nav {
  position: absolute; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(3px);
}
.ph-lb-x:hover, .ph-lb-nav:hover { background: rgba(255,255,255,.24); }
.ph-lb-x { top: 16px; left: 16px; }
.ph-lb-nav { top: 50%; transform: translateY(-50%); }
.ph-lb-nav.l { left: 16px; }
.ph-lb-nav.r { right: 356px; }
.ph-lb-nav i, .ph-lb-x i { font-size: 20px; }

/* ── portfolio strip ─────────────────────────────────────── */
.ph-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.ph-scard { margin: 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--bd); cursor: pointer; background: var(--white); }
.ph-scard:hover { border-color: var(--accent); }
.ph-scard img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--bg2); }
.ph-scard figcaption { display: flex; flex-direction: column; padding: 6px 7px; gap: 1px; }
.ph-scard figcaption span:first-child {
  font-size: 11px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ph-scard figcaption .cd-soft { font-size: 10.5px; }

/* ── narrow ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ph-grid   { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .ph-albums { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .ph-check  { opacity: 1; }
  .ph-album-a { opacity: 1; }

  /* The photo comes first on a phone; the details scroll under it. */
  .ph-lb { grid-template-columns: 1fr; grid-template-rows: 52vh 1fr; }
  .ph-lb-fig { padding: 12px; }
  .ph-lb-fig img { max-height: calc(52vh - 24px); }
  .ph-lb-side { border-left: 0; border-top: 1px solid var(--bd); }
  .ph-lb-nav.r { right: 16px; }
}
