/* course.css — 코스 상세 페이지 (v3 — 기존 스타일 복원) */

.page-wrap { padding-top: var(--header-h); padding-bottom: 60px; }

/* ── 캐러셀 래퍼 ─────────────────────────────────────── */
.carousel-wrap {
  background: white;
  padding: 14px 14px 0;
  max-width: 640px;
  margin: 0 auto;
}

.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: linear-gradient(135deg, #2d1a22 0%, #4a2030 50%, #6b2d45 100%);
  touch-action: pan-y;
  border-radius: 16px;
}

.carousel-placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  color: rgba(255,255,255,.38);
  font-size: 52px;
}
.carousel-placeholder span { font-size: 14px; font-weight: 600; letter-spacing: .5px; }

.carousel-track {
  display: flex; height: 100%;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.carousel-slide { min-width: 100%; height: 100%; position: relative; cursor: pointer; overflow: hidden; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; transition: transform .4s ease; }
.carousel-slide:hover img { transform: scale(1.02); }

/*캐러셀 음영*/
.carousel-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 120px 16px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
/*캐러셀 텍스트 — vw 기반 반응형 (줄바꿈 방지) */
.carousel-place-name {
  font-size: clamp(22px, 7.8vw, 50px);
  font-weight: 800; color: white;
  margin-bottom: 4px;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  letter-spacing: -.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 장소명: 가게명(큰) + 위치(작게) — JS에서 분리 렌더링 필요 */
.carousel-place-name-main {
  font-size: clamp(16px, 4.5vw, 26px);
  font-weight: 800; color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
  margin-bottom: 4px;
}
.carousel-place-name-sub {
  font-size: clamp(12px, 2vw, 16px);
  font-weight: 400; color: rgba(255,255,255,.9);
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
  display: inline;
  margin-left: 4px;
}
.carousel-place-comment {
  font-size: clamp(11px, 2.8vw, 15px);
  color: rgba(255,255,255,.85);
  font-style: italic;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  word-break: break-all;
  white-space: pre-wrap;
}

.carousel-counter {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,.5); color: white;
  font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 100px;
  backdrop-filter: blur(8px); letter-spacing: .5px;
}

.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.35); border: 1.5px solid rgba(255,255,255,.25);
  color: white; font-size: 28px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); transition: background .2s, transform .2s;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.carousel-nav:hover { background: rgba(0,0,0,.55); transform: translateY(-50%) scale(1.06); }
.carousel-nav.prev { left: 10px; }
.carousel-nav.next { right: 10px; }

/* ── 코스 헤더 ─────────────────────────────────────────── */
.course-header {
  padding: 18px 16px 0;
  background: white; border-bottom: 1px solid var(--border);
  margin-top: 8px; max-width: 640px; margin-left: auto; margin-right: auto;
}

.course-meta-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.course-region {
  background: var(--primary-light); color: var(--primary);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px;
}

.course-time-badge { font-size: 12px; color: var(--sub); font-weight: 600; }

.course-name { font-size: 21px; font-weight: 800; color: var(--dark); line-height: 1.3; margin-bottom: 6px; }

.course-desc { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 8px; }

.course-ref {
  font-size: 12px; color: #bbb; margin-bottom: 8px;
  padding: 7px 10px; background: #fafafa; border-radius: 8px; border-left: 3px solid var(--border-dark);
}
.course-ref a { color: #888; text-decoration: underline; }

.course-meta-bottom { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.course-author { font-size: 13px; font-weight: 600; color: #555; cursor: pointer; transition: color var(--transition); }
.course-author:hover { color: var(--primary); }
.course-date { font-size: 12px; color: #bbb; }

/* ── 액션 바 ───────────────────────────────────────────── */
.course-actions-row {
  display: flex; align-items: center;
  gap: 6px; flex-wrap: wrap; padding: 10px 0 12px;
  border-top: 1px solid var(--border);
}

.course-action-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 100px;
  font-size: 13px; font-weight: 600; color: #888; background: white;
  transition: border-color .18s, color .18s, background .18s; white-space: nowrap;
  min-height: 36px;
  box-sizing: border-box;
}
.course-action-btn:hover { border-color: #555; color: #555; }

.course-like-btn.liked { color: var(--liked-color); border-color: var(--border); background: white; }

.course-bookmark-btn { font-size: 15px; padding: 7px 12px; }
.course-bookmark-btn.bookmarked { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }

.ref-count { font-size: 11px; color: #aaa; }

.course-report-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  margin-left: auto;
  padding: 6px 4px;
  transition: color .15s;
}
.course-report-btn:hover { color: var(--accent2); }

.course-owner-actions {
  width: 100%; display: flex; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.course-edit-btn, .course-delete-btn {
  background: none; border: none; font-size: 13px; font-weight: 600;
  color: #bbb; transition: color .2s, background .2s; padding: 6px 14px; border-radius: 8px;
}
.course-edit-btn:hover   { color: #555; background: var(--bg); }
.course-delete-btn:hover { color: var(--accent2); background: #fff5f5; }

/* ── 섹션 ─────────────────────────────────────────────── */
.detail-section {
  background: white; padding: 18px 16px; margin-top: 10px;
  max-width: 640px; margin-left: auto; margin-right: auto;
}
.section-label {font-size: 13px; font-weight: 700; color: var(--sub); margin-bottom: 0px; letter-spacing: .2px; }

/* ── 타임라인 ──────────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; }

.tl-item {
  display: flex; gap: 12px; position: relative;
  padding-bottom: 16px;
  border-bottom: none;
  margin-bottom: 4px;
}
.tl-item:last-child { border-bottom: none; }
.tl-item:not(:last-child) .tl-line {
  position: absolute; left: 11px; top: 24px; bottom: -16px;
  width: 2px; background: #e0e0e0; z-index: 0;
}
.tl-left { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; position: relative; z-index: 1; }
.tl-num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tl-right { flex: 1; min-width: 0; padding-bottom: 4px; }
.tl-place-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tl-place-info { flex: 1; min-width: 0; }
.tl-name { font-size: 14px; font-weight: 700; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-name-link {
  font-size: 14px; font-weight: 700; color: var(--primary);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.tl-name-link:hover { text-decoration: underline; }
.tl-sub { font-size: 11px; color: var(--sub); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-comment {
  font-size: 13px; color: #666; font-style: italic;
  margin: 10px 0 2px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  line-height: 1.6;
}
.tl-stay { font-size: 11px; color: var(--sub); white-space: nowrap; margin-top: 2px; }
.tl-duration {
  font-size: 10px; color: var(--sub);
  margin-top: 6px;
  padding-top: 6px;
  border-top: none;
  display: inline-block;
}
.tl-photo { width: 58px; height: 58px; border-radius: 10px; overflow: hidden; flex-shrink: 0; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.1); transition: transform .2s; }
.tl-photo:hover { transform: scale(1.05); }
.tl-photo img { width: 100%; height: 100%; object-fit: cover; }
.tl-photo-empty { width: 58px; height: 58px; flex-shrink: 0; }
.tl-travel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 4px 0;
}

.tl-travel-line-area {
  width: 24px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.tl-travel-dist {
  font-size: 10px;
  font-weight: 600;
  color: #bbb;
  white-space: nowrap;
  text-align: center;
}

.tl-travel-time {
  font-size: 11px;
  color: #aaa;
  font-weight: 500;
  white-space: nowrap;
}

/* ── 한줄평 줄노트 구분선 ───────────────────────────────── */
.tl-comment-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}
.timeline-summary { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--sub); display: flex; gap: 16px; flex-wrap: wrap; }
.timeline-summary strong { color: var(--dark); font-weight: 700; }

/* ── 지도 ─────────────────────────────────────────────── */
.detail-map { height: 300px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); }
.map-location-btn {
  position: absolute; bottom: 12px; right: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  background: white; border: none; box-shadow: 0 2px 10px rgba(0,0,0,.22);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10; transition: box-shadow .2s, transform .15s;
}
.map-location-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.3); transform: scale(1.07); }

/* ── 참조 코스 ───────────────────────────────────────── */
.referenced-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; padding: 0 !important; }

/* ── 댓글 ─────────────────────────────────────────────── */
.comment-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.comment-sort-chips { display: flex; gap: 5px; }
.comment-sort-chips .chip { padding: 4px 10px; font-size: 11px; border: 1.5px solid var(--border); border-radius: 100px; color: var(--sub); background: white; font-weight: 600; cursor: pointer; transition: all .15s; }
.comment-sort-chips .chip.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.comment-total { font-size: 12px; color: var(--sub); font-weight: 400; margin-left: 4px; }
.comment-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 16px; }
.comment-item { display: flex; flex-direction: column; gap: 4px; }
.comment-item-header { display: flex; align-items: center; gap: 8px; }
.comment-nick { font-size: 13px; font-weight: 700; color: var(--dark); }
.comment-time { font-size: 11px; color: #bbb; }
.comment-body { font-size: 14px; color: #333; line-height: 1.55; }
.comment-foot { display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.comment-like-btn, .comment-reply-toggle { background: none; border: none; font-size: 12px; color: #bbb; display: flex; align-items: center; gap: 4px; transition: color .2s; cursor: pointer; }
.comment-like-btn.liked { color: #555; font-weight: 700; }
.comment-like-btn:hover, .comment-reply-toggle:hover { color: #555; }
.comment-delete-btn { background: none; border: none; font-size: 12px; color: #ddd; margin-left: auto; transition: color .2s; cursor: pointer; }
.comment-delete-btn:hover { color: var(--accent2); }

.reply-area { padding-left: 20px; border-left: 2px solid #f0f0f0; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.reply-item { display: flex; flex-direction: column; gap: 3px; }
.reply-header { display: flex; align-items: center; gap: 6px; }
.reply-nick { font-size: 12px; font-weight: 700; color: var(--dark); }
.reply-time { font-size: 11px; color: #bbb; }
.reply-body { font-size: 13px; color: #444; line-height: 1.55; }
.reply-foot { display: flex; align-items: center; gap: 8px; }
.reply-like-btn, .reply-delete-btn { background: none; border: none; font-size: 11px; color: #ccc; display: flex; align-items: center; gap: 3px; transition: color .2s; cursor: pointer; }
.reply-like-btn.liked { color: #555; font-weight: 700; }
.reply-like-btn:hover, .reply-delete-btn:hover { color: #555; }

.reply-input-wrap { display: flex; gap: 6px; margin-top: 6px; }
.reply-input { flex: 1; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 13px; outline: none; transition: border-color .15s; }
.reply-input:focus { border-color: var(--primary); }
.reply-submit-btn { padding: 9px 16px; background: var(--primary); color: white; border: none; border-radius: 10px; font-size: 13px; font-weight: 700; cursor: pointer; }

.comment-input-wrap { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.comment-input { flex: 1; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 14px; outline: none; transition: border-color .15s; }
.comment-input:focus { border-color: var(--primary); }
.comment-submit-btn { padding: 11px 18px; background: var(--primary); color: white; border: none; border-radius: 12px; font-size: 14px; font-weight: 700; cursor: pointer; }
.comment-submit-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 전체화면 뷰어 ────────────────────────────────────── */
.photo-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.96); z-index: 5000; display: flex; align-items: center; justify-content: center; }
.photo-viewer-close { position: absolute; top: 16px; right: 16px; color: white; font-size: 26px; background: rgba(255,255,255,.12); border: none; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; z-index: 1; cursor: pointer; transition: background .2s; }
.photo-viewer-close:hover { background: rgba(255,255,255,.25); }
.photo-viewer-counter { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.75); font-size: 13px; font-weight: 600; letter-spacing: .5px; }
.photo-viewer-img-wrap {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  max-width: 100%;
  max-height: 80vh;
  border-radius: 4px;
  overflow: hidden;
}
.photo-viewer-img { max-width: 100%; max-height: 80vh; object-fit: contain; border-radius: 4px; display: block; }
.photo-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.35); color: white; font-size: 32px; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid rgba(255,255,255,.25); transition: background .2s; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.photo-viewer-nav:hover { background: rgba(0,0,0,.55); }
.photo-viewer-nav.prev { left: 12px; }
.photo-viewer-nav.next { right: 12px; }
.viewer-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  pointer-events: none;
  border-radius: 0 0 4px 4px;
}
.viewer-caption-name { font-size: 15px; font-weight: 700; color: white; margin-bottom: 4px; text-shadow: 0 2px 8px rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-caption-comment { font-size: 12px; color: rgba(255,255,255,.85); font-style: italic; text-shadow: 0 1px 4px rgba(0,0,0,.6); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.heart { color: #ccc; font-size: 14px; transition: color .2s; }
.course-like-btn.liked .heart, .feed-like-btn.liked .heart { color: #333; }
/* ── 댓글 헤더 정렬 ──────────────────────────────────── */
.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.comment-sort-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* 썸네일 슬라이드 — 오버레이 없음 */
.carousel-slide:first-child .carousel-overlay {
  display: none;
}
/* ── 사진 도용 방지 ───────────────────────────────────────── */
.carousel-slide img,
.tl-photo img,
.photo-viewer-img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}

/* ── 워터마크 오버레이 ────────────────────────────────────── */
.wm-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}
.wm-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-20deg);
  font-size: clamp(14px, 4vw, 22px);
  font-weight: 700;
  color: rgba(255, 255, 255, 0.18);
  white-space: nowrap;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.wm-corner {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.tl-transport-icon {
  display: inline-flex;
  align-items: center;
  color: var(--sub);
  margin-left: 4px;
  vertical-align: middle;
}