/* web.css — 여행여권 웹 커뮤니티의 껍데기(머리 줄 · 본문 폭 · 아래 줄)와, 앱 화면을 브라우저에 맞추는 규칙.
   읽는 순서: base.css(앱 style.css 에서 뽑은 토큰·공용 부품) → community.css(앱과 같은 파일) → 이 파일. 여기 클래스는 wv- 로 시작한다.
   원본은 webver/web.css — 사이트의 community/web.css 는 scripts/build_web_community.py 가 복사한 것이다. */

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }   /* 글·시트가 열려 본문 스크롤이 잠겨도 화면이 옆으로 밀리지 않게 */
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -0.01em; background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
textarea, select { font: inherit; color: inherit; }
.wv-skip { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--layer); color: var(--text); padding: 10px 14px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.wv-skip:focus { top: 12px; }

/* ---------- 머리 줄: 앱 이름(랜딩으로) · 메뉴 · 계정 ---------- */
.wv-top { flex: none; background: var(--bg); border-bottom: 1px solid var(--border); padding-top: env(safe-area-inset-top); }
.wv-top-in { display: flex; align-items: center; gap: 8px; height: 56px; max-width: 1140px; margin: 0 auto; padding: 0 16px 0 20px; }
.wv-brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; text-decoration: none; }
.wv-brand img { flex: none; width: 30px; height: 30px; border-radius: 8px; }
.wv-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wv-nav { display: flex; align-items: center; gap: 2px; margin-right: 6px; }
.wv-nav a:not(.wv-tab) { display: none; }   /* 휴대폰 폭: 여행 · 커뮤니티 탭만(앱 소개 · 앱 받기는 아래 줄에 있다) */
.wv-nav a.wv-tab[aria-current="page"] { color: var(--primary); background: var(--primary-weak); }
@media (max-width: 479px) { .wv-brand span { display: none; } .wv-me { max-width: 34vw; } }   /* 좁은 화면: 탭 자리를 내려고 앱 이름 글자는 접는다(아이콘은 남는다) */
.wv-nav a { padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
#wv-account { flex: none; display: inline-flex; min-width: 0; }
.wv-login { height: 36px; padding: 0 14px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; white-space: nowrap; }
.wv-login:active { background: var(--primary-press); }
.wv-me { display: inline-flex; align-items: center; gap: 6px; height: 36px; max-width: 44vw; padding: 0 12px 0 4px; border-radius: 999px; background: var(--fill); color: var(--text); font-size: 14px; font-weight: 600; }
.wv-me .cm-ava { width: 28px; height: 28px; font-size: 13px; }
.wv-me span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 본문: 앱의 탭 화면과 같은 폭. 좌우 20px 은 community.css 의 칩 줄(.cm-chips)이 가장자리까지 밀고 나가는 만큼이다 ---------- */
#pages { flex: 1; }
.page { max-width: 600px; margin: 0 auto; padding: 4px 20px 28px; }
.cm-fab { right: max(16px, calc(50% - 280px)); bottom: calc(20px + env(safe-area-inset-bottom)); }   /* 앱은 아래 탭 위에 띄운다. 웹은 탭이 없고, 넓은 화면에서는 본문 줄 오른쪽 끝에 맞춘다 */
.cm-scroll { scrollbar-gutter: stable both-edges; }   /* 스크롤 막대가 자리를 차지하는 브라우저에서도 본문 줄이 가운데에 오게 */

/* ---------- 아래 줄 ---------- */
.wv-foot { flex: none; border-top: 1px solid var(--border); padding: 20px 0 calc(92px + env(safe-area-inset-bottom)); font-size: 12px; line-height: 1.7; color: var(--text-3); }   /* 아래 여백: 글쓰기 버튼에 가리지 않게 */
.wv-foot-in { max-width: 600px; margin: 0 auto; padding: 0 20px; }
.wv-foot a { text-decoration: none; }
.wv-foot-links, .wv-langs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; }
.wv-foot-links { font-size: 13px; color: var(--text-2); }
.wv-langs a[aria-current="true"] { color: var(--text-2); font-weight: 600; }
.wv-biz, .wv-copy { margin: 0 0 4px; overflow-wrap: anywhere; }

/* ---------- 로그인 버튼 아래 안내(시트 안에 복사되어 보인다) · 웹 대화창 ---------- */
.login-btns .wv-hint { margin: 2px 0 0; text-align: center; }
.login-btns .wv-legal { display: flex; justify-content: center; gap: 16px; margin: 0; }
.wv-rows { margin: 4px 0 12px; }
.wv-rows .row { width: calc(100% + 16px); text-align: left; text-decoration: none; }   /* .row.tap 은 좌우로 8px 씩 넓다 */
.wv-rows .row-title { display: block; }
.wv-rows .row-desc { display: block; }
#wv-modal .btn + .btn { margin-top: 8px; }
#wv-modal .field { margin-bottom: 4px; }
#wv-modal .field input { font-size: 16px; }   /* iOS 는 16px 미만 입력창을 누르면 화면을 확대한다 */
#wv-modal:not([hidden]) ~ #cm-toast { top: calc(16px + env(safe-area-inset-top)); bottom: auto; }   /* 웹 대화창이 떠 있는 동안 알림은 위쪽에(아래 버튼을 가리지 않게) */

/* ---------- 웹에는 여행 탭이 없다: 일정·여행 기록 붙이기와 여행일정공유 글쓰기는 앱에서만 ---------- */
.cm-attbtns { display: none; }
.cm-flabel:has(+ #cm-w-attach > .cm-attbtns) { display: none; }
#cm-w-board .chip[data-v="plan"]:not(.active) { display: none; }
@media (min-width: 900px) { .cm-w-extra { border: 0; padding: 0 4px; margin-top: 10px; } }   /* 웹에서는 붙이기가 없어 안내 한 줄만 남는다 */

/* ---------- 마우스로 볼 때 ---------- */
@media (hover: hover) and (pointer: fine) {
  .cm-chips { flex-wrap: wrap; overflow: visible; }   /* 옆으로 미는 칩 줄은 마우스로 넘기기 어렵다 → 줄을 바꾼다 */
  .cm-card:hover .cm-card-title, .wv-foot a:hover, .login-btns .wv-legal a:hover { text-decoration: underline; }
  .top-btn:hover, .row.tap:hover, .cm-cmt-more:hover { background: var(--fill); }
  .cm-cmt-more { border-radius: 10px; }
  .chip:hover:not(.active):not(:disabled), .wv-me:hover, .btn.secondary:hover, .cm-like:hover:not(.on) { background: var(--grey200); }
  .btn.primary:hover:not(:disabled), .wv-login:hover, .cm-fab:hover, .cm-send:hover { background: var(--blue600); }
  .wv-nav a:hover { background: var(--fill); color: var(--text); }
}

/* ---------- 넓은 화면: 머리 줄 메뉴, 하위 화면은 본문 줄에 맞추고, 바텀시트는 가운데 창으로 ---------- */
@media (min-width: 720px) {
  .wv-top-in { height: 64px; padding: 0 28px; }
  .wv-brand { font-size: 20px; }
  .wv-brand img { width: 34px; height: 34px; border-radius: 9px; }
  .wv-nav { gap: 4px; margin-right: 8px; }
  .wv-nav a:not(.wv-tab) { display: inline; }
  .page { padding-top: 12px; }
  #cm-screen .sd-top { height: 64px; padding-left: max(8px, calc(50% - 290px)); padding-right: max(8px, calc(50% - 290px)); }
  .cm-bar { padding: 12px max(16px, calc(50% - 280px)); }
  .modal-root { display: grid; place-items: center; padding: 24px; }
  .modal-root .sheet { position: relative; left: auto; right: auto; bottom: auto; width: 100%; max-width: 440px; max-height: min(84vh, 760px); border-radius: 22px; padding: 14px 24px 22px; }
  #cm-sheet .sheet { max-height: min(84vh, 760px); }
  .modal-root .handle { display: none; }
  .modal-root .sheet-title { margin-top: 8px; }
}

/* ---------- PC(1024px 이상): 폰 화면을 가운데에 세워 두지 않는다. 왼쪽 기둥(글쓰기 · 게시판 · 지역) + 넓은 목록, 검색 칸은 늘 보이고, 글·글쓰기 화면도 넓게 ---------- */
@media (min-width: 1024px) {
  .page { max-width: 1140px; padding: 24px 28px 56px; }
  #cm-page { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 44px; align-items: start; }
  #cm-page > .title, #cm-page > .cm-hint { grid-column: 1 / -1; }
  .cm-head { grid-column: 1 / -1; grid-row: 1; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
  .cm-head .title { margin: 0; font-size: 28px; line-height: 38px; }
  .cm-head [data-act="q-open"] { display: none; }   /* 검색 칸이 늘 보인다 */
  .cm-pre { grid-column: 2; grid-row: 2; max-width: 780px; }
  .cm-main { grid-column: 2; grid-row: 3; max-width: 780px; min-width: 0; }
  .cm-side { grid-column: 1; grid-row: 2 / span 2; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; }
  .cm-side-write { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 14px; background: var(--primary); color: #fff; font-size: 16px; font-weight: 700; }
  .cm-side-write svg { width: 20px; height: 20px; }
  .cm-side-label { display: block; margin: 22px 0 8px; padding: 0 12px; font-size: 12px; font-weight: 700; color: var(--text-3); }
  .cm-side .cm-chips { margin: 0 0 4px; padding: 0; }
  #cm-boards { flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  #cm-boards .chip { display: flex; align-items: center; width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; background: transparent; color: var(--text-2); font-size: 15px; font-weight: 600; text-align: left; }
  #cm-boards .chip.active { background: var(--primary-weak); color: var(--primary-weak-text); }
  #cm-regions, #cm-subs { padding: 0 6px; gap: 6px; }
  #cm-subs { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
  .cm-fab { display: none; }
  .cm-search { height: 48px; margin-bottom: 16px; border-radius: 14px; }
  .cm-search input { height: 48px; }
  .cm-boardhint { font-size: 14px; margin-bottom: 12px; }
  .cm-card { padding: 18px 20px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--layer, var(--bg)); transition: border-color .12s, box-shadow .12s; }
  .cm-card.big { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .cm-card.big { grid-template-rows: 1fr auto; }
  .cm-card.big .cm-card-photo { grid-row: 1 / span 2; margin-bottom: 0; border-radius: 12px; }
  .cm-card.big .cm-card-main, .cm-card.big .cm-card-foot { grid-column: 2; }
  .cm-card-thumb { width: 104px; height: 104px; }
  .cm-card-title { font-size: 18px; line-height: 26px; }
  .cm-card-ex { font-size: 15px; line-height: 22px; }
  .cm-scroll > * { max-width: 760px; }
  #cm-screen .sd-top { padding-left: max(8px, calc(50% - 390px)); padding-right: max(8px, calc(50% - 390px)); border-bottom: 1px solid var(--border); }
  .cm-scroll { padding-top: 20px; }
  .cm-bar { padding: 12px max(16px, calc(50% - 380px)); }
  .cm-bar .btn { max-width: 760px; }
  .wv-foot { padding-bottom: 28px; }
  .wv-foot-in { max-width: 1140px; padding: 0 28px; }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .cm-card:hover { border-color: var(--grey300, #d1d6db); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
  #cm-boards .chip:hover:not(.active) { background: var(--fill); }
  .cm-side-write:hover { background: var(--blue600); }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .wv-top, .wv-foot, .cm-fab, #cm-toast { display: none !important; } }
