﻿/* =========================================
   Character IP – 横スクロール・マルチトラック
   ======================================= */
:root {
 --cm-item-size: 280px; /* 丸サムネの直径 */
 --cm-gap: 28px; /* サムネ間隔 */
 --cm-duration: 60s; /* JSで上書き。手動ならここでもOK */
 --cm-card-w: 280px; /* カード幅 */
 --cm-thumb-h: 170px; /* 画像の高さ */

 --cm-radius: 0px; /* 角丸 */
 --cm-title-size: 24px;
 --cm-desc-size: 18px;
 --section-leading: 45px; /* .section-title の margin-left と同じ */
 --title-text-gutter: 18px; /* .section-title の padding-left と同じ */
 --cm-accent-gray: #cfd3d4; /* グレー線 */
 --cm-accent-yellow: #ffd400; /* 黄色線 */
 --cm-accent-thickness: 2.5px; /* 線の太さ */
 --cm-accent-yellow-w: 22%; /* 黄色部分の長さ（% か px） */
 /* 画像枠の色が変数参照なら合わせて */
 --cm-frame-color: #d9d9d9;
}

.character-ip {
 padding: 160px 0;
 margin-top: 50px;
 overflow: visible;
 height: auto;
 background-color: #edefeb;
 position: relative;
 isolation: isolate;
}

/* ↓↓↓ これらは削除してOK（条件が二重で紛らわしいため）
.character-ip .character-marquee.is-hovering .cursor-halo { opacity: 1; }
.character-ip .character-marquee { position: relative; }
*/

.character-ip__text-wrapper {
 max-width: 680px;
 margin: 0 60px 40px;
 line-height: 1.7;
 font-size: 17px;
}
.character-ip__text {
 margin: 0;
}
.text-line1,
.text-line2 {
 display: block;
}

/*
.character-marquee {
    position: relative;
    overflow: hidden;
    width: 100%;

    margin: 56px auto 0;
    
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
*/
.character-marquee {
 position: relative;
 overflow: hidden;
 width: 100vw; /* ← ビューポート幅いっぱい */
 margin-top: 40px; /* 左右のmarginは不要 */
 left: 50%;
 transform: translateX(-50%); /* コンテナ中央基準で100vwを中央寄せ */
 /* 端フェードをやめ、完全に端から表示に */
 -webkit-mask-image: none;
 mask-image: none;
}

.character-marquee__inner {
 position: relative;
 display: flex;
 align-items: center;
 /* 可動部。2本のトラック全体を左へ流す */
 width: max-content;
 will-change: transform;
}

.character-marquee__track {
 display: inline-flex;
 align-items: center;
 gap: var(--cm-gap);
 padding-inline: var(--cm-gap);
}

.cm-card {
 display: flex;
 flex-direction: column;
 width: 300px;
 height: 300px;
 border: 0;
 border-radius: var(--cm-radius);
 overflow: hidden;
 transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.12s ease;
}

/* 画像領域 */
.cm-thumb {
 position: relative;
 width: 300px;
 height: 300px;
 overflow: hidden;
 background: #f7f7f7;
 border: 7px solid #d9d9d9;
 background: var(--cm-frame-color);
}

.cm-thumb img {
 width: 100%;
 height: 100%;
 object-fit: cover;
 display: block;
 background: #fff;
}

.cm-item-link {
 display: block;
 width: 100%;
 height: 100%;
 transform-origin: center;
 transition: transform 0.18s ease;
}
.cm-item-link img {
 position: relative;
 transition: all 0.4s;
}

.character-ip .cm-meta {
 margin-top: 20px;
 position: relative;
 padding-top: calc(10px + 8px); /* 既存padding + ラインとタイトルの間隔(8px) */
}

/* グレーのベースライン（全幅） */
.character-ip .cm-meta::before {
 content: "";
 position: absolute;
 left: 0;
 right: 0;
 top: 0;
 height: 3px; /* 太さ調整 */
 background: linear-gradient(90deg, #bfbfbf 0%, #bfbfbf 80%, #ffd400 80%, #ffd400 100%);
}

/* 右端の黄色アクセント（重ねる） */
.character-ip .cm-meta::after {
 content: "";
 position: absolute;
 top: 0;
 right: 0;
 left: 0;
 height: 3px;
 z-index: 0;
 transform: scaleX(0);
 transform-origin: right top;
 transition: 0.6s ease-out transform;
 background: #ffd400;
}

.cm-title {
 margin: 0 0 6px 0;
 font-size: var(--cm-title-size);
 line-height: 1.3;
 font-weight: 700;
 color: #222;
 /* 1行で省略 */
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}

.cm-desc {
 margin-top: 20px;
 font-size: var(--cm-desc-size);
 line-height: 1.45;
 color: #444;
 /* 2〜3行で省略（ブラウザ対応：WebKit系） */
 display: -webkit-box;
 -webkit-box-orient: vertical;
 -webkit-line-clamp: 3;
 overflow: hidden;
 min-height: calc(1em * 1.45 * 2); /* 2行分の最小高さ（お好みで） */
}

.character-ip .cm-item:hover .cm-thumb,
.character-ip .cm-item:focus-within .cm-thumb {
 border-color: #ffe66a;
}

/* Character IP のカード内リンクは下線なし＆色は継承 */
.character-ip .cm-item-link,
.character-ip .cm-item-link:visited,
.character-ip .cm-item-link:hover,
.character-ip .cm-item-link:focus,
.character-ip .cm-item-link:active {
 text-decoration: none !important;
 color: inherit;
}

/* 念のため、タイトル/説明にも下線系を明示的にオフ */
.character-ip .cm-title,
.character-ip .cm-desc {
 text-decoration: none !important;
 border-bottom: 0 !important;
}

/* アニメーション（JSが --cm-translate と --cm-duration を設定） */
.character-marquee__inner {
 animation: cm-marquee var(--cm-duration) linear infinite;
}

@keyframes cm-marquee {
 from {
  transform: translateX(0);
 }

 to {
  transform: translateX(calc(var(--cm-translate, -50%)));
 }
}

/* ホバーで一時停止 */
/*
.character-marquee:hover .character-marquee__inner {
    animation-play-state: paused;
}
    */

.character-ip .character-marquee {
 position: relative;
}

/* 2) ハローポジションの基準を確実にする */
.character-ip {
 position: relative; /* ← 追加 */
}

@media (min-width: 769px) {
 .cm-item-link:hover img {
  transform: scale(1.1);
 }
 .cm-item-link:hover .cm-meta::after {
  transform-origin: left top;
  transform: scaleX(1);
 }
}

@media (max-width: 1200px) {
 :root {
  --cm-item-size: 120px;
  --cm-gap: 24px;
  --cm-card-w: 240px;
  --cm-thumb-h: 150px;
 }
}

@media (max-width: 768px) {
 :root {
  --cm-item-size: 96px;
  --cm-gap: 18px;
  --cm-card-w: 200px;
  --cm-thumb-h: 130px;
  --cm-gap: 18px;
 }
 .character-ip {
  padding-block: 140px 100px;
  margin: 0;
 }
 .character-ip__text-wrapper {
  max-width: unset;
  font-size: 16px;
  margin: 0 30px 40px;
 }
 .character-marquee {
  margin-top: 40px;
 }
}

@media (max-width: 600px) {
 .character-ip {
  padding-block: 100px 60px;
 }
 .character-ip__text-wrapper {
  font-size: min(15.7px, 4.18vw);
  margin: 0 20px 20px;
 }
 .character-marquee {
  margin-top: 20px;
 }
 .carousel-logo {
  width: 220px;
  margin-top: 160px;
 }
 .cm-thumb {
  width: 240px;
  height: 240px;
 }
 .cm-title {
  font-size: 18px;
 }
 .character-ip .cm-meta::before {
  height: 2px;
 }
 .cm-desc {
  margin-top: 10px;
  font-size: 13px;
 }
}
