/* ==========================================
   CSS Variables
   ========================================== */
:root {
  --color-bg: #e6d8c5;
  --color-bg-sub: #e6e3d9;
  --color-accent: #95515e;
  --color-text: #333333;
  --color-gray: #555555;
  --color-white: #ffffff;
  --color-yellow: #ffe669;
  --color-blue-l: #73cbf3;
  --color-blue-m: #3e71ca;
  --color-pink: #ef91b9;
  --color-rose: #d68f8d;
  --color-brown: #653824;
  --header-h: 48px;
  --nav-h: 56px;
  --pc-nav-w-collapsed: 56px;
  --pc-nav-w-expanded: 180px;
}

/* ==========================================
   Base
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family:
    "Roboto", "Zen Kaku Gothic Antique", "游ゴシック体", "Yu Gothic", YuGothic,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

/* ==========================================
   App Container (flex column, max 480px)
   ========================================== */
.app_container {
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ==========================================
   Header
   ========================================== */
.app_header {
  height: var(--header-h);
  flex-shrink: 0;
  background: var(--color-bg);
  border-bottom: 1px solid #cccccc;
  display: flex;
  align-items: center;
  padding: 0 7.5px;
  position: relative;
}

.app_header_logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-brown);
  letter-spacing: 0.05em;
  height: 48px;
  padding: 11px 0;
}
.app_header_logo img {
  height: 100%;
}

.app_header_tab {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  pointer-events: none;
}

@keyframes headerTabIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.app_header_tab.tab-changed {
  animation: headerTabIn 0.2s ease both;
}

.app_header:has(~ .bottom_nav .is_active[data-tab="magazine"]) {
  display: none;
}

/* ==========================================
   Main / Tab System
   ========================================== */
.app_main {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.tab_content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  visibility: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tab_content.is_active {
  visibility: visible;
  position: relative;
  z-index: 1;
}

.tab_iframe_wrap {
  overflow: hidden;
}

.tab_iframe_wrap.is_active {
  overflow: hidden;
}

.tab_iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.tab_scroll_inner {
  padding: 16px;
}

/* ==========================================
   Bottom Navigation
   ========================================== */
.bottom_nav {
  flex-shrink: 0;
  background: var(--color-bg-sub);
  border-top: solid 0.1px #cccccc;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
}

.bottom_nav_btn {
  flex: 1;
  height: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--color-gray);
  padding: 0 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease;
}

.bottom_nav_btn:active {
  transform: scale(0.88);
}

.bottom_nav_btn.is_active {
  color: var(--color-accent);
}
.bottom_nav_btn.is_active .bottom_nav_icon::before {
  background-color: transparent;
}

.bottom_nav_icon::before {
  font-family: "Material Symbols Rounded";
  font-variation-settings:
    "FILL" 0,
    "wght" 300,
    "GRAD" 0,
    "opsz" 24;
  font-size: 28px;
  line-height: 1;
  display: block;
  padding-inline: 14px;
  border-radius: 40px;
  transition: font-variation-settings 0.25s ease;
}

.bottom_nav_btn.is_active .bottom_nav_icon::before {
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.bottom_nav_btn[data-tab="home"] .bottom_nav_icon::before {
  content: "home";
}
.bottom_nav_btn[data-tab="map"] .bottom_nav_icon::before {
  content: "map";
}
.bottom_nav_btn[data-tab="event"] .bottom_nav_icon::before {
  content: "event";
}
.bottom_nav_btn[data-tab="more"] .bottom_nav_icon::before {
  content: "apps";
}
.bottom_nav_btn[data-tab="magazine"] .bottom_nav_icon::before {
  content: "newspaper";
}

.bottom_nav_label {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

/* ==========================================
   Common States
   ========================================== */
.state_loading,
.state_empty,
.state_error {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--color-gray);
}

.state_error {
  color: var(--color-accent);
}

/* ==========================================
   Common: Section Header
   ========================================== */
.section_header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-left: 4px;
}

.section_title {
  font-size: 16px;
  font-weight: 900;
}

.section_link {
  font-size: 14px;
  color: var(--color-accent);
}

/* ==========================================
   Common: Weather Icon (data-icon attr)
   ========================================== */
.weather_icon::before {
  font-family: "Material Symbols Rounded";
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  content: attr(data-icon);
  line-height: 1;
  display: block;
}

/* ==========================================
   Home Tab
   ========================================== */
.home_section {
  margin-bottom: 36px;
}

.home_section_last {
  margin-bottom: 0;
}

/* Home: Weather Card */
.home_weather_card {
  background: var(--color-bg-sub);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.home_weather_top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home_weather_icon::before {
  font-size: 88px;
}

.home_weather_info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home_weather_label {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.05em;
}

.home_weather_date {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.home_weather_dow {
  font-size: 16px;
  font-weight: 400;
  color: var(--color-gray);
}

.home_weather_temps {
  margin-top: 8px;
}

.home_weather_high {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--color-accent);
}

.home_weather_low {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--color-blue-m);
}

.home_weather_bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.home_weather_desc {
  font-size: 16px;
  color: var(--color-gray);
}

.home_weather_rain {
  font-size: 16px;
  color: var(--color-gray);
}

.home_weather_wind {
  font-size: 16px;
  color: var(--color-gray);
}

.home_weather_link {
  width: 100%;
  text-align: center;
}

/* Home: Event Items */
.home_event_wrap {
  border-top: solid 1px #ccc;
}
.home_event_item {
  padding: 12px 4px;
  display: block;
  color: var(--color-text);
  border-bottom: solid 1px #ccc;
}

.home_event_item:last-child {
  margin-bottom: 0;
}

.home_event_date {
  font-size: 14px;
  color: var(--color-gray);
  margin-bottom: 6px;
}

.home_event_title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.home_event_location {
  font-size: 14px;
  color: var(--color-gray);

  display: flex;
  align-items: center;
  gap: 4px;
}
.home_event_location:before {
  content: "\e55f";
  color: var(--color-accent);
  font-family: "Material Symbols Rounded";
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  font-size: 16px;
  line-height: 1;
  display: inline-block;
}

/* Home: RSS Feed Grid */
.feed_grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feed_item {
  background: var(--color-bg);
  border: 1px solid #ccc;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: var(--color-text);
}

.feed_item_thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex-shrink: 0;
}

.feed_item_thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feed_item_body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.feed_source {
  display: none;
  font-size: 12px;
  color: var(--color-accent);
  font-weight: 700;
}

.feed_title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed_date {
  font-size: 12px;
  color: var(--color-gray);
  margin-top: auto;
}

.adsbygoogle {
  display: none !important;
}

/* ==========================================
   Interactions & Animations
   ========================================== */

/* グライダーピル — アクティブタブ背景がスライド */
.bottom_nav_glider {
  position: absolute;
  top: 6px;
  height: 30px;
  border-radius: 40px;
  background-color: #e1cace;
  transition: left 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 0;
}

/* アイコンバウンス */
@keyframes navIconBounce {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.32);
  }
  60% {
    transform: scale(0.88);
  }
  80% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

.bottom_nav_icon.bounce-anim {
  animation: navIconBounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* リップル波紋 */
.nav_ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(149, 81, 94, 0.18);
  transform: scale(0);
  animation: navRipple 0.52s ease-out forwards;
  pointer-events: none;
}

@keyframes navRipple {
  to {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* タブスライドイン */
@keyframes tabSlideFromRight {
  from {
    opacity: 0;
    transform: translateX(28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes tabSlideFromLeft {
  from {
    opacity: 0;
    transform: translateX(-28px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tab_content.is_active.slide-from-right {
  animation: tabSlideFromRight 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.tab_content.is_active.slide-from-left {
  animation: tabSlideFromLeft 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* フィードカード ホバー・タップ */
.feed_item {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

@media (hover: hover) {
  .feed_item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  }
}

.feed_item:active {
  transform: scale(0.97);
  box-shadow: none;
}

/* イベント行 ホバー */
.home_event_item {
  transition: background-color 0.15s ease;
}

@media (hover: hover) {
  .home_event_item:hover {
    background-color: rgba(149, 81, 94, 0.05);
  }
}

.home_event_item:active {
  background-color: rgba(149, 81, 94, 0.09);
}

/* ==========================================
   More Tab / Sub-tabs
   ========================================== */
#js-tab-more {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#js-tab-more.is_active {
  height: 100%;
}

.subtab_nav {
  flex-shrink: 0;
  display: flex;
  border-bottom: 1px solid #cccccc;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.subtab_nav::-webkit-scrollbar {
  display: none;
}

.subtab_btn {
  flex-shrink: 0;
  padding: 0 16px;
  height: 44px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-gray);
  position: relative;
  overflow: hidden;
  transition:
    color 0.2s ease,
    transform 0.12s ease;
}

.subtab_btn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-accent);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: none;
}

.subtab_btn.is_active {
  color: var(--color-accent);
}

.subtab_btn.is_active::after {
  transform: scaleX(1);
}

.subtab_btn:active {
  transform: scale(0.9);
}

.subtab_panels {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.subtab_panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.subtab_panel.is_active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.subtab_panel.is_active.slide-from-right {
  animation: tabSlideFromRight 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.subtab_panel.is_active.slide-from-left {
  animation: tabSlideFromLeft 0.28s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* ==========================================
   PC Layout (≥ 1200px)
   ========================================== */
.pc_side_nav,
.pc_magazine_col {
  display: none;
}

@media (min-width: 1200px) {
  .app_container {
    max-width: 1440px;
    margin: 0 auto;
    height: 100dvh;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 0px 1fr;
    grid-template-areas:
      "header  header"
      "sidenav content";
  }

  .app_header {
    grid-area: header;
    display: flex;
    display: none;
  }

  .app_main {
    grid-area: content;
    overflow: hidden;
    position: relative;
  }

  .bottom_nav {
    display: none;
  }

  .pc_side_nav {
    grid-area: sidenav;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid #cccccc;
    width: var(--pc-nav-w-expanded);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 0 8px;
  }

  .app_container.is_nav_collapsed .pc_side_nav {
    width: var(--pc-nav-w-collapsed);
  }

  .pc_nav_logo {
    width: var(--pc-nav-w-expanded);
    overflow: hidden;
    padding: 10px 26px 10px 12px;
    margin-right: 14px;
  }
  .app_container.is_nav_collapsed .pc_nav_logo {
    /* height: 54px;
    aspect-ratio: 1/1;
    object-fit: cover;
    overflow: hidden; */

    img {
      height: 34px;
      aspect-ratio: 1/1;
      object-fit: cover;
      object-position: left;
      overflow: hidden;
    }
  }

  .pc_nav_btn,
  .pc_nav_toggle {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-gray);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    transition:
      color 0.15s ease,
      background-color 0.15s ease;
  }

  .pc_nav_btn.is_active {
    color: var(--color-accent);
  }

  .pc_nav_icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pc_nav_icon::before {
    font-family: "Material Symbols Rounded";
    font-variation-settings:
      "FILL" 0,
      "wght" 300,
      "GRAD" 0,
      "opsz" 24;
    font-size: 24px;
    line-height: 1;
    display: block;
    transition: font-variation-settings 0.25s ease;
  }

  .pc_nav_btn.is_active .pc_nav_icon::before {
    font-variation-settings:
      "FILL" 1,
      "wght" 400,
      "GRAD" 0,
      "opsz" 24;
  }

  .pc_nav_btn[data-hash="home"] .pc_nav_icon::before {
    content: "home";
  }
  .pc_nav_btn[data-hash="map"] .pc_nav_icon::before {
    content: "map";
  }
  .pc_nav_btn[data-hash="magazine"] .pc_nav_icon::before {
    content: "newspaper";
  }
  .pc_nav_btn[data-hash="event"] .pc_nav_icon::before {
    content: "event";
  }
  .pc_nav_btn[data-hash="more-weather"] .pc_nav_icon::before {
    content: "partly_cloudy_day";
  }
  .pc_nav_btn[data-hash="more-info"] .pc_nav_icon::before {
    content: "store";
  }
  .pc_nav_btn[data-hash="more-news"] .pc_nav_icon::before {
    content: "article";
  }

  .pc_nav_divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 20px;
    flex-shrink: 0;
  }

  .pc_nav_toggle {
    font-size: 14px;
    margin-top: auto;
    flex-shrink: 0;
  }

  .pc_nav_toggle .pc_nav_icon::before {
    content: "keyboard_double_arrow_left";
  }

  .app_container.is_nav_collapsed .pc_nav_toggle .pc_nav_icon::before {
    content: "keyboard_double_arrow_right";
  }

  .subtab_nav {
    display: none;
  }

  .tab_home {
    max-width: 560px;
    margin-inline: auto;
  }
}

@media (min-width: 1200px) and (hover: hover) {
  .app_container.is_nav_collapsed .pc_side_nav:hover {
    width: var(--pc-nav-w-expanded);
    border-right: none;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }
  .app_container.is_nav_collapsed .pc_side_nav:hover .pc_nav_logo {
    img {
      overflow: visible;
    }
  }

  .pc_nav_btn:hover,
  .pc_nav_toggle:hover {
    background-color: rgba(149, 81, 94, 0.06);
    color: var(--color-text);
  }

  .pc_nav_btn.is_active:hover {
    color: var(--color-accent);
  }
}
