/* 3초 여행 — Redesign Layout
 * Mobile-first app shell.  Soft cream base, central scrollable main,
 * fixed bottom nav with safe-area insets.
 */

:root {
  /* Brand — 그래파이트: 흑연색 바탕에 은은한 하늘빛 한 줄기 (앱 아이콘 09D) */
  --c-primary:        #1F242B;
  --c-on-ink:         #FFFFFF;   /* 진한 바탕(--c-primary/--c-text) 위 글자 — 다크에서는 어둡게 */
  --c-primary-strong: #111418;
  --c-accent:         #3A4652;
  --c-mint:           #A9C4E2;
  --c-sky:            #DCE8F5;
  --c-blue:           #3A6EA5;   /* 로고의 숫자 3 색 — 강조에만 쓴다 */

  /* Surface — 쿨 뉴트럴(사진의 청록과 어우러지게, 따뜻한 크림 캐스트 제거) */
  --c-bg:             #F5F6F8;
  --c-surface:        #FFFFFF;
  --c-surface-2:      #EFF1F4;
  --c-border:         #E2E5EA;
  --c-divider:        #EAEDF1;

  /* Text */
  --c-text:           #15181D;
  --c-text-soft:      #5F6670;
  --c-text-mute:      #8B929B;

  /* States */
  --c-focus:          #3A6EA5;
  --c-danger:         #EF4444;
  --c-success:        #10B981;

  /* Gradients */
  /* 사진 로딩 전 플레이스홀더 — 흑연색 위에 도시마다 살짝 다른 빛 (채도를 낮춰 아이콘과 맞춤) */
  --g-hero:    linear-gradient(135deg, #111418 0%, #1F2A36 100%);
  --g-tokyo:   linear-gradient(135deg, #3B4A57 0%, #14181D 100%);
  --g-paris:   linear-gradient(135deg, #46597A 0%, #151A24 100%);
  --g-jeju:    linear-gradient(135deg, #3F6A67 0%, #131D1D 100%);
  --g-osaka:   linear-gradient(135deg, #3E5C61 0%, #141B1D 100%);
  --g-bangkok: linear-gradient(135deg, #3A6383 0%, #141C25 100%);
  --g-seoul:   linear-gradient(135deg, #4D5573 0%, #171A26 100%);
  --g-newyork: linear-gradient(135deg, #434C52 0%, #121518 100%);
  --g-sydney:  linear-gradient(135deg, #3A6779 0%, #121B21 100%);

  /* Sizes */
  --topbar-h: 50px;   /* base (mobile); grows per breakpoint in redesign-responsive.css */
  --nav-h:    68px;
  /* Unified content axis — every centered element (topbar, main, page-scroll,
   * bottom-tab-nav) shares this max-width.  Overridden per breakpoint in
   * redesign-responsive.css so the axis stays consistent. */
  --app-content-max: 100%;
  --app-side-padding: 16px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 6px rgba(0,0,0,.05);
  --shadow-md: 0 8px 24px rgba(20, 30, 45, .10);
  --shadow-lg: 0 12px 36px rgba(20, 30, 45, .16);

  /* Safe area */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===================== APP SHELL =====================
 * Mobile-first: shell fills viewport.
 * Wider devices: shell still spans full width but content (page-scroll +
 *   bottom-tab-nav) gets a max-width.  This means no fixed "phone frame".
 */
.app-shell {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: 100%;
  margin: 0 auto;
  background: var(--c-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===================== TOP BAR =====================
 * Symmetric grid keeps content centered.  Width is bounded by
 * --app-content-max so it shares the same center axis as .app-main and
 * .bottom-tab-nav.  Height collapses to just safe-area inset on tab
 * pages where the back button is hidden (no wasted empty space).
 */
.app-topbar {
  flex: 0 0 auto;
  width: 100%;
  max-width: var(--app-content-max);
  margin-inline: auto;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: var(--c-bg);
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding-left: 8px;
  padding-right: 8px;
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--c-divider);
}
/* Brand lockup pinned to the top-center of every page (logo mark + name).
 * The topbar no longer collapses on tab pages — the brand stays visible
 * everywhere.  Centered because the 44px back/spacer columns are symmetric. */
.topbar-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
  padding-top: var(--safe-top);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  z-index: 1;            /* sits above the (empty) grid cells, below nothing else */
}
/* Single wordmark logo — height scales with --topbar-h (set per breakpoint
 * in redesign-responsive.css) so it grows on larger browsers. */
.topbar-brand-logo {
  display: block;
  width: auto;
  height: calc(var(--topbar-h) - 18px);
  max-height: 56px;
}

.topbar-back {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
  transition: background .15s;
}
.topbar-back:hover { background: rgba(0,0,0,.04); }

/* Accessibility — title stays in DOM for screen readers / aria-live, but is
 * visually hidden so the top-left no longer shows a duplicate page name. */
.sr-only,
.topbar-title.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.topbar-spacer { width: 40px; height: 40px; }

/* ===================== MAIN / PAGES =====================
 * Main is bounded by --app-content-max and centered.  Pages and
 * .page-scroll inside therefore fill that bounded width — no per-child
 * max-width hack needed.  Bottom-tab-nav uses the same variable so
 * everything sits on the same center axis.
 */
.app-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--app-content-max);
  margin-inline: auto;
  position: relative;
  overflow: hidden;
}

.app-page {
  position: absolute;
  inset: 0;
  display: none;
  background: var(--c-bg);
  overflow: hidden;
}
.app-page.is-active { display: block; }

.page-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px var(--app-side-padding) calc(var(--nav-h) + var(--safe-bottom) + 24px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.page-scroll > * { min-width: 0; }   /* allow text to wrap inside grid/flex children */
.page-scroll::-webkit-scrollbar { width: 4px; }
.page-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,.1); border-radius: 4px; }

.page-header {
  margin: 6px 0 14px;
}
.page-header.schedule-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
}
.page-title {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--c-text);
}
.page-sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--c-text-soft);
}

.section-block { margin: 28px 0; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--c-text);
  letter-spacing: -.02em;
}
.section-more {
  font-size: 13px;
  color: var(--c-primary-strong);
  font-weight: 600;
}

/* ===================== BOTTOM NAV ===================== */
.bottom-tab-nav {
  flex: 0 0 auto;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  padding-inline: var(--app-side-padding);    /* gutters match .page-scroll */
  width: 100%;
  max-width: var(--app-content-max);          /* same axis as topbar + main */
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr 84px 1fr 1fr;
  align-items: stretch;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--c-divider);
  position: relative;
  z-index: 50;
  box-shadow: 0 -4px 20px rgba(0,0,0,.04);
}

.tab-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--c-text-mute);
  font-size: 11px;
  font-weight: 600;
  height: var(--nav-h);
  transition: color .15s, transform .15s;
}
.tab-button .tab-ico { transition: transform .15s; }
.tab-button.is-active { color: var(--c-primary-strong); }
.tab-button.is-active .tab-ico { transform: translateY(-1px); }
.tab-button:active .tab-ico { transform: scale(.94); }

.tab-fab-button {
  align-self: center;
  width: 60px;
  height: 60px;
  margin: 0 auto;
  margin-top: -22px;
  border-radius: 50%;
  background: var(--c-primary);
  color: var(--c-on-ink);
  font-size: 30px;
  font-weight: 300;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(17,20,24,.22), 0 0 0 4px var(--c-bg);
  transition: transform .18s ease;
}
.tab-fab-button:active { transform: scale(.94); }
.fab-plus { line-height: 1; margin-top: -3px; }
