/* ==========================================================
   Design tokens
   元Vue実装の Tailwind カスタムトークン(sumi-*, sun-*, mag2-*)を
   近似したCSS変数に置き換えています。実際のブランドカラーに
   合わせて調整してください。
========================================================== */
:root {
  --color-white: #ffffff;
  --color-sumi-50: #f6f6f6;
  --color-sumi-100: #dfdfdf;
  --color-sumi-400: #989898;
  --color-sumi-500: #808080;
  --color-sumi-700: #515151;
  --color-sumi-900: #222222;
  --color-sun-600: #da1c2f;
  --color-sun-700: #be1728;

  --fs-2xs: 11px;
  --fs-sm: 13px;
  --fs-base: 14px;

  --header-height: 50px;
  --z-header: 50;
  --z-drawer-overlay: 60;
  --z-drawer: 70;

  --spacing: 0.25rem;
}

.new-header * {
  box-sizing: border-box;
}

body {
  margin: 0;
}
body .new-header {
  margin: 0;
  font-family:
    Helvetica Neue,
    Segoe UI,
    Hiragino Kaku Gothic ProN,
    Hiragino Sans,
    Meiryo,
    MS PGothic,
    sans-serif;
  color: var(--color-sumi-900);
}

.new-header a {
  color: inherit;
  text-decoration: none;
  font-weight: 400;
  display: flex;
  line-height: 1.5;
}
.new-header a:hover {
  opacity: 1;
}
.new-header ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.new-header button {
  font: inherit;
  line-height: 1.5;
  margin: 0;
  letter-spacing: 0;
}
.new-header button:hover {
  opacity: 1;
  filter: opacity(1);
}

/* ==========================================================
   Header
========================================================== */
.header.new-header {
  width: 100%;
  z-index: var(--z-header);
  background: var(--color-white);
  margin: 0;
}

.header[data-fixed="true"].new-header {
  position: fixed;
  top: 0;
  left: 0;
}

.new-header .header__inner {
  height: var(--header-height);
  background: var(--color-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-sumi-50);
  position: relative;
}

.new-header.header-spacer {
  height: var(--header-height);
}
.new-header .header-spacer:not([hidden]) {
  display: block;
}

.new-header .header__logo {
  padding: 0 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  height: 100%;
}
.new-header .header__logo img {
  height: auto;
  width: 100px;
}

/* ==========================================================
   PC nav
========================================================== */
.new-header .header__nav--pc {
  width: 100%;
  display: none;
}

@media (min-width: 1024px) {
  .new-header .header__nav--pc {
    display: block;
  }
  .new-header .header__nav--sp {
    display: none;
  }
}

.new-header .nav-list {
  padding-right: 16px;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-end;
  color: var(--color-sumi-700);
}

.new-header .nav-list__item {
  position: relative;
}

.new-header .nav-list__item--search {
  min-width: 250px;
  max-width: 400px;
  padding: 0 8px;
  width: 100%;
  flex: 1;
}

.new-header .text-link {
  position: relative;
  height: var(--header-height);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-size: var(--fs-sm);
  color: var(--color-sumi-700);
  white-space: nowrap;
  font-weight: 400;
  margin: 0;
}
.new-header .text-link:hover {
  background: var(--color-sumi-50);
}

.new-header .icon-link {
  position: relative;
  height: var(--header-height);
  padding: 0 10px;
  display: flex;
  align-items: center;
  color: var(--color-sumi-700);
  margin: 0;
}
.new-header .icon-link:hover {
  background: var(--color-sumi-50);
}

.new-header .icon-btn {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  color: var(--color-sumi-700);
  cursor: pointer;
  padding: 4px;
}

/* ==========================================================
   Search form
========================================================== */
.new-header .search-form {
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--color-sumi-50);
  border-radius: 999px;
  border: 1px solid var(--color-white);
  margin: 0;
}
.new-header .search-form:hover {
  border-color: var(--color-sumi-100);
}
.new-header .search-form:focus-within {
  border-color: var(--color-sumi-100);
}

.new-header .search-form__label {
  width: 100%;
  margin: 0;
  padding: 0;
}
.new-header .search-form__input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: var(--fs-base);
  margin: 0;
  box-shadow: none;
}
.new-header .search-form__input:focus {
  outline: none;
  box-shadow: none;
}

.new-header .search-form__submit {
  background: none;
  border: none;
  padding: 0 8px;
  display: flex;
  align-items: center;
  color: var(--color-sumi-700);
  cursor: pointer;
}

.new-header .drawer__search {
  padding: 16px;
  border-bottom: 1px solid var(--color-sumi-100);
}
.new-header .drawer__search .search-form {
  width: 100%;
}

/* ==========================================================
   Dropdown (PC: hover / SP,touch: click) — dropdown.js が制御
========================================================== */
.new-header .dropdown {
  display: inline-flex;
}

.new-header .dropdown__trigger {
  height: var(--header-height);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--color-sumi-700);
  font-size: var(--fs-sm);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 400;
}
.new-header .dropdown__trigger:hover,
.new-header .dropdown__trigger:active {
  background: var(--color-sumi-50);
}

/*
 * .dropdown__panel: 当たり判定だけを持つ透明な外枠。
 *   top: 100% でトリガー直下にぴったり接するため、
 *   トリガーの高さがドロップダウンごとに違っても隙間(デッドゾーン)ができない。
 * .dropdown__panel-inner: 見た目(背景・角丸・影)を持つ内側の箱。
 *   padding-top で "見た目上の隙間" を作るが、その padding 部分も
 *   外枠(.dropdown__panel)の当たり判定の内側なので hover が途切れない。
 */
.new-header .dropdown__panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s;
  position: absolute;
  top: 100%;
  right: 4px;
  padding-top: 8px; /* ← ここが見えない"つなぎ目"。隙間はあるが当たり判定は継続 */
  z-index: var(--z-header);
}

.new-header .dropdown__panel-inner {
  background: var(--color-white);
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
  transform: translateY(4px);
  transition: transform 0.2s ease;
}

.new-header .dropdown__panel--about .dropdown__panel-inner {
  width: 296px;
}
.new-header .dropdown__panel.dropdown__panel--write {
  padding-top: 16px;
}
.new-header .dropdown__panel--write .dropdown__panel-inner {
  width: 272px;
  max-height: calc(100svh - 100px);
  overflow-y: auto;
}
.new-header .dropdown__panel--account .dropdown__panel-inner {
  width: 272px;
}

.new-header .dropdown.is-open .dropdown__panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.new-header .dropdown.is-open .dropdown__panel-inner {
  transform: translateY(0);
}

/* ==========================================================
   Menu list (dropdown / drawer共通の項目リスト)
========================================================== */
.new-header .menu-list__item {
  border-bottom: 1px solid var(--color-sumi-100);
  color: var(--color-sumi-700);
}
.new-header .menu-list__item:last-child {
  border-bottom: none;
}

.new-header .menu-list__item--heading {
  padding: 12px 16px;
  font-weight: bold;
  background: var(--color-sumi-100);
  color: var(--color-sumi-700);
  font-size: 15px;
  text-align: left;
}

.menu-list__link {
  display: flex;
  padding: 12px 16px;
  gap: 16px;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  color: var(--color-sumi-700);
  font-size: var(--fs-base);
}
.menu-list__link:hover,
.menu-list__link:active {
  background: var(--color-sumi-50);
  opacity: 1;
}

.new-header .menu-list__label {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  font-weight: 400;
  font-size: 15px;
}

/* ==========================================================
   書くボタン
========================================================== */
.new-header .write-btn {
  position: relative;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-sumi-900);
  border-radius: 999px;
  color: var(--color-white);
  font-size: var(--fs-sm);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  height: fit-content;
  line-height: 1.5;
  margin-right: 0;
  margin-left: 0;
  text-shadow: none;
}
.new-header .write-btn:hover,
.new-header .write-btn:active {
  background: var(--color-sumi-700);
}

.new-header .write-magazine-item img {
  height: fit-content;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.new-header .write-magazine-item .menu-list__label {
  flex: 1;
  word-break: break-word;
}
.new-header .write-magazine-item .menu-list__label span {
  flex: 1;
  line-height: 150%;
  color: var(--color-sumi-700);
  font-size: 15px;
}

/* ==========================================================
   ログイン / アカウント
========================================================== */
.new-header .btn {
  display: block;
  text-align: center;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: bold;
  padding: 6px 16px;
  cursor: pointer;
  line-height: 1.5;
  text-shadow: none;
  box-shadow: none;
}
.new-header .btn--primary {
  color: var(--color-white);
  background: var(--color-sun-600);
  border: 1px solid var(--color-sun-600);
  margin-right: 0;
  margin-left: 0;
}
.new-header .btn--primary:hover {
  background: var(--color-sun-700);
  border-color: var(--color-sun-700);
  color: var(--color-sumi-50);
}
.new-header .btn--outline {
  color: var(--color-sumi-700);
  background: var(--color-white);
  border: 1px solid var(--color-sumi-400);
}
.new-header .btn--outline:hover {
  background: var(--color-sumi-50);
}
.new-header .btn--full {
  width: 100%;
  padding-inline: calc(var(--spacing) * 4);
  padding-block: 12px;
  font-size: 16px;
}

.new-header .account-panel__user {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-bottom: 1px solid var(--color-sumi-100);
}
.new-header .account-panel__user p {
  margin: 0;
}
.new-header .account-panel__user .label {
  font-size: var(--fs-2xs);
  color: var(--color-sumi-500);
  font-weight: bold;
  text-shadow: none;
  display: inline;
  padding: 0;
  line-height: 1.5;
  background-color: initial;
}
.new-header .account-panel__user .value {
  word-break: break-all;
  line-height: 1.5;
  font-weight: 400;
  font-size: 16px;
  padding: 0;
  color: var(--color-sumi-700);
  text-align: left;
}

.new-header .account-panel__search {
  padding: 16px;
  border-bottom: 1px solid var(--color-sumi-100);
}
.new-header .account-panel__logout {
  padding: 16px;
  display: flex;
  justify-content: center;
}

/* ==========================================================
   SP nav
========================================================== */
.new-header .header__nav--sp {
  display: flex;
}
.new-header .nav-list--sp {
  padding-right: 16px;
  gap: 16px;
}

@media (min-width: 1024px) {
  .new-header .header__nav--sp {
    display: none;
  }
}

/* ==========================================================
   モバイルドロワー
========================================================== */
.new-header.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 80%;
  max-width: 384px;
  background: var(--color-white);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease-in-out;
  z-index: var(--z-drawer);
  overflow-y: auto;
}
.new-header.drawer.is-open {
  transform: translateX(0);
}

.new-header .drawer__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  background: none;
  border: 1px solid var(--color-sumi-400);
  border-radius: 999px;
  padding: 4px;
  display: flex;
  cursor: pointer;
  color: var(--color-sumi-700);
}

.new-header .drawer__nav {
  display: flex;
  flex-direction: column;
  padding-top: 56px;
}

.new-header .drawer__logout {
  padding: 16px;
  justify-content: center;
}

.new-header .drawer-auth-item {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-top: 1px solid var(--color-sumi-100);
  border-bottom: 1px solid var(--color-sumi-100);
}
.new-header .drawer-auth-item .label {
  font-size: var(--fs-2xs);
  color: var(--color-sumi-500);
  margin: 0;
  border-radius: 0;
  background-color: initial;
  text-shadow: none;
  font-size: 12px;
  padding: 0;
  font-weight: 400;
  line-height: 1.5;
}
.new-header .drawer-auth-item .value {
  word-break: break-all;
  line-height: 1.5;
  margin: 0;
  padding: 0;
  font-weight: 400;
  color: var(--color-sumi-900);
  font-size: 16px;
}

.new-header .drawer-auth-login {
  padding: 16px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--color-sumi-100);
}

.new-header.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: var(--z-drawer-overlay);
}
.new-header.drawer-overlay:not([hidden]) {
  display: block;
}
.new-header.drawer-overlay[hidden] {
  display: none;
}

/* ==========================================================
   アコーディオン (メルマガ発行) — details/summary + CSS制御
========================================================== */
.new-header .accordion__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  padding: 12px 16px;
  gap: 16px;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  color: var(--color-sumi-700);
  background: var(--color-sumi-100);
  font-size: 15px;
}
.new-header .accordion__summary::-webkit-details-marker {
  display: none;
}

.new-header .accordion__icon--remove {
  display: none;
}
.new-header .accordion[open] .accordion__icon--add {
  display: none;
}
.new-header .accordion[open] .accordion__icon--remove {
  display: inline-flex;
}

.new-header .menu-list--nested {
  border-top: 1px solid var(--color-sumi-100);
}
.new-header .menu-list__item--accordion {
  border-bottom: 1px solid var(--color-white);
}

.new-header .menu-list__item--accordion .accordion {
  margin-bottom: 0;
}

/* body固定時(ドロワー展開中)のスクロールロックはJS側でstyleを操作 */

/* ==========================================================
   微調整
========================================================== */
.new-header .px-2 {
  padding-inline: calc(var(--spacing) * 2);
}

/* ==========================================================
   デモ用コンテンツ(実装には不要。動作確認用)
========================================================== */
/* .demo-content {
  padding: 24px 16px;
  max-width: 720px;
  margin: 0 auto;
}
.demo-toggle {
  display: block;
  margin: 12px 0;
  font-size: 14px;
} */
