/* photos.css — geotagged project photo library (screen #photos + #ph-view).
   Leans on app.css for .screen/.bar/.field-form/.tagged-chip; this file only
   adds the capture row, the day-grouped thumbnail grid, and the detail view. */

.ph-capture-row {
  display: flex;
  gap: 10px;
}
.ph-shoot,
.ph-pick {
  flex: 1;
  padding: 12px 10px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.ph-shoot { background: #2f5d74; color: #fff; }
.ph-pick { background: #e8edf2; color: #1b2430; }
.ph-batch-toggle {
  display: flex; align-items: center; gap: 6px;
  padding: 0 10px; border-radius: 10px; background: #e8edf2; color: #1b2430;
  font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap;
}
.ph-batch-toggle input { width: 18px; height: 18px; margin: 0; accent-color: #2f5d74; }
.ph-batch-toggle:has(input:checked) { background: #2f5d74; color: #fff; }

/* --- batch capture: in-app viewfinder, shutter, thumbnail strip, one upload --- */
.ph-batch-ov {
  position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff;
  display: flex; flex-direction: column;
}
.ph-batch-ov[hidden] { display: none; }
.ph-batch-ov video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.ph-batch-top {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; font-size: 14px; font-weight: 600;
  background: linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,0));
}
.ph-batch-top button { background: rgba(0,0,0,.45); color: #fff; border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 18px; }
.ph-batch-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .12s; }
.ph-batch-flash.on { opacity: .8; transition: none; }
.ph-batch-bottom { position: relative; margin-top: auto; background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.7)); padding-bottom: env(safe-area-inset-bottom); }
.ph-batch-strip { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; min-height: 64px; }
.ph-batch-strip img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 2px solid rgba(255,255,255,.7); flex: none; }
.ph-batch-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 22px 18px; }
.ph-batch-bar button { border: none; color: #fff; font-size: 15px; font-weight: 700; }
.ph-batch-flip { background: rgba(255,255,255,.18); border-radius: 50%; width: 52px; height: 52px; font-size: 22px; }
.ph-batch-shutter {
  width: 76px; height: 76px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 4px #000, 0 0 0 7px #fff; padding: 0;
}
.ph-batch-shutter:active { transform: scale(.92); }
.ph-batch-done { background: #2f5d74; border-radius: 26px; padding: 14px 18px; min-width: 52px; }
.ph-batch-done:disabled { opacity: .45; }
.ph-batch-err { position: absolute; left: 12px; right: 12px; bottom: 150px; background: rgba(180,40,40,.9); padding: 10px 12px; border-radius: 8px; font-size: 14px; }

.ph-pending {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 2px;
  font-size: 14px;
  color: #4a5563;
}
.ph-spin {
  width: 14px;
  height: 14px;
  border: 2px solid #cfd6df;
  border-top-color: #2f5d74;
  border-radius: 50%;
  animation: ph-rot 0.8s linear infinite;
  display: inline-block;
}
@keyframes ph-rot { to { transform: rotate(360deg); } }

.ph-filters {
  display: flex;
  gap: 8px;
  padding: 4px 12px 0;
}
.ph-filters select {
  flex: 1;
  min-width: 0;
  padding: 8px;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.ph-viewtoggle {
  display: flex;
  flex: 0 0 auto;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  overflow: hidden;
}
.ph-vbtn {
  border: none;
  background: #fff;
  color: #4a5563;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.ph-vbtn.is-on { background: #2f5d74; color: #fff; }

.ph-map-wrap { padding: 8px 12px 16px; }
.ph-map {
  height: 62vh;
  min-height: 320px;
  border-radius: 10px;
  overflow: hidden;
  background: #e8edf2;
}
.ph-map-note {
  margin: 8px 2px 0;
  font-size: 13px;
  color: #6b7686;
}
.ph-popwrap { cursor: pointer; }
.ph-pop {
  width: 190px;
  max-height: 150px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.ph-popmeta { margin-top: 5px; font-size: 12.5px; line-height: 1.4; }

.ph-feed { padding: 4px 12px 12px; }
.ph-day {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7686;
}
.ph-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
@media (min-width: 700px) {
  .ph-grid { grid-template-columns: repeat(5, 1fr); }
}
.ph-cell {
  position: relative;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #e8edf2;
  aspect-ratio: 1 / 1;
  cursor: pointer;
}
.ph-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ph-cell figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 6px;
  font-size: 10.5px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  white-space: nowrap;
  overflow: hidden;
}
.ph-cell-who { overflow: hidden; text-overflow: ellipsis; }
.ph-badges {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
}
.ph-badge {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10.5px;
  border-radius: 8px;
  padding: 1px 6px;
}

.ph-empty {
  text-align: center;
  padding: 40px 16px;
  color: #6b7686;
  font-size: 22px;
}
.ph-empty span { font-size: 13px; }

.ph-more {
  display: block;
  margin: 0 auto 20px;
  padding: 9px 22px;
  border: 1px solid #cfd6df;
  border-radius: 20px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* ------------------------------ detail overlay ------------------------------ */
.ph-view {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #101418;
  display: flex;
  flex-direction: column;
}
.ph-view .docview-bar { flex: 0 0 auto; }
.ph-view-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 30px;
}
.ph-imgwrap { position: relative; }
#ph-view-img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  background: #000;
  display: block;
}
.ph-navarrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 76px;
  border: none;
  border-radius: 10px;
  background: rgba(16, 20, 24, 0.55);
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 6px;
}
.ph-navarrow:active { background: rgba(47, 93, 116, 0.85); }
.ph-navarrow--l { left: 8px; }
.ph-navarrow--r { right: 8px; }
.ph-view-meta {
  padding: 10px 14px 4px;
  color: #dfe6ec;
  font-size: 14px;
  line-height: 1.5;
}
.ph-view-meta a { color: #7fc4e8; }
.ph-view-note {
  padding: 4px 14px 8px;
  color: #dfe6ec;
  font-size: 14px;
}
.ph-dim { color: #8b96a3; }

.ph-comments { padding: 6px 14px; }
.ph-comment {
  background: #1b232b;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
  color: #e8edf2;
}
.ph-chead {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  margin-bottom: 3px;
}
.ph-cbody { font-size: 14px; white-space: pre-wrap; }
.ph-ctags { display: block; margin-top: 4px; font-size: 12px; color: #9fb4c6; }
.ph-nocomments { font-size: 13.5px; padding: 4px 0 8px; }

.ph-comment-form {
  padding: 4px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ph-comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #33404c;
  border-radius: 10px;
  background: #1b232b;
  color: #e8edf2;
  padding: 9px 10px;
  font-size: 15px;
  resize: vertical;
}
.ph-comment-form .f-lab { color: #9fb4c6; }
.ph-comment-form select {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #33404c;
  background: #1b232b;
  color: #e8edf2;
}
.ph-comment-form .f-check { color: #9fb4c6; font-size: 13.5px; }
#ph-comment-send {
  align-self: flex-start;
  padding: 9px 20px;
  border: none;
  border-radius: 10px;
  background: #2f5d74;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
}

.ph-view-actions { padding: 6px 14px 20px; }
.ph-del-btn {
  border: 1px solid #7a3040;
  color: #ff9aa8;
  background: transparent;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 13.5px;
  cursor: pointer;
}
