:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #6b7280;
  --border: #e3e6ea;
  --primary: #e8590c;
  --primary-dark: #c2410c;
  --food: #e8590c;
  --club: #2563eb;
  --danger: #dc2626;
  --success: #15803d;
  --radius: 10px;
  color-scheme: light;  /* 다크 모드는 아직 지원하지 않음: 폼 컨트롤도 밝은 모양으로 고정 */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  /* 내용이 짧은 페이지에서도 푸터가 화면 맨 아래에 붙도록 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.nowrap { white-space: nowrap; }

a { color: inherit; }
img { max-width: 100%; display: block; }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; margin: 0 0 .75rem; }
h1 small { font-size: .9rem; color: var(--muted); font-weight: normal; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 24px; padding-bottom: 48px; flex: 1 0 auto; width: 100%; }

/* 헤더 */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.3rem; text-decoration: none; }
.logo span { color: var(--primary); }
.nav { display: flex; gap: 16px; }
.nav a, .user-menu a { text-decoration: none; }
.nav a:hover, .user-menu a:hover, .nav a.active { color: var(--primary); }
.nav a.active { font-weight: 700; }
.user-menu { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); padding: 24px 0; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.footer-inner a { color: var(--text); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }

/* 개인정보처리방침 */
.policy { max-width: 760px; margin: 0 auto; line-height: 1.75; }
.policy h2 { font-size: 1.1rem; margin: 2rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.policy ul, .policy ol { padding-left: 1.3rem; }
.policy li { margin-bottom: .3rem; }
.policy .toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px 16px 36px; }
.policy .table-wrap { overflow-x: auto; }
.policy table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.policy th, .policy td { border: 1px solid var(--border); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.policy th { background: var(--surface); white-space: nowrap; }

/* 버튼·폼 */
.btn {
  display: inline-block; padding: .5rem 1rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); cursor: pointer; text-decoration: none; font: inherit; color: inherit; text-align: center;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-sm { padding: .3rem .7rem; font-size: .9rem; }
.btn-block { width: 100%; padding: .7rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; color: inherit; }
.link-button:hover { color: var(--primary); }
form.inline { display: inline; }

.field { margin-bottom: 1rem; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=date],
.field input:not([type]), .field select, .field textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px;
  font: inherit; color: inherit; background: #fff;
}
/* 한 줄 입력칸 높이를 맞춤(날짜 칸은 브라우저 기본 높이가 달라 2px 더 높았음) */
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select { height: calc(1.6em + 1.1rem + 2px); }
.field input[type=date]:invalid { color: var(--muted); }  /* 비어 있을 때 '연도-월-일'을 안내 글자색으로 */
.field input[type=file] { font: inherit; font-size: .92rem; max-width: 100%; }
.field input[type=file]::file-selector-button {
  margin-right: .7rem; padding: .45rem .9rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); font: inherit; cursor: pointer;
}
.field input[type=file]::file-selector-button:hover { border-color: var(--muted); }
.optional { font-weight: 400; color: var(--muted); font-size: .88rem; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }
.hint { color: var(--muted); font-size: .88rem; margin: .25rem 0 0; }
.panel > .hint { margin-bottom: 1.25rem; }  /* 제목 아래 안내문과 폼 사이 */
.error { color: var(--danger); font-size: .88rem; margin: .25rem 0 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.25rem; }

/* 패널·레이아웃 */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.medium { max-width: 720px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }
.withdraw-notice { padding-left: 1.2rem; margin: 0 0 1.25rem; line-height: 1.6; }
.withdraw-notice li { margin-bottom: .4rem; }
.withdraw-link { text-align: right; font-size: .85rem; }
.withdraw-link a { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.empty { color: var(--muted); margin: 0; padding: 4px 0 16px; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 16px; background: #eef2ff; }
.flash-success { background: #ecfdf5; color: var(--success); }
.flash-error { background: #fef2f2; color: var(--danger); }

/* 홈 */
.hero { text-align: center; padding: 32px 0 24px; }
.hero h1 { font-size: 1.8rem; }
.hero p { color: var(--muted); }

/* www 첫 화면: 맛집 / 동호회 선택 */
.portal-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 720px; margin: 8px auto 48px; }
.portal-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 200px; padding: 24px; border-radius: 16px; border: 2px solid var(--primary); color: var(--primary); text-align: center; text-decoration: none; }
.portal-choice strong { font-size: 2rem; }
.portal-choice span { color: var(--muted); }
.portal-choice:hover { background: var(--primary); color: #fff; }
.portal-choice:hover span { color: inherit; }
.search { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; }
.search input { flex: 1; padding: .55rem .8rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; min-width: 0; }
.section { margin-top: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h1, .section-head h2 { margin: 0; }  /* 제목 아래 여백이 있으면 옆 링크와 세로 정렬이 어긋남 */
.section-head a:not(.btn) { color: var(--muted); }  /* .btn까지 잡으면 주황 버튼 글자가 회색이 됨 */

/* 카드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.card-thumb { aspect-ratio: 4 / 3; background: #eceff3; display: flex; align-items: center; justify-content: center; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { color: var(--muted); font-weight: 600; }
.card-body { padding: 12px 14px 14px; }
.card-body h3 { font-size: 1rem; margin: .35rem 0 .2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-body .target { margin: 0; color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }

.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; color: #fff; text-decoration: none; }
.badge-food { background: var(--food); }
.badge-club { background: var(--club); }
.stars { color: #f59e0b; letter-spacing: 1px; }
.stars .off { color: #d1d5db; }

/* 목록 */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { margin: 0; flex: 0 1 24rem; }  /* 검색 안내 문구가 잘리지 않을 너비 */
.toolbar .place-filter { flex-basis: 36rem; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: .4rem .9rem; border-radius: 999px; text-decoration: none; color: var(--muted); }
.tabs a.active { background: var(--text); color: #fff; }
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: .35rem .75rem; border-radius: 6px; text-decoration: none; border: 1px solid var(--border); background: var(--surface); }
.pagination .current { background: var(--text); color: #fff; border-color: var(--text); }

/* 상세 */
.review-detail h1 { margin-top: .5rem; }
.target-line { font-size: 1.05rem; margin: 0; }
.review-detail .content { white-space: pre-wrap; margin-top: 20px; font-size: 1.02rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-top: 20px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.gallery.small { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 0; }
.image-check { display: block; font-weight: normal !important; font-size: .9rem; }

/* 마이페이지 */
.info { display: grid; grid-template-columns: 90px 1fr; gap: 6px 12px; margin: 0 0 16px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }

@media (max-width: 720px) {
  .header-inner { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  .user-menu { margin-left: 0; width: 100%; justify-content: flex-end; }
  .two-col, .row { grid-template-columns: 1fr; gap: 0; }
  .two-col { gap: 0; }
  .panel { padding: 18px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero h1 { font-size: 1.4rem; }
  .portal-choices { grid-template-columns: 1fr; }
  .portal-choice { min-height: 140px; }
  .toolbar .search { flex-basis: 100%; max-width: none; }
  /* 업종 이름이 길면(동호회 종목 등) 검색칸이 찌그러지므로 업종 선택을 한 줄로 내린다 */
  .toolbar .place-filter { flex-wrap: wrap; }
  .toolbar .place-filter select { flex: 1 1 100%; max-width: none; }  /* 아래쪽 기본 규칙보다 우선하도록 선택자를 한 단계 높임 */
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}

/* 장소 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { padding: .3rem .8rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .92rem; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.place-filter select { padding: .45rem .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; max-width: 14rem; }
.place-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.place-list li + li { border-top: 1px solid var(--border); }
.place-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; text-decoration: none; color: inherit; }
.place-list a:hover { background: #fafafa; }
.place-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.place-sub, .place-addr { color: var(--muted); font-size: .88rem; }
.place-addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branch { font-weight: 400; color: var(--muted); }
.place-stat { flex-shrink: 0; font-size: .9rem; }
.rating-summary .stars { color: #f59f00; }
.rating-summary.none { color: var(--muted); }
.place-detail h1 { margin-bottom: .3rem; }
.place-detail .info { margin-top: 12px; }
.place-picked { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.notice { padding: .6rem .8rem; border-radius: 8px; background: #fff7ed; color: #9a3412; }
.source-attribution { margin-top: 24px; color: var(--muted); font-size: .8rem; }

.hint-inline { color: var(--muted); font-size: .85rem; }
.badge-cert { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; font-size: .75rem; vertical-align: middle; font-weight: 600; }
