/* ===== 사진 썸네일 (게시판 · 진행 기록 · 사진첩 공통) ===== */
.thumbs { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.thumbs.sm { grid-template-columns: repeat(auto-fill, 72px); }
.thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0;
  border-radius: 14px; overflow: hidden; background: var(--brand-50); cursor: zoom-in;
}
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.thumb:hover img { transform: scale(1.05); }
.thumb.missing::after { content: "🖼️"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; }

/* ===== 사진첩: 사진만 쭉 ===== */
.album-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.album-grid .thumb { border-radius: 18px; }

/* ===== 제목 + 등록 버튼 줄 (사진첩 · 자료실) ===== */
.head.titlebar { align-items: center; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-actions .search { width: 220px; }

/* ===== 보드 (게시판: 코르크 · 투표소: 하늘색 펠트) — 나무 액자 안에 카드를 핀으로 꽂은 느낌 ===== */
.board {
  padding: 12px; border-radius: 32px;
  background:
    repeating-linear-gradient(100deg, rgba(255, 255, 255, .07) 0 7px, rgba(120, 70, 20, .05) 7px 13px),
    linear-gradient(145deg, #E8C08A, #D19D62 55%, #DFB078);
  box-shadow: 0 2px 4px rgba(90, 60, 25, .12), 0 16px 36px rgba(90, 60, 25, .16);
}
.board-inner {
  min-height: 62vh; padding: 22px 22px 30px; border-radius: 22px;
  box-shadow: inset 0 3px 10px rgba(70, 40, 10, .22);
}
.board.cork .board-inner {
  background-color: #EACFA3;
  background-image:
    radial-gradient(rgba(140, 90, 40, .22) 1.2px, transparent 1.7px),
    radial-gradient(rgba(255, 255, 255, .38) 1px, transparent 1.5px),
    radial-gradient(rgba(160, 110, 50, .14) 2px, transparent 2.7px);
  background-size: 13px 13px, 19px 19px, 31px 31px;
  background-position: 0 0, 6px 9px, 14px 3px;
}
.board.felt .board-inner {
  background-color: #D3E5FB;
  background-image:
    radial-gradient(rgba(66, 115, 184, .13) 1px, transparent 1.6px),
    radial-gradient(rgba(255, 255, 255, .55) 1px, transparent 1.5px);
  background-size: 12px 12px, 18px 18px;
  background-position: 0 0, 6px 8px;
}
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.board-sign {
  position: relative; margin: 0; padding: 10px 26px 12px; border-radius: 14px;
  background: #FFFDF7; color: var(--brand-900);
  font-size: clamp(21px, 2.6vw, 27px); font-weight: 800; letter-spacing: -0.03em;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .08), 0 10px 18px rgba(80, 50, 20, .18);
  transform: rotate(-1.5deg);
}
.board-sign::before, .board-sign::after, .note::before {
  content: ""; position: absolute; top: -7px; width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 1.6px, var(--pin, #E0685A) 2.6px);
  box-shadow: 0 3px 4px rgba(0, 0, 0, .28);
}
.board-sign::before { left: 12px; }
.board-sign::after { right: 12px; --pin: #5A8FD6; }
.board-sub { margin: -6px 0 20px 4px; font-size: 13px; color: var(--brand-900); }
.board-sub .text-btn { color: var(--brand-700); }

/* 보드에 꽂힌 카드 */
.notes { display: grid; gap: 22px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); align-items: start; }
.notes-col { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.note {
  position: relative; padding: 22px 18px 14px; border-radius: 18px;
  background: var(--paper, #fff); color: var(--text);
  box-shadow: 0 1px 2px rgba(60, 40, 10, .12), 0 10px 22px rgba(60, 40, 10, .16);
  transform: rotate(var(--r, 0deg)); transition: transform .25s var(--ease), box-shadow .25s;
}
.note::before { left: calc(50% - 8px); }
.note[data-go] { cursor: pointer; }
.note:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 2px 4px rgba(60, 40, 10, .12), 0 18px 32px rgba(60, 40, 10, .2); z-index: 1; }
.note h3 {
  margin: 6px 0; font-size: 17px; line-height: 1.35; letter-spacing: -0.02em; color: var(--brand-900);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}
.note > p {
  margin: 0; font-size: 14px; color: var(--text-2); white-space: pre-line; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.note-empty { max-width: 340px; margin: 10px auto 0; text-align: center; }

/* 게시판: 가로로 긴 글 카드 (왼쪽에 핀) */
.strips { display: flex; flex-direction: column; gap: 14px; }
.note.strip { display: flex; align-items: center; gap: 14px; padding: 12px 18px 12px 32px; border-radius: 16px; }
.note.strip::before { left: 9px; top: calc(50% - 8px); }
.note.strip:hover { transform: translateY(-2px); }
.strip-photo { flex: none; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; background: rgba(255, 255, 255, .6); }
.strip-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.strip-main { flex: 1; min-width: 0; }
.strip-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.note.strip h3 { display: block; margin: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-sub { margin-top: 3px; font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-meta { flex: none; display: flex; gap: 10px; font-size: 13px; color: var(--text-3); }

/* 투표소: 진행 중 / 마감된 투표 탭 */
.board-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: -10px 0 18px; }
.board-tab {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .85);
  color: var(--brand-900); font-size: 14px; font-weight: 700; transition: background .15s;
}
.board-tab b { padding: 1px 7px; border-radius: var(--r-pill); font-size: 12px; background: var(--brand-100); color: var(--brand-800); }
.board-tab:hover { background: rgba(255, 255, 255, .85); }
.board-tab.on { background: #fff; box-shadow: 0 4px 10px rgba(43, 66, 112, .12); }

/* ===== 사진 크게 보기 ===== */
.viewer {
  position: fixed; inset: 0; z-index: 78; display: flex; flex-direction: column; /* 확인 창(80)은 이 위에 */
  background: rgba(14, 22, 40, .94); color: #fff; animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.viewer-count { font-weight: 700; font-size: 14px; opacity: .85; }
.viewer-actions { display: flex; gap: 8px; }
.v-btn {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 17px; transition: background .15s;
}
.v-btn:hover { background: rgba(255, 255, 255, .24); }
.viewer-stage { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; padding: 0 68px; touch-action: pan-y; }
.viewer-stage img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); user-select: none; -webkit-user-drag: none;
}
.v-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 22px; }
.v-nav.prev { left: 14px; }
.v-nav.next { right: 14px; }
.viewer-cap { padding: 14px 20px calc(18px + env(safe-area-inset-bottom)); text-align: center; font-size: 14px; }
.viewer-cap a { color: var(--brand-300); font-weight: 700; }
.viewer-cap .when { opacity: .6; font-size: 12px; margin-top: 2px; }

/* ===== 폼: 사진 첨부 · 항목 목록 ===== */
.photo-field { display: flex; flex-wrap: wrap; gap: 8px; }
.pv { position: relative; width: 76px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--brand-50); }
.pv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; color: #fff; background: rgba(30, 45, 75, .6);
}
.pick-btn {
  width: 76px; height: 76px; border-radius: 14px; border: 2px dashed var(--brand-300);
  background: var(--brand-50); color: var(--brand-700); font-size: 12px; font-weight: 700;
  display: grid; place-content: center; justify-items: center; gap: 2px; line-height: 1.2;
}
.pick-btn span { font-size: 22px; }
.list-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.lf-row { display: flex; gap: 8px; align-items: center; }
.lf-row .input { flex: 1; }
.lf-add { align-self: flex-start; }

/* ===== 게시판 ===== */
.post h1 { margin: 8px 0 4px; font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.03em; color: var(--brand-900); word-break: break-word; }
.post-body { white-space: pre-wrap; word-break: break-word; line-height: 1.75; margin: 18px 0 0; }
.post .thumbs { margin-top: 18px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.post-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* 댓글 */
.comments { list-style: none; margin: 0 0 8px; padding: 0; }
.cmt { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.cmt:first-child { border-top: 0; padding-top: 4px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: var(--brand-900); background: var(--brand-100);
}
.cmt-name { font-weight: 700; font-size: 14px; }
.cmt-name span { font-weight: 500; color: var(--text-3); font-size: 12px; margin-left: 6px; }
.cmt-text { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.as-who { font-size: 13px; color: var(--text-3); margin: 0 0 8px 4px; }

/* ===== 투표소 카드 속 ===== */
.poll-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.poll h3 { margin: 0; font-size: 18px; letter-spacing: -0.02em; color: var(--brand-900); word-break: break-word; }
.poll-meta { font-size: 13px; color: var(--text-3); margin: 6px 0 14px; }
.opt {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface-2);
  font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s;
}
.opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand-600); }
.opt:has(input:checked) { border-color: var(--brand-500); background: var(--brand-50); }
.result { position: relative; overflow: hidden; padding: 10px 14px; margin-bottom: 8px; border-radius: var(--r-md); background: var(--surface-2); }
.result .fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand-100), var(--brand-300)); transition: width .6s var(--ease); }
.result.top .fill { background: linear-gradient(90deg, var(--cheese), #F6D27E); }
.result-row { position: relative; display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.result-row .cnt { color: var(--brand-800); white-space: nowrap; }
.result .mine { margin-left: 6px; font-size: 12px; font-weight: 700; color: var(--brand-700); }
.result .who { position: relative; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.poll-foot .row-actions { margin-left: auto; }

@media (max-width: 560px) {
  .album-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .album-grid .thumb { border-radius: 10px; }
  .viewer-stage { padding: 0 8px; }
  .v-nav { display: none; }
  .board { padding: 8px; border-radius: 26px; }
  .board-inner { padding: 18px 14px 24px; border-radius: 19px; }
  .notes-col { gap: 24px; }
  .head-actions { width: 100%; }
  .head-actions .search { flex: 1; width: auto; }
}
