/*
Theme Name: 발길맵 (Balgilmap)
Theme URI: https://balgilmap.com
Author: 발길맵
Description: 전국 축제와 가볼 만한 곳을 지도와 필터로 보여주는 발길맵 전용 테마입니다.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: balgilmap
*/

:root {
  --paper: #EDF1EA; --paper-deep: #E1E8DD; --card: #FFFFFF;
  --ink: #13231B; --ink-soft: #4B5D52; --forest: #1E4D3A; --forest-deep: #10291F;
  --trail: #F2C230; --trail-ink: #3A2C00; --land: #F8FAF5; --line: #D3DCCF;
  --fest: #D9483B; --tour: #2F6FB0; --news: #6B5BA8;
  --shadow: 0 12px 30px rgba(16, 41, 31, 0.12);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1A15; --paper-deep: #15231C; --card: #172820;
    --ink: #E9EEE6; --ink-soft: #A4B5A9; --forest: #5FAF86; --forest-deep: #0A1410;
    --land: #1C2F25; --line: #2A3D32; --fest: #F07366; --tour: #6FA8E6; --news: #A596E0;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  }
}
html { scroll-padding-top: calc(76px + env(safe-area-inset-top, 0px)); }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'Gothic A1', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; line-height: 1.65; -webkit-font-smoothing: antialiased; }
body.admin-bar .site-header { top: calc(32px + env(safe-area-inset-top, 0px)); }
@media (max-width: 782px) { body.admin-bar .site-header { top: env(safe-area-inset-top, 0px); } }
h1, h2, h3 { margin: 0; font-weight: 400; font-family: 'Black Han Sans', 'Apple SD Gothic Neo', sans-serif; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--trail); outline-offset: 2px; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--forest-deep); color: #EEF3EA; }
.header-inner { display: flex; align-items: center; gap: 26px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: 'Black Han Sans', sans-serif; font-size: 23px; white-space: nowrap; color: #EEF3EA; }
.brand svg { width: 26px; height: 30px; flex-shrink: 0; }
.main-nav { display: flex; gap: 20px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.main-nav a { display: inline-block; font-size: 14.5px; color: #C8D6CC; white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: #fff; border-bottom-color: var(--trail); }
.header-cta { background: var(--trail); color: var(--trail-ink); border-radius: 8px; padding: 8px 14px; font-size: 13.5px; font-weight: 800; white-space: nowrap; }
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 6px 16px; padding-top: 10px; padding-bottom: 8px; }
  .main-nav { order: 3; flex-basis: 100%; }
  .header-cta { margin-left: auto; }
}

/* Hero */
.hero { padding: 44px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }
.hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.15; }
.hero .lead { margin: 16px 0 0; font-size: 16.5px; color: var(--ink-soft); max-width: 40ch; }
.search { margin-top: 28px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; box-shadow: var(--shadow); }
.search select { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 9px; padding: 11px 10px; font-size: 14px; font-family: inherit; }
.search button { background: var(--forest); color: #fff; border: 0; border-radius: 9px; padding: 0 20px; font-size: 15px; font-weight: 800; cursor: pointer; }
@media (max-width: 480px) { .search { grid-template-columns: 1fr 1fr; } .search button { grid-column: span 2; padding: 12px; } }
.hero-stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div { font-size: 13.5px; color: var(--ink-soft); }
.hero-stats strong { display: block; font-size: 22px; color: var(--ink); font-weight: 800; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tab { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 700; cursor: pointer; }
.tab .dot { width: 9px; height: 9px; border-radius: 50%; }
.tab .count { font-weight: 500; color: var(--ink-soft); font-size: 12.5px; }
.tab[aria-pressed="true"] { background: var(--forest-deep); color: #fff; border-color: var(--forest-deep); }
.tab[aria-pressed="true"] .count { color: #B9CABE; }

/* Map */
.map-card { position: relative; background: var(--paper-deep); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; padding: 10px 10px 86px; }
.map-card svg.map { display: block; width: 100%; height: auto; max-height: 560px; }
.land { fill: var(--land); stroke: var(--forest); stroke-width: 0.8; stroke-linejoin: round; }
.land.hl { fill: #FDF1C4; }
.pin { cursor: pointer; transition: opacity .25s; }
.pin circle.halo { fill: currentColor; opacity: 0.2; }
.pin circle.core { fill: currentColor; stroke: var(--land); stroke-width: 2; }
.pin.off { opacity: 0.08; pointer-events: none; }
.pin.on circle.halo { opacity: 0.45; }
.pin:focus-visible { outline: none; }
.pin:focus-visible circle.core { stroke: var(--trail); stroke-width: 3.5; }
.cat-fest { color: var(--fest); }
.cat-tour { color: var(--tour); }
.cat-news, .cat-etc { color: var(--news); }
.map-panel { position: absolute; left: 14px; right: 14px; bottom: 14px; background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.map-panel .name { font-weight: 800; font-size: 15.5px; }
.map-panel .meta { font-size: 13px; color: var(--ink-soft); }
.map-panel a { flex-shrink: 0; background: var(--trail); color: var(--trail-ink); font-weight: 800; font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.map-panel a[hidden] { display: none; }

/* Sections */
section.block { padding: 52px 0; }
.block-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.block-head h2 { font-size: 28px; }
.block-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 14.5px; }
.more { font-size: 14px; font-weight: 700; color: var(--forest); white-space: nowrap; border-bottom: 1.5px solid currentColor; }

/* Filters */
.filters { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 18px; }
.filter-row { display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start; padding: 6px 0; }
.filter-row + .filter-row { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 6px; }
.filter-label { font-weight: 800; font-size: 14px; padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.chip .n { color: var(--ink-soft); font-weight: 500; margin-left: 3px; font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--trail); border-color: var(--trail); color: var(--trail-ink); font-weight: 800; }
.chip[aria-pressed="true"] .n { color: var(--trail-ink); }
.chip:disabled { opacity: 0.4; cursor: default; }
.filter-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-soft); }
.filter-foot b { color: var(--ink); }
.reset { border: 0; background: none; color: var(--forest); font-weight: 800; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) { .filter-row { grid-template-columns: 1fr; gap: 6px; } .filter-label { padding-top: 0; } }

/* Cards */
.place-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.place { background: var(--card); border: 1px solid var(--line); border-radius: 14px; border-top: 5px solid currentColor; overflow: hidden; transition: box-shadow .2s; }
.place:hover { box-shadow: var(--shadow); }
.place.selected { box-shadow: 0 0 0 3px var(--trail), var(--shadow); }
.place[hidden] { display: none; }
.place .thumb { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-deep); }
.place .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px 18px 16px; }
.place .kind { font-size: 12.5px; font-weight: 800; }
.place h3 { font-family: 'Gothic A1', sans-serif; font-weight: 800; font-size: 17.5px; color: var(--ink); margin: 4px 0 8px; line-height: 1.35; }
.place h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.place .row { font-size: 13.5px; color: var(--ink-soft); display: flex; gap: 6px; }
.place .row b { color: var(--ink); font-weight: 700; flex-shrink: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 6px; background: var(--paper-deep); color: var(--ink-soft); }
.badge.theme { background: var(--forest); color: #fff; }
a.badge:hover { text-decoration: underline; }
.empty { display: none; background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; color: var(--ink-soft); }
.empty.show { display: block; }
.empty button { margin-top: 10px; border: 0; background: var(--forest); color: #fff; border-radius: 9px; padding: 9px 14px; font-weight: 800; cursor: pointer; }
.first-post { background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; color: var(--ink-soft); }

/* Situations */
.situ-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 820px) { .situ-row { grid-template-columns: repeat(2, 1fr); } }
.situ { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: block; }
.situ:hover { border-color: var(--forest); }
.situ strong { display: block; font-size: 16px; margin-bottom: 4px; }
.situ span { font-size: 13.5px; color: var(--ink-soft); }

/* Guides */
.guide { background: var(--forest-deep); color: #E9EFE6; }
.guide .block-head h2 { color: #fff; }
.guide .block-head p { color: #A9BCAF; }
.guide .more { color: var(--trail); }
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; padding: 22px; display: block; }
.guide-card:hover { border-color: var(--trail); }
.guide-card h3 { font-size: 22px; color: #fff; }
.guide-card > p { color: #BFD0C4; font-size: 14.5px; margin: 8px 0 16px; }
.steps { list-style: none; margin: 0; padding: 0 0 0 4px; }
.steps li { position: relative; padding: 0 0 14px 24px; font-size: 14px; color: #DCE6DD; }
.steps li::before { content: ""; position: absolute; left: 0; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--trail); }
.steps li::after { content: ""; position: absolute; left: 4px; top: 19px; bottom: 0; border-left: 2px dotted rgba(242,194,48,0.6); }
.steps li:last-child::after { display: none; }
.steps b { color: #fff; margin-right: 6px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news li { display: flex; gap: 14px; align-items: baseline; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.news .rank { font-family: 'Black Han Sans', sans-serif; font-size: 20px; color: var(--forest); width: 22px; flex-shrink: 0; }
.news .title { font-weight: 700; font-size: 15.5px; }
.news a.title:hover { text-decoration: underline; text-underline-offset: 3px; }
.news .date { margin-left: 8px; font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }

/* Trust */
.trust-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 820px) { .trust-grid { grid-template-columns: 1fr; } }
.trust-grid strong { display: block; font-size: 16.5px; margin-bottom: 4px; }
.trust-grid p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* Archive */
.archive-head { padding: 40px 0 20px; }
.archive-head h1 { font-size: clamp(30px, 4.4vw, 42px); }
.archive-head p { margin: 6px 0 0; color: var(--ink-soft); }
.pagination { display: flex; justify-content: center; gap: 6px; margin: 30px 0 10px; flex-wrap: wrap; }
.pagination .page-numbers { min-width: 38px; text-align: center; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-weight: 700; }
.pagination .current { background: var(--forest); color: #fff; border-color: var(--forest); }

/* Single */
.post-head { padding: 36px 0 20px; }
.crumbs { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 10px; }
.crumbs a { color: var(--forest); font-weight: 700; }
.post-head h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.2; }
.post-head .sub { margin-top: 10px; color: var(--ink-soft); font-size: 15px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; padding-bottom: 56px; }
@media (max-width: 920px) { .post-layout { grid-template-columns: 1fr; } .post-side { order: -1; } }
.post-side { position: sticky; top: 84px; display: grid; gap: 14px; }
@media (max-width: 920px) { .post-side { position: static; } }
.info-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.info-card h2 { font-size: 19px; margin-bottom: 10px; }
.info-card dl { margin: 0; display: grid; grid-template-columns: 76px 1fr; gap: 8px 10px; font-size: 14.5px; }
.info-card dt { font-weight: 800; }
.info-card dd { margin: 0; color: var(--ink-soft); word-break: keep-all; overflow-wrap: anywhere; }
.info-card dd a { color: var(--forest); text-decoration: underline; }
.mini-map { background: var(--paper-deep); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.mini-map svg.map { display: block; width: 100%; height: auto; max-height: 300px; }
.mini-map .pin circle.halo { opacity: 0.35; }
.btn-route { display: block; text-align: center; background: #03C75A; color: #fff; font-weight: 800; padding: 12px; border-radius: 10px; margin-top: 10px; }
.btn-route:hover { filter: brightness(1.05); }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 28px clamp(20px, 4vw, 40px); font-size: 16.5px; line-height: 1.85; }
.entry > *:first-child { margin-top: 0; }
.entry h2 { font-family: 'Gothic A1', sans-serif; font-weight: 800; font-size: 23px; margin: 36px 0 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.entry h3 { font-family: 'Gothic A1', sans-serif; font-weight: 800; font-size: 19px; margin: 26px 0 8px; }
.entry p { margin: 0 0 16px; }
.entry a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }
.entry img { border-radius: 12px; }
.entry figure { margin: 20px 0; }
.entry figcaption { font-size: 13px; color: var(--ink-soft); text-align: center; margin-top: 6px; }
.entry table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 16px 0; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.entry th { background: var(--paper-deep); }
.entry blockquote { margin: 18px 0; padding: 12px 18px; border-left: 4px solid var(--trail); background: var(--paper); border-radius: 0 10px 10px 0; }
.entry ul, .entry ol { padding-left: 22px; margin: 0 0 16px; }
.post-tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.post-updated { margin-top: 18px; font-size: 13.5px; color: var(--ink-soft); }
.featured { margin-bottom: 18px; border-radius: 16px; overflow: hidden; }
.featured img { display: block; width: 100%; }

/* Page (약관 등) */
.page-wrap { max-width: 820px; margin: 0 auto; padding: 40px 20px 72px; }
.page-wrap h1 { font-size: clamp(30px, 4.4vw, 40px); margin-bottom: 18px; }

/* Footer */
.site-footer { background: var(--forest-deep); color: #A9BCAF; padding: 34px 0; font-size: 13px; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 12px; color: #DCE6DD; font-size: 14px; }
.site-footer .links ul { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; margin: 0; padding: 0; }
.site-footer a:hover { color: #fff; }

/* Content helpers */
.alignwide, .alignfull { max-width: 100%; }
.wp-block-image img { height: auto; }
