/* ブランドページの「取り扱い機種」と機種カード。
   template-parts/brand-collection.php 専用。既存の
   .vendor-brand-featured 系（旧レイアウト）とはクラス名を分けている。 */

/* ---- ブランド名のふりがな ----
   英字のブランド名と同じ色・太さで並べる（区切りの縦線も同じ）。 */
.nicobay-brand-header__furigana {
  color: inherit;
  font-weight: 700;
  font-size: 0.8em;
  margin-left: 2px;
}

/* ---- スマホ: ブランド名〜機種一覧を左詰めにする ----
   既定の .nicobay-brand-header__container は align-items:center で、
   スマホ（縦並び）だと中身が内容幅に縮んで中央寄せになる。 */
@media screen and (max-width: 749px) {
  .nicobay-brand-header__container {
    align-items: stretch;
  }

  .nicobay-brand-header__content {
    text-align: left;
  }
}

/* ---- 取り扱い機種の一覧 ---- */
.nicobay-gear-lineup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 14px;
}

.nicobay-gear-lineup__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #8a8a8a;
}

.nicobay-gear-lineup ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nicobay-gear-lineup li {
  display: flex;
}

.nicobay-gear-lineup a {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  color: #4d4d4d;
  text-decoration: none;
}

.nicobay-gear-lineup a::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgb(var(--nicobay-green));
}

.nicobay-gear-lineup a:hover {
  color: rgb(var(--nicobay-green));
}

.nicobay-gear-lineup a:focus-visible {
  outline: 2px solid rgb(var(--nicobay-green));
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- 機種カード ---- */
.nicobay-gears {
  background: #f8f8f8;
  padding-bottom: 28px;
}

.nicobay-gear {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-margin-top: 12px;
}

.nicobay-gear + .nicobay-gear {
  margin-top: 12px;
}

.nicobay-gear__name {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #333;
}

.nicobay-gear__visual {
  position: relative;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}

.nicobay-gear__visual img {
  display: block;
  width: 100%;
  height: auto;
}

/* 機種画像が未提供の機種。枠だけ残して空欄にする。 */
.nicobay-gear__visual--empty {
  aspect-ratio: 5 / 3;
  background: #fff;
}

/* 画像に焼き込まれた「商品詳細を見る」ボタンの位置。
   いただいた画像 26 点すべてでほぼ同じ位置だったので固定値で置く。 */
/* base.css の a:empty { display: none } に負けないよう型セレクタ込みで指定する
   （テンプレート側でも中に空 span を入れて :empty を外している）。 */
a.nicobay-gear__hotspot,
a.nicobay-gear__card-link {
  display: block;
}

.nicobay-gear__hotspot {
  position: absolute;
  left: 49.2%;
  top: 77.3%;
  width: 38.4%;
  height: 15.4%;
  z-index: 3;
  border-radius: 999px;
  transition: box-shadow 0.15s ease;
}

.nicobay-gear__hotspot:hover {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 4px 14px rgba(0, 0, 0, 0.3);
}

.nicobay-gear__hotspot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* スマホはホバーが無く画像内のボタンに気づけないため、カード全体も押せるようにする。
   評価行と説明文はこれより上（z-index 2）に置くので、開閉と読みは邪魔しない。 */
.nicobay-gear__card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 16px;
}

/* ---- 評価 ＋ 説明文の開閉ボタン（画像の下） ---- */
.nicobay-gear__meta {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 24px;
}

/* 既存の nicobay-brand-inline.css は PC で開閉ボタンを隠すが、
   機種カードでは PC でもプルダウンにする。 */
.nicobay-gear__meta .description-toggle-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.nicobay-gear__meta .description-toggle-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.nicobay-gear__meta .description-toggle-btn[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

.nicobay-gear__description {
  position: relative;
  z-index: 2;
  overflow: hidden;
  max-height: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.95;
  color: #505050;
  white-space: pre-line;
  transition: max-height 0.3s ease-out;
}

.nicobay-gear__description.expanded {
  max-height: 1200px;
}

@media (prefers-reduced-motion: reduce) {
  .nicobay-gear__hotspot,
  .nicobay-gear__meta .description-toggle-btn svg,
  .nicobay-gear__description {
    transition: none;
  }
}

/* ---- PC ---- */
@media screen and (min-width: 750px) {
  .nicobay-gear-lineup ul {
    flex-flow: row wrap;
    column-gap: 24px;
  }

  .nicobay-gear-lineup a {
    font-size: clamp(15px, 1.25vw, 22px);
    width: auto;
  }

  /* キービジュアルが大きい PC では 15px / 11px が小さく見えるため、
     画面幅に合わせて上げる（1120px でモックと同じ 15px / 11px / 23px）。 */
  .nicobay-gear-lineup__label {
    font-size: clamp(11px, 0.85vw, 15px);
  }

  .nicobay-brand-header__title {
    font-size: clamp(23px, 1.9vw, 34px);
  }

  /* 1 列だと右側が大きく空くので 2 列に並べる。 */
  .nicobay-gears .page-width {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }

  .nicobay-gear {
    padding: 20px 24px 22px;
  }

  /* グリッドの gap で間隔を取るので、1 列用の margin は消す。 */
  .nicobay-gear + .nicobay-gear {
    margin-top: 0;
  }

  /* PC のみ機種名を 30% 大きく（スマホは 19px のまま）。 */
  .nicobay-gear__name {
    font-size: calc(22px * 1.3);
  }

  .nicobay-gear__description {
    font-size: 13.5px;
  }

  /* カード全体のリンクはスマホ向けの逃げ道。PC はホバーで気づけるので出さない。
     上の a.nicobay-gear__card-link より詳細度を落とさないよう型セレクタ込みで書く。 */
  a.nicobay-gear__card-link {
    display: none;
  }
}
