/* =========================================================
   top.css — TOPページ（index.html）固有スタイル
   アコーディオン形式のカラーパネル（01〜05）とその展開アニメーション。
   共通部分（リセット・ブランドロゴ・MENUドロワー）は style.css を参照。
   ※ index.html のデザインベースから移設。値は一切変更していない。
========================================================= */

/* パネルを縦積みし、全体でビューポートの高さを埋める */
.bar-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
}

/* 各カラーパネル: flex比率でクリック時に伸縮する */
.bar-item {
  position: relative;
  flex: 1;
  width: 100%;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: flex 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

/* カラーバー本体: 背景色の帯。展開時に幅が100vwへ広がる */
.bar-bg {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  transition: width 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 左寄せ/右寄せパネルで帯の起点を切り替える */
.align-left .bar-bg { left: 0; width: 90vw; }
.align-right .bar-bg { right: 0; width: 90vw; }

.align-left.open .bar-bg,
.align-right.open .bar-bg {
  width: 100vw;
}

/* パネルごとの配色（01〜05） */
.c-lime   .bar-bg { background: #b5ff00; }
.c-yellow .bar-bg { background: #ffea00; }
.c-pink   .bar-bg { background: #ff2a85; }
.c-purple .bar-bg { background: #bd3eff; }
.c-gray   .bar-bg { background: #1e1e1e; }

/* テキストレイアウト（左右・天地を完全統一） */
.item-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-left: calc(10vw + 36px);
  padding-right: 260px; /* 赤いMENUスラブとの干渉を確実に避ける */
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

.bar-header {
  position: relative;
  display: flex;
  align-items: baseline;
  width: 100%;
  color: #000;
}
/* ダークパネル（05 Contact）のみ文字を白に */
.c-gray .bar-header { color: #fff; }

.bar-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  width: 48px;
  flex-shrink: 0;
  opacity: 0.35;
}

.bar-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s ease;
}

/* サブタイトルの開始位置を左揃え固定 */
.bar-sub {
  position: absolute;
  left: calc(64vw - 10vw - 36px); /* 赤ブロックの左手前に綺麗に揃える */
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0.75;
  text-align: left;
  transition: opacity 0.3s ease;
}

/* ホバー時は文字のみグレーにフェード */
.bar-item:hover .bar-title {
  color: rgba(0, 0, 0, 0.45);
}
.c-gray:hover .bar-title {
  color: rgba(255, 255, 255, 0.45);
}
.bar-item:hover .bar-sub { opacity: 1; }

/* 展開スタイル: クリックされたパネルを大きく開く */
.bar-item.open {
  flex: 3;
}
.bar-item.open .bar-title { color: #000; }
.c-gray.open .bar-title { color: #fff; }

/* 詳細本文: 通常は畳んでおき、展開時にフェードイン */
.bar-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: #000;
  max-width: 680px;
  margin-left: 48px;
  transition: 
    max-height 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease,
    margin-top 0.4s ease;
}
.c-gray .bar-body { color: #ddd; }

.bar-item.open .bar-body {
  max-height: 200px;
  opacity: 1;
  margin-top: 14px;
  pointer-events: auto;
  transition-delay: 0.15s;
}

.bar-body p {
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 500;
}
.bar-body .tags {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.bar-body .tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.12);
  padding: 3px 8px;
  border-radius: 2px;
}
.c-gray .bar-body .tag {
  background: rgba(255, 255, 255, 0.18);
}

/* CONTACTパネル（05）の「SEND MESSAGE →」ボタン */
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 20px;
  background: #fff;
  color: #000;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  border-radius: 2px;
  transition: background 0.2s ease;
}
.contact-btn:hover {
  background: #ffea00;
}

/* =========================================================
   スマホ対応（TOPページのカラーパネル）
========================================================= */
@media (max-width: 768px) {
  .bar-container {
    height: calc(100dvh - 54px);
  }

  .align-left .bar-bg,
  .align-right .bar-bg {
    left: 0;
    right: 0;
    width: 100% !important;
  }

  .item-inner {
    padding: 0 20px;
  }

  .bar-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .bar-num {
    font-size: 0.75rem;
    width: auto;
    margin-bottom: 2px;
  }

  .bar-title {
    font-size: 1.35rem;
    letter-spacing: -0.01em;
  }

  .bar-sub {
    position: static;
    font-size: 0.75rem;
    opacity: 0.8;
  }

  .bar-item.open {
    flex: 2.6;
  }

  .bar-body {
    margin-left: 0;
  }

  .bar-item.open .bar-body {
    max-height: 160px;
    margin-top: 8px;
  }

  .bar-body p {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .contact-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    margin-top: 10px;
  }
}
