/**
 * Gantomo SNS — 3カラムシェル・フィード幅・右レール
 */

body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-primary-container {
  max-width: var(--gs-shell-max) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: var(--gs-content-pad) !important;
  padding-right: var(--gs-content-pad) !important;
  gap: 1rem !important;
  display: grid !important;
  grid-template-columns: minmax(12rem, var(--gs-rail-w)) minmax(0, 1fr) minmax(12rem, var(--gs-rail-w)) !important;
  align-items: start !important;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-left-panel,
body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-left-sidebar {
  width: auto !important;
  min-width: 0 !important;
  max-width: var(--gs-rail-w) !important;
  flex-shrink: 0 !important;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-content-area,
body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-main {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-left-panel {
  grid-column: 1 !important;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-content-area,
body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-main {
  grid-column: 2 !important;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-right-sidebar,
body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-right-panel,
body.gantomo-sns-shell.gantomo-sns-readylaunch .gs-discovery-slot {
  grid-column: 3 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: var(--gs-rail-w) !important;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .activity-list,
body.gantomo-sns-shell.gantomo-sns-readylaunch .activity-item,
body.gantomo-sns-shell.gantomo-sns-readylaunch .activity-content,
body.gantomo-sns-shell.gantomo-sns-readylaunch .activity-header,
body.gantomo-sns-shell.gantomo-sns-readylaunch .bp-list li {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: break-word;
  word-break: normal;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .activity-list .activity-item {
  margin-bottom: 0.5rem !important;
  border-radius: 0 !important;
  border-top: 3px solid var(--gs-accent) !important;
}

body.gantomo-sns-shell.gantomo-sns-readylaunch .activity-list .activity-item + .activity-item {
  margin-top: 0 !important;
}

/* --- プラットフォーム切替ナビ --- */
/* 横断ナビがあるときは二重バーにしない */
body:has(#gantomo-crossnav) #gs-platform-nav {
  display: none !important;
}

.gs-platform-nav {
  position: relative;
  top: auto;
  z-index: 1;
  min-height: 0;
  max-height: 40px;
  margin-top: 0;
  background: linear-gradient(90deg, #3ecbff 0%, #6ea8ff 52%, #ff8ec8 100%);
  border-bottom: 0;
  backdrop-filter: none;
}

body.gantomo-sns-readylaunch .bb-rl-header.gantomo-header-with-nav {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  background: #fff8f0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.gantomo-sns-readylaunch .bb-rl-header.gantomo-header-with-nav .bb-rl-header-container {
  flex: 0 0 52px;
  width: 100%;
  min-height: 52px;
  height: 52px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

body.gantomo-sns-readylaunch .bb-rl-header.gantomo-header-with-nav .gs-platform-nav {
  flex: 0 0 40px;
  position: relative !important;
  top: auto !important;
  margin: 0 !important;
  width: 100%;
}

body.gantomo-sns-has-platform-nav.gantomo-sns-readylaunch {
  --bb-rl-header-height: 92px;
}

.gs-platform-nav__inner,
.gs-platform-nav__inner[class*="gs-platform-nav__inner--"] {
  max-width: var(--gs-shell-max);
  margin: 0 auto;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-start;
  gap: 0.1rem;
  padding: 0.15rem 0.6rem;
  overflow-x: auto;
  overflow-y: hidden;
  min-height: 40px;
  max-height: 40px;
}

.gs-platform-nav__item {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto !important;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  min-height: 28px;
  height: 28px;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  color: #fff !important;
  text-shadow: 0 1px 0 rgba(0, 70, 130, 0.18);
  border: 1px solid transparent;
  border-radius: var(--gs-radius-sm);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.gs-platform-nav__item:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.28);
  text-shadow: none;
}

.gs-platform-nav__item.is-active,
.gs-platform-nav__item--sns.is-active,
.gs-platform-nav__item--forum.is-active,
.gs-platform-nav__item--news.is-active,
.gs-platform-nav__item--chat.is-active {
  color: #0077cc !important;
  background: #fff !important;
  border-color: #fff !important;
  text-shadow: none;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.35);
}

.gs-platform-nav__icon {
  font-size: 1rem;
  line-height: 1;
}

/* --- ディスカバリレール --- */
.gs-discovery {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.gs-discovery__card--platform {
  padding: 1rem 1rem 0.85rem;
}

.gs-discovery__card--news {
  border-color: rgba(124, 58, 237, 0.2);
}

.gs-discovery__card--news .gs-news-list__link {
  grid-template-columns: 1fr;
  gap: 0.15rem;
  padding: 0.5rem 0.35rem;
}

.gs-discovery__card--news .gs-news-list__date {
  font-size: 0.72rem;
}

.gs-discovery__card--news .gs-news-list__title {
  font-size: 0.84rem;
}

.gs-discovery__platform {
  display: grid;
  gap: 0.4rem;
}

.gs-discovery__platform:has(.gs-discovery__platform-link:nth-child(4)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gs-discovery__platform:not(:has(.gs-discovery__platform-link:nth-child(4))) {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gs-discovery__platform-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.55rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--gs-ink);
  border: 1px solid var(--gs-line);
  border-radius: var(--gs-radius-sm);
  background: var(--gs-bg);
  transition: background 0.12s ease;
}

.gs-discovery__platform-link:hover {
  background: var(--gs-surface);
}

.gs-discovery__platform-link--sns { border-top: 2px solid var(--gs-pillar-sns); }
.gs-discovery__platform-link--news { border-top: 2px solid var(--gs-pillar-news); }
.gs-discovery__platform-link--forum { border-top: 2px solid var(--gs-pillar-forum); }
.gs-discovery__platform-link--chat { border-top: 2px solid var(--gs-pillar-chat); }

.gs-discovery__platform-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.gs-discovery__card {
  background: var(--gs-surface);
  border: 1px solid var(--gs-line);
  border-radius: var(--gs-radius);
  padding: 1rem;
  box-shadow: var(--gs-shadow);
}

.gs-discovery__title {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gs-ink);
}

.gs-discovery__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gs-discovery__list li + li {
  margin-top: 0.35rem;
}

.gs-discovery__list a {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--gs-radius-sm);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease;
}

.gs-discovery__list a:hover {
  background: var(--gs-bg);
}

.gs-discovery__list--members a {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.gs-discovery__name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gs-ink);
}

.gs-discovery__meta {
  font-size: 0.78rem;
  color: var(--gs-ink-muted);
}

.gs-discovery__avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.gs-discovery__more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.gs-discovery__text {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--gs-ink-muted);
  line-height: 1.45;
}

.gs-discovery__card--muted {
  background: var(--gs-bg);
}

@media (max-width: 1100px) {
  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-primary-container {
    grid-template-columns: 72px minmax(0, 1fr) !important;
  }

  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-right-sidebar,
  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-right-panel,
  body.gantomo-sns-shell.gantomo-sns-readylaunch .gs-discovery-slot {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-primary-container {
    display: block !important;
    padding-bottom: calc(var(--gs-tabbar-height) + env(safe-area-inset-bottom) + 1rem) !important;
  }

  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-left-panel,
  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-left-sidebar {
    width: 100% !important;
    min-width: 0 !important;
  }

  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-content-area,
  body.gantomo-sns-shell.gantomo-sns-readylaunch .bb-rl-main {
    max-width: 100% !important;
  }
}
