/* ============================================================
   header.css — JAPAN ARCHIVE ヘッダー（ハンバーガーなし）
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 5, 3, 0.97);
  border-bottom: 1px solid rgba(201, 145, 58, 0.12);
  backdrop-filter: blur(20px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  flex-wrap: nowrap;
  /* ★修正: 幅を超えた要素が絶対に溢れないよう */
  min-width: 0;
}

/* ---- ロゴ ---- */
.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 24px;
  height: 24px;
  color: var(--gold);
  opacity: 0.8;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.logo-mark svg {
  width: 100%;
  height: 100%;
}
.header-logo:hover .logo-mark {
  opacity: 1;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.logo-main {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--paper);
  text-transform: uppercase;
  line-height: 1;
  transition: color 0.2s;
}
.header-logo:hover .logo-main {
  color: var(--gold);
}
.logo-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 9px;
  color: rgba(201, 145, 58, 0.42);
  letter-spacing: 0.06em;
  line-height: 1;
}

/* 縦区切り */
.header-logo::after {
  content: "";
  display: block;
  width: 1px;
  height: 22px;
  background: rgba(201, 145, 58, 0.14);
  margin-left: 12px;
  flex-shrink: 0;
}

/* ---- ナビ（デスクトップ） ---- */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.header-nav__link {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 5px 11px;
  color: rgba(212, 201, 176, 0.32);
  transition: all 0.2s;
  white-space: nowrap;
  position: relative;
}
.header-nav__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 11px;
  right: 11px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s ease;
  transform-origin: left;
}
.header-nav__link:hover {
  color: rgba(212, 201, 176, 0.75);
}
.header-nav__link:hover::after {
  transform: scaleX(1);
}
.header-nav__link.is-active {
  color: var(--gold);
}
.header-nav__link.is-active::after {
  transform: scaleX(1);
}

#header-mylevel-link {
  background: rgba(201, 145, 58, 0.06);
  border: 1px solid rgba(201, 145, 58, 0.2);
  border-radius: 3px;
  padding: 4px 11px;
  color: rgba(201, 145, 58, 0.65) !important;
  margin-left: 4px;
}
#header-mylevel-link::after {
  display: none;
}
#header-mylevel-link:hover {
  background: rgba(201, 145, 58, 0.12);
  border-color: rgba(201, 145, 58, 0.45);
  color: var(--gold) !important;
}

/* ---- 右エリア ---- */
.header-right {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}
.header-right::before {
  content: "";
  display: block;
  width: 1px;
  height: 18px;
  background: rgba(201, 145, 58, 0.12);
  flex-shrink: 0;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 5px;
}
.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.7);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.6);
  animation: blink 2s infinite;
  flex-shrink: 0;
}
.pulse-dot.is-verified {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
  animation: none;
}
.status-mono {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 38, 38, 0.38);
  white-space: nowrap;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-mono.is-verified {
  color: rgba(34, 197, 94, 0.62);
}

.header-cta {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 3px;
}
.header-cta--login {
  background: transparent;
  border: 1px solid rgba(201, 145, 58, 0.32);
  color: rgba(201, 145, 58, 0.68);
}
.header-cta--login:hover {
  background: rgba(201, 145, 58, 0.1);
  border-color: var(--gold);
  color: var(--gold);
}
.header-cta--logout {
  background: transparent;
  border: 1px solid rgba(212, 201, 176, 0.1);
  color: rgba(212, 201, 176, 0.28);
  display: none;
}
.header-cta--logout:hover {
  border-color: rgba(212, 201, 176, 0.28);
  color: rgba(212, 201, 176, 0.65);
}

/* ---- スマホ用サブナビ（ハンバーガーなし） ---- */
.header-mobile-nav {
  display: none;
  border-top: 1px solid rgba(201, 145, 58, 0.08);
  background: rgba(4, 3, 2, 0.98);
}
.header-mobile-nav__inner {
  display: flex;
  align-items: center;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 0;
}
.header-mobile-nav__inner::-webkit-scrollbar {
  display: none;
}

.header-mobile-nav__link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(212, 201, 176, 0.38);
  padding: 10px 14px;
  white-space: nowrap;
  flex-shrink: 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.header-mobile-nav__link:hover,
.header-mobile-nav__link.is-active {
  color: var(--gold);
  border-bottom-color: rgba(201, 145, 58, 0.5);
}

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

/* ---- レスポンシブ ---- */
@media (max-width: 680px) {
  .header-inner {
    padding: 0 16px;
    gap: 12px;
    height: 50px;
    overflow: hidden;
  }
  .header-nav,
  #header-mylevel-link {
    display: none !important;
    visibility: hidden;
    width: 0 !important;
    overflow: hidden;
    flex: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none;
  }
  .header-status {
    display: none;
  }
  .header-right::before {
    display: none;
  }
  .logo-sub {
    display: none;
  }
  .header-mobile-nav {
    display: block;
  }
}
@media (min-width: 681px) {
  .header-mobile-nav {
    display: none !important;
  }
}

/* ---- スマホヘッダー追加修正 ---- */
@media (max-width: 680px) {
  .header-cta {
    min-height: 40px;
    min-width: 60px;
    padding: 6px 12px;
    font-size: 11px;
  }
  .header-inner {
    padding: 0 12px;
  }
  .logo-main {
    font-size: 12px;
    letter-spacing: 0.12em;
  }
}

/* ====================================================
   ★修正: iOS入力ズーム防止・全体
   ==================================================== */
input, select, textarea {
  /* iOS: font-size 16px以上でズーム防止 */
  font-size: max(16px, 1em);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* ただしヘッダー等の小さい文字はそのまま */
.header-nav__link, .status-mono, .header-cta {
  font-size: inherit;
}

/* ====================================================
   ★ヘッダースマホ崩れ修正（登録ページ等）
   ==================================================== */
@media (max-width: 680px) {
  /* ロゴとボタンだけ表示、navは完全非表示 */
  .header-logo {
    flex-shrink: 0;
    min-width: 0;
  }
  .logo-text-wrap {
    overflow: hidden;
  }
  .logo-sub {
    display: none !important;
  }
  .header-right {
    flex-shrink: 0;
    margin-left: auto;
  }
  /* site-headerがflex-wrapしないよう */
  .site-header {
    overflow: hidden;
  }
  .header-inner {
    justify-content: space-between;
  }
  /* ヘッダーのモバイルナビ（横スクロール式） */
  .header-mobile-nav {
    border-top: 1px solid rgba(201, 145, 58, 0.08);
  }
  .header-mobile-nav__inner {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .header-mobile-nav__inner::-webkit-scrollbar { display: none; }
  .header-mobile-nav__link {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 9px;
    letter-spacing: 0.12em;
  }
  /* レベルリンクも横並び */
  .header-mobile-nav__level {
    display: flex;
    gap: 0;
    flex-shrink: 0;
  }
}

/* ============================================================
   ★追加修正: PCヘッダーデザイン改善
   ============================================================ */

/* header-inner: max-width広げてナビが入るように */
.header-inner {
  max-width: 1280px !important;
  gap: 16px !important;
  overflow: visible !important;
}

/* ナビリンク: 見切れないよう */
.header-nav__link {
  font-size: 10px !important;
  letter-spacing: 0.14em !important;
  padding: 5px 10px !important;
}

/* レベルリンク（INNER CIRCLE等）のスタイル強化 */
.header-nav__link--level,
#header-mylevel-link {
  background: rgba(201, 145, 58, 0.08) !important;
  border: 1px solid rgba(201, 145, 58, 0.25) !important;
  border-radius: 3px !important;
  color: rgba(201, 145, 58, 0.75) !important;
  padding: 4px 10px !important;
  margin-left: 6px !important;
  transition: all 0.2s !important;
}
#header-mylevel-link:hover {
  background: rgba(201, 145, 58, 0.15) !important;
  border-color: rgba(201, 145, 58, 0.5) !important;
  color: var(--gold) !important;
}

/* status-mono: 文字が長くなっても省略しない */
.status-mono {
  max-width: 130px !important;
}

/* ログインボタン: SVGアイコン除去でスッキリ */
.header-cta--login svg {
  display: none;
}
