/* 共通スタイル - ヘッダー、言語バー、サイドメニューなど */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #fff;
  color: #333;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* グローバルアイコン設定 */
.globe-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="%23333" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10" /><line x1="2" y1="12" x2="22" y2="12" /><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" /></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.85;
}

/* ヘッダー */
.main-header {
  width: 100%;
  height: 60px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* メニューアイコン */
.menu-icon {
  font-size: 24px;
  cursor: pointer;
  color: #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 50%;
  padding: 0;
  margin: 0;
  margin-right: 8px;
}

.menu-icon:hover {
  background-color: rgba(60, 64, 67, 0.08);
}

/* サイト名 */
.site-name {
  font-size: 18px;
  font-weight: 400;
  color: #202124;
  line-height: 1.2;
  margin: 0;
  padding: 0;
}

.site-name-primary {
  display: block;
  font-size: 18px;
}

.site-name-secondary {
  display: block;
  font-size: 16px;
  opacity: 0.9;
}

.header-right {
  display: flex;
  align-items: center;
}

/* 言語ボタン */
.language-button {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #5f6368;
  font-size: 14px;
  padding: 8px;
  transition: all 0.2s ease;
}

.language-button:hover {
  color: #1a73e8;
}

/* 言語バー */
.language-bar {
  width: 100%;
  height: 48px;
  background-color: #fff;
  border-bottom: 1px solid #dadce0;
  position: fixed;
  top: 60px;
  left: 0;
  z-index: 900;
  transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.language-bar::-webkit-scrollbar {
  display: none;
}

.language-bar.hidden {
  transform: translateY(-100%);
}

/* 言語リスト */
.language-nav {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 48px;
}

.language-nav a {
  text-decoration: none;
  color: #5f6368;
  font-size: 14px;
  padding: 0 12px;
  height: 48px;
  line-height: 48px;
  white-space: nowrap;
  transition: all 0.2s ease;
  position: relative;
}

.language-nav a:first-child {
  padding-left: 0;
}

.language-nav a:hover {
  color: #1a73e8;
}

.language-nav a.active {
  color: #1a73e8;
  font-weight: 500;
}

.language-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #1a73e8;
  border-radius: 3px 3px 0 0;
}

/* メインコンテンツエリア */
.page-container {
  margin-top: 120px;
  padding: 0 0 20px 0;
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: margin-top 0.3s;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.page-container.bar-hidden {
  margin-top: 80px;
}

/* 言語選択パネル */
.language-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 350px;
  max-width: 90vw;
  max-height: 80vh;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  padding: 24px;
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow-y: auto;
}

.language-panel.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.language-panel h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
  color: #202124;
  font-weight: 500;
  text-align: center;
  position: sticky;
  top: 0;
  background-color: #fff;
  padding: 5px 0;
  z-index: 1;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.language-grid a {
  text-decoration: none;
  color: #202124;
  padding: 10px;
  border-radius: 4px;
  font-size: 14px;
  text-align: center;
  transition: all 0.2s ease;
}

.language-grid a:hover {
  background-color: #f8f9fa;
}

.language-grid a.active {
  background-color: #e8f0fe;
  color: #1a73e8;
  font-weight: 500;
}

/* オーバーレイ */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1050;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* サイドメニュー */
.side-menu {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background-color: #fff;
  border-right: 1px solid #dadce0;
  padding: 0 0 20px;
  box-sizing: border-box;
  transition: left 0.3s ease;
  z-index: 1100;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.side-menu-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
}

.side-menu-header .menu-icon {
  margin-right: 12px;
}

.side-menu-header-text {
  font-size: 16px;
  font-weight: 500;
  color: #202124;
}

.side-menu-section {
  padding: 0 0 15px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 15px;
}

.side-menu-section:last-child {
  border-bottom: none;
}

.side-menu-title {
  font-size: 14px;
  color: #5f6368;
  margin: 0 0 10px;
  padding: 0 20px;
}

.side-menu a {
  display: block;
  text-decoration: none;
  color: #202124;
  font-size: 14px;
  padding: 10px 20px;
  transition: background-color 0.2s;
}

.side-menu a:hover {
  background-color: #f8f9fa;
}

.side-menu a.active {
  background-color: #e8f0fe;
  color: #1a73e8;
  font-weight: 500;
}

/* コンテナスタイル */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 5%;
  flex: 1;
  box-sizing: border-box;
}

h1 {
  font-size: 28px;
  margin: 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #ccc;
}

/* 広告コンテナのスタイル */
.ad-container {
  width: 100%;
  overflow: hidden;
  margin: 20px 0;
  text-align: center;
  clear: both;
  position: relative;
  z-index: 5;
}

/* アドセンス広告用スタイル */
ins.adsbygoogle {
  display: block;
  overflow: hidden;
  background-color: transparent;
}

/* 広告コンテナの位置別スタイル */
.ad-container-top,
.ad-container-bottom {
  width: 100%;
  max-width: 970px;
  margin: 30px auto;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .language-bar {
    display: none;
  }
  
  .page-container {
    margin-top: 80px;
  }
  
  .language-panel {
    width: 300px;
    padding: 16px;
  }
  
  .language-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .language-grid a {
    padding: 12px 5px;
    font-size: 13px;
  }
  
  .page-container {
    padding: 15px 10px;
  }
  
  /* モバイル広告用のスタイル調整 */
  .ad-container {
    margin: 15px auto;
  }
}