/* ==========================================================================
   Layout - ヘッダー
   ========================================================================== */

/* ===== サイトヘッダー ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--pb-z-header);
  background: var(--pb-header-bg);
  border-bottom: 1px solid var(--pb-header-border);
  transition: transform var(--pb-transition-base), box-shadow var(--pb-transition-base);
}

.admin-bar .site-header {
  top: 32px;
}

.site-header.is-scrolled {
  box-shadow: var(--pb-shadow-lg);
}

.site-header.is-hidden {
  transform: translateY(-100%);
}

/* ===== ヘッダーメッセージバー ===== */
.header-message-bar {
  padding: var(--pb-space-2) var(--pb-space-4);
  text-align: center;
  font-size: var(--pb-font-size-sm);
  font-weight: var(--pb-font-weight-medium);
  line-height: 1.4;
}

.header-message-bar a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== ヘッダーインナー ===== */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--pb-header-height);
  max-width: var(--pb-container-max);
  margin: 0 auto;
  padding: 0 var(--pb-space-6);
}

/* ===== ロゴ ===== */
.site-logo {
  flex-shrink: 0;
  margin-right: var(--pb-space-8);
}

.site-logo a {
  display: flex;
  align-items: center;
  gap: var(--pb-space-3);
}

.site-logo img {
  height: 40px;
  width: auto;
}

.site-logo .logo-text {
  font-size: var(--pb-font-size-2xl);
  font-weight: var(--pb-font-weight-bold);
  color: var(--pb-text-primary);
  letter-spacing: -0.02em;
}

.site-logo .logo-text:hover {
  color: var(--pb-primary);
}

.site-description {
  font-size: var(--pb-font-size-xs);
  color: var(--pb-text-muted);
  margin-top: 2px;
  display: none;
}

@media screen and (min-width: 1024px) {
  .site-description {
    display: block;
  }
}

/* ===== グローバルナビ ===== */
.global-nav {
  display: none;
  flex: 1;
}

@media screen and (min-width: 1024px) {
  .global-nav {
    display: block;
  }
}

.global-nav ul {
  display: flex;
  align-items: center;
  gap: 0;
}

.global-nav li {
  position: relative;
}

.global-nav > ul > li > a {
  display: flex;
  align-items: center;
  height: var(--pb-header-height);
  padding: 0 var(--pb-space-5);
  font-size: var(--pb-font-size-sm);
  font-weight: var(--pb-font-weight-medium);
  color: var(--pb-text-primary);
  position: relative;
  white-space: nowrap;
}

.global-nav > ul > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--pb-space-5);
  right: var(--pb-space-5);
  height: 3px;
  background: var(--pb-primary);
  border-radius: var(--pb-radius-full) var(--pb-radius-full) 0 0;
  transform: scaleX(0);
  transition: transform var(--pb-transition-base);
}

.global-nav > ul > li > a:hover::after,
.global-nav > ul > li.current-menu-item > a::after {
  transform: scaleX(1);
}

.global-nav > ul > li > a:hover {
  color: var(--pb-primary);
}

.global-nav > ul > li.current-menu-item > a {
  color: var(--pb-primary);
}

/* ドロップダウン */
.global-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--pb-bg-primary);
  border: 1px solid var(--pb-border-color);
  border-radius: var(--pb-radius-md);
  box-shadow: var(--pb-shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--pb-transition-base);
  z-index: var(--pb-z-dropdown);
  padding: var(--pb-space-2) 0;
}

.global-nav li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.global-nav .sub-menu a {
  display: block;
  padding: var(--pb-space-3) var(--pb-space-5);
  font-size: var(--pb-font-size-sm);
  color: var(--pb-text-primary);
  transition: all var(--pb-transition-fast);
}

.global-nav .sub-menu a:hover {
  background: var(--pb-bg-secondary);
  color: var(--pb-primary);
}

/* ===== ヘッダーアクション ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--pb-space-3);
  flex-shrink: 0;
}

/* 検索 */
.header-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--pb-radius-full);
  color: var(--pb-text-secondary);
  transition: all var(--pb-transition-fast);
}

.header-search-toggle:hover {
  background: var(--pb-bg-secondary);
  color: var(--pb-primary);
}

.header-search-toggle svg {
  width: 20px;
  height: 20px;
}

/* ダークモードトグル */
.dark-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--pb-radius-full);
  color: var(--pb-text-secondary);
  transition: all var(--pb-transition-fast);
}

.dark-mode-toggle:hover {
  background: var(--pb-bg-secondary);
  color: var(--pb-primary);
}

.dark-mode-toggle svg {
  width: 20px;
  height: 20px;
}

/* ハンバーガー */
.hamburger-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  gap: 5px;
  border-radius: var(--pb-radius-full);
  transition: all var(--pb-transition-fast);
}

@media screen and (min-width: 1024px) {
  .hamburger-toggle {
    display: none;
  }
}

.hamburger-toggle:hover {
  background: var(--pb-bg-secondary);
}

.hamburger-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--pb-text-primary);
  border-radius: var(--pb-radius-full);
  transition: all var(--pb-transition-base);
}

.hamburger-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.hamburger-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.hamburger-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== 検索オーバーレイ ===== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--pb-z-overlay);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 20vh;
  opacity: 0;
  visibility: hidden;
  transition: all var(--pb-transition-base);
}

.search-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-inner {
  width: 100%;
  max-width: 640px;
  padding: 0 var(--pb-space-6);
  transform: translateY(-20px);
  transition: transform var(--pb-transition-base);
}

.search-overlay.is-active .search-overlay-inner {
  transform: translateY(0);
}

.search-overlay input[type="text"] {
  width: 100%;
  height: 64px;
  padding: 0 var(--pb-space-6);
  font-size: var(--pb-font-size-xl);
  background: var(--pb-bg-primary);
  border-radius: var(--pb-radius-lg);
  color: var(--pb-text-primary);
  box-shadow: var(--pb-shadow-xl);
}

.search-overlay input[type="text"]::placeholder {
  color: var(--pb-text-muted);
}

/* ===== モバイルドロワー ===== */
.drawer-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100vh;
  z-index: var(--pb-z-modal);
  background: var(--pb-bg-primary);
  box-shadow: var(--pb-shadow-xl);
  transform: translateX(100%);
  transition: transform var(--pb-transition-slow);
  overflow-y: auto;
  padding: var(--pb-space-6);
}

.drawer-menu.is-active {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--pb-z-modal) - 1);
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--pb-transition-base);
}

.drawer-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.drawer-menu .drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  margin-bottom: var(--pb-space-6);
  border-radius: var(--pb-radius-full);
  color: var(--pb-text-secondary);
}

.drawer-menu .drawer-close:hover {
  background: var(--pb-bg-secondary);
}

.drawer-menu nav ul {
  display: flex;
  flex-direction: column;
}

.drawer-menu nav a {
  display: block;
  padding: var(--pb-space-4) 0;
  font-size: var(--pb-font-size-base);
  font-weight: var(--pb-font-weight-medium);
  color: var(--pb-text-primary);
  border-bottom: 1px solid var(--pb-border-light);
}

.drawer-menu nav a:hover {
  color: var(--pb-primary);
}

.drawer-menu .sub-menu {
  padding-left: var(--pb-space-5);
}

.drawer-menu .sub-menu a {
  font-size: var(--pb-font-size-sm);
  color: var(--pb-text-secondary);
}
