/* モバイル用のresearch.php追加スタイル */

/* 重要: 他のCSSを強制的に上書き */
@media (max-width: 768px) {
  /* 列幅制限を解除 */
  .research-table th:first-child,
  .research-table td:first-child,
  .research-table th,
  .research-table td {
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
  }
  
  /* word-breakを無効化 */
  .research-table,
  .research-table *,
  .research-name,
  .research-name a,
  .research-desc,
  .news-grid,
  .page-layout,
  .research-container * {
    word-break: normal !important;
    word-wrap: normal !important;
    white-space: normal !important;
  }
  
  /* リンクのスタイルをリセット */
  .research-name a {
    display: inline !important;
    max-width: none !important;
    flex-shrink: unset !important;
    gap: 0 !important;
  }
  
  /* アイコンを削除 */
  .research-name a:after {
    display: none !important;
  }
}

/* モバイル専用のカテゴリドロップダウン */
.mobile-category-select {
  display: none;
  width: calc(100% - 30px);
  margin: 0 15px 20px;
  padding: 14px 40px 14px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
  background-color: white;
  color: #333;
  font-weight: 500;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  transition: border-color 0.2s;
}

.mobile-category-select:focus {
  outline: none;
  border-color: #999;
}

/* モバイルでドロップダウンを表示、ボタンを非表示 */
@media (max-width: 480px) {
  .research-categories {
    display: none;
  }
  
  .mobile-category-select {
    display: block;
  }

  /* 研究ヘッダーをシンプルに */
  .research-header {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 20px;
  }
  
  .research-header p {
    padding: 0 15px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
  }
  
  /* コンテナの幅を最大化 */
  .research-container {
    padding: 0;
    max-width: 100%;
  }
}

/* 追加のモバイル最適化 */
@media (max-width: 480px) {
  /* セクションヘッダーの調整 */
  .research-section-header {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .research-section-header h2 {
    font-size: 20px;
  }
  
  /* フラグのサイズ調整 */
  .research-section-header .flag {
    font-size: 24px;
    margin-right: 10px;
  }
  
  /* 更新日の位置調整 */
  .updated-date {
    text-align: center;
    padding: 20px 15px;
    font-size: 14px;
    color: #6b7280;
  }
}

/* パンくずリストのモバイル対応 */
@media (max-width: 768px) {
  .breadcrumbs {
    font-size: 12px;
    padding: 10px;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .breadcrumbs a {
    color: #666;
  }
}

/* コンテナの余白調整 */
@media (max-width: 480px) {
  .container {
    padding: 0;
  }
  
  main {
    padding: 0;
  }
  
  /* ヘッダータイトルのサイズ調整 */
  .container h1 {
    font-size: 22px;
    padding: 20px 15px 10px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
  }
}

/* タップターゲットサイズの最適化 */
@media (max-width: 768px) {
  .research-category-btn,
  #research-search-button,
  .research-name a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
}

/* 横スクロール防止 */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  
  .research-content {
    overflow-x: hidden;
  }
}

/* フッターのスタイルはfooter-common.cssで管理 */

/* ページトップへ戻るボタンのモバイル対応 */
@media (max-width: 768px) {
  .page-top-link {
    bottom: 70px !important; /* サブナビと被らないよう位置調整 */
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
  }
  
  .page-top-link i {
    font-size: 16px;
  }
}

/* シンプルなテキストリンクスタイル */
@media (max-width: 768px) {
  .research-search {
    padding: 0 15px;
    margin-bottom: 20px;
  }
  
  .research-table {
    padding: 0 15px;
  }
  
  /* モバイルでは説明文を非表示に */
  .research-table thead,
  .research-desc {
    display: none !important;
  }
  
  /* テーブルのスクロールを無効化 */
  .research-table {
    display: block !important;
    overflow-x: visible !important;
    overflow: visible !important;
  }
  
  /* 箱を削除してシンプルなリストに */
  .research-table tr {
    margin-bottom: 0;
    display: block;
    background: transparent;
    border: none;
    padding: 12px 0;
    box-shadow: none;
  }
  
  .research-name {
    margin-bottom: 0;
    padding-left: 20px;
    position: relative;
  }
  
  /* リストマーカー */
  .research-name:before {
    content: "\2022";
    position: absolute;
    left: 5px;
    color: #999;
  }
  
  /* テキストリンクのみのシンプルなスタイル */
  .research-name a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    font-weight: 400;
    display: inline;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    min-width: auto;
    text-align: left;
    transition: color 0.2s;
  }
  
  .research-name a:hover,
  .research-name a:active {
    color: #000;
    text-decoration: underline;
    background: none;
  }
  
  /* 検索ボックスのシンプルなデザイン */
  .search-section {
    padding: 0 15px;
    margin-bottom: 20px;
  }
  
  #research-search-input {
    font-size: 16px;
    padding: 14px 15px;
    border: 1px solid #ddd;
    background-color: white;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 10px;
  }
  
  #research-search-input:focus {
    outline: none;
    border-color: #999;
  }
  
  #research-search-button {
    padding: 14px 20px;
    min-height: 44px;
    font-size: 16px;
    background-color: #f5f5f5;
    width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #333;
    font-weight: 500;
    transition: background-color 0.2s;
  }
  
  #research-search-button:hover {
    background-color: #e8e8e8;
  }
  
  /* 検索ボタンのテキストを表示 */
  #research-search-button span {
    display: inline;
    margin-left: 5px;
  }
}
