/**
 * Gantomo SNS — モバイル最適化・下部タブバー
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.gantomo-sns-theme {
  overflow-x: clip;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

img,
video,
iframe,
svg {
  max-width: 100%;
  height: auto;
}

/* --- 下部タブバー --- */
.gs-mobile-tabbar {
  display: none;
}

@media (max-width: 768px) {
  .gs-platform-nav {
    display: none;
  }

  .gs-mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: calc(var(--gs-tabbar-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--gs-line);
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 12px rgba(15, 20, 25, 0.06);
  }

  .gs-mobile-tabbar__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.25rem;
    text-decoration: none;
    color: var(--gs-ink-muted);
    font-size: 0.68rem;
    font-weight: 600;
    transition: color 0.12s ease;
  }

  .gs-mobile-tabbar__item.is-active {
    color: var(--gs-accent);
  }

  .gs-mobile-tabbar__item--sns.is-active { color: var(--gs-pillar-sns); }
  .gs-mobile-tabbar__item--news.is-active { color: var(--gs-pillar-news); }
  .gs-mobile-tabbar__item--forum.is-active { color: var(--gs-pillar-forum); }
  .gs-mobile-tabbar__item--chat.is-active { color: var(--gs-pillar-chat); }
  .gs-mobile-tabbar__item--profile.is-active { color: var(--gs-ink); }

  .gs-mobile-tabbar__icon {
    font-size: 1.15rem;
    line-height: 1;
  }

  body.gantomo-sns-shell.gantomo-sns-readylaunch {
    padding-bottom: calc(var(--gs-tabbar-height) + env(safe-area-inset-bottom));
  }

  /* RL ヘッダー コンパクト化 */
  body.gantomo-sns-readylaunch .bb-rl-header {
    min-height: 48px !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
  }

  body.gantomo-sns-readylaunch .bb-rl-header .bb-rl-site-branding img,
  body.gantomo-sns-readylaunch .bb-rl-header .bb-rl-site-branding .site-title {
    max-height: 28px !important;
    font-size: 0.95rem !important;
  }

  body.gantomo-sns-readylaunch .bb-rl-header .bb-rl-site-branding .logo--community .gs-community-logo__name {
    font-size: 1.2rem !important;
  }

  body.gantomo-sns-readylaunch .bb-rl-header .bb-rl-site-branding .logo--community .gs-community-logo__tagline {
    font-size: 0.72rem !important;
  }

  body.gantomo-sns-readylaunch .bb-rl-left-panel {
    display: none !important;
  }

  body.gantomo-has-crossnav .gantomo-site-header .gantomo-crossnav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  body.gantomo-has-crossnav .gantomo-site-header .gantomo-crossnav::-webkit-scrollbar {
    display: none;
  }

  .gs-main {
    padding: 0.75rem;
  }

  .gs-card {
    padding: 1rem;
  }
}

@media (min-width: 769px) {
  .gs-mobile-tabbar {
    display: none !important;
  }
}
