/* 打ち上げ図インタラクティブセクション */
.launch-diagram-section {
  position: relative;
  width: 100%;
  max-width: var(--max-width-main); /* innerと同じ幅 */
  margin: 0 auto;
  padding: 0;
  /* background: linear-gradient(
    to bottom,
    #0056a7 0%,
    #0056a7 40%,
    #008ad1 70%,
    #00afd6 100%
  ); */
  overflow: hidden; /* 太陽がはみ出さないように */
  border-radius: 4px; /* 角丸を追加（任意） */
}

/* カテゴリボタン群 */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  z-index: 5;
  padding: 20px;
  margin-bottom: 0px;
  background: #0056a7;
}

/* スマホ: ボタン配置（背景透過） */
@media (max-width: 768px) {
  .launch-diagram-section {
    max-width: 100%;
    padding: 0;
    border-radius: 0;
  }
  
  .category-buttons {
    padding: 30px 5px;
    position: relative;
    z-index: 2;
  }
  
  .launch-diagram-container {
    width: 100%;
  }
  
  .diagram-background {
    width: 100%;
  }
}

/* PC: 画像上部に絶対配置 → 通常フローに変更 */
@media (min-width: 769px) {
  .category-buttons {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 100%; /* コンテナ（=画像幅）に合わせる */
    max-width: 100%;
    padding: 24px 20px;
    margin-bottom: 0;
  }
  .category-buttons .category-btn{
   white-space: nowrap; 
  }
}

.category-btn {
  padding: 2px 10px;
  background: linear-gradient(to bottom, #4F4F4F 0%, #000000 100%);
  color: var(--color-white);
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

/* hover時の白オーバーレイ */
.category-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.category-btn:hover::after {
  background: rgba(255, 255, 255, 0.2);
}
/* カテゴリボタンの色 */
.category-btn .ico-testing{
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  height: 30px;
}
.category-btn .ico-testing.ico-radio-magnetic,
.category-btn .ico-testing.ico-function-performance{
  width: 60px;
  height: 30px;
}
.category-btn .ico-testing img{
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* カテゴリボタンの色 */
.category-btn[data-category="acoustic"]{
  background: var(--color-acoustic);
}
.category-btn[data-category="vibration"]{
  background: var(--color-vibration);
}
.category-btn[data-category="shock"]{
  background: var(--color-shock);
}
.category-btn[data-category="acceleration"]{
  background: var(--color-acceleration);
}
.category-btn[data-category="thermal-vacuum"]{
  background: var(--color-thermal-vacuum);
}
.category-btn[data-category="radio-magnetic"]{
  background: var(--color-radio-magnetic);
}
.category-btn[data-category="function-performance"]{
  background: var(--color-function-performance);
}

.category-btn:hover {
  color: #fff;
  transition: 0.4s;
}

.category-btn.active {
  background: #004EA2;
  color: #fff;
}

/* 打ち上げ図コンテナ */
.launch-diagram-container {
  position: relative;
  display: inline-block; /* 画像サイズにフィット */
  width: 100%;
  margin: 0 auto;
}

/* picture要素も位置基準にする */
.launch-diagram-container picture {
  display: block;
  width: 100%;
}

/* 背景画像 */
.diagram-background {
  width: 100%;
  height: auto;
  display: block;
}

/* PC版：画像の高さを画面内に収める */
@media (min-width: 769px) {
  .launch-diagram-section {
    display: flex;
    flex-direction: column;
    align-items: center; /* コンテナを中央揃え */
  }
  
  .launch-diagram-container {
    width: auto; /* 画像サイズに合わせる */
    max-width: 100%;
  }
  
  .launch-diagram-container picture {
    display: block;
  }
  
  .diagram-background {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(98vh - 120px); /* ボタン分を引く */
  }
}

/* 黄色アイコン（点滅） */
.hotspot {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 80px;
  cursor: pointer;
  background-size: 60% 60%;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: pulse 2s ease-in-out infinite;
  /* 白いボーダー */
  border: 3px solid #fff;
  /* ドロップシャドウ（濃いめ） */
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.6),
    0 2px 8px rgba(0, 0, 0, 0.8),
    0 0 0 3px rgba(255, 255, 255, 0.4);
}
.hotspot.wide {
  width: 90px;
  height: 50px;
  background-size: 70%;
}
.hotspot:hover {
  transform: scale(1.3);
  animation: none;
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.7),
    0 4px 12px rgba(0, 0, 0, 0.9),
    0 0 0 5px rgba(255, 255, 255, 0.6);
}

/* 各カテゴリのスタイル */
.hotspot[data-category="acoustic"] {
  background-color: var(--color-acoustic);
  background-image: var(--icon-acoustic);
}

.hotspot[data-category="vibration"] {
  background-color: var(--color-vibration);
  background-image: var(--icon-vibration);
}

.hotspot[data-category="shock"] {
  background-color: var(--color-shock);
  background-image: var(--icon-shock);
}

.hotspot[data-category="acceleration"] {
  background-color: var(--color-acceleration);
  background-image: var(--icon-acceleration);
}

.hotspot[data-category="thermal-vacuum"] {
  background-color: var(--color-thermal-vacuum);
  background-image: var(--icon-thermal-vacuum);
}

.hotspot[data-category="radio-magnetic"] {
  background-color: var(--color-radio-magnetic);
  background-image: var(--icon-radio-magnetic);
}

.hotspot[data-category="function-performance"] {
  background-color: var(--color-function-performance);
  background-image: var(--icon-function-performance);
}

/* 電波・磁気の個別アイコン */
.hotspot[data-category="radio-magnetic"][data-icon="radio"] {
  background-image: var(--icon-radio);
}

.hotspot[data-category="radio-magnetic"][data-icon="magnetic"] {
  background-image: var(--icon-magnetic);
}

.hotspot[data-category="function"] {
  background-color: var(--color-function-performance);
  background-image: var(--icon-function);
}
/* 性能 */
.hotspot[data-category="function-performance"][data-icon="performance"] {
  background-color: var(--color-function-performance);
  background-image: var(--icon-performance);
}
/* 機能 */
.hotspot[data-category="function-performance"][data-icon="function"] {
  background-color: var(--color-function-performance);
  background-image: var(--icon-function);
}

/* 点滅アニメーション */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

/* 説明パネル */
.explanation-panel {
  position: fixed;
  background: var(--color-black-70);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  overflow-y: auto;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PC: 右からスライド */
@media (min-width: 769px) {
  .explanation-panel {
    top: 0;
    right: 0;
    width: 450px;
    max-width: 90vw;
    height: 100vh;
    transform: translateX(100%);
  }
  
  .explanation-panel.is-open {
    transform: translateX(0);
  }
}

/* スマホ: 下からスライド */
@media (max-width: 768px) {
  .explanation-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 80vh;
    border-radius: 6px 6px 0 0;
    transform: translateY(100%);
  }
  
  .explanation-panel.is-open {
    transform: translateY(0);
  }
}

/* パネルヘッダー */
.panel-header {
  position: sticky;
  top: 0;
  color: #fff;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
}

.panel-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
}

.panel-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.panel-close:hover {
  transform: rotate(90deg);
}

/* パネルコンテンツ */
.panel-content {
  padding: 30px 20px;
  color: var(--color-white);
}
.panel-content .content-box__title{
  color: var(--color-white);
}

/* パネル内の画像 */
.panel-image {
  margin: 20px 0;
  border-radius: 4px;
  overflow: hidden;
}

.panel-image img {
  width: 100%;
  height: auto;
  display: block;
}

.panel-content .content-box__content ul{
  list-style: none;
}
.panel-content h3 {
  color: var(--color-white);
  font-size: 1.2rem;
  margin-bottom: 16px;
  font-weight: 700;
}

.panel-content p {
  line-height: 1.8;
  margin-bottom: 16px;
}

.panel-content ul {
  margin-left: 20px;
  margin-bottom: 16px;
}

.panel-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

/* 関連施設へのリンク */
.panel-content .panel-facilities ul{
  list-style: none;
  margin-left: 0;
}
.panel-content .panel-facilities ul li{
  border: 1px solid var(--color-white);
  padding: 8px 16px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}
.panel-content .panel-facilities ul li:hover{
  background: rgba(255, 255, 255, 0.1);
}
.panel-content .panel-facilities ul li a{
  color: var(--color-white);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  align-items: flex-end;
}

/* 矢印スタイル（eCLAと同じ） */
.panel-content .panel-facilities ul li a span.facility-arrow {
  position: relative;
  display: inline-block;
  width: 80px;
  height: 1px;
  background-color: #fff;
  flex-shrink: 0;
  margin-left: 20px;
  animation: arrow-slide 1.5s ease-in-out infinite;
}

.panel-content .panel-facilities ul li a span.facility-arrow::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 10px;
  height: 1px;
  background-color: #fff;
  transform: rotate(35deg);
  transform-origin: right center;
}

/* オーバーレイ */
.panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.panel-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
  .category-buttons {
    gap: 8px;
  }
  
  .category-btn {
    padding: 4px 16px;
    font-size: 1rem;
  }
  
  .hotspot {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }
  .hotspot.wide {
    width: 63px;
    height: 36px;
  }
  
  .panel-title {
    font-size: 1.1rem;
  }
}

/* 矢印アニメーション */
@keyframes arrow-slide {
  0% {
    transform: translateX(-10px);
    opacity: 0.5;
  }
  50% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(-10px);
    opacity: 0.5;
  }
}
