/* ResearchDX 独自のヘッダー・フッター（2026-10-14 作成）
   STUDIO 由来の CSS とは独立。色・余白はこのファイル冒頭の変数で指定する
   コントラスト（WCAG 2.1 の計算式で確認）:
   - 白 #FFFFFF / 黒 #000000 … 21:1
   - 薄灰 #C8C8C8 / 黒 #000000 … 12.6:1（フッター本文）
   - 黒 #000000 / 橙 #F6A700 … 10.4:1（お問い合わせボタン。橙の下線・フォーカス枠と黒背景も同じ） */
:root {
  --rdx-color-bg: #000000;
  --rdx-color-text: #FFFFFF;
  --rdx-color-text-sub: #C8C8C8;
  --rdx-color-line: #3A3A3A;
  --rdx-color-cta: #F6A700;
  --rdx-color-cta-hover: #FFC23D;
  --rdx-color-cta-text: #000000;
  --rdx-content-width: 1273px;
  /* パンくずの文字位置と揃える */
  --rdx-gutter: 24px;
  --rdx-header-height: 72px;
  --rdx-font: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
}

/* STUDIO の共通 CSS が全要素に color: #333 を当てているので、ヘッダー・フッター内は親の色を継ぐ。
   詳細度は低いので、以下の個別指定が優先される */
.rdx-header *,
.rdx-footer * {
  color: inherit;
}

.rdx-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- ヘッダー ---------- */
.rdx-header {
  position: sticky;
  top: 0;
  z-index: 100;
  align-self: stretch;
  width: 100%;
  background: var(--rdx-color-bg);
  color: var(--rdx-color-text);
  font-family: var(--rdx-font);
}
.rdx-header__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  width: min(var(--rdx-content-width), calc(100% - var(--rdx-gutter) * 2));
  height: var(--rdx-header-height);
  margin: 0 auto;
}
.rdx-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: var(--rdx-color-text);
  text-decoration: none;
}
.rdx-brand img {
  display: block;
  width: 110px;
  height: auto;
}
.rdx-brand__name {
  padding-left: 12px;
  border-left: 1px solid var(--rdx-color-text-sub);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}
.rdx-header__nav {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-left: auto;
}
.rdx-header__list {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rdx-header__list a {
  display: block;
  padding: 8px 0;
  color: var(--rdx-color-text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.rdx-header__list a:hover,
.rdx-header__list a[aria-current="page"] {
  border-bottom-color: var(--rdx-color-cta);
}
.rdx-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--rdx-color-cta);
  color: var(--rdx-color-cta-text);
  font-family: var(--rdx-font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.rdx-button:hover {
  background: var(--rdx-color-cta-hover);
}
.rdx-header a:focus-visible,
.rdx-header button:focus-visible,
.rdx-footer a:focus-visible {
  outline: 3px solid var(--rdx-color-cta);
  outline-offset: 3px;
}
.rdx-header__toggle {
  display: none;
}

/* 幅 1080px 未満: メニューを折りたたむ */
@media screen and (max-width: 1079px) {
  .rdx-header {
    --rdx-header-height: 60px;
  }
  .rdx-header__inner {
    width: calc(100% - 32px);
    gap: 16px;
  }
  .rdx-brand img {
    width: 88px;
  }
  .rdx-brand__name {
    font-size: 17px;
  }
  .rdx-header__toggle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--rdx-color-text);
    cursor: pointer;
  }
  .rdx-header__toggle-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s, opacity 0.2s;
  }
  .rdx-header__toggle[aria-expanded="true"] .rdx-header__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .rdx-header__toggle[aria-expanded="true"] .rdx-header__toggle-bar:nth-child(2) {
    opacity: 0;
  }
  .rdx-header__toggle[aria-expanded="true"] .rdx-header__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .rdx-header__nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
    margin: 0;
    padding: 8px 16px 32px;
    background: var(--rdx-color-bg);
    border-top: 1px solid var(--rdx-color-line);
  }
  .rdx-header__nav.is-open {
    display: flex;
  }
  .rdx-header__list {
    flex-direction: column;
    gap: 0;
  }
  .rdx-header__list a {
    padding: 16px 0;
    border-bottom: 1px solid var(--rdx-color-line);
    font-size: 16px;
  }
  .rdx-header__list a[aria-current="page"] {
    border-bottom-color: var(--rdx-color-line);
    color: var(--rdx-color-cta);
  }
  .rdx-header__nav .rdx-button {
    min-height: 52px;
    font-size: 16px;
  }
}

/* ---------- フッター ---------- */
.rdx-footer {
  align-self: stretch;
  width: 100%;
  background: var(--rdx-color-bg);
  color: var(--rdx-color-text-sub);
  font-family: var(--rdx-font);
  font-size: 14px;
  line-height: 1.75;
}
.rdx-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  width: min(var(--rdx-content-width), calc(100% - var(--rdx-gutter) * 2));
  margin: 0 auto;
  padding: 64px 0 48px;
}
.rdx-footer__about {
  max-width: 500px;
}
.rdx-footer__tagline {
  margin: 20px 0 0;
  color: var(--rdx-color-text);
  font-size: 15px;
}
.rdx-footer__company {
  margin: 16px 0 0;
}
.rdx-footer__corporate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 20px;
  border: 1px solid var(--rdx-color-text);
  border-radius: 999px;
  color: var(--rdx-color-text);
  font-weight: 700;
  text-decoration: none;
}
.rdx-footer__corporate:hover {
  background: var(--rdx-color-text);
  color: var(--rdx-color-bg);
}
.rdx-footer__nav {
  display: flex;
  gap: 64px;
}
.rdx-footer__heading {
  margin: 0 0 12px;
  color: var(--rdx-color-text);
  font-size: 14px;
  font-weight: 700;
}
.rdx-footer__nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rdx-footer__nav li+li {
  margin-top: 8px;
}
.rdx-footer__nav a {
  color: var(--rdx-color-text-sub);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rdx-footer__nav a:hover {
  color: var(--rdx-color-text);
}
.rdx-footer__bottom {
  border-top: 1px solid var(--rdx-color-line);
}
.rdx-footer__bottom small {
  display: block;
  width: min(var(--rdx-content-width), calc(100% - var(--rdx-gutter) * 2));
  margin: 0 auto;
  padding: 20px 0;
  font-size: 12px;
}

@media screen and (max-width: 840px) {
  .rdx-footer__inner {
    flex-direction: column;
    gap: 40px;
    width: calc(100% - 32px);
    padding: 48px 0 40px;
  }
  .rdx-footer__nav {
    flex-direction: column;
    gap: 32px;
  }
  .rdx-footer__bottom small {
    width: calc(100% - 32px);
  }
}

/* 右下の固定ボタン（STUDIO 由来の nav.fixed）をフッター表示中に隠す（rdx.js が付け外し） */
.rdx-is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, visibility 0.2s;
}
