/**
 * Zebra メーカーページ（/maker/zebra/）専用スタイル
 * ページ内メニュー・用途から選ぶガイド・製品グループの説明・導入の流れ
 * 配色と寸法は ELATEC メーカーページ（elatec-hub.css）に合わせる。
 */

/*
 * ページ内リンクの停止位置
 * - ページ内メニューはヘッダーの真下に固定する（高さ --zebra-toc-h）。移動先の見出しが隠れないよう、
 *   html の scroll-padding-top（直接 #… 付きの URL で開いたとき）と、サイト共通の smooth-scroll.js が
 *   控除する --header-sticky-offset（"#" で始まるリンクを押したとき）にメニューの高さを加える。
 * - 値は hid-hub.css・xerafy-hub.css・elatec-hub.css と同じ（main.css の --header-h はスマホ60px・PC120px）。
 */
html {
  scroll-padding-top: calc(var(--header-h, 60px) + var(--zebra-toc-h));
}
:root {
  --zebra-toc-h: 80px;
  --header-sticky-offset: 156px;
}
@media (min-width: 768px) {
  :root {
    --zebra-toc-h: 72px;
    --header-sticky-offset: 208px;
  }
}
/* 表示領域の高さが低い場合（拡大表示・スマホの横向きなど）は、本文を読める高さを残すためメニューを固定しない */
@media (max-height: 500px) {
  :root {
    --zebra-toc-h: 0px;
    --header-sticky-offset: 76px;
  }
}
@media (max-height: 500px) and (min-width: 768px) {
  :root {
    --header-sticky-offset: 136px;
  }
}
/* 移動先（ページ内メニューの各セクション・製品カテゴリ目次・各製品グループ・よくあるご質問） */
section[id^="zebra-"],
section[id^="products-"],
#zebra-product-toc,
#faq.c-faq {
  scroll-margin-top: 16px;
}

/*
 * ページ内メニュー（ヘッダーの真下に固定する1行のバー。HID・Xerafy・ELATEC ページと同じ形）
 * - 折り返さず、入りきらない項目は横スクロールで送る（入りきる幅では中央寄せ）
 * - 高さは --zebra-toc-h で固定し、ボタン列を上下中央に置く（横スクロールバーの有無で高さが変わらないように）
 * - 背景は box-shadow で画面幅いっぱいに広げ、下端に区切り線を引く
 * - 現在のセクションは /assets/js/maker-hub-toc.js が .is-active と aria-current を付ける
 */
.p-zebra-hub-toc {
  position: sticky;
  top: var(--header-h, 60px);
  z-index: 90;
  display: flex;
  align-items: center;
  height: var(--zebra-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-zebra-hub-toc {
    max-width: none;
  }
}
@media (max-height: 500px) {
  .p-zebra-hub-toc {
    position: static;
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
  }
}
.p-zebra-hub-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-zebra-hub-toc__list > li {
  flex: 0 0 auto;
}
.p-zebra-hub-toc__list > li:first-child {
  margin-left: auto;
}
.p-zebra-hub-toc__list > li:last-child {
  margin-right: auto;
}
/* 印刷時は固定せず、全項目を折り返して紙面に収める（横スクロールは紙ではたどれないため） */
@media print {
  .p-zebra-hub-toc {
    position: static;
    height: auto;
    padding-top: 6px;
    padding-bottom: 6px;
    box-shadow: none;
    clip-path: none;
  }
  .p-zebra-hub-toc__list {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
  }
  .p-zebra-hub-toc__list > li:first-child,
  .p-zebra-hub-toc__list > li:last-child {
    margin-right: 0;
    margin-left: 0;
  }
  .p-zebra-hub-toc__list .p-zebra-hub-toc__link {
    white-space: normal;
  }
  /* サイト共通の印刷用CSSがリンクの後ろに付けるURLは、ページ内の移動先で紙面では使えないため付けない */
  .p-zebra-hub-toc__link::after {
    content: none !important;
  }
}
.p-zebra-hub-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;
  text-decoration: none;
  white-space: nowrap;
}
.p-zebra-hub-toc__link:hover {
  border-color: #9c0071;
  color: #9c0071;
}
.p-zebra-hub-toc__link.is-active {
  color: #fff;
  background: #9c0071;
  border-color: #9c0071;
  font-weight: 700;
}
.p-zebra-hub-toc__link.is-active:hover {
  color: #fff;
  background: #7a0058;
  border-color: #7a0058;
}
.p-zebra-hub-toc__link:focus-visible {
  outline: 3px solid #9c0071;
  outline-offset: 2px;
}

/* リード文 */
.p-zebra-hub__lead {
  max-width: 880px;
  margin: 0 auto 2.4rem;
  font-size: 17px;
  line-height: 1.9;
}

/* 用途から選ぶガイド */
.p-zebra-guide {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (width >= 768px) {
  .p-zebra-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (width >= 1100px) {
  .p-zebra-guide {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.p-zebra-guide__item {
  display: flex;
}
.p-zebra-guide__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 18px 18px 16px;
  color: #05192d;
  background: #fff;
  border: 1px solid #d9dde3;
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.p-zebra-guide__link:hover {
  border-color: #9c0071;
  box-shadow: 0 4px 14px rgb(5 25 45 / 8%);
}
.p-zebra-guide__link:focus-visible {
  outline: 3px solid #9c0071;
  outline-offset: 2px;
}
.p-zebra-guide__img {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 10px;
}
.p-zebra-guide__img img,
.p-zebra-guide__img picture {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.p-zebra-guide__need {
  margin: 0;
  color: #9c0071;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}
.p-zebra-guide__title {
  margin: 6px 0 8px;
  color: #05192d;
  font-size: 17px;
  line-height: 1.5;
}
.p-zebra-guide__text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
}
.p-zebra-guide__more {
  margin: 12px 0 0;
  color: #9c0071;
  font-size: 14px;
  font-weight: 700;
}

/* 1次元・2次元の説明 */
.p-zebra-note {
  max-width: 960px;
  margin: 2.4rem auto 0;
  padding: 18px 22px;
  background: #f9f6f8;
  border-left: 4px solid #9c0071;
  border-radius: 4px;
}
.p-zebra-note__title {
  margin: 0 0 8px;
  color: #05192d;
  font-size: 16px;
}
.p-zebra-note__list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 15px;
  line-height: 1.9;
}

/* 製品グループの説明 */
.p-zebra-group__lead {
  max-width: 920px;
  margin: -0.8rem auto 2.4rem;
  font-size: 15px;
  line-height: 1.9;
  text-align: center;
}
@media (width < 768px) {
  .p-zebra-group__lead {
    text-align: left;
  }
}

/* 選ばれる理由（当社サポート） */
.p-zebra-reasons__note {
  margin: 1.6rem 0 0;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}

/* 導入の流れ */
.p-zebra-steps {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (width >= 992px) {
  .p-zebra-steps {
    gap: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.p-zebra-steps__item {
  padding: 16px 16px 18px;
  background: #f9f9f9;
  border-radius: 5px;
  border-top: 4px solid #9c0071;
}
.p-zebra-steps__num {
  margin: 0;
  color: #9c0071;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.p-zebra-steps__title {
  margin: 4px 0 6px;
  color: #05192d;
  font-size: 16px;
}
.p-zebra-steps__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}
