/* ==========================================
   Prototype / 共通アイテム一覧ページ
========================================== */

.item-page .mod-intro {
  max-width: 1000px;
  margin: 2.5rem auto 2rem;
  padding: 1.5rem;
  background: rgba(0, 20, 35, 0.72);
  border: 1px solid rgba(0, 234, 255, 0.22);
  border-radius: 14px;
  box-shadow: 0 0 18px rgba(0, 234, 255, 0.08);
}

.item-page .mod-intro p {
  line-height: 1.9;
  color: #d9f8ff;
}

.item-page .mod-sub-nav {
  margin-top: 1rem;
  color: #bfefff;
}

.item-page .mod-sub-nav a {
  color: #7aefff;
  text-decoration: none;
}

.item-page .mod-sub-nav a:hover {
  text-decoration: underline;
}

.item-list-section {
  max-width: 1100px;
  margin: 0 auto 4rem;
  padding: 0 1rem;
}

.item-list-section h2 {
  font-size: 1.9rem;
  margin-bottom: 0.8rem;
  color: #79f3ff;
  text-shadow: 0 0 10px rgba(0, 234, 255, 0.28);
}

.section-lead {
  margin-bottom: 1.5rem;
  color: #ccecf5;
  line-height: 1.8;
}

/* ===== グリッド ===== */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.2rem;
}

/* ===== カード ===== */
.item-card {
  display: block;
  width: 100%;
  padding: 1.1rem 0.9rem 1.2rem;
  background: linear-gradient(180deg, rgba(10, 28, 42, 0.95), rgba(7, 17, 28, 0.96));
  border: 1px solid rgba(0, 234, 255, 0.18);
  border-radius: 14px;
  text-align: center;
  color: #ddfaff;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.item-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 234, 255, 0.5);
  box-shadow: 0 0 18px rgba(0, 234, 255, 0.16);
}

.item-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 0.9rem;
  image-rendering: auto;
}

.prototype-item-page .item-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #ebfcff;
}

.item-short {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #8fd8e8;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.03em;
}

/* ===== モーダル ===== */
.item-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  padding: 2rem 1rem;
  background: rgba(0, 8, 15, 0.82);
}

.item-modal.is-open {
  display: block;
}

.modal-box {
  position: relative;
  max-width: 980px;
  max-height: 90vh;
  margin: 0 auto;
  padding: 1.5rem;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(12, 24, 36, 0.98), rgba(7, 14, 24, 0.98));
  border: 1px solid rgba(0, 234, 255, 0.28);
  border-radius: 18px;
  box-shadow: 0 0 28px rgba(0, 234, 255, 0.14);
}

.modal-close {
  position: absolute;
  top: 0.7rem;
  right: 1rem;
  background: none;
  border: none;
  color: #dffaff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

#item-modal-title {
  margin: 0 0 0.25rem;
  padding-right: 2.4rem;
  font-size: 1.6rem;
  color: #f2feff;
}

.modal-eng {
  margin: 0 0 1.2rem;
  color: #91dbea;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.03em;
}

.modal-main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.6rem;
  align-items: start;
}

.modal-image-wrap img {
  width: 100%;
  max-height: 420px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  object-fit: contain;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: #78f4ff;
  text-shadow: 0 0 8px rgba(0, 234, 255, 0.15);
}

.modal-section div,
.modal-section p {
  line-height: 1.9;
  color: #d8f3fa;
}

/* ===== PDA ===== */
.pda-toggle {
  display: inline-block;
  padding: 0.7rem 1rem;
  background: rgba(0, 234, 255, 0.08);
  border: 1px solid rgba(0, 234, 255, 0.3);
  border-radius: 10px;
  color: #ddfaff;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.pda-toggle:hover {
  background: rgba(0, 234, 255, 0.14);
  border-color: rgba(0, 234, 255, 0.52);
}

.pda-entry {
  margin-top: 1rem;
  padding: 1rem 1rem 1.05rem;
  background: rgba(255,255,255,0.035);
  border-left: 3px solid rgba(0, 234, 255, 0.45);
  border-radius: 8px;
}

.pda-entry h4 {
  margin-bottom: 0.7rem;
}

/* ===== 補助 ===== */
.is-hidden {
  display: none;
}

/* カード内の要素を縦方向に整列 */
.item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* 画像位置を固定しやすくする */
.item-card img {
  flex-shrink: 0;
}

/* 日本語タイトルの高さを揃える */
.item-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #ebfcff;

  min-height: 3em;          /* 2行ぶん確保 */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* 英語名も位置を安定させる */
.item-short {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #8fd8e8;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.03em;

  min-height: 3.2em;        /* 英語名が2行になっても揃いやすい */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
}


/* ===== スマホ ===== */
@media (max-width: 800px) {
  .item-modal {
    /* モーダル全体の上下余白 */
    padding: 1rem 0 !important;
  }

  .modal-box {
    width: calc(100% - 1.4rem) !important;   /* モーダル本体の左右余白 */
    max-width: 680px !important;
    max-height: 85vh !important;             /* モーダル本体の上下の圧迫感を軽減 */
    margin: 0 auto !important;               /* 左右中央配置 */
    padding: 1.1rem 0.95rem 1.2rem !important; /* モーダル内側の余白（上・左右・下） */
    border-radius: 14px !important;
    box-sizing: border-box !important;
  }

  .modal-main {
    grid-template-columns: 1fr;
    gap: 1rem; /* 画像と本文の縦間隔 */
  }

  .modal-image-wrap {
    max-width: 100%;
    margin: 0 auto; /* 画像ブロックを中央寄せ */
  }

  .modal-image-wrap img {
    max-height: 220px !important;
    border-radius: 10px;
  }

  #item-modal-title {
    font-size: 1.15rem !important;
    line-height: 1.4 !important;
    padding-right: 2rem; /* 閉じるボタンと重ならないための右余白 */
    margin-bottom: 0.2rem; /* タイトル下の余白 */
  }

  .modal-eng {
    font-size: 0.82rem !important;
    line-height: 1.5;
    margin-bottom: 0.9rem !important; /* 英語名の下余白 */
  }

  .modal-section {
    margin-bottom: 1.2rem; /* セクション同士の間隔 */
  }

  .modal-section h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem; /* 見出しと本文の間隔 */
  }

  .modal-section div,
  .modal-section p {
    font-size: 0.96rem;
    line-height: 1.85;
  }

  .pda-toggle {
    width: 100%;
    padding: 0.85rem 1rem; /* PDAボタン内側の上下左右余白 */
    font-size: 0.95rem;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .item-card img {
    width: 96px;
    height: 96px;
  }

  .item-short {
    font-size: 0.78rem;
  }
}