/* =========================================================
   식도락 Project / Korea Map Page
   Requires main.css to be loaded first.
========================================================= */

/* =========================================================
   Header
========================================================= */

.topbar{
  color:#fff;
  background:linear-gradient(
    135deg,
    var(--garnet, #73000a) 0%,
    var(--garnet-bright, #8a0010) 58%,
    var(--garnet-dark, #520007) 100%
  );
  border-bottom:1px solid rgba(255,255,255,.16);
  box-shadow:0 3px 10px rgba(0,0,0,.12);
  padding:18px var(--pad, 22px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap;
}

.topbar .site-name{
  display:inline-block;
  color:#fff;
  text-decoration:none;
  font-size:24px;
  font-weight:700;
  line-height:1.1;
}

.topbar .site-name:hover{
  text-decoration:none;
  opacity:.92;
}

.topbar p{
  margin:4px 0 0;
  color:rgba(255,255,255,.9);
  font-size:13px;
  line-height:1.35;
}

.topbar nav{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:18px;
  flex-wrap:wrap;
}

.topbar nav a{
  color:#fff;
  opacity:.9;
  text-decoration:none;
  font-size:13px;
  font-weight:600;
  padding:6px 0;
  border-bottom:2px solid transparent;
  transition:opacity .15s ease, border-color .15s ease;
}

.topbar nav a:hover{
  opacity:1;
  text-decoration:none;
  border-bottom-color:rgba(255,255,255,.85);
}

/* =========================================================
   Main Layout
========================================================= */

.page-shell{
  width:100%;
  max-width:1540px;
  margin:0 auto;
  padding:30px var(--pad, 22px) 36px;
  display:grid;
  grid-template-columns:290px minmax(420px, 1fr) minmax(390px, .9fr);
  gap:22px;
  align-items:stretch;
}

.sidebar,
.map-card,
.slides-panel{
  min-width:0;
  border:1px solid var(--line, #e8e3e3);
  border-radius:var(--radius, 14px);
  background:rgba(255,255,255,.96);
  box-shadow:var(--shadow, 0 10px 28px rgba(0,0,0,.07));
  overflow:hidden;
}

.sidebar{
  padding:18px;
  align-self:start;
}

.map-card{
  position:relative;
  min-height:720px;
}

.slides-panel{
  padding:16px;
  display:flex;
  flex-direction:column;
  min-height:720px;
}

#map{
  width:100%;
  height:100%;
  min-height:720px;
  background:var(--soft, #faf7f7);
}

/* =========================================================
   Typography / Shared Elements
========================================================= */

.eyebrow{
  margin:0 0 8px;
  color:var(--garnet, #73000a);
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  line-height:1.2;
  text-transform:uppercase;
}

.sidebar h1{
  margin:0 0 8px;
  color:var(--ink, #1f1f1f);
  font-size:24px;
  line-height:1.18;
}

.korean-title{
  display:block;
  color:var(--garnet);
  font-size:34px;
  line-height:1.05;
  letter-spacing:.01em;
}

.english-title{
  display:block;
  margin-top:2px;
  color:var(--ink);
  font-size:22px;
  line-height:1.15;
}

.intro{
  margin:12px 0 18px;
  color:var(--muted, #666);
  font-size:13.5px;
  line-height:1.55;
}

/* =========================================================
   Sidebar Stats / Search
========================================================= */

.project-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:16px 0 18px;
}

.project-stats div{
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:linear-gradient(180deg, #fff, var(--soft));
  box-shadow:0 3px 10px rgba(0,0,0,.035);
}

.project-stats strong{
  display:block;
  color:var(--garnet);
  font-size:21px;
  line-height:1.1;
}

.project-stats span{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:12px;
  line-height:1.25;
}

.city-search-label{
  display:block;
  margin:0 0 6px;
  color:var(--ink);
  font-size:12px;
  font-weight:800;
}

.city-search{
  width:100%;
  margin:0 0 8px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--text);
  background:#fff;
  font:inherit;
  outline:0;
}

.city-search:focus{
  border-color:rgba(115,0,10,.45);
  box-shadow:0 0 0 3px rgba(115,0,10,.12);
}

.city-list-meta{
  display:flex;
  align-items:center;
  gap:5px;
  margin:0 0 10px;
  color:var(--muted);
  font-size:12px;
}

.city-list-meta #visibleCityCount{
  color:var(--garnet);
  font-weight:800;
}

/* =========================================================
   City List
========================================================= */

.city-list{
  display:flex;
  flex-direction:column;
  gap:9px;
}

.sikdorak-sidebar .city-list{
  max-height:48vh;
  overflow:auto;
  padding-right:4px;
}

.sikdorak-sidebar .city-list::-webkit-scrollbar{
  width:8px;
}

.sikdorak-sidebar .city-list::-webkit-scrollbar-thumb{
  background:rgba(115,0,10,.24);
  border-radius:999px;
}

.city-list-button{
  position:relative;
  width:100%;
  border:1px solid var(--line, #e8e3e3);
  border-radius:12px;
  background:var(--surface, #fff);
  padding:11px 68px 11px 12px;
  text-align:left;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.025);
  transition:
    transform .15s ease,
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease;
}

.city-list-button:hover,
.city-list-button.active{
  background:linear-gradient(90deg, rgba(115,0,10,.07), #fff);
  border-color:rgba(115,0,10,.35);
  box-shadow:var(--shadow-soft, 0 6px 18px rgba(0,0,0,.055));
  transform:translateY(-1px);
}

.city-list-button:focus-visible{
  outline:3px solid rgba(115,0,10,.28);
  outline-offset:2px;
}

.city-name{
  display:block;
  color:var(--ink, #1f1f1f);
  font-size:13.5px;
  font-weight:800;
  line-height:1.25;
}

.city-korean{
  display:block;
  margin-top:2px;
  color:var(--muted, #666);
  font-size:12.5px;
  line-height:1.25;
}

.city-heart-mini{
  position:absolute;
  top:50%;
  right:10px;
  transform:translateY(-50%);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  min-width:46px;
  padding:4px 7px;
  border:1px solid rgba(115,0,10,.16);
  border-radius:999px;
  color:var(--garnet, #73000a);
  background:#fff;
  font-size:11.5px;
  font-weight:900;
  line-height:1;
  box-shadow:0 2px 8px rgba(0,0,0,.035);
}

.city-list-button:hover .city-heart-mini,
.city-list-button.active .city-heart-mini{
  color:#fff;
  background:var(--garnet, #73000a);
  border-color:var(--garnet, #73000a);
}

/* =========================================================
   Map
========================================================= */

.map-ribbon{
  position:absolute;
  z-index:3;
  top:14px;
  left:14px;
  max-width:calc(100% - 28px);
  padding:8px 12px;
  border:1px solid rgba(115,0,10,.18);
  border-radius:999px;
  color:var(--garnet);
  background:rgba(255,255,255,.94);
  box-shadow:0 6px 18px rgba(0,0,0,.12);
  font-size:12px;
  font-weight:800;
  line-height:1.25;
}

.map-error{
  min-height:720px;
  display:grid;
  place-items:center;
  padding:24px;
  color:var(--garnet, #73000a);
  font-weight:800;
  text-align:center;
  background:var(--soft, #faf7f7);
}

/* Google marker */

.custom-marker{
  display:flex;
  align-items:center;
  gap:6px;
  border:0;
  background:transparent;
  padding:0;
  transform:translateY(-4px);
  user-select:none;
}

.marker-dot{
  width:16px;
  height:16px;
  border:3px solid #fff;
  border-radius:999px;
  background:var(--garnet, #73000a);
  box-shadow:0 3px 9px rgba(0,0,0,.28);
}

.marker-label{
  max-width:120px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:4px 8px;
  border:1px solid rgba(115,0,10,.15);
  border-radius:999px;
  color:var(--garnet, #73000a);
  background:#fff;
  font-size:12px;
  font-weight:800;
  line-height:1.25;
  box-shadow:0 4px 12px rgba(0,0,0,.18);
}

.food-marker:hover .marker-dot{
  background:var(--garnet-bright);
  transform:scale(1.08);
}

.food-marker:hover .marker-label{
  color:#fff;
  background:var(--garnet);
  border-color:var(--garnet);
}

.info-window{
  color:var(--text, #222);
  font:13px/1.45 Arial, Helvetica, sans-serif;
}

.info-window strong{
  color:var(--garnet, #73000a);
}

/* =========================================================
   Slides Panel
========================================================= */

.empty-state{
  margin:auto;
  padding:24px;
  text-align:center;
  color:var(--muted, #666);
}

.food-empty-state{
  max-width:360px;
}

.food-empty-state::before{
  content:"🍽️";
  display:block;
  margin-bottom:10px;
  font-size:42px;
  line-height:1;
}

.empty-state h2{
  margin:0 0 8px;
  color:var(--ink, #1f1f1f);
  font-size:22px;
  line-height:1.25;
}

.empty-state p{
  margin:0;
  font-size:13.5px;
  line-height:1.55;
}

.slides-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:12px;
  padding-bottom:12px;
  border-bottom:1px solid var(--line, #e8e3e3);
}

.slides-header h2{
  margin:0;
  color:var(--garnet);
  font-size:22px;
  line-height:1.2;
}

.slides-header h2 span{
  color:var(--muted, #666);
  font-size:15px;
  font-weight:600;
}

.slides-header p{
  margin:6px 0 0;
  color:var(--muted, #666);
  font-size:13.5px;
  line-height:1.5;
}

.slide-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  flex-shrink:0;
}

.slide-actions a{
  display:inline-block;
  padding:7px 11px;
  border:1px solid var(--line, #e8e3e3);
  border-radius:999px;
  background:var(--garnet, #73000a);
  color:#fff;
  font-size:12.5px;
  font-weight:800;
  line-height:1.2;
  text-decoration:none;
  white-space:nowrap;
  transition:
    background .15s ease,
    border-color .15s ease,
    transform .15s ease;
}

.slide-actions a:hover{
  background:var(--garnet-dark, #520007);
  border-color:var(--garnet-dark, #520007);
  text-decoration:none;
  transform:translateY(-1px);
}

.slide-actions a + a{
  background:#fff;
  color:var(--garnet, #73000a);
  border-color:rgba(115,0,10,.25);
}

.slide-actions a + a:hover{
  background:rgba(115,0,10,.06);
  color:var(--garnet, #73000a);
  border-color:rgba(115,0,10,.4);
}

.viewer-intro{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
}

.viewer-badge{
  display:inline-block;
  padding:5px 8px;
  border-radius:999px;
  color:var(--garnet);
  background:rgba(115,0,10,.07);
  font-weight:800;
  white-space:nowrap;
}

.viewer-help{
  text-align:right;
}

.slide-frame{
  width:100%;
  flex:1;
  min-height:560px;
  border:1px solid var(--line, #e8e3e3);
  border-radius:14px;
  background:#fff;
  box-shadow:var(--shadow-soft, 0 6px 18px rgba(0,0,0,.055));
  display:block;
}

/* =========================================================
   Heart Voting
========================================================= */

.heart-vote-box{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 12px;
  padding:12px;
  border:1px solid rgba(115,0,10,.16);
  border-radius:14px;
  background:
    radial-gradient(circle at 22px 22px, rgba(115,0,10,.10), transparent 38px),
    linear-gradient(90deg, rgba(115,0,10,.055), #fff);
  box-shadow:0 4px 14px rgba(0,0,0,.035);
}

.heart-vote-button{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:8px 12px;
  border:1px solid rgba(115,0,10,.24);
  border-radius:999px;
  background:#fff;
  color:var(--garnet, #73000a);
  font:inherit;
  font-size:13px;
  font-weight:900;
  line-height:1.2;
  cursor:pointer;
  transition:
    transform .15s ease,
    background .15s ease,
    color .15s ease,
    border-color .15s ease,
    box-shadow .15s ease;
}

.heart-vote-button:hover{
  background:var(--garnet, #73000a);
  color:#fff;
  border-color:var(--garnet, #73000a);
  box-shadow:0 6px 16px rgba(115,0,10,.18);
  transform:translateY(-1px);
}

.heart-vote-button:disabled{
  cursor:default;
  transform:none;
}

.heart-vote-button.has-voted{
  background:var(--garnet, #73000a);
  color:#fff;
  border-color:var(--garnet, #73000a);
  box-shadow:none;
}

.heart-symbol{
  font-size:20px;
  line-height:1;
}

.heart-vote-help{
  margin:7px 0 0;
  color:var(--muted, #666);
  font-size:12px;
  line-height:1.35;
}

.heart-count{
  min-width:88px;
  padding:8px 11px;
  border:1px solid rgba(115,0,10,.16);
  border-radius:999px;
  color:var(--garnet, #73000a);
  background:#fff;
  font-size:14px;
  font-weight:900;
  line-height:1.15;
  text-align:center;
  white-space:nowrap;
  box-shadow:0 3px 10px rgba(0,0,0,.035);
}

/* =========================================================
   Opening Popup
========================================================= */

.tour-vote-modal-open{
  overflow:hidden;
}

.tour-vote-popup[hidden]{
  display:none;
}

.tour-vote-popup{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:22px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}

.tour-vote-popup.is-open{
  opacity:1;
  pointer-events:auto;
}

.tour-vote-backdrop{
  position:absolute;
  inset:0;
  background:rgba(20, 10, 12, .48);
  backdrop-filter:blur(3px);
}

.tour-vote-card{
  position:relative;
  z-index:1;
  width:min(100%, 440px);
  max-height:calc(100vh - 44px);
  overflow:auto;
  padding:26px;
  border:1px solid rgba(115,0,10,.18);
  border-radius:22px;
  background:
    radial-gradient(circle at 36px 36px, rgba(115,0,10,.12), transparent 70px),
    #fff;
  box-shadow:0 24px 70px rgba(0,0,0,.28);
  transform:translateY(10px) scale(.98);
  transition:transform .18s ease;
}

.tour-vote-popup.is-open .tour-vote-card{
  transform:translateY(0) scale(1);
}

.tour-vote-close{
  position:absolute;
  top:12px;
  right:12px;
  width:36px;
  height:36px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--muted);
  cursor:pointer;
  font-size:23px;
  line-height:1;
  display:grid;
  place-items:center;
}

.tour-vote-close:hover{
  color:#fff;
  background:var(--garnet);
  border-color:var(--garnet);
}

.tour-vote-icon{
  width:62px;
  height:62px;
  display:grid;
  place-items:center;
  margin-bottom:12px;
  border:1px solid rgba(115,0,10,.16);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-soft);
  font-size:32px;
}

.tour-vote-card h2{
  margin:0 34px 8px 0;
  color:var(--garnet);
  font-size:25px;
  line-height:1.18;
}

.tour-vote-card p{
  margin:0 0 16px;
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}

.tour-vote-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.tour-vote-primary,
.tour-vote-secondary{
  min-height:42px;
  padding:10px 14px;
  border-radius:999px;
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.tour-vote-primary{
  border:1px solid var(--garnet);
  background:var(--garnet);
  color:#fff;
}

.tour-vote-primary:hover{
  background:var(--garnet-dark);
  border-color:var(--garnet-dark);
}

.tour-vote-secondary{
  border:1px solid rgba(115,0,10,.22);
  background:#fff;
  color:var(--garnet);
}

.tour-vote-secondary:hover{
  background:rgba(115,0,10,.06);
}

/* =========================================================
   Focus States
========================================================= */

.heart-vote-button:focus-visible,
.tour-vote-close:focus-visible,
.tour-vote-primary:focus-visible,
.tour-vote-secondary:focus-visible{
  outline:3px solid rgba(115,0,10,.28);
  outline-offset:2px;
}

/* =========================================================
   Responsive
========================================================= */

@media (max-width:1250px){
  .page-shell{
    grid-template-columns:280px minmax(0, 1fr);
  }

  .slides-panel{
    grid-column:1 / -1;
    min-height:640px;
  }

  .slide-frame{
    min-height:620px;
  }
}

@media (max-width:900px){
  .page-shell{
    grid-template-columns:1fr;
    padding-top:22px;
    padding-bottom:30px;
  }

  .sidebar,
  .map-card,
  .slides-panel{
    border-radius:12px;
  }

  .map-card,
  #map{
    min-height:560px;
  }

  .slides-panel{
    min-height:600px;
  }

  .slide-frame{
    min-height:520px;
  }

  .korean-title{
    font-size:30px;
  }

  .english-title{
    font-size:20px;
  }

  .sikdorak-sidebar .city-list{
    max-height:none;
  }

  .viewer-intro{
    align-items:flex-start;
    flex-direction:column;
  }

  .viewer-help{
    text-align:left;
  }
}

@media (max-width:700px){
  .topbar{
    align-items:flex-start;
    flex-direction:column;
    padding:18px var(--pad, 16px);
  }

  .topbar .site-name{
    font-size:22px;
  }

  .topbar nav{
    justify-content:flex-start;
    gap:14px;
  }

  .page-shell{
    padding-left:var(--pad, 16px);
    padding-right:var(--pad, 16px);
  }

  .sidebar{
    padding:14px;
  }

  .sidebar h1{
    font-size:21px;
  }

  .project-stats{
    grid-template-columns:1fr;
  }

  .city-list{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
  }

  .city-list-button{
    padding:10px 62px 10px 10px;
  }

  .city-heart-mini{
    right:8px;
  }

  .map-ribbon{
    top:10px;
    left:10px;
    font-size:11px;
  }

  .map-card,
  #map{
    min-height:500px;
  }

  .slides-panel{
    padding:14px;
    min-height:560px;
  }

  .slides-header,
  .heart-vote-box{
    align-items:flex-start;
    flex-direction:column;
  }

  .slide-actions{
    justify-content:flex-start;
  }

  .heart-count{
    min-width:0;
  }

  .slide-frame{
    min-height:480px;
  }
}

@media (max-width:520px){
  .topbar nav a{
    font-size:12px;
  }

  .page-shell{
    padding-top:18px;
    gap:16px;
  }

  .city-list{
    grid-template-columns:1fr;
  }

  .city-list-button{
    padding-right:68px;
  }

  .map-card,
  #map{
    min-height:440px;
  }

  .slides-panel{
    min-height:520px;
  }

  .slides-header h2{
    font-size:20px;
  }

  .slide-frame{
    min-height:430px;
  }

  .marker-label{
    max-width:96px;
    font-size:11px;
  }

  .tour-vote-popup{
    align-items:end;
    padding:14px;
  }

  .tour-vote-card{
    width:100%;
    max-height:calc(100vh - 28px);
    padding:22px;
    border-radius:20px;
  }

  .tour-vote-icon{
    width:54px;
    height:54px;
    border-radius:16px;
    font-size:29px;
  }

  .tour-vote-card h2{
    margin-right:34px;
    font-size:22px;
  }

  .tour-vote-card p{
    font-size:13.5px;
  }

  .tour-vote-actions{
    flex-direction:column;
  }

  .tour-vote-primary,
  .tour-vote-secondary{
    width:100%;
  }
}

@media (max-width:420px){
  .map-card,
  #map{
    min-height:400px;
  }

  .slide-frame{
    min-height:390px;
  }

  .tour-vote-card{
    padding:20px;
  }

  .tour-vote-card h2{
    font-size:21px;
  }
}

@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    transition:none !important;
  }
}