@charset "UTF-8";

/* ============================================================
   header パーシャル用スタイル
   common/partials/header.html とセットで使う
   ※ ページ固有の CSS より後に <link> してください
   ============================================================ */


:root {
  --text-primary: #1e1e1e;
  --text-tertiary: #9d9d9d;
  --text-accent: #961414;
  --border-primary: #dadada;
  --border-accent: #961414;
  --surface-secondary: #ffffff;

  --font-sans: "Zen Kaku Gothic New", sans-serif;
  --font-en: "Inter", sans-serif;

  --header-h: 80px;
  --inner-max: 1500px;
}

html { scroll-padding-top: var(--header-h); }

/* ---- Header ---- */
.header ul,
.header ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.header a {
  color: inherit;
  text-decoration: none;
}
.header img {
  display: block;
  max-width: 100%;
  height: auto;
}
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface-secondary);
  border-bottom: 1px solid var(--border-accent);
}
.header__inner {
  height: var(--header-h);
  width: min(100% - 44px, var(--inner-max));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.header__top { min-width: 0; }
.site-logo { margin: 0; }
.header__logo {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 31px;
  row-gap: 10px;
}
.header__logo-jtm { grid-column: 1; grid-row: 1; height: 11px; width: auto; }
.header__logo-wordmark { grid-column: 1; grid-row: 2; height: 26px; width: auto; align-self: center; }
.header__logo-tagline { grid-column: 2; grid-row: 2; height: 13px; width: auto; align-self: center; }

.header__nav { display: flex; align-items: center; gap: 48px; }
.header .gnav { display: flex; align-items: center; gap: 24px; }
.header .gnav__item a {
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-primary);
  position: relative;
  padding-bottom: 15px;
}
.header .gnav__item--current a::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 16px;
  height: 1px;
  background: var(--border-accent);
}
.header .lang { display: flex; align-items: center; gap: 11px; }
.header .lang__item { font-family: var(--font-en); font-weight: 500; font-size: 0.6875rem; color: var(--text-tertiary); }
.header .lang__item--active { color: var(--text-accent); }
.header .lang__divider { width: 1px; height: 10px; background: var(--border-primary); }

/* 下層ページ — nav 常時表示・固定 */
body:not(.page-top) .header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
}
body:not(.page-top) > main {
  padding-top: var(--header-h);
}

/* ---------- SP (max-width: 1023px) ---------- */
@media (max-width: 1023px) {
  :root { --header-h: 64px; }

  .header-slot {
    position: relative;
  }
  .header {
    position: static;
    border-bottom: 0;
  }
  .page-top .header.is-compact {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--surface-secondary);
  }
  body:not(.page-top) .header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--surface-secondary);
  }
  body:not(.page-top) > main {
    padding-top: 108px;
  }

  /* TOP 初期: 大きな KV ロゴ（opening__logo-area と同じ top: 50px） */
  .page-top .header:not(.is-compact) .header__inner {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    padding:
      50px
      max(12px, 9.33vw)
      0;
    gap: 0;
  }
  .page-top .header:not(.is-compact) .header__top {
    width: 100%;
    min-height: 124px;
  }
  .page-top .header:not(.is-compact) .header__logo {
    justify-items: start;
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
  .page-top .header:not(.is-compact) .header__logo-jtm {
    grid-column: 1;
    grid-row: 1;
    height: 13px;
  }
  .page-top .header:not(.is-compact) .header__logo-wordmark {
    grid-column: 1;
    grid-row: 2;
    /* 高さ固定だと375px未満で縦横比が崩れるため幅基準で縮小 */
    width: min(303px, 100%);
    height: auto;
    align-self: start;
  }
  .page-top .header:not(.is-compact) .header__logo-tagline {
    grid-column: 1;
    grid-row: 3;
    height: 13px;
    align-self: start;
    margin-top: 3px;
  }

  /* TOP 初期: nav 非表示 / 下層ページ: コンパクト＋nav 常時表示 */
  .page-top .header:not(.is-compact) .header__nav {
    display: none;
  }
  .page-top .header.is-compact .header__inner,
  body:not(.page-top) .header__inner {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    height: auto;
    padding: 0;
    gap: 0;
  }
  .page-top .header.is-compact .header__top,
  body:not(.page-top) .header__top {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 10px clamp(16px, 4.27vw, 20px);
    border-bottom: 1px solid var(--border-accent);
  }
  .page-top .header.is-compact .header__logo,
  body:not(.page-top) .header__logo {
    width: 100%;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    row-gap: 4px;
    align-content: center;
  }
  .page-top .header.is-compact .header__logo img,
  body:not(.page-top) .header__logo img {
    max-width: none;
  }
  .page-top .header.is-compact .header__logo-jtm,
  body:not(.page-top) .header__logo-jtm {
    grid-column: 1;
    grid-row: 1;
    height: 11px;
  }
  .page-top .header.is-compact .header__logo-wordmark,
  body:not(.page-top) .header__logo-wordmark {
    grid-column: 1;
    grid-row: 2;
    height: 24px;
    align-self: end;
  }
  .page-top .header.is-compact .header__logo-tagline,
  body:not(.page-top) .header__logo-tagline {
    grid-column: 3;
    grid-row: 2;
    height: 13px;
    align-self: center;
    justify-self: end;
  }
  .page-top .header.is-compact .header__nav,
  body:not(.page-top) .header .header__nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0 16px;
    height: 35px;
    /* Figma sub navi (16205:1810) */
    padding: 0 clamp(16px, 6.4vw, 24px);
    box-shadow: inset 0 -1px 0 var(--border-primary);
  }
  .page-top .header.is-compact .gnav,
  body:not(.page-top) .header .gnav {
    gap: 20px;
    flex: 1 1 max-content;
    align-self: stretch;
    align-items: stretch;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .page-top .header.is-compact .gnav::-webkit-scrollbar,
  body:not(.page-top) .header .gnav::-webkit-scrollbar { display: none; }
  .page-top .header.is-compact .gnav__item,
  body:not(.page-top) .header .gnav__item {
    display: flex;
    align-items: stretch;
  }
  .page-top .header.is-compact .gnav__item a,
  body:not(.page-top) .header .gnav__item a {
    display: inline-flex;
    align-items: center;
    height: 100%;
    font-size: 0.6875rem;
    line-height: 1.7;
    padding-bottom: 0;
    white-space: nowrap;
  }
  .page-top .header.is-compact .gnav__item--current a::after,
  body:not(.page-top) .header .gnav__item--current a::after {
    bottom: 0;
    width: 16px;
    z-index: 1;
  }
  .page-top .header.is-compact .lang,
  body:not(.page-top) .header .lang {
    gap: 12px;
    flex: none;
    margin-left: auto;
  }
  .page-top .header.is-compact .lang__item,
  body:not(.page-top) .header .lang__item {
    font-size: 0.625rem;
  }

  html:has(body.page-top) {
    scroll-padding-top: 108px;
  }
  html:has(body:not(.page-top) .header) {
    scroll-padding-top: 108px;
  }

  @media (max-width: 374.98px) {
    .page-top .header.is-compact .header__logo-jtm,
    body:not(.page-top) .header__logo-jtm {
      height: clamp(9px, 2.93vw, 11px);
    }
    .page-top .header.is-compact .header__logo-wordmark,
    body:not(.page-top) .header__logo-wordmark {
      height: clamp(19px, 6.4vw, 24px);
    }
    .page-top .header.is-compact .header__logo-tagline,
    body:not(.page-top) .header__logo-tagline {
      height: clamp(10px, 3.47vw, 13px);
    }
  }
}
