/**
 * 조인커뮤니티 5일장 — 첫 화면(상단바·히어로·주제 아이콘·오늘 장터·배너)
 * 색은 joinon.co.kr 홈페이지와 같은 값 (--jc-*)
 * 기존 페이지 스타일과 겹치지 않도록 새 요소는 jh- 로 시작
 */
:root {
  --jc-navy: #102a72;
  --jc-navy-deep: #081d57;
  --jc-blue: #1687ea;
  --jc-blue-deep: #0868d7;
  --jc-sky: #edf7ff;
  --jc-sky-strong: #ddecff;
  --jc-ink: #141923;
  --jc-muted: #5d6677;
  --jc-line: #dce5f0;
  --jc-grad: linear-gradient(100deg, #081d57, #0d4ea6 64%, #1687ea);

  /* 기존 페이지 변수도 홈페이지 색으로 맞춤 */
  --bg-primary: #fbfdff;
  --primary: var(--jc-blue);
  --primary-hover: var(--jc-blue-deep);
  --primary-light: var(--jc-sky);
  --border-color: var(--jc-line);
  --text-main: var(--jc-navy-deep);
  --text-muted: var(--jc-muted);
}

.jh-wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.jh-en { font-family: montserrat, Montserrat, Pretendard, sans-serif; }

/* ── 상단바 ─────────────────────────────── */
.jh-nav { position: sticky; top: 0; z-index: 100; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--jc-line); }
.jh-nav .jh-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.jh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.jh-brand img { width: 52px; height: auto; flex: none; }
.jh-brand b { display: block; font-size: 17px; font-weight: 900; color: var(--jc-navy-deep); white-space: nowrap; }
.jh-brand small { display: block; font-size: 10px; font-weight: 800; letter-spacing: 2px; color: var(--jc-blue); white-space: nowrap; }
.jh-menu { display: flex; gap: 22px; font-size: 14px; font-weight: 600; }
.jh-menu a { color: #313a4b; text-decoration: none; }
.jh-menu a:hover, .jh-menu a.on { color: var(--jc-blue); }
.jh-menu a.on { font-weight: 800; }
.jh-nav-cta { display: flex; align-items: center; gap: 8px; }

.jh-pill { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; padding: 10px 18px; font-weight: 800; font-size: 14px; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; transition: background .15s, transform .15s; }
.jh-pill.blue { background: var(--jc-blue); color: #fff; box-shadow: 0 12px 28px rgba(22, 135, 234, .22); }
.jh-pill.blue:hover { background: var(--jc-blue-deep); }
.jh-pill.line { background: #fff; color: var(--jc-navy-deep); border: 1px solid var(--jc-line); }
.jh-pill.line:hover { border-color: var(--jc-blue); color: var(--jc-blue); }
.jh-pill.white { background: #fff; color: var(--jc-navy-deep); }

/* ── 히어로 ─────────────────────────────── */
.jh-hero { position: relative; overflow: hidden; background: linear-gradient(112deg, #fff 0%, #fff 44%, #f4f9ff 100%); padding: 46px 0 34px; }
.jh-hero::before { content: ""; position: absolute; width: 620px; height: 620px; border-radius: 50%; border: 90px solid var(--jc-sky); right: -180px; top: -260px; pointer-events: none; }
.jh-hero .jh-wrap { position: relative; }
.jh-hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.jh-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; color: var(--jc-blue); }
.jh-eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--jc-blue); }
.jh-title { font-size: 56px; line-height: 1.16; font-weight: 900; letter-spacing: -2px; color: var(--jc-navy-deep); margin-top: 14px; }
.jh-title em { font-style: normal; color: var(--jc-blue); }
.jh-lead { color: var(--jc-muted); font-size: 16px; line-height: 1.7; margin-top: 16px; }
.jh-search { display: flex; gap: 8px; margin-top: 24px; background: #fff; border: 1px solid var(--jc-line); border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: 0 10px 30px rgba(8, 29, 87, .07); }
.jh-search:focus-within { border-color: var(--jc-blue); }
.jh-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; font-family: inherit; color: var(--jc-ink); }
.jh-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 22px; }
.jh-stats div { font-size: 12px; color: var(--jc-muted); font-weight: 600; }
.jh-stats b { display: block; font-size: 24px; font-weight: 800; color: var(--jc-navy-deep); }

/* 오늘 가까운 장터 카드 */
.jh-today { background: #fff; border: 1px solid var(--jc-line); border-radius: 26px; padding: 22px; box-shadow: 0 24px 60px rgba(8, 29, 87, .12); }
.jh-today-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.jh-today-head small { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--jc-blue); }
.jh-today-head h3 { font-size: 26px; font-weight: 800; color: var(--jc-navy-deep); margin-top: 6px; line-height: 1.3; }
.jh-badge { width: 58px; height: 58px; flex: none; border-radius: 50%; background: var(--jc-navy-deep); color: #fff; display: grid; place-items: center; text-align: center; font-size: 11px; font-weight: 800; line-height: 1.2; }
.jh-badge b { display: block; font-size: 17px; }
.jh-near { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.jh-near button { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; background: #fafdff; border: 1px solid var(--jc-sky-strong); cursor: pointer; transition: background .15s; }
.jh-near button:hover, .jh-near button:focus-visible { background: var(--jc-sky); }
.jh-near img, .jh-near .jh-noimg { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--jc-sky); }
.jh-near .t { flex: 1; min-width: 0; }
.jh-near .t b { display: block; font-size: 15px; font-weight: 800; color: var(--jc-navy-deep); }
.jh-near .t span { display: block; font-size: 12px; color: var(--jc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jh-near .km { font-size: 13px; font-weight: 800; color: var(--jc-blue); white-space: nowrap; }
.jh-today-foot { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--jc-muted); }
.jh-link { all: unset; color: var(--jc-blue); font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap; }
.jh-today-foot .jh-link { font-size: 12px; }

/* ── 섹션 공통 ───────────────────────────── */
.jh-sec { padding: 34px 0 6px; }
.jh-sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.jh-sec-head small { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--jc-blue); }
.jh-sec-head h2 { font-size: 26px; font-weight: 800; color: var(--jc-navy-deep); margin-top: 4px; letter-spacing: -.5px; }

/* 주제 아이콘 */
.jh-cats { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.jh-cat { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px 14px; border-radius: 20px; border: 1px solid var(--jc-line); background: #fff; cursor: pointer; text-align: center; transition: border-color .15s, box-shadow .15s, transform .15s; }
.jh-cat:hover, .jh-cat:focus-visible { border-color: var(--jc-blue); box-shadow: 0 12px 28px rgba(22, 135, 234, .14); transform: translateY(-2px); }
.jh-cat .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--jc-sky); color: var(--jc-blue); display: grid; place-items: center; }
.jh-cat.on { border-color: var(--jc-blue); background: var(--jc-sky); }
.jh-cat.on .ic, .jh-cat.hot .ic { background: var(--jc-blue); color: #fff; }
.jh-cat svg { width: 26px; height: 26px; }
.jh-cat b { font-size: 14px; font-weight: 800; color: var(--jc-navy-deep); }
.jh-cat span { font-size: 11px; color: var(--jc-muted); font-weight: 600; }

/* 지금 장 서는 곳 사진 카드 */
.jh-scroller { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 18px; }
.jh-scroller::-webkit-scrollbar { height: 6px; }
.jh-scroller::-webkit-scrollbar-thumb { background: var(--jc-sky-strong); border-radius: 9px; }
.jh-card { all: unset; box-sizing: border-box; display: block; flex: 0 0 262px; border-radius: 22px; overflow: hidden; background: #fff; border: 1px solid var(--jc-line); scroll-snap-align: start; cursor: pointer; transition: box-shadow .2s, transform .2s; }
.jh-card:hover, .jh-card:focus-visible { box-shadow: 0 18px 40px rgba(8, 29, 87, .12); transform: translateY(-3px); }
.jh-card .ph { position: relative; display: block; height: 164px; background: var(--jc-sky); }
.jh-card .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jh-card .live { position: absolute; left: 12px; top: 12px; background: var(--jc-blue); color: #fff; font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 999px; display: flex; align-items: center; gap: 6px; }
.jh-card .km { position: absolute; right: 12px; top: 12px; background: rgba(8, 29, 87, .85); color: #fff; font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 999px; }
.jh-card .credit { position: absolute; left: 10px; right: 10px; bottom: 6px; text-align: right; font-size: 10px; color: rgba(255, 255, 255, .92); text-shadow: 0 1px 2px rgba(0, 0, 0, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jh-card .body { display: block; padding: 14px 16px 16px; }
.jh-card .body b { display: block; font-size: 17px; font-weight: 800; color: var(--jc-navy-deep); }
.jh-card .meta { display: block; font-size: 12px; color: var(--jc-muted); margin-top: 3px; }
.jh-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.jh-chips span { font-size: 11px; font-weight: 700; color: var(--jc-blue-deep); background: var(--jc-sky); padding: 4px 9px; border-radius: 999px; }
@keyframes jh-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .9); } 50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); } }
.jh-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: jh-pulse 1.6s infinite; }

/* 다가오는 축제 */
.jh-sec-desc { font-size: 13px; color: var(--jc-muted); margin: -8px 0 14px; }
.jh-fest .live { background: #f97316; }
.jh-fest .ph { background: linear-gradient(135deg, var(--jc-sky), var(--jc-sky-strong)); }
.jh-fest-noimg { position: absolute; inset: 0; display: grid; place-items: center; font-size: 44px; }
.jh-fest .body b { font-size: 16px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jh-scroller.jh-fest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); overflow: visible; }
.jh-scroller.jh-fest-grid .jh-card { flex: none; }

/* 그라데이션 배너 (제철 장보기 · 광고 문의) */
.jh-banners { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; margin: 26px 0 8px; }
.jh-banner { position: relative; overflow: hidden; border-radius: 24px; padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.jh-banner.grad { background: var(--jc-grad); color: #fff; }
.jh-banner.grad::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 44px solid rgba(255, 255, 255, .07); right: -60px; top: -90px; pointer-events: none; }
.jh-banner.sky { background: var(--jc-sky); border: 1px solid var(--jc-sky-strong); color: var(--jc-navy-deep); }
.jh-banner small { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }
.jh-banner.grad small { color: #9fd0ff; }
.jh-banner.sky small { color: var(--jc-blue); }
.jh-banner h3 { font-size: 21px; font-weight: 800; margin-top: 4px; }
.jh-banner p { font-size: 14px; margin-top: 4px; line-height: 1.5; }
.jh-banner.grad p { color: #dfeeff; }
.jh-banner.sky p { color: var(--jc-muted); }
.jh-banner .jh-pill { position: relative; z-index: 1; }

/* 주제 필터가 켜졌을 때 목록 위 안내 */
.jh-feature-note { display: none; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 auto 12px; max-width: 1200px; padding: 10px 16px; border-radius: 14px; background: var(--jc-sky); color: var(--jc-navy-deep); font-weight: 700; font-size: 14px; }
.jh-feature-note.show { display: flex; }
.jh-feature-note button { all: unset; cursor: pointer; color: var(--jc-blue); font-weight: 800; }

/* ── 기존 목록 영역을 같은 색으로 ──────────── */
body { background: var(--bg-primary); }
.filter-card { border-radius: 22px; border-color: var(--jc-line); box-shadow: 0 10px 30px rgba(8, 29, 87, .05); }
.chip-btn.active { background: var(--jc-blue); border-color: var(--jc-blue); color: #fff; }
.market-card { border-radius: 20px; border-color: var(--jc-line); }
.market-card:hover { border-color: var(--jc-blue); box-shadow: 0 18px 40px rgba(8, 29, 87, .10); }
#btn-gps-sort { border-radius: 999px; }
footer h4 { color: var(--jc-navy-deep) !important; }

/* ── 태블릿·휴대폰 ───────────────────────── */
@media (max-width: 900px) {
  .jh-menu { display: none; }
  .jh-hero { padding-top: 30px; }
  .jh-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .jh-title { font-size: 36px; letter-spacing: -1.2px; }
  .jh-lead br { display: none; }
  .jh-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .jh-cat { padding: 12px 4px 10px; border-radius: 16px; }
  .jh-cat .ic { width: 44px; height: 44px; border-radius: 14px; }
  .jh-card { flex-basis: 78%; }
  .jh-banners { grid-template-columns: minmax(0, 1fr); }
  .jh-banner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .jh-nav .jh-wrap { height: 58px; }
  .jh-brand img { width: 44px; }
  .jh-brand b { font-size: 15px; }
  .jh-nav-cta .jh-pill { padding: 8px 12px; font-size: 12px; }
  #google_translate_element { display: none !important; } /* 휴대폰은 오른쪽 아래 English 버튼으로 */
  .jh-search .jh-pill span { display: none; }
  .jh-stats { gap: 16px; }
  .jh-stats b { font-size: 20px; }
  .jh-sec-head h2 { font-size: 21px; }
  .jh-today { padding: 18px; border-radius: 22px; }
  .jh-today-head h3 { font-size: 22px; }
}

/* ── 장터 상세 창: 핵심 정보 + 탭 (2026-09-25) ─────────────── */
.md-core { border: 2px solid var(--jc-blue); }
.md-next { margin-top: 6px; font-size: 0.82rem; font-weight: 600; color: var(--jc-muted); }
.md-next span { display: inline-block; margin: 3px 4px 0 0; padding: 2px 9px; border-radius: 999px; background: var(--jc-sky); color: var(--jc-navy-deep); }
.md-next b { color: var(--jc-blue); }
.md-tabs { position: sticky; top: -1px; z-index: 2; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin-bottom: 4px; background: #fff; scrollbar-width: none; }
.md-tabs::-webkit-scrollbar { display: none; }
.md-tab { flex: none; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--jc-line); background: #fff; font-weight: 700; font-size: 0.86rem; color: #313a4b; cursor: pointer; white-space: nowrap; }
.md-tab.on { background: var(--jc-blue); border-color: var(--jc-blue); color: #fff; }
.md-panel { display: none; }
.md-panel.on { display: block; }
.md-verified-head { font-size: 0.8rem; font-weight: 800; color: #047857; margin-bottom: 6px; }
.md-ref-note { margin-bottom: 12px; padding: 12px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 0.85rem; line-height: 1.6; }
.md-ref { opacity: .92; border-style: dashed; }
#modal-verified-source { font-size: 0.75rem; color: #94a3b8; margin: -4px 0 12px; }
.md-own { margin-top: 4px; font-size: 0.74rem; font-weight: 400; color: #94a3b8; }
.ev-live { margin-top: 3px; font-size: 0.8rem; font-weight: 700; }
.ev-live .ok { color: #047857; } .ev-live .busy { color: #b45309; } .ev-live .na { color: #64748b; }

/* 축제 상세 창 (home.js jhFest) */
.jf-back { position: fixed; inset: 0; z-index: 3000; background: rgba(8, 29, 87, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.jf-box { position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 24px; box-shadow: 0 30px 80px rgba(8, 29, 87, .35); }
.jf-close { position: absolute; right: 14px; top: 14px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .95); color: var(--jc-navy-deep); font-size: 18px; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.jf-ph { position: relative; height: 240px; background: var(--jc-sky); }
.jf-ph img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 24px 24px 0 0; }
.jf-ph .credit { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.jf-body { padding: 22px 24px 24px; }
.jf-badge { display: inline-block; background: #ff7a1a; color: #fff; font-size: 12px; font-weight: 800; padding: 5px 12px; border-radius: 999px; }
.jf-body h2 { margin: 10px 0 14px; font-size: 22px; line-height: 1.35; font-weight: 800; color: var(--jc-navy-deep); padding-right: 36px; }
.jf-body h3 { margin: 20px 0 8px; font-size: 16px; font-weight: 800; color: var(--jc-navy-deep); }
.jf-rows { border-top: 1px solid var(--jc-line); }
.jf-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--jc-line); font-size: 14px; }
.jf-row span { flex: 0 0 76px; color: var(--jc-muted); font-weight: 700; }
.jf-row p { margin: 0; color: var(--jc-ink); white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.jf-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.jf-btns a { flex: 1 1 130px; text-align: center; padding: 12px 10px; border-radius: 14px; font-size: 14px; font-weight: 800; text-decoration: none; }
.jf-kakao { background: #fee500; color: #191919; } .jf-naver { background: #03c75a; color: #fff; }
.jf-home { background: var(--jc-blue); color: #fff; } .jf-tel { background: var(--jc-sky); color: var(--jc-navy-deep); }
.jf-text { margin: 0; font-size: 14px; line-height: 1.7; color: #333b4a; white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.jf-markets { display: grid; gap: 8px; }
.jf-market { all: unset; box-sizing: border-box; display: block; padding: 12px 14px; border: 1px solid var(--jc-line); border-radius: 14px; cursor: pointer; background: var(--jc-sky); }
.jf-market:hover, .jf-market:focus-visible { border-color: var(--jc-blue); }
.jf-market b { display: block; font-size: 15px; color: var(--jc-navy-deep); }
.jf-market span { display: block; margin-top: 2px; font-size: 13px; color: var(--jc-muted); }
.jf-src { margin: 18px 0 0; font-size: 12px; color: #94a3b8; }
@media (max-width: 600px) {
  .jf-back { padding: 0; align-items: flex-end; }
  .jf-box { max-height: 94vh; border-radius: 22px 22px 0 0; }
  .jf-ph { height: 190px; }
  .jf-body { padding: 18px 16px 22px; }
  .jf-body h2 { font-size: 19px; }
}
