/* ═══════════════════════════════════════════════════════════════
 *  skins/board/gallery/style.css
 *  썸네일 갤러리 스킨 — 일러·창작·사진 게시판용
 *
 *  list 스킨과 동일하게 core.css 의 DEFAULT BOARD UI 를 물려받고,
 *  여기서는 갤러리만의 그리드 / 카드 스타일만 정의.
 *  글 상세 (post-view) 와 댓글은 inc/post-view.php partial 사용 → core CSS.
 * ═══════════════════════════════════════════════════════════════ */

/* ─── 그리드 (3단 고정) ─── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;           /* 카드 높이를 각자 내용에 맞게 — 세로 늘어남 방지 */
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 14px;
  padding: 24px;
}
/* 비어 있을 때 */
.gallery-grid .empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-mute);
  font-size: 13px;
}

/* ─── 카드 ─── */
.g-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--paper-2);
  border: 1px solid var(--hair-soft);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.g-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

/* ─── 썸네일 (트위터 카드 비율 1.91:1) ─── */
.g-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1.91 / 1;       /* 트위터 카드 비율 — 고정 높이 대신 비율로 지정 */
  overflow: hidden;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.g-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;    /* 기본값 — 인라인 style로 덮어씀 */
  display: block;
}
.g-initial {
  font-size: 64px;
  font-weight: 800;
  color: var(--ink-mute);
  line-height: 1;
  user-select: none;
}

/* ─── 카드 텍스트 ─── */
.g-info {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.g-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.g-subtitle {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.g-meta {
  font-size: 10px;
  color: var(--ink-mute);
  font-weight: 500;
  margin-top: 4px;
}

/* ─── 모바일 ─── */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;   /* 모바일 1단 */
    gap: 12px;
    padding: 14px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .g-info    { padding: 10px 12px 12px; }
  .g-title   { font-size: 13px; }
  .g-initial { font-size: 48px; }
}

/* ─── 갤러리 view: 제목 → 이미지 → 본문 순서로 재배치 ─── */
.gallery-view .post-view {
  display: flex;
  flex-direction: column;
}
.gallery-view .post-view .post-head    { order: 1; }
.gallery-view .post-view .post-images  { order: 2; margin-top: 24px; }
.gallery-view .post-view .post-body    { order: 3; margin-top: 24px; }

/* head 의 하단 보더 제거 (이미지가 자연스러운 구분선 역할) */
.gallery-view .post-view .post-head {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* 비공개 갤러리 카드 — 이미지 대신 자물쇠 */
.g-thumb .g-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 32px;
  color: var(--ink-mute);
  background: color-mix(in srgb, var(--ink) 6%, var(--paper-2));
}

/* ─── 썸네일 포커스 포인트 설정 UI (write.php) ─── */
.thumb-focus-wrap {
  margin-top: 12px;
}
.thumb-focus-stage {
  position: relative;
  display: block;
  width: 100%;
  cursor: crosshair;
  border-radius: 10px;
  overflow: visible;
  border: 1px solid var(--hair);
  user-select: none;
}
.thumb-focus-stage img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  border-radius: 10px;
  vertical-align: top;
}
/* 1.91:1 비율 오버레이 — 트위터 카드 미리보기 영역 */
.thumb-focus-overlay {
  position: absolute;
  width: 100%;                  /* 이미지 가로에 꽉 맞춤 */
  aspect-ratio: 1.91 / 1;
  border: 2px dashed var(--accent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 1;
}
/* 드래그 핀 */
.thumb-focus-pin {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  touch-action: none;
  z-index: 2;                   /* 오버레이 위에 표시 */
}
.thumb-focus-pin:active { cursor: grabbing; }
