/* ============================================================
   Photos App Styles (prefix: pho-)
   ============================================================ */

/* Tab panes: only the active tab is shown */
.pho-pane { position: absolute; inset: 0; display: none; flex-direction: column; background: var(--bg); }
.pho-pane.on { display: flex; }
.pho-pane .scroll { flex: 1; }

/* Library header: count line under the large title */
.pho-count {
  margin: 0 0 12px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--label2);
}
.pho-select { color: var(--tint); font-size: 17px; padding: 0 8px; height: 44px; }

/* Library grid: 3 columns of square photos with thin gaps */
.pho-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.pho-cell {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: var(--fill);
  overflow: hidden;
}
.pho-cell::before { content: ""; display: block; padding-top: 100%; }
.pho-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pho-cell:active { opacity: 0.75; }

/* Tab bar (same look as the other apps) */
.pho-tabbar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 84px;
  z-index: 7;
  background: var(--bar);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 0.5px solid var(--sep);
}
.pho-tab {
  width: 70px;
  height: 77px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  outline: none;
}
.pho-tab svg { width: 27px; height: 27px; margin-bottom: 4px; }
.pho-tab span { font-size: 10px; font-weight: 500; }
.pho-tab:not(.on) svg, .pho-tab:not(.on) span { color: var(--label2); }
.pho-tab.on svg, .pho-tab.on span { color: var(--tint); }
.pho-tab:active { opacity: 0.7; }

/* Photo viewer */
.pho-viewer .nav.solid { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: transparent; }
.pho-viewer .nav-t { font-size: 14px; }
.pho-viewer .back { color: var(--label); }
.pho-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 95px 0 96px;
}
.pho-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Viewer toolbar: share, heart, info, trash in 4 equal columns, all on one line */
.pho-vbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 96px;
  padding-bottom: 26px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  background: var(--bg);
}
.pho-vbtn {
  flex: 1;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--label);
  background: none;
  border: 0;
}
.pho-vbtn svg { width: 25px; height: 25px; display: block; }
.pho-vbtn:active { opacity: 0.6; }
.pho-heart.on { color: var(--red); }
.pho-heart.on svg path { fill: currentColor; }


/* Photo viewer swipe: horizontal track of slides, one photo per slide */
.pho-stage { overflow: hidden; touch-action: pan-y; }
.pho-track { flex: 0 0 100%; width: 100%; height: 100%; display: flex; will-change: transform; }
.pho-slide { flex: 0 0 100%; width: 100%; height: 100%; }
.pho-slide img { -webkit-user-drag: none; user-select: none; }


/* Albums tab: 2-column grid */
.pho-albums { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 6px 16px 0; }
.pho-album { display: block; padding: 0; border: 0; background: none; text-align: left; color: var(--label); }
.pho-album:active { opacity: 0.75; }
.pho-album-cover { position: relative; display: block; width: 100%; border-radius: 10px; overflow: hidden; background: var(--fill); }
.pho-album-cover::before { content: ""; display: block; padding-top: 100%; }
.pho-album-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pho-album-locked, .pho-album-empty { color: var(--label2); }
.pho-album-cover svg { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%); }
.pho-album-name { display: block; margin-top: 6px; font-size: 15px; font-weight: 500; }
.pho-album-count { display: block; margin-top: 1px; font-size: 13px; color: var(--label2); }
.pho-empty { padding: 120px 0; text-align: center; font-size: 20px; color: var(--label2); }

/* Face ID prompt (Hidden album) */
.pho-faceid-dim { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0); opacity: 0; transition: opacity 220ms ease, background 220ms ease; }
.pho-faceid-dim.show { opacity: 1; background: rgba(0, 0, 0, 0.35); }
.pho-faceid { width: 150px; height: 150px; box-sizing: border-box; padding: 0 10px; border-radius: 28px; background: var(--cell); color: var(--label); box-shadow: 0 0 0 0.5px var(--sep), 0 8px 30px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transform: scale(0.92); transition: transform 220ms ease; }
.pho-faceid-dim.show .pho-faceid { transform: scale(1); }
.pho-faceid svg { width: 46px; height: 46px; display: block; }
.pho-faceid-label { font-size: 15px; font-weight: 500; text-align: center; line-height: 1.2; }
.pho-faceid.scanning svg { animation: phoFidPulse 0.9s ease-in-out infinite alternate; }
.pho-faceid.scanning .fid-face { animation: phoFidFace 0.9s ease-in-out infinite alternate; }
.pho-faceid.failed svg { animation: phoFidShake 0.5s ease both; }
.pho-faceid.failed .fid-face { opacity: 0.45; }
@keyframes phoFidPulse { from { transform: scale(0.95); } to { transform: scale(1.04); } }
@keyframes phoFidFace { from { opacity: 0.3; } to { opacity: 1; } }
@keyframes phoFidShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
