/*©2025 AG-All,AGworld All rights reserved*/
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c&family=Noto+Sans+JP:wght@400;500;700&display=swap');
@import url('/css/System/button.css');

:root {
  --primary-color: #0078d4;
  --secondary-color: #f5f5f5;
  --accent-color: #0056b3;
  --text-color: #333;
  --border-color: #e0e0e0;
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

/*AGworld's overall site structure*/
body{
  font-family: "Noto Sans JP", "M PLUS Rounded 1c", sans-serif;
  overflow-x: hidden;
  cursor: default;
  padding-top: 75px; 
  margin: 0;
  width: 100%;
  color: var(--text-color);
  line-height: 1.6;
  background-color: #fafafa;
}
/* 検索機能のスタイル - PC版 */
.search-container {
    position: fixed;
    top: 10px;
    left: 50%;
  transform: translateX(-50%);
    z-index: 1000;
    max-width: 280px;
    min-width: 200px;
    flex-shrink: 0; 
    z-index: 5;
}

.search-box {
  z-index: 5;
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    padding: 8px 15px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box:focus-within {
    box-shadow: 0 4px 20px rgba(0, 120, 212, 0.3);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    padding: 6px 10px;
    font-size: 14px;
    background: transparent;
    min-width: 0;
}

#searchInput::placeholder {
    color: #000000;
    font-size: 14px;
}

.search-button {
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.search-button:hover {
    background: rgba(0, 120, 212, 0.15);
    transform: scale(1.1);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

.search-results {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
    margin-top: 8px;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.search-result-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
}

.search-result-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background-color: #f0f8ff;
}

.search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.search-result-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
    font-size: 14px;
    line-height: 1.3;
}

.search-result-snippet {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.search-result-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 11px;
    color: #999;
}

.search-result-date,
.search-result-category {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-result-meta i {
    font-size: 10px;
    opacity: 0.7;
}

.no-results {
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.no-results i {
    font-size: 24px;
    color: #ccc;
    margin-bottom: 10px;
    display: block;
}

.no-results p {
    margin: 0 0 5px;
    font-weight: 500;
}

.no-results small {
    color: #999;
    font-size: 12px;
}

/* 検索結果の強化スタイル */
.search-loading {
    padding: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 14px;
}

.search-loading i {
    margin-right: 8px;
    font-size: 16px;
}

.search-results-header {
    padding: 12px 15px 8px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.search-results-header small {
    color: #666;
    font-size: 12px;
    font-weight: 500;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-speed) ease;
}

a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

summary {
  display: block;
  list-style: none;
}

summary::-webkit-details-marker,
details summary::-webkit-details-marker {
  display: none;
  content: none;
}

details{
  display: block;
}

iframe{
  overflow-y : hidden;
}

/*メインコンテンツ部分*/
main {
  font-size: 1.1rem;
  width: 80%;
  max-width: 800px;
  margin: 20px auto;
  text-align: center;
}

main img {
  width: 60%;
  max-width: 600px;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  margin: 20px 0;
}

main h1 {
  font-size: 2.2rem;
  margin: 1.5rem 0;
  color: #222;
}

main h2 {
  font-size: 1.8rem;
  margin: 2rem 0 1.5rem;
  position: relative;
  padding-bottom: 10px;
}

main h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background-color: var(--primary-color);
}

p1 {
  font-size: 1.1rem;
  line-height: 1.6;
  display: block;
  margin-bottom: 1rem;
}

/*トップへスクロールボタン*/
#click_warp {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  display: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

#click_warp:hover {
  background-color: var(--accent-color);
  transform: scale(1.05);
}

/*記事部分*/
article {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

article h3 {
  margin: 0;
}

article p {
  margin: 0.5rem 0;
}

article time {
  color: #666;
  font-size: 0.9rem;
}

/*言語切り替え部分*/
.ls {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  text-align: center;
  margin: 2rem auto;
  background-color: white;
  border-radius: 50px;
  border: 2px solid var(--primary-color);
  max-width: 320px;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ls img {
  width: 30px;
  height: auto;
}

.ls a, .ls a:hover, .ls a:visited {
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: 5px 15px;
  border-radius: 20px;
}

.ls a:hover {
  background-color: rgba(0, 120, 212, 0.1);
}

/*モバイル向けスタイル*/
@media (max-width: 768px) {
   html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  body {
    padding-top: 70px;
  }
 
  main {
     width: 90%; 
    font-size: 1rem;
    margin: 20px auto; /* マージンも調整 */
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  main img {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  main h1 {
    font-size: 1.8rem;
  }
  
  main h2 {
    font-size: 1.5rem;
  }
  
  
  .top_info {
    font-size: 1rem; 
    margin-left: 0; 
    white-space: nowrap;
    overflow: hidden; 
    text-overflow: ellipsis; 
  }
   /* PC版のスタイルをリセット */
    .search-container {
        position: fixed;
        top: 10px;
        right: 15px;
        z-index: 1001;
        width: 50px;
        height: 50px;
        max-width: none;
        min-width: none;
        margin: 0;
        transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    
    .search-container.expanded {
        top: 8px;
        right: 8px;
        left: 8px;
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        height: 48px;
    }
    /*Phone Search button*/
    .search-box {
        width: 50px;
        height: 50px;
        background: white;
        border: 2px solid var(--primary-color);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
        overflow: hidden;
        position: absolute;
        right: 0;
    }
    
    .search-container.expanded .search-box {
        width: 100%;
        max-width: 100%;
        height: 48px;
        border-radius: 24px;
        padding: 0 16px;
        justify-content: flex-start;
        box-sizing: border-box;
    }
    
    .search-button {
        width: 100%;
        height: 100%;
        background: none;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        order: 2;
        box-sizing: border-box;
        padding: 0;
        margin: 0;
        position: relative;
    }
    
    .search-container.expanded .search-button {
        width: 40px;
        height: 40px;
        border-radius: 6px;
        padding: 6px;
        flex-shrink: 0;
    }
    
    .search-button:hover {
        background: rgba(0, 120, 212, 0.1);
    }
    
    .search-icon {
        width: 22px;
        height: 22px;
        color: var(--primary-color);
        transition: all 0.3s ease;
    }
    
    .search-container.expanded .search-icon {
        width: 18px;
        height: 18px;
    }
    
    #searchInput {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        font-size: 16px;
        color: var(--text-color);
        width: 0;
        opacity: 0;
        padding: 0;
        margin: 0;
        transition: all 0.4s ease 0.1s;
        order: 1;
        display: none;
    }
    
    .search-container.expanded #searchInput {
        display: block;
        width: 100%;
        max-width: 100%;
        opacity: 1;
        padding: 8px 12px;
        margin-right: 8px;
        box-sizing: border-box;
    }
    
    #searchInput::placeholder {
        color: #ffffff;
        font-size: 16px;
    }
    
    .search-results {
        position: fixed;
        top: 64px;
        left: 8px;
        right: 8px;
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        background: white;
        border: 1px solid #ddd;
        border-radius: 16px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        overflow-x: hidden;
        display: none;
        z-index: 1002;
        margin: 0;
        box-sizing: border-box;
    }
    
    .search-results.show {
        display: block;
    }
}

/* 非常に小さな画面での調整 */
@media (max-width: 480px) {
  
  .s_menu_logo {
    height: 30px !important; /* モバイルロゴも少し小さく */
  }
}

/* --- ニュースサイト専用：モバイルでは検索をモバイルメニュー内に常時表示 --- */

/* 移動フラグが付いた場合はヘッダー表示を抑制（PCでは従来通りヘッダーに表示） */
.search-container.moved-to-mobile-menu {
  /* PCでは通常の位置を使うが、移動済みならヘッダーで見えないようにしない（移動そのものがDOM再配置しているため不要） */
}

/* モバイル用：メニュー内に入れた検索の見た目 */
@media (max-width: 768px) {
  /* ヘッダ固定型は非表示（ヘッダー上の小さいアイコンを残したければ別途） */
  .search-container {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    z-index: auto !important;
    display: none; /* ヘッダーに残る分は非表示。実際の検索はモバイルメニュー内に移動される */
  }
  /* モバイルメニュー内に挿入された検索コンテナを常時展開スタイルに */
  .mobile-menu .search-container,
  .mobile-menu-container .search-container,
  #mobileMenuContainer .search-container {
    display: block !important;
    padding: 10px 12px;
  }

  .mobile-menu .search-box,
  .mobile-menu-container .search-box,
  #mobileMenuContainer .search-box {
    width: 90%;
    margin: 0 auto !important;
    height: 48px;
    border-radius: 10px;
    padding: 6px 10px;
    box-sizing: border-box;
    background: #ffffff60;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    
  }

  /* input を常時表示（展開ロジックを無効化） */
  #searchInput {
    display: block !important;
    width: calc(100% - 48px);
    opacity: 1 !important;
    padding: 8px 10px;
    font-size: 16px;
    border: none;
    background: transparent;
  }

  .search-button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    padding: 6px;
    margin-left: 6px;
  }

  /* 検索結果ドロップダウンはメニュー内での表示に合わせて固定 */
  .search-results {
    position: static;
    width: 100%;
    max-height: 40vh;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    margin-top: 8px;
    border-radius: 8px;
  }
}

