/* layout.css: アプリシェル・全体配置
   ヘッダー固定 / 本文スクロール / 下部ナビ固定 のモバイルファースト構成。 */

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: var(--content-max);
  margin: 0 auto;
  background: var(--c-bg);
}

/* --- ヘッダー --- */
.app-header {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) var(--sp-4);
  padding-top: calc(var(--sp-3) + env(safe-area-inset-top, 0px));
  background: var(--c-primary);
  color: #fff;
  box-shadow: var(--shadow-card);
}

/* 今日の天気バッジ (ヘッダー右) */
.weather-badge {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
}

.app-title {
  font-size: var(--fs-lg);
  letter-spacing: 0.06em;
}

/* --- 本文 (シーンの入れ物。ナビ高さ分の余白を確保) --- */
.app-main {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-4);
  padding-bottom: calc(var(--nav-h) + var(--sp-4) + env(safe-area-inset-bottom, 0px));
}

.scene {
  animation: scene-in 0.18s ease-out;
}

@keyframes scene-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* --- 下部ナビ (固定) --- */
.main-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--content-max);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: var(--c-surface);
  border-top: 2px solid var(--c-border);
  box-shadow: 0 -2px 8px var(--c-shadow);
  z-index: 100;
}

.nav-btn {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  font-size: var(--fs-base);
  font-weight: 700;
  transition: color 0.15s, background 0.15s;
}

.nav-btn.is-active {
  color: var(--c-primary-dark);
  background: var(--c-surface-alt);
  box-shadow: inset 0 -3px 0 var(--c-primary);
}
