/* ============================================================
   BUKHANSAN DULLE-GIL — STYLE SHEET
   Mobile-first responsive design
   ============================================================ */

/* ---- Variables ---- */
:root {
  --green-dark:   #2d6a4f;
  --green-darker: #1b4332;
  --green-mid:    #40916c;
  --green-light:  #74c69d;
  --green-pale:   #d8f3dc;
  --green-bg:     #f0f4f2;
  --red-marker:   #e63946;
  --orange-mid:   #e07b39;
  --gray-900:     #1a1a1a;
  --gray-700:     #444;
  --gray-500:     #777;
  --gray-300:     #d0d0d0;
  --gray-100:     #f5f5f5;
  --white:        #fff;
  --sidebar-w:    268px;
  --header-h:     60px;
  --radius:       10px;
  --shadow-sm:    0 1px 6px rgba(0,0,0,.07);
  --shadow-md:    0 4px 18px rgba(0,0,0,.12);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.15);
  --transition:   .18s ease;
  --font: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--green-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--header-h);
  background: linear-gradient(135deg, var(--green-darker) 0%, var(--green-dark) 55%, var(--green-mid) 100%);
  color: var(--white);
  box-shadow: 0 2px 20px rgba(0,0,0,.22);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-icon { font-size: 1.5rem; filter: drop-shadow(0 1px 3px rgba(0,0,0,.3)); }
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand-title {
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -.3px;
}
.brand-subtitle {
  font-size: .72rem;
  opacity: .75;
  letter-spacing: .3px;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile course dropdown (hidden on desktop) */
.mobile-course-select { display: flex; }
.mobile-course-select select {
  border: 1.5px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12);
  color: var(--white);
  padding: 6px 10px;
  border-radius: 7px;
  font-size: .82rem;
  max-width: 170px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}
.mobile-course-select select option { background: var(--green-dark); color: var(--white); }

/* Language toggle */
.lang-toggle {
  display: flex;
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 7px;
  overflow: hidden;
}
.lang-btn {
  background: transparent;
  color: rgba(255,255,255,.65);
  border: none;
  padding: 5px 12px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .5px;
  transition: background var(--transition), color var(--transition);
}
.lang-btn.active {
  background: rgba(255,255,255,.25);
  color: var(--white);
}
.lang-btn:hover:not(.active) { background: rgba(255,255,255,.12); }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout {
  flex: 1;
  display: flex;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-h) - 40px);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.course-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid rgba(0,0,0,.08);
  box-shadow: 2px 0 16px rgba(0,0,0,.07);
  overflow-y: auto;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
}
.sidebar-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--gray-300);
  background: linear-gradient(135deg, var(--green-pale), #e8f5eb);
}
.sidebar-title {
  font-size: .82rem;
  font-weight: 800;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: .8px;
}
.course-list {
  display: flex;
  flex-direction: column;
}
.course-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,.05);
  transition: background var(--transition), padding-left var(--transition);
}
.course-list-item:hover {
  background: var(--green-pale);
  padding-left: 20px;
}
.course-list-item.active {
  background: linear-gradient(135deg, var(--green-darker), var(--green-dark));
  color: var(--white);
  padding-left: 20px;
}
.course-list-item.active .item-num { background: rgba(255,255,255,.22); color: var(--white); }
.item-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-name {
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.3;
}
.item-dist {
  margin-left: auto;
  font-size: .72rem;
  color: var(--gray-500);
  flex-shrink: 0;
}
.course-list-item.active .item-dist { color: rgba(255,255,255,.65); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 60vh;
  gap: 16px;
  color: var(--gray-500);
  text-align: center;
  padding: 24px;
}
.empty-icon { font-size: 3.5rem; filter: grayscale(.3); }
.empty-state p { font-size: .95rem; max-width: 280px; line-height: 1.65; }

/* Course detail wrapper */
.course-detail { padding-bottom: 48px; }

/* Course header */
.course-header {
  background: var(--white);
  padding: 22px 28px 20px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  border-left: 4px solid var(--green-mid);
  box-shadow: var(--shadow-sm);
}
.course-title-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.course-number {
  font-size: .78rem;
  font-weight: 700;
  color: var(--green-mid);
  background: var(--green-pale);
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  border: 1px solid rgba(64,145,108,.2);
}
.course-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -.3px;
}
.course-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.stat-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--green-bg);
  border: 1px solid rgba(64,145,108,.15);
  border-radius: 8px;
  padding: 7px 14px;
}
.stat-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-500);
  font-weight: 700;
}
.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}
.stat-difficulty.easy     { color: #2d6a4f; }
.stat-difficulty.moderate { color: #c06a10; }
.stat-difficulty.hard     { color: var(--red-marker); }
.course-description {
  margin-top: 16px;
  font-size: .95rem;
  line-height: 1.78;
  color: var(--gray-700);
  max-width: 680px;
}

/* ============================================================
   MAP
   ============================================================ */
.map-wrapper {
  position: relative;
  width: 100%;
  height: 420px;
  background: var(--gray-300);
  box-shadow: 0 2px 12px rgba(0,0,0,.08) inset;
}
#kakao-map {
  width: 100%;
  height: 100%;
}

/* ============================================================
   SECTION BLOCKS (shared)
   ============================================================ */
.section-block {
  padding: 24px 28px 22px;
  background: var(--white);
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
}
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-pale);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: linear-gradient(to bottom, var(--green-light), var(--green-dark));
  border-radius: 2px;
}

/* ============================================================
   HOW TO GET THERE
   ============================================================ */
.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.access-card {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.access-card:hover { box-shadow: var(--shadow-md); }
.access-start { border-top: 3px solid var(--green-mid); }
.access-end   { border-top: 3px solid var(--red-marker); }
.access-card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.access-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: .8rem;
  flex-shrink: 0;
  color: var(--white);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.start-badge { background: linear-gradient(135deg, var(--green-mid), var(--green-dark)); }
.end-badge   { background: linear-gradient(135deg, #f25f6a, var(--red-marker)); }
.access-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.access-role {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-500);
}
.access-node-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--gray-900);
}
.access-transit {
  font-size: .82rem;
  line-height: 1.7;
  color: var(--gray-700);
}
.access-transit .transit-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.transit-icon {
  flex-shrink: 0;
  font-weight: 700;
  font-size: .74rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 2px;
}
.transit-icon.subway { background: #003499; color: var(--white); }
.transit-icon.bus    { background: #3a6b00; color: var(--white); }

.btn-directions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 600;
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
  color: var(--white);
  margin-top: auto;
}
.btn-directions:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.btn-start {
  background: linear-gradient(135deg, var(--green-mid), var(--green-dark));
  box-shadow: 0 2px 8px rgba(64,145,108,.35);
}
.btn-end {
  background: linear-gradient(135deg, #f25f6a, var(--red-marker));
  box-shadow: 0 2px 8px rgba(230,57,70,.35);
}
.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: currentColor;
}

/* ============================================================
   PHOTO GALLERY
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.photo-item {
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  aspect-ratio: 4/3;
  background: var(--gray-300);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.photo-item:hover { transform: scale(1.025); box-shadow: var(--shadow-md); }
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: var(--white);
  font-size: .8rem;
  padding: 24px 10px 10px;
  line-height: 1.3;
}
.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #e8f5eb, var(--green-pale));
  color: var(--green-dark);
  font-size: .8rem;
  text-align: center;
  padding: 8px;
}
.photo-placeholder-icon { font-size: 2.2rem; }
.photo-credit {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: .58rem;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.38);
  padding: 2px 5px;
  border-radius: 3px;
  line-height: 1.3;
  text-decoration: none;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.photo-credit:hover { color: rgba(255,255,255,.9); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.88);
  z-index: 900;
  backdrop-filter: blur(3px);
}
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 901;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
}
.lightbox.open, .lightbox-overlay.open { display: flex; }
.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 50px rgba(0,0,0,.6);
}
.lightbox-caption {
  color: rgba(255,255,255,.88);
  font-size: .9rem;
  text-align: center;
  max-width: 500px;
}
.lightbox-credit {
  color: rgba(255,255,255,.5);
  font-size: .72rem;
  text-align: center;
  max-width: 500px;
}
.lightbox-credit a { color: rgba(255,255,255,.68); text-decoration: underline; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: var(--white);
  font-size: 1.4rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .75;
  transition: opacity var(--transition), background var(--transition);
}
.lightbox-close:hover { opacity: 1; background: rgba(255,255,255,.2); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: linear-gradient(135deg, var(--green-darker), var(--green-dark));
  color: rgba(255,255,255,.55);
  text-align: center;
  font-size: .78rem;
  padding: 16px;
  letter-spacing: .5px;
}

/* ============================================================
   RESPONSIVE — TABLET (< 900px)
   ============================================================ */
@media (max-width: 900px) {
  .app-layout { flex-direction: column; }
  .course-sidebar { display: none; }
  .main-content { overflow-y: visible; }
  .map-wrapper { height: 320px; }
  .access-grid { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .course-header { padding: 18px 20px 16px; }
  .section-block { padding: 20px 20px 18px; }
}

/* ============================================================
   RESPONSIVE — MOBILE (< 600px)
   ============================================================ */
@media (max-width: 600px) {
  .brand-subtitle { display: none; }
  .course-header { padding: 14px 16px; border-left-width: 3px; }
  .course-title { font-size: 1.15rem; }
  .section-block { padding: 18px 16px 16px; }
  .map-wrapper { height: 260px; }
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .course-stats { gap: 8px; }
  .stat-item { padding: 6px 10px; }
}

/* ============================================================
   RESPONSIVE — WIDE (> 900px): show sidebar, hide mobile dropdown
   ============================================================ */
@media (min-width: 901px) {
  .mobile-course-select { display: none; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
