/* 컴포넌트 스타일 - 카드, 사진그리드, 라이트박스, 폼, 푸터 */
/* ---- cards ---- */
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 22px;
}
.card .price { color: var(--accent-dark); font-weight: 800; font-size: 1.05rem; margin-top: 8px; }

/* ---- photo grid (instagram style) ---- */
.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
@media (min-width: 640px) { .photo-grid { gap: 8px; } }
.photo-grid .tile {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px;
  background: var(--accent-soft); cursor: pointer; border: none; padding: 0;
}
.photo-grid .tile img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.25s ease;
}
.photo-grid .tile:hover img { transform: scale(1.04); }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(20, 18, 15, 0.88);
  display: none; align-items: center; justify-content: center; padding: 20px; flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(92vw, 720px); max-height: 72vh; border-radius: 10px; object-fit: contain; }
.lightbox .caption { color: #f2efe9; margin-top: 14px; max-width: 640px; text-align: center; font-size: 0.95rem; }
.lightbox .close {
  position: absolute; top: 16px; right: 20px; background: none; border: none;
  color: #fff; font-size: 2rem; cursor: pointer; line-height: 1;
}

/* ---- forms ---- */
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 480px; }
label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 5px; }
input, textarea, select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 0.95rem; font-family: inherit; background: var(--surface); color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
.form-note {
  background: var(--warn-soft); border-radius: 10px; padding: 12px 14px; font-size: 0.85rem; color: var(--ink-soft);
}
.form-status { font-size: 0.92rem; font-weight: 600; min-height: 1.4em; }
.form-status.ok { color: var(--accent-dark); }
.form-status.err { color: #a3312c; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 0.85rem; color: var(--ink-soft); }
.consent input { width: auto; margin-top: 3px; }

/* ---- footer ---- */
footer {
  border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 0 40px;
  font-size: 0.8rem; color: var(--ink-soft);
}
footer .biz { line-height: 1.9; }

/* ---- photo grid: 여러 장 게시글 표시 배지 ---- */
.photo-grid .tile { display: block; text-decoration: none; }
.multi-badge {
  position: absolute; top: 6px; right: 8px;
  color: #fff; font-size: 1rem; line-height: 1;
  text-shadow: 0 1px 3px rgba(0,0,0,0.55);
  pointer-events: none;
}

/* ---- post detail (게시글 상세: 사진들을 아래로 스크롤) ---- */
.post-view { max-width: 640px; margin: 0 auto; }
.post-view header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px; gap: 12px;
}
.post-view .back { text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.post-caption {
  font-size: 1.02rem; line-height: 1.7; margin: 0 0 18px;
  white-space: pre-wrap; /* 캡션의 줄바꿈 유지 */
}
.post-images { display: flex; flex-direction: column; gap: 10px; }
.post-images img {
  width: 100%; border-radius: 10px; display: block;
  background: var(--accent-soft); min-height: 120px;
}
.post-nav { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.post-nav a { text-decoration: none; font-weight: 600; }

/* ---- 반응형: 접속 기기별 차등 (같은 사이트가 화면 크기에 맞춰 변형) ---- */
/* 모바일 (기본): 사진 그리드 3열(인스타와 동일), 여백 축소 */
@media (max-width: 639px) {
  section { padding: 32px 0; }
  .hero { padding: 48px 0 40px; }
  .btn { display: block; margin: 8px auto 0; max-width: 280px; }
  .btn.ghost { margin-left: auto; }
  .post-view header { flex-direction: column; gap: 4px; }
}
/* 태블릿 이상: 그리드 간격 넓게 */
@media (min-width: 640px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
/* 데스크톱: 사진 그리드 4열, 콘텐츠 폭 최대 활용 */
@media (min-width: 1024px) {
  .photo-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .post-view { max-width: 680px; }
}

/* ---- post caption: 마크다운 서식 ---- */
/* (줄바꿈은 마크다운 렌더러가 <p>/<br>로 처리하므로 pre-wrap을 해제한다) */
.post-caption { font-size: 1.02rem; line-height: 1.7; margin: 0 0 18px; white-space: normal; }
.post-caption p { margin: 0 0 4px; }
.post-caption h2 { font-size: 1.25rem; margin: 14px 0 6px; }
.post-caption h3 { font-size: 1.08rem; margin: 12px 0 4px; }
.post-caption ul { margin: 6px 0 10px; padding-left: 22px; }
.post-caption code {
  background: var(--accent-soft); padding: 1px 6px; border-radius: 5px;
  font-size: 0.88em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- FAQ 아코디언 (브라우저 기본 details/summary 활용 - JS 불필요) ---- */
.faq-list details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0 18px; margin-bottom: 10px;
}
.faq-list summary {
  cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; flex-shrink: 0; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { margin: 0 0 14px; color: var(--ink-soft); }

/* ---- 취소/환불 정책 ---- */
.policy ul { margin: 4px 0 12px; padding-left: 20px; }
.policy li { margin: 7px 0; }

/* ---- Training Courses ---- */
.course-card { margin-bottom: 14px; }
.course-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.course-meta { display: flex; gap: 12px; font-size: 0.8rem; color: var(--ink-soft); }
.course-includes { margin: 2px 0 12px; padding-left: 20px; }
.small-btn { padding: 9px 18px; font-size: 0.85rem; }

/* ---- 플로팅 채팅 위젯 ---- */
.chat-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 1.5rem;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.chat-fab:hover { background: var(--accent-dark); }
.chat-panel {
  position: fixed; right: 18px; bottom: 84px; z-index: 95;
  width: min(360px, calc(100vw - 36px)); height: min(480px, 70vh);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 10px 34px rgba(0,0,0,0.2);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 8px;
}
.chat-head .chat-close {
  margin-left: auto; background: none; border: none; font-size: 1.4rem;
  cursor: pointer; color: var(--ink-soft); line-height: 1;
}
.chat-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg {
  max-width: 82%; padding: 9px 13px; border-radius: 14px; font-size: 0.9rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
.chat-msg.visitor { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.owner { align-self: flex-start; background: var(--accent-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }
.chat-input .btn { padding: 9px 16px; font-size: 0.85rem; }
@media (max-width: 639px) {
  .chat-input .btn { display: inline-block; margin: 0; max-width: none; } /* 모바일 .btn 블록화 규칙 예외 */
}

/* ---- 연락 수단 드롭다운 + 입력칸 (예약/문의 폼 공용) ---- */
.contact-row { display: flex; gap: 8px; }
.contact-row select { flex: 0 0 auto; width: auto; min-width: 118px; }
.contact-row input { flex: 1; min-width: 0; }

/* ---- 공지사항 배너 (관리자 페이지에서 내용 저장 시 홈 상단에 표시) ---- */
.notice-wrap { padding: 14px 0 0; }
.notice-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0;
  padding: 12px 16px; font-size: 0.92rem; line-height: 1.6;
}
.notice-banner .notice-icon { flex-shrink: 0; }
.notice-banner .notice-body p { margin: 0 0 4px; }
.notice-banner .notice-body p:last-child { margin-bottom: 0; }

/* ---- 예약 가능시간 안내 (booking 폼 날짜 아래) ---- */
availability-hint { display: block; }
.availability-hint {
  margin-top: 7px; padding: 9px 12px; border-radius: 9px;
  font-size: 0.84rem; line-height: 1.5;
}
.availability-hint.ok { background: var(--accent-soft); color: var(--accent-dark); }
.availability-hint.warn { background: var(--warn-soft); color: var(--ink-soft); }

/* ---- 청룡 전설 (브랜드 스토리) ---- */
.legend {
  background: linear-gradient(160deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 0 14px 14px 0; padding: 22px 26px; margin-bottom: 8px;
}
.legend p { margin: 0 0 14px; line-height: 1.8; }
.legend p:last-child { margin-bottom: 0; }
