/* 基本スタイル */
.site-header {
    background-color: #f8f8f8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-branding {
  padding: 15px 0;
}

.site-title {
  margin: 0;
  font-size: 24px;
}

.site-title a {
  text-decoration: none;
  color: #333;
}

/* メインナビゲーション */
.main-navigation {
  display: flex;
  align-items: center;
}

/* アクセシビリティ用スクリーンリーダーテキスト */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* メニューアイテム - デスクトップ (960px以上) */
@media screen and (min-width: 960px) {
  .menu-toggle {
    display: none;
  }
  
  .menu-items {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .menu-items > li {
    position: relative;
    margin: 0;
  }
  
  .menu-items > li > a {
    display: block;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
  }
  
  .menu-items .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
    min-width: 200px;
    background: #1F2023;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    list-style: none;
    margin: 0;
    /* margin-top: 16px; */
    padding: 8px 8px 16px;
    border-radius: 8px;
  }
  
  /* より安定したホバー体験のために、親要素のpadding-bottomを追加 */
  .menu-items .menu-item-has-children {
    padding-bottom: 16px; /* 元のmargin-topの分をpaddingで補完 */
  }

  .menu-items .menu-item-has-children:hover .sub-menu {
    display: block;
    margin-top: 2px;
  }

  /* または、より確実な方法として擬似要素でブリッジを作成 */
  .menu-items .menu-item-has-children::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 16px; /* 元のmargin-topと同じ高さ */
    background: transparent;
    z-index: 998;
  }
  
  .menu-items .sub-menu li:last-child {
    border-bottom: none;
  }
  
  .menu-items .sub-menu a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
  }
}

/* メニューアイテム - モバイル (960px未満) */
@media screen and (max-width: 959px) {
  .menu-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    width: 50px;
    position: absolute;
    top: 0;
    right: 10px;
    background: transparent;
    border: none;
    padding: 0 10px;
  }
  
  .hamburger-icon {
    position: relative;
    width: 30px;
    height: 20px;
  }
  
  .hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #fff;
    position: absolute;
    left: 0;
    transition: all 0.3s ease;
  }
  
  .hamburger-line:nth-child(1) {
    top: 0;
  }
  
  .hamburger-line:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
  }
  
  .hamburger-line:nth-child(3) {
    bottom: 0;
  }
  
  /* ハンバーガーメニュー開いたとき */
  .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    top: 10px;
    transform: rotate(45deg);
  }
  
  .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    bottom: auto;
    top: 10px;
    transform: rotate(-45deg);
  }
  
  .menu-items {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  
  /* メニュー表示の複数パターンをカバー */
  .main-navigation.menu-open .menu-items,
  .main-navigation .menu-toggle[aria-expanded="true"] ~ .menu-items {
    display: block;
  }
  
  .menu-items > li {
    border-bottom: 2px solid #f0f0f0;
  }
  
  .menu-items > li > a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
  }
  
  /* サブメニュー（アコーディオン） */
  .menu-items li.menu-item-has-children {
    position: relative;
  }
  
  .menu-items li.menu-item-has-children > a {
    padding-right: 50px;
  }
  
  .menu-items .sub-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  
  .menu-items li.submenu-open > .sub-menu {
    display: block;
  }
  
  .menu-items .sub-menu li a {
    display: block;
    padding: 12px 20px 12px 35px;
    text-decoration: none;
    font-size: 14px;
  }
}

/* PC表示時（960px以上）の言語切替 */
@media screen and (min-width: 960px) {
  .main-navigation .wpml-ls-legacy-list-horizontal {
    display: block; /* PCでは常に表示 */
    margin-left: 10px;
  }
}

/* モバイル表示時（960px未満）の言語切替 */
@media screen and (max-width: 959px) {
  /* 言語切替の初期状態は非表示 */
  .main-navigation .wpml-ls-legacy-list-horizontal {
    display: none;
    margin-top: 0;
    padding: 15px 20px;
    text-align: left;
  }
  
  /* メニュー開放時に表示 */
  .main-navigation.menu-open .wpml-ls-legacy-list-horizontal,
  .main-navigation .menu-toggle[aria-expanded="true"] ~ .wpml-ls-legacy-list-horizontal {
    display: block;
  }
  
  /* 言語切替の位置調整 */
  .main-navigation .wpml-ls-legacy-list-horizontal ul {
    text-align: center;
  }
  
  /* メニュー項目が入るコンテナと同じスタイルを適用 */
  .main-navigation .wpml-ls-legacy-list-horizontal {
    position: relative;
    width: 100%;
    z-index: 999;
  }
  
  /* ハンバーガーメニュークリック時のコンテナスタイル統一 */
  .main-navigation.menu-open .menu-items,
  .main-navigation.menu-open .wpml-ls-legacy-list-horizontal,
  .main-navigation .menu-toggle[aria-expanded="true"] ~ .menu-items,
  .main-navigation .menu-toggle[aria-expanded="true"] ~ .wpml-ls-legacy-list-horizontal {
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  }
}

/* PC表示時のSNSリンクは非表示 */
@media screen and (min-width: 960px) {
  .mobile-sns-links {
    display: none;
  }
}

/* モバイル専用SNSリンクのスタイル */
@media screen and (max-width: 959px) {
  .mobile-sns-links {
    display: none; /* 初期は非表示に */
    margin-top: 40px;
    margin-bottom: 40px;
  }
  
  .main-navigation.menu-open .mobile-sns-links,
  .main-navigation .menu-toggle[aria-expanded="true"] ~ .mobile-sns-links {
    display: block; /* メニューが開いているときだけ表示 */
  }
  
  .mobile-sns-links .sns-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
  }
  
  .mobile-sns-links .sns-item {
    margin: 0;
  }
  
  .mobile-sns-links .sns-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: #fff;
    border-radius: 50%;
    color: #333;
    transition: all 0.3s ease;
    text-decoration: none;
  }
  
  .mobile-sns-links .sns-item a:hover {
    transform: scale(1.1);
  }
  
  /* 各SNSの色設定 */
  .mobile-sns-links .sns-twitter a:hover {
    background-color: #000;
    color: #fff;
  }
  
  .mobile-sns-links .sns-bluesky a:hover {
    background-color: #00bfff;
    color: #fff;
  }
  
  .mobile-sns-links .sns-youtube a:hover {
    background-color: #ff0000;
    color: #fff;
  }
}