/* ==========================================================================
   shizuku media — Header Styles
   ========================================================================== */

/* Site wrapper — centers header + container together */
.site-wrapper {
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}

/* Fixed header — stays at top within site-wrapper width */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  background: var(--color-bg-white);
  border-bottom: 1px solid;
  border-image: linear-gradient(90deg, #CCEFF2, #E5CFF0) 1;
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 430px;
  z-index: 100;
}

/* ヘッダー固定分の余白をコンテナに追加 */
.sp-container {
  padding-top: 56px;
}

/* WP admin bar offset */
.admin-bar .header {
  top: var(--wp-admin--admin-bar--height, 32px);
}

.admin-bar .sp-container {
  padding-top: calc(24px + var(--wp-admin--admin-bar--height, 24px));
}

/* --------------------------------------------------------------------------
   Header elements
   -------------------------------------------------------------------------- */
.header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header__logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-primary);
  cursor: pointer;
}

.header__btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Menu toggle (hamburger) */
.header__menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-primary);
  cursor: pointer;
}

.header__menu-toggle svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   Mobile Menu Panel
   -------------------------------------------------------------------------- */
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  background: var(--color-bg-white);
  z-index: 200;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.admin-bar .menu-panel {
  top: var(--wp-admin--admin-bar--height, 32px);
  height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}

.menu-panel[hidden] {
  display: block;
  transform: translateX(100%);
  pointer-events: none;
}

.menu-panel.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.menu-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  background: var(--color-bg-white);
  z-index: 1;
}

.menu-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-primary);
}

/* Menu search */
.menu-panel__search {
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border-light);
}

.menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--color-bg-light);
  border-radius: 10px;
  border: 1px solid var(--color-border-light);
}

.menu-search svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.menu-search__input {
  flex: 1;
  border: none;
  background: none;
  font-size: 13px;
  color: var(--color-text-primary);
  outline: none;
  font-family: inherit;
}

.menu-search__input::placeholder {
  color: var(--color-text-muted);
}

/* Accordion nav */
.menu-panel__nav {
  padding: 8px 0;
}

.nav-accordion {
  border-bottom: 1px solid var(--color-border-light);
}

.nav-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  cursor: pointer;
  text-align: left;
}

.nav-accordion__trigger svg {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-accordion__trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-accordion__panel {
  padding: 0 20px 12px 36px;
}

.nav-accordion__panel[hidden] {
  display: none;
}

.nav-accordion__link {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.nav-accordion__link:hover {
  color: var(--color-teal);
}

/* Menu overlay backdrop */
.menu-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   Search Overlay
   -------------------------------------------------------------------------- */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 430px;
  margin: 0 auto;
  background: var(--color-bg-white);
  z-index: 200;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}

.search-overlay[hidden] {
  display: block;
  transform: translateY(-100%);
  pointer-events: none;
}

.search-overlay.is-open {
  transform: translateY(0);
  pointer-events: auto;
}

.admin-bar .search-overlay {
  top: var(--wp-admin--admin-bar--height, 32px);
}

.search-overlay__inner {
  padding: 20px;
}

.search-overlay__field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px solid var(--color-teal);
  border-radius: 12px;
  background: #fff;
}

.search-overlay__field svg {
  flex-shrink: 0;
  color: var(--color-teal);
}

.search-overlay__input {
  flex: 1;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--color-text-primary);
  outline: none;
  font-family: inherit;
}

.search-overlay__input::placeholder {
  color: var(--color-text-muted);
}

.search-overlay__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  display: flex;
}

.search-overlay__quick {
  margin-top: 20px;
}

.search-overlay__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  display: block;
}

.search-overlay__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.search-overlay__tags a {
  font-size: 13px;
  color: var(--color-text-dark);
  padding: 6px 14px;
  background: var(--color-bg-light);
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid var(--color-border-light);
}

.search-overlay__tags a:active {
  background: var(--color-teal);
  color: #fff;
  border-color: var(--color-teal);
}
