/*
 * 사진첩(갤러리형 게시판) — 2026-10-12
 * 목록 카드 격자 · 글 보기 · 사진 올리기 · 크게 보기.
 * 옛 갤러리 스타일 위에 덮어쓰므로 사진첩 영역(.sh_photo_*) 안에서만 적용한다.
 */
:root {
	--shp-ink: #222;
	--shp-sub: #777;
	--shp-line: #e3e3e3;
	--shp-accent: #1a9a8a;
	--shp-bg: #fff;
	--shp-soft: #f5f7f7;
}

/* ── 목록: 카드 격자 ───────────────────────────────────── */
.sh_photo_grid ul.sh_cards { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; margin: 24px 0 !important; padding: 0 !important; list-style: none; }
.sh_photo_grid ul.sh_cards > li { width: auto !important; height: auto !important; float: none !important; margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
.sh_card { display: block; text-decoration: none; color: var(--shp-ink); border-radius: 10px; overflow: hidden; background: var(--shp-bg); box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: box-shadow .15s, transform .15s; }
.sh_card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.sh_card_pic { position: relative; aspect-ratio: 4 / 3; background: var(--shp-soft); overflow: hidden; }
.sh_card_pic img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; display: block; }
.sh_card_count { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 18px; }
.sh_card_new { position: absolute; left: 8px; top: 8px; padding: 1px 7px; border-radius: 4px; background: #f39c12; color: #fff; font-size: 11px; font-weight: bold; line-height: 16px; }
.sh_card_body { padding: 10px 12px 12px; }
.sh_card_title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: bold; line-height: 1.4; min-height: 2.8em; word-break: keep-all; }
.sh_card_date { margin-top: 6px; font-size: 12px; color: var(--shp-sub); }
.sh_card_admin { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; border-top: 1px solid var(--shp-line); font-size: 12px; color: var(--shp-sub); background: var(--shp-soft); }
.sh_card_admin input[type=text] { width: 44px; }
.sh_photo_empty { padding: 60px 0; text-align: center; color: var(--shp-sub); }
@media (max-width: 640px) {
	.sh_photo_grid ul.sh_cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.sh_card_title { font-size: 14px; }
}

/* ── 글 보기: 글 다음에 사진 — 블로그 / 사진첩 두 가지 ───── */
.sh_photo_view { margin-top: 28px; text-align: left; }
.sh_view_bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; margin-bottom: 18px; border-top: 1px solid var(--shp-line); border-bottom: 1px solid var(--shp-line); }
.sh_view_count { font-size: 14px; color: var(--shp-sub); }
.sh_view_modes { display: inline-flex; border: 1px solid var(--shp-line); border-radius: 8px; overflow: hidden; }
.sh_view_modes button { border: 0; background: #fff; color: var(--shp-sub); padding: 6px 14px; font-size: 13px; cursor: pointer; }
.sh_view_modes button + button { border-left: 1px solid var(--shp-line); }
.sh_view_modes button.on { background: var(--shp-accent); color: #fff; font-weight: bold; }
/* 블로그: 사진마다 크게, 아래에 제목·설명 */
.sh_photo_view figure { margin: 0 auto 34px; max-width: 860px; text-align: center; }
.sh_photo_view img { max-width: 100%; max-height: 80vh; width: auto; height: auto; border-radius: 6px; cursor: zoom-in; background: var(--shp-soft); }
.sh_photo_view figcaption { max-width: 760px; margin: 12px auto 0; text-align: left; line-height: 1.7; }
.sh_photo_view figcaption b { display: block; font-size: 16px; color: var(--shp-ink); }
.sh_photo_view figcaption b::before { content: ""; display: inline-block; width: 4px; height: 15px; margin-right: 8px; vertical-align: -2px; border-radius: 2px; background: var(--shp-accent); }
.sh_photo_view figcaption span { display: block; margin-top: 4px; font-size: 14px; color: #555; }
/* 사진첩: 격자, 제목만 한 줄 */
.sh_photo_view.mode-album .sh_view_list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.sh_photo_view.mode-album figure { margin: 0; max-width: none; }
.sh_photo_view.mode-album img { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.sh_photo_view.mode-album figcaption { margin-top: 6px; }
.sh_photo_view.mode-album figcaption b { font-size: 13px; font-weight: normal; color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh_photo_view.mode-album figcaption b::before, .sh_photo_view.mode-album figcaption span { display: none; }
@media (max-width: 640px) {
	.sh_photo_view.mode-album .sh_view_list { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.sh_photo_view figcaption b { font-size: 15px; }
}

/* ── 크게 보기 ─────────────────────────────────────────── */
.sh_lb { position: fixed; inset: 0; z-index: 99999; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.sh_lb img { max-width: 94vw; max-height: 86vh; object-fit: contain; user-select: none; }
.sh_lb button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 28px; line-height: 1; width: 52px; height: 52px; border-radius: 26px; cursor: pointer; }
.sh_lb button:hover { background: rgba(255,255,255,.25); }
.sh_lb .sh_lb_prev { left: 2vw; } .sh_lb .sh_lb_next { right: 2vw; } .sh_lb .sh_lb_close { top: 2vh; right: 2vw; font-size: 24px; }
.sh_lb img { max-height: 78vh; margin-bottom: 8vh; }
.sh_lb .sh_lb_cap { position: absolute; bottom: 2vh; left: 6vw; right: 6vw; text-align: center; color: #ddd; font-size: 14px; line-height: 1.5; }
.sh_lb .sh_lb_cap b { display: block; color: #fff; font-size: 16px; }
.sh_lb .sh_lb_cap b:empty, .sh_lb .sh_lb_cap p:empty { display: none; }
.sh_lb .sh_lb_cap p { margin: 2px 0 0; color: #bbb; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sh_lb .sh_lb_count { font-size: 12px; color: #999; margin-bottom: 2px; }

/* ── 사진 올리기 ───────────────────────────────────────── */
.sh_up_drop { border: 2px dashed #b9c6c4; border-radius: 10px; padding: 22px; text-align: center; color: var(--shp-sub); background: var(--shp-soft); cursor: pointer; }
.sh_up_drop.over { border-color: var(--shp-accent); background: #e9f6f4; }
.sh_up_drop b { color: var(--shp-accent); }
.sh_up_note { margin-top: 6px; font-size: 12px; color: var(--shp-sub); text-align: left; }
.sh_up_grid { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sh_up_tile { position: relative; display: flex; gap: 12px; align-items: stretch; padding: 8px; border: 1px solid var(--shp-line); border-radius: 8px; background: #fff; }
.sh_up_tile .pic { position: relative; flex: 0 0 110px; height: 110px; border-radius: 6px; overflow: hidden; background: var(--shp-soft); }
.sh_up_tile .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh_up_tile .txt { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sh_up_tile .txt input, .sh_up_tile .txt textarea { width: 100% !important; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; padding: 5px 8px; font-size: 13px; font-family: inherit; }
.sh_up_tile .txt input, .sh_up_tile .txt textarea { text-align: left !important; height: auto; }
.sh_up_tile .txt input { font-weight: bold; }
.sh_up_tile .txt textarea { flex: 1; resize: vertical; min-height: 54px; }
.sh_up_tile .bar { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11px; color: var(--shp-sub); }
.sh_up_tile .bar span:last-child { display: flex; flex-direction: column; gap: 4px; }
.sh_up_tile .bar button { border: 1px solid var(--shp-line); background: #fff; border-radius: 4px; padding: 0 8px; font-size: 12px; line-height: 22px; cursor: pointer; }
.sh_up_tile .tag { position: absolute; left: 4px; top: 4px; padding: 0 6px; border-radius: 4px; background: var(--shp-accent); color: #fff; font-size: 11px; line-height: 18px; }
.sh_up_tile.removed { opacity: .35; }
.sh_up_tile.busy .pic::after { content: "준비 중…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--shp-sub); background: rgba(255,255,255,.7); }
.sh_up_status { margin-top: 8px; font-size: 12px; color: var(--shp-sub); text-align: left; }
.sh_up_status.warn { color: #c0392b; }
