
/* =========================================================
   Featured Section
   ---------------------------------------------------------
   ・3カラムレイアウト
   ・画像クロスフェード（ximg / is-front）
   ・画像未登録時のグラデーション表示
   ・テキストfade同期
   ・PCのみ並び替え（1→中央）
   ・登場アニメーション（stagger）
========================================================= */

/* =========================
   1) Section spacing
========================= */
.featured {
  padding-left: 18px;
  padding-right: 18px;
  padding-bottom: 60px;
}

/* スマホ・タブレットではセクション下の余白を控えめにする */
@media (max-width: 1024px) {
  .featured {
    padding-bottom: 30px;
  }
}

@media (max-width: 767px) {

  .featured {
    padding-left: 0;
    padding-right: 0;
  }

}

/* ==========================================
   FEATURED
   画面の高さに応じた横幅調整
   ========================================== */

.featured {
    width: min(100%, 150vh);
    margin-left: auto;
    margin-right: auto;
}

/* =========================
   2) Grid Layout
========================= */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px;
  align-items: start;
}

/* タブレット */


/* =========================
   3) PCのみ並び順変更
   ---------------------------------------------------------
   1 → 真ん中
   2 → 左
   3 → 右
========================================================= */
@media (min-width: 768px) {

  .featured .card:nth-child(1) {
    order: 2;
  }

  .featured .card:nth-child(2) {
    order: 1;
  }

  .featured .card:nth-child(3) {
    order: 3;
  }

}

/* =========================
   4) Card
========================= */
.card {
  border-radius: 18px;
  overflow: hidden;
}

/* =========================
   5) Entrance Animation
   ---------------------------------------------------------
   カードの登場アニメーション
========================================================= */
.featured .card {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity .7s ease,
    transform .7s cubic-bezier(.2,.9,.2,1.2);
}

.featured.is-visible .card {
  opacity: 1;
  transform: none;
}

.featured.is-visible .card:nth-child(1) {
  transition-delay: .12s;
}

.featured.is-visible .card:nth-child(2) {
  transition-delay: .30s;
}

.featured.is-visible .card:nth-child(3) {
  transition-delay: .48s;
}

/* =========================
   6) Thumbnail
   ---------------------------------------------------------
   ・横幅100%
   ・縦横比 6:11
   ・画像は親領域いっぱいに表示
========================================================= */
.card .thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 11;
  overflow: hidden;
}

/* =========================
   7) Cross Fade Images
   ---------------------------------------------------------
   ・imgA / imgB を重ねて表示
   ・JSで is-front を切り替え
   ・opacityでクロスフェード
========================================================= */
.thumb .ximg {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease;
  will-change: opacity;
}

.thumb .ximg.is-front {
  opacity: 1;
}

/* 画像の質感 */
.card .thumb img {
  transform: scale(1.01);
  filter: saturate(1.06) contrast(1.03);
}

/* =========================
   8) No Image
   ---------------------------------------------------------
   ・画像未登録時の背景
   ・オレンジ / ラベンダー / イエロー
   ・画像枠全体にグラデーション表示
========================================================= */
.thumb.no-image {
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 165, 90, .45),
      transparent 65%
    ),
    radial-gradient(
      circle at 85% 25%,
      rgba(190, 175, 235, .35),
      transparent 65%
    ),
    radial-gradient(
      circle at 50% 85%,
      rgba(255, 221, 110, .40),
      transparent 70%
    ),
    #faf9f7;
}

/* 画像未登録時はimgを非表示 */
.thumb.no-image .ximg {
  opacity: 0;
}

/* =========================
   9) Slash Light
   ---------------------------------------------------------
   画像上のスラッシュ光エフェクト
========================================================= */
.card .thumb::after {
  content: "";
  position: absolute;
  inset: -40% -60%;
  background: linear-gradient(
    115deg,
    rgba(255,255,255,0) 35%,
    rgba(255,174,238,.45) 45%,
    rgba(249,197,67,.35) 52%,
    rgba(255,255,255,0) 62%
  );
  transform: translateX(-18%);
  opacity: .45;
  pointer-events: none;
}

/* =========================
   10) Text Area
   ---------------------------------------------------------
   タグ・モデル名のフェード制御
========================================================= */
.card .cap-top,
.card .name {
  opacity: 1;
  transition:
    opacity .6s ease,
    transform .6s ease;
  will-change: opacity, transform;
}

/* JS用フェード */
.card .cap-top.fade,
.card .name.fade {
  opacity: 0;
  transform: translateY(4px);
}

/* =========================
   11) Tag
========================= */
.card .cap-top {
  width: fit-content;
  max-width: calc(100% - 40px);
  margin-inline: auto;
  overflow-wrap: anywhere;
  text-align: center;
  padding-top: 18px;
  color: #557f9a;
  font: calc(12px * var(--official-font-scale, 1))/1 ui-sans-serif, system-ui, -apple-system,
        "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  position: relative;
  min-height: 30px;
}

/* 丸アイコン */
.card .cap-top::before {
  content: "";
  position: absolute;
  right: calc(100% + 10px);
  top: 19px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    var(--pink),
    var(--blue)
  );
  box-shadow: 0 6px 16px rgba(255,174,238,.35);
  vertical-align: -1px;
}

/* メーカー情報がない場合は装飾も含めて非表示 */
.card .cap-top.is-hidden {
  display: none;
}


/* =========================
   12) Model Name
========================= */
.card .name {
  text-align: center;
  padding: 10px 0 0;
  color: #3a3a3a;
  letter-spacing: .20em;
  text-transform: uppercase;
  min-height: 18px;
  text-shadow: 0 1px 0 rgba(255,255,255,.8);
}

/* =========================================
   FEATURED モデル名
   ========================================= */

.card .name {
  display: flex;
  flex-direction: column;
  font-size: calc(13px * var(--official-font-scale, 1));
}

/* ローマ字 */
.card .name .name-roma {
  display: block;
  letter-spacing: 0.08em;
  font-size: calc(11px * var(--official-font-scale, 1));
}

/* 漢字 */
.card .name .name-jp {
  display: block;
  letter-spacing: 0.05em;
}

/* =========================
   13) Hover (PC only)
========================= */
@media (hover: hover) {

  .card {
    transition: transform .25s ease;
  }

  .card:hover {
    transform: translateY(-4px);
  }

}

/* =========================
   14) Responsive
   ---------------------------------------------------------
   スマートフォンでは1カラム表示
   2番目・3番目のカードは非表示
========================================================= */
@media (max-width: 767px) {

  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  /* PCの並び替え解除 */
  .featured .card:nth-child(1),
  .featured .card:nth-child(2),
  .featured .card:nth-child(3) {
    order: initial;
  }

  /* 2と3は非表示 */
  .featured .card:nth-child(2),
  .featured .card:nth-child(3) {
    display: none;
  }

}

/* スマホ：画像枠を短くし、上側を基準にトリミングする */
@media (max-width: 767px) {
  .featured .card .thumb {
    aspect-ratio: 3 / 4;
  }
  .featured .thumb .ximg {
    object-position: center top;
  }
}

/* Keep a small configured pool centered, without duplicate cards. */
@media (min-width: 768px) {
  .featured[data-count="1"] .grid-3 { grid-template-columns: minmax(0,1fr); max-width: 360px; margin-inline: auto; }
  .featured[data-count="2"] .grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 760px; margin-inline: auto; }
  .featured[data-count="2"] .card { order: initial; }
}

/* Prevent intrinsic card widths from expanding the featured grid. */
.featured { min-width: 0; max-width: 100%; }
.featured .card, .featured .card > a { min-width: 0; }
.featured .card > a { display: block; }
.featured .card .name { overflow-wrap: anywhere; }
