/* 더 보기 · 사진 보정과 홍보 사진 (scenes/photo.html). 틀은 ta.css, 여기서는 .s-photo 아래만.
   사진은 css 배경으로 불러 와(이 파일 기준 주소) 홈·더 보기·시험 페이지 어디에 붙여도 같은 그림이 나온다. */

.s-photo { --ph-v-b: .5; --ph-v-w: .5; }
.s-photo.ph-noanim * { transition: none !important; }
.s-photo .ta-thread { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px); }

/* 탭 이름: 원본 → 저장한 새 파일 */
.s-photo .ph-f1 { opacity: 0; }
.s-photo .ph-ftab.go .ph-f0 { opacity: 0; }
.s-photo .ph-ftab.go .ph-f1 { opacity: 1; }
.s-photo .ta-tool:has(.ph-saved.show) .ph-note0 { display: none; }

/* 작업 과정: 다 끝나면 접힌다 */
.s-photo .ph-m-steps ol { max-height: 130px; overflow: hidden; transition: max-height .45s var(--ta-glide), opacity .3s, margin .45s var(--ta-glide); }
.s-photo .ph-m-steps.half ol { max-height: 0; opacity: 0; margin-top: 0 !important; }
.s-photo .ph-m-steps.half .ta-steps-h svg { transform: none; }
.s-photo .ta-steps-h svg { transition: transform .3s var(--ta-glide); }

/* ───────── 자료 칸: 사진 편집 ───────── */
.s-photo .ph-ed { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 12px; padding: 14px 12px 14px 14px; }
.s-photo .ph-canvas { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; border-radius: 8px; background: repeating-conic-gradient(#ececef 0 25%, #f6f6f8 0 50%) 0 0 / 14px 14px; }
.s-photo .ph-pic { position: relative; width: min(100cqw - 16px, 100cqh - 16px); aspect-ratio: 1; border-radius: 4px; overflow: hidden; box-shadow: 0 8px 22px -12px rgba(0, 0, 0, .5); clip-path: inset(0 0 0 0 round 4px); transition: clip-path .7s var(--ta-glide); }
.s-photo .ph-canvas { container-type: size; }
.s-photo .ph-img { position: absolute; inset: 0; background: #5d4636 url("/home/assets/proposal/photo/latte11.webp") center / cover no-repeat;
  filter: brightness(.74) saturate(.72) contrast(.9); transition: filter 1.6s var(--ta-inout); }
.s-photo .ph-cool { position: absolute; inset: 0; background: rgba(70, 92, 130, .22); mix-blend-mode: multiply; transition: opacity 1.6s var(--ta-inout); }
.s-photo .ph-pic.lit .ph-img { filter: brightness(1.05) saturate(1.12) contrast(1.02) sepia(.14); }
.s-photo .ph-pic.lit .ph-cool { opacity: 0; }

/* 4:5 자르기 틀 — 바깥은 어둡게, 안쪽은 삼등분 선과 모서리 손잡이 */
.s-photo .ph-crop { position: absolute; top: 0; bottom: 0; left: 10%; right: 10%; opacity: 0; box-shadow: 0 0 0 999px rgba(10, 10, 12, .5); outline: 1.5px solid rgba(255, 255, 255, .95); outline-offset: -1px; transition: opacity .35s; }
.s-photo .ph-crop.show { opacity: 1; }
.s-photo .ph-crop i { position: absolute; background: rgba(255, 255, 255, .45); }
.s-photo .ph-g1, .s-photo .ph-g2 { top: 0; bottom: 0; width: 1px; }
.s-photo .ph-g1 { left: 33.33%; } .s-photo .ph-g2 { left: 66.66%; }
.s-photo .ph-g3, .s-photo .ph-g4 { left: 0; right: 0; height: 1px; }
.s-photo .ph-g3 { top: 33.33%; } .s-photo .ph-g4 { top: 66.66%; }
.s-photo .ph-crop b { position: absolute; width: 14px; height: 14px; border: 3px solid #fff; }
.s-photo .ph-c1 { left: -2px; top: -2px; border-width: 3px 0 0 3px !important; }
.s-photo .ph-c2 { right: -2px; top: -2px; border-width: 3px 3px 0 0 !important; }
.s-photo .ph-c3 { left: -2px; bottom: -2px; border-width: 0 0 3px 3px !important; }
.s-photo .ph-c4 { right: -2px; bottom: -2px; border-width: 0 3px 3px 0 !important; }
.s-photo .ph-pic.go { clip-path: inset(0 10% 0 10% round 4px); }
.s-photo .ph-pic.go .ph-crop { opacity: 0; }

/* 보정 칸 */
.s-photo .ph-panel { display: flex; flex-direction: column; gap: 9px; min-width: 0; padding-top: 2px; }
.s-photo .ph-lab { font-size: 11px; font-weight: 700; color: var(--ta-faint); }
.s-photo .ph-lab + .ph-chips, .s-photo .ph-lab + .ph-sl { margin-top: -3px !important; }
.s-photo .ph-sl { display: grid; gap: 6px; }
.s-photo .ph-sl-h { display: flex; justify-content: space-between; font-size: 11.5px; color: #3a3a3c; }
.s-photo .ph-sl-h b { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ta-tx); }
.s-photo .ph-tr { position: relative; display: block; height: 4px; border-radius: 4px; background: #e2e2e6; }
.s-photo .ph-tr::before { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 10px; background: #c4c4c9; }
.s-photo .ph-fill { position: absolute; top: 0; bottom: 0; left: 50%; width: calc((var(--v) - .5) * 100%); border-radius: 4px; background: var(--cobalt); transition: width 1.5s var(--ta-inout); }
.s-photo .ph-knob { position: absolute; top: 50%; left: calc(var(--v) * 100%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .15); transition: left 1.5s var(--ta-inout); }
.s-photo .ph-sl-b { --v: var(--ph-v-b); }
.s-photo .ph-sl-w { --v: var(--ph-v-w); }
.s-photo .ph-sl-w .ph-fill { background: linear-gradient(90deg, #f1a64a, #e8772e); }
.s-photo .ph-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.s-photo .ph-chips span { display: grid; place-items: center; height: 26px; border-radius: 7px; background: #fff; box-shadow: inset 0 0 0 1px #dedee2; font-size: 11.5px; color: #3a3a3c; transition: background .25s, color .25s, box-shadow .25s; }
.s-photo .ph-chips span.on, .s-photo .ph-chips span.lit { background: #1d1d1f; color: #fff; box-shadow: none; font-weight: 700; }
.s-photo .ph-chips:has(.lit) span.on { background: #fff; color: #3a3a3c; box-shadow: inset 0 0 0 1px #dedee2; font-weight: 400; }

/* ───────── 답 속 결과물 카드 ───────── */
.s-photo .ph-card { margin-top: 8px; padding: 10px 12px 12px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--ta-bd), 0 1px 2px rgba(0, 0, 0, .03); }
.s-photo .ph-card-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.s-photo .ph-card-h > span:first-child { display: grid; line-height: 1.35; }
.s-photo .ph-card-h b { font-size: 12px; font-weight: 700; }
.s-photo .ph-card-h small { font-size: 11px; color: var(--ta-faint); }
.s-photo .ph-big { flex: none; padding: 4px 9px; border-radius: 7px; background: #f1f1f3; font-size: 11.5px; color: #3a3a3c; }
.s-photo .ph-thumbs { display: flex; gap: 7px; margin-top: 9px !important; }
.s-photo .ph-t { position: relative; flex: none; width: 50px; height: 50px; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
  background: linear-gradient(110deg, #ececef 30%, #f8f8fa 50%, #ececef 70%) 0 0 / 220% 100%; animation: ph-shim 1.1s linear infinite; }
.s-photo .ph-t::after { content: ""; position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; filter: blur(6px); transform: scale(1.08); transition: opacity .45s, filter .6s var(--ta-glide), transform .6s var(--ta-glide); }
.s-photo .ph-t.in::after { opacity: 1; filter: none; transform: none; }
.s-photo .ph-t.in { animation: none; }
.s-photo .ph-t0::after { background-image: url("/home/assets/proposal/photo/latte45.webp"); background-position: 50% 40%; }
.s-photo .ph-t1::after { background-image: url("/home/assets/proposal/photo/gen2.webp"); }
.s-photo .ph-t2::after { background-image: url("/home/assets/proposal/photo/gen3.webp"); }
.s-photo .ph-t3::after { background-image: url("/home/assets/proposal/photo/gen4.webp"); }
.s-photo .ph-t.go { box-shadow: 0 0 0 2px var(--cobalt); }
@keyframes ph-shim { from { background-position: 120% 0; } to { background-position: -100% 0; } }

@container tadesk (max-width: 700px) {
  .s-photo .ta-side { inset: 22% 0 0 0; }
  .s-photo .ph-ed { grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; padding: 12px 10px; }
  .s-photo .ph-lab, .s-photo .ph-sl-h, .s-photo .ph-chips span, .s-photo .ph-card-h b, .s-photo .ph-card-h small, .s-photo .ph-big { font-size: 12px; }
  .s-photo .ph-t { width: 52px; height: 52px; }
  .s-photo .ta-p code { font-size: 12px; }
}
/* 휴대폰 배치지만 칸이 넓을 때(태블릿 세로 등): 보정 칸을 넓혀 사진 옆 빈 곳을 줄인다 */
@container tadesk (min-width: 521px) and (max-width: 700px) {
  .s-photo .ph-ed { grid-template-columns: minmax(0, 1fr) 200px; gap: 16px; padding: 14px 16px; }
  .s-photo .ph-panel { gap: 11px; }
}
@media (max-width: 860px) {
  .s-photo .ta-desk { --ta-h: 500px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-photo .ph-t { animation: none; }
  .s-photo .ph-img, .s-photo .ph-cool, .s-photo .ph-fill, .s-photo .ph-knob, .s-photo .ph-pic, .s-photo .ph-t::after { transition: none; }
}
