/**
 * Xerafy メーカーページ（/maker/xerafy/）専用スタイル
 * ページ内メニュー・お悩みから探す・用途から選ぶ・シリーズ早見表・
 * 公開事例・カスタム対応・ご相談の流れ
 * 配色と寸法は Zebra メーカーページ（zebra-hub.css）に合わせる。
 */

/*
 * ページ内リンクの停止位置
 * - 本ページの目次・シリーズリンクは /maker/xerafy/#… 形式（ブラウザ標準のページ内移動）で、
 *   html の scroll-padding-top（ヘッダー＋ページ内メニューの高さ）＋下の scroll-margin-top（16px）の位置に止まる。
 * - "#" で始まるその他のリンクはサイト共通の smooth-scroll.js が処理し、--header-sticky-offset
 *   （未設定時 60px）を控除する。ヘッダー＋ページ内メニューの高さ＋16px を指定する
 *   （このCSSを読み込むページだけに効く。resource-library.css と同じ方式）。
 * - ページ内メニューはヘッダーの真下に固定する（高さ --xerafy-toc-h）。値は hid-hub.css・elatec-hub.css と同じ
 *   （main.css の --header-h はスマホ60px・PC120px）。
 */
html {
  scroll-padding-top: calc(var(--header-h, 60px) + var(--xerafy-toc-h));
}
:root {
  --xerafy-toc-h: 80px;
  --header-sticky-offset: 156px;
}
@media (min-width: 768px) {
  :root {
    --xerafy-toc-h: 72px;
    --header-sticky-offset: 208px;
  }
}
/* 表示領域の高さが低い場合（拡大表示・スマホの横向きなど）は、本文を読める高さを残すためメニューを固定しない */
@media (max-height: 500px) {
  :root {
    --xerafy-toc-h: 0px;
    --header-sticky-offset: 76px;
  }
}
@media (max-height: 500px) and (min-width: 768px) {
  :root {
    --header-sticky-offset: 136px;
  }
}
.p-xerafy-anchor,
#faq.c-faq {
  scroll-margin-top: 16px;
}

/* 本文中のテキストリンク（グローバルのリセットで下線が消えるため明示） */
.p-xerafy-table a,
.p-xerafy-uses__more a {
  color: #9c0071;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.p-xerafy-table a:hover,
.p-xerafy-uses__more a:hover {
  text-decoration-thickness: 2px;
}

/*
 * ページ内メニュー（ヘッダーの真下に固定する1行のバー。HID ページと同じ形）
 * - 折り返さず、入りきらない項目は横スクロールで送る（入りきる幅では中央寄せ）
 * - 高さは --xerafy-toc-h で固定し、ボタン列を上下中央に置く（横スクロールバーの有無で高さが変わらないように）
 * - 背景は box-shadow で画面幅いっぱいに広げ、下端に区切り線を引く
 * - 現在のセクションは /assets/js/maker-hub-toc.js が .is-active と aria-current を付ける
 */
.p-xerafy-toc {
  position: sticky;
  top: var(--header-h, 60px);
  z-index: 90;
  display: flex;
  align-items: center;
  height: var(--xerafy-toc-h);
  margin-top: 2.4rem;
  margin-bottom: 1.6rem;
  background: #fff;
  box-shadow: 0 0 0 100vmax #fff, 0 1px 0 100vmax #d9dde3;
  clip-path: inset(0 -100vmax -1px);
}
/* PC では全項目を1行に収めやすいよう、メニューだけ本文の最大幅（1200px）を超えて広げる */
@media (min-width: 768px) {
  .p-xerafy-toc {
    max-width: none;
  }
}
@media (max-height: 500px) {
  .p-xerafy-toc {
    position: static;
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}
.p-xerafy-toc__list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  list-style: none;
}
.p-xerafy-toc__list > li {
  flex: 0 0 auto;
}
.p-xerafy-toc__list > li:first-child {
  margin-left: auto;
}
.p-xerafy-toc__list > li:last-child {
  margin-right: auto;
}
/* 印刷時は固定せず、全項目を折り返して紙面に収める（横スクロールは紙ではたどれないため） */
@media print {
  .p-xerafy-toc {
    position: static;
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
    box-shadow: none;
    clip-path: none;
  }
  .p-xerafy-toc__list {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }
  .p-xerafy-toc__list > li:first-child,
  .p-xerafy-toc__list > li:last-child {
    margin-right: 0;
    margin-left: 0;
  }
  .p-xerafy-toc__list .p-xerafy-toc__link {
    white-space: normal;
  }
  /* サイト共通の印刷用CSSがリンクの後ろに付けるURLは、ページ内の移動先で紙面では使えないため付けない */
  .p-xerafy-toc__link::after {
    content: none !important;
  }
}
.p-xerafy-toc__link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 14px;
  color: #05192d;
  background: #fff;
  border: 1px solid #d9dde3;
  border-radius: 9999px;
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
}
.p-xerafy-toc__link:hover {
  border-color: #9c0071;
  color: #9c0071;
}
.p-xerafy-toc__link.is-active {
  color: #fff;
  background: #9c0071;
  border-color: #9c0071;
  font-weight: 700;
}
.p-xerafy-toc__link.is-active:hover {
  color: #fff;
  background: #7a0058;
  border-color: #7a0058;
}
.p-xerafy-toc__link:focus-visible,
.p-xerafy-pill:focus-visible,
.p-xerafy-table-wrap:focus-visible {
  outline: 3px solid #9c0071;
  outline-offset: 2px;
}

/* リード文 */
.p-xerafy-lead {
  max-width: 880px;
  margin: 0 auto 2.4rem;
  font-size: 17px;
  line-height: 1.9;
}
.p-xerafy-lead + .p-xerafy-lead {
  margin-top: -1.2rem;
}

/* シリーズへのリンク（小さなピル） */
.p-xerafy-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.p-xerafy-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  color: #9c0071;
  background: #fff;
  border: 1px solid #9c0071;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
}
.p-xerafy-pill:hover {
  color: #fff;
  background: #9c0071;
}

/* こんなお悩みはありませんか？ */
.p-xerafy-worries {
  max-width: 1040px;
  margin: 0 auto;
}
.p-xerafy-worries__title {
  margin: 0 0 1.6rem;
  color: #05192d;
  font-size: 20px;
  text-align: center;
}
.p-xerafy-worries__list {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (width >= 768px) {
  .p-xerafy-worries__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.p-xerafy-worries__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #d9dde3;
  border-left: 4px solid #9c0071;
  border-radius: 4px;
}
.p-xerafy-worries__text {
  margin: 0;
  color: #05192d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
}
.p-xerafy-worries__to {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0;
  font-size: 14px;
}

/* 用途から選ぶ */
.p-xerafy-uses {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (width >= 768px) {
  .p-xerafy-uses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (width >= 1100px) {
  .p-xerafy-uses {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.p-xerafy-uses__item {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 16px;
  background: #fff;
  border: 1px solid #d9dde3;
  border-radius: 8px;
}
.p-xerafy-uses__title {
  margin: 0 0 10px;
  color: #05192d;
  font-size: 17px;
  line-height: 1.5;
}
.p-xerafy-uses__detail {
  flex: 1;
  margin: 0 0 12px;
}
.p-xerafy-uses__detail dt {
  margin: 0;
  color: #9c0071;
  font-size: 13px;
  font-weight: 700;
}
.p-xerafy-uses__detail dd {
  margin: 2px 0 10px;
  font-size: 14px;
  line-height: 1.8;
}
.p-xerafy-uses__detail dd:last-child {
  margin-bottom: 0;
}
.p-xerafy-uses__more {
  margin: 10px 0 0;
  font-size: 14px;
}

/* シリーズ早見表 */
.p-xerafy-table-wrap {
  overflow-x: auto;
  margin: 0 0 1.2rem;
  border: 1px solid #d9dde3;
  border-radius: 6px;
  background: #fff;
}
.p-xerafy-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.7;
}
.p-xerafy-table caption {
  padding: 10px 14px;
  color: #05192d;
  font-size: 13px;
  text-align: left;
}
.p-xerafy-table th,
.p-xerafy-table td {
  padding: 10px 14px;
  border-top: 1px solid #e5e8ec;
  text-align: left;
  vertical-align: top;
}
.p-xerafy-table thead th {
  color: #05192d;
  background: #eef1f4;
  font-size: 13px;
  white-space: nowrap;
}
.p-xerafy-table tbody th {
  white-space: nowrap;
}
.p-xerafy-table td:nth-child(2) {
  min-width: 9em;
}
.p-xerafy-table td:nth-child(3) {
  min-width: 12em;
}
.p-xerafy-table tbody th a {
  color: #9c0071;
  font-weight: 700;
}
.p-xerafy-table__models {
  margin: 0;
  padding: 0;
  list-style: none;
}
.p-xerafy-table-hint {
  margin: 0 0 1.6rem;
  font-size: 13px;
}
@media (width >= 900px) {
  .p-xerafy-table-hint {
    display: none;
  }
}

/* 選定のポイント・補足ボックス */
.p-xerafy-note {
  max-width: 960px;
  margin: 2.4rem auto 0;
  padding: 18px 22px;
  background: #f9f6f8;
  border-left: 4px solid #9c0071;
  border-radius: 4px;
}
.p-xerafy-note__title {
  margin: 0 0 8px;
  color: #05192d;
  font-size: 17px;
}
.p-xerafy-note__list {
  margin: 0;
  padding-left: 1.4em;
  list-style: disc;
  font-size: 15px;
  line-height: 1.9;
}
ol.p-xerafy-note__list {
  list-style: decimal;
}
.p-xerafy-note__text {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.8;
}

/* 製品一覧のシリーズ見出しと説明 */
.p-xerafy-series-title {
  margin-top: 4rem;
}
.p-xerafy-series-lead {
  margin: -0.4rem 0 1.6rem;
  font-size: 15px;
  line-height: 1.8;
}

/* 公開事例 */
.p-xerafy-cases {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (width >= 768px) {
  .p-xerafy-cases {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (width >= 1100px) {
  .p-xerafy-cases {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.p-xerafy-cases__item {
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: #fff;
  border: 1px solid #d9dde3;
  border-top: 4px solid #9c0071;
  border-radius: 5px;
}
.p-xerafy-cases__label {
  margin: 0;
  color: #05192d;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}
.p-xerafy-cases__figure {
  margin: 8px 0 4px;
  color: #9c0071;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.3;
}
.p-xerafy-cases__figure-sub {
  margin: 0 0 10px;
  color: #05192d;
  font-size: 14px;
  font-weight: 700;
}
.p-xerafy-cases__text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}
.p-xerafy-cases__meta {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
}
.p-xerafy-cases__note {
  margin: 1.6rem 0 0;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}

/* カスタム対応 */
.p-xerafy-services {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (width >= 768px) {
  .p-xerafy-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (width >= 1100px) {
  .p-xerafy-services {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.p-xerafy-services__item {
  padding: 18px;
  background: #fff;
  border: 1px solid #d9dde3;
  border-radius: 8px;
  text-align: center;
}
.p-xerafy-services__icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
}
.p-xerafy-services__icon img,
.p-xerafy-services__icon picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.p-xerafy-services__title {
  margin: 0 0 8px;
  color: #05192d;
  font-size: 17px;
}
.p-xerafy-services__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  text-align: left;
}

/* ご相談の流れ */
.p-xerafy-steps {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (width >= 992px) {
  .p-xerafy-steps {
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.p-xerafy-steps__item {
  padding: 16px 16px 18px;
  background: #fff;
  border-radius: 5px;
  border-top: 4px solid #9c0071;
}
.p-xerafy-steps__num {
  margin: 0;
  color: #9c0071;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.p-xerafy-steps__title {
  margin: 4px 0 6px;
  color: #05192d;
  font-size: 16px;
}
.p-xerafy-steps__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}
