/* ================================================================
   page_styles.css
   各コンテンツページ固有のスタイル。
   - 共通カテゴリ見出し・リスト装飾
   - index.php（解除コード生成フォーム）
   - unlockpage.php（解除コード結果表示）
   - details.php（ERC コード入力方法の詳細ガイド）
   - sitemap.php（サイトマップグリッド）
   - contact.php（Google フォーム埋め込み）

   広告スタイルは ads.css。
   ブレークポイント 768px 統一。
   ================================================================ */


/* ==========================================================================
   共通カテゴリ見出し・リスト装飾（コンテンツページ全般）
   ========================================================================== */

.sitemap_category h2 {
  font-size: 20px;
  margin: 30px 0 15px;
  font-weight: bold;
  color: #333;
  position: relative;
  padding-left: 15px;
}

.sitemap_category h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 6px;
  background: linear-gradient(to bottom, #1e90ff, #87cefa);
}

.sitemap_category p,
.sitemap_category ul,
.sitemap_category ol {
  margin-left: 15px;
  font-size: 16px;
  margin-bottom: 15px;
}

ul {
  list-style: disc;
  padding-left: 15px;
}

.sub_list {
  list-style: decimal;
  padding-left: 15px;
}


/* ==========================================================================
   index.php 固有
   ========================================================================== */

/* .main_content が .page_container の直下に来るときの上マージン（フォーム含む枠） */
.page_container > .main_content {
  margin-top: 30px;
}

.main_content {
  max-width: 800px;
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 30px;
  text-align: center;
  box-sizing: border-box;
  background-color: #fff;
  margin-bottom: 30px;
  position: relative;
  z-index: 10;
}

.main_content h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.main_content input[type="text"] {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.main_content button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 4px;
  background-color: #1e90ff;
  color: #fff;
  cursor: pointer;
}

.main_content button:hover {
  background-color: #187bcd;
}

/* 情報ボックス（How to Use 等） */
.info_box {
  border: 1px solid #ccc;
  padding: 15px;
  margin-top: 20px;
  border-radius: 5px;
  background-color: #fafafa;
  text-align: left;
}

.info_box h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.more_details {
  display: block;
  text-align: right;
  margin-top: 10px;
  color: #1e90ff;
  text-decoration: none;
  font-size: 14px;
}

.more_details:hover {
  text-decoration: underline;
}


/* ==========================================================================
   タイル選択 UI（index.php、Phase 5 で追加）

   NOTE: セレクタは全て `.tile_grid .tile...` で書く。
   これは親セレクタ `.main_content button { background: #1e90ff; ... }` より
   特異度を高くして、タイルのデフォルト（白背景）が勝つようにするため。
   ========================================================================== */

.tile_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.tile_grid .tile {
  padding: 14px 0;
  border: 2px solid #1e90ff;
  background: #1e90ff;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: #fff;
  transition: all 0.15s ease;
}

.tile_grid .tile:hover {
  background: #187bcd;
  border-color: #187bcd;
}

/* 選択中：黒への完全インバース。ベータ版 unlock68/index.html と同等の
   最大コントラストを実現。白背景×黒塗りで「選択中」が一目瞭然。 */
.tile_grid .tile.selected {
  border-color: #000;
  background: #000;
  color: #fff;
}

.tile_grid .tile.selected:hover {
  background: #222;
  border-color: #222;
}

/* 「68系以前のモデル」タイルは横 1 行まるごと使うが、見た目は他タイルと統一。
   グレー塗りつぶし・破線枠は目立ちすぎてユーザーが迷うため廃止。 */
.tile_grid .tile_legacy {
  grid-column: 1 / -1;
}

/* 選択中表示（タイルグリッド下に出る「選択中のモデル: XXX」） */
.selected_indicator {
  margin: 10px 0 15px;
  padding: 10px;
  background: #e8f4fd;
  border: 1px solid #1e90ff;
  border-radius: 4px;
  font-size: 14px;
  color: #1e90ff;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   unlockpage.php 固有
   ========================================================================== */

.unlock_container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #fff;
}

.code_box {
  margin-top: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #1e90ff;
}

/* 解除コード表示下の横並びボタン群（Back to Home / How to Use） */
.action_buttons {
  margin-top: 30px;
}


/* ==========================================================================
   sitemap.php 固有
   ========================================================================== */

.sitemap_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 20px;
}

.sitemap_grid .sitemap_category h2 {
  margin: 0 0 16px;
}

.sitemap_grid .sitemap_category ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0 15px;
}

.sitemap_grid .sitemap_category li {
  margin-bottom: 10px;
}

.sitemap_grid .sitemap_category a {
  font-size: 16px;
  text-decoration: none;
  color: #1e90ff;
}

.sitemap_grid .sitemap_category a:hover {
  text-decoration: underline;
}


/* ==========================================================================
   details.php 固有（ERC 入力方法の詳細ガイド）
   ========================================================================== */

.guide_section {
  margin-bottom: 40px;
}

.guide_step {
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
}

.step_title {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
  color: #1e90ff;
}

.step_description {
  margin-bottom: 15px;
  line-height: 1.6;
}

.step_image {
  width: 100%;
  max-width: 600px;
  height: auto;
  border: 1px solid #ddd;
  border-radius: 5px;
  margin: 10px 0;
}

.image_caption {
  font-size: 14px;
  color: #666;
  font-style: italic;
  margin-top: 5px;
}

.note_box {
  background-color: #f8f8f8;
  border-left: 4px solid #ffc107;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
}

.note_box h4 {
  margin-top: 0;
  color: #d39e00;
}

/* ボタン風の強調ラベル（[MENU] や [現在地] の表現に使用） */
.button_example {
  display: inline-block;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 3px 8px;
  margin: 0 3px;
  font-family: monospace;
  font-weight: bold;
}

.step_list {
  padding-left: 10px;
  margin-bottom: 20px;
}

.step_item {
  margin-bottom: 12px;
  padding-left: 28px;
  position: relative;
  line-height: 1.5;
}

.step_number {
  position: absolute;
  left: 0;
  font-weight: bold;
}


/* ==========================================================================
   action_button（details.php / unlockpage.php で共通使用）
   ========================================================================== */

.action_button {
  display: inline-block;
  background-color: #1e90ff;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 20px;
  margin: 20px 0;
  text-decoration: none;
  text-align: center;
  font-weight: bold;
  transition: background-color 0.2s;
}

.action_button:hover {
  background-color: #187bcd;
}

/* unlockpage.php で横並びボタンコンテナ内にある場合の調整 */
.action_buttons .action_button {
  padding: 10px 20px;
  margin: 0 10px;
}


/* ==========================================================================
   contact.php 固有
   ========================================================================== */

iframe {
  border: none;
  width: 100%;
  min-height: 900px;
}


/* ==========================================================================
   モバイル対応（ブレークポイント 768px、旧 720px から統一）
   ========================================================================== */

@media (max-width: 768px) {

  /* カテゴリ見出しのモバイル調整 */
  .sitemap_category h2 {
    font-size: 18px;
    margin: 25px 0 10px;
    padding-left: 12px;
  }

  .sitemap_category h2::before {
    width: 4px;
    border-radius: 4px;
  }

  .sitemap_category p,
  .sitemap_category ul,
  .sitemap_category ol {
    margin-left: 12px;
    font-size: 15px;
  }

  ul {
    padding-left: 12px;
  }

  /* sitemap.php: 3列 → 1列 */
  .sitemap_grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sitemap_grid .sitemap_category ul {
    margin-left: 0;
  }

  .sitemap_grid .sitemap_category li {
    margin-bottom: 0;
  }

  /* モバイルではサイトマップのリンクをタップしやすいブロック状に */
  .sitemap_grid .sitemap_category a {
    display: block;
    width: 100%;
    background: #e0e0e0;
    border-radius: 8px;
    padding: 12px 0;
    margin: 10px 0;
    text-align: center;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
  }

  .sitemap_grid .sitemap_category a:hover {
    background: #d5d5d5;
  }

  /* index.php モバイル */
  .main_content {
    padding: 20px;
  }

  .main_content h2 {
    font-size: 18px;
  }

  .main_content button {
    width: 100%;
  }

  /* タイルグリッドのモバイル調整（Phase 5） */
  .tile_grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .tile {
    padding: 12px 0;
    font-size: 15px;
  }

  .tile_legacy {
    grid-column: 1 / -1;
  }

  /* エラーメッセージ（unlockpage.php でネットワークエラー等） */
  .error_message {
    color: #c62828;
    padding: 15px;
    background: #ffebee;
    border: 1px solid #ef9a9a;
    border-radius: 4px;
    margin: 20px 0;
  }

  /* contact.php モバイル */
  iframe {
    min-height: 700px;
  }
}

/* さらに小さい画面（480px 以下） */
@media (max-width: 480px) {
  .main_content {
    padding: 15px;
  }

  iframe {
    min-height: 800px;
  }
}
