/* 関連動画リスト形式 */
.fts-related-widget{
  container-type: inline-size;
}
/* クラスを重ねているのはテーマの ul の指定に負けないようにするため（Press の有無で変わらないように） */
ul.fts-related-widget.fts-related-widget {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
ul.fts-related-widget a {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
  line-height: 1.1em;
}
ul.fts-related-widget.layout-list a{
  display: flex;
  width: 100%;
}
li.fanza-related-item.layout-list{
  width: 100%;
}
.fanza-related-item img{
  height: auto;
  flex-shrink: 0;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top;
  width: 100%;
}
p.meta {
  text-align: right;
  font-size: 12px;
  font-weight: normal;
}
/* 1) メタ全体をフレックスに */
.fanza-related-item .meta{
  display:flex;
  gap:8px;
  align-items:center;
  font-size:.75rem;
  margin:0 4px 6px;
  color:#666;
}
/* テキストのみの場合 */
ul.fts-related-widget.layout-text {
  display: block;
}
ul.layout-text .fp_post_meta {
  font-size: 16px;
}
ul.layout-text.has-num .fp_post_meta{
  padding: 0 0 0 2em;
}
/* 2) 各アイコン-数字のまとまりもインラインフレックスで中央揃え */
.fanza-related-item .meta .fav,
.fanza-related-item .meta .pv,
.fanza-related-item .meta .image-fav{
  display:inline-flex;
  align-items:center;
  gap:3px;
}

/* 3) SVG は行高さに合わせて自動縮小 */
.fanza-related-item .meta svg{
  width:1em;
  height:1em;
  flex:0 0 auto;
}

.fp_post_meta {
  padding: 5px;
  font-size: 13px;
}
.fp_post_meta p{
  margin-bottom: 5px!important;
}
.fts-related-widget.layout-list .fanza-related-item {
    display: flex;
    align-items: flex-start; 
    gap: 10px;
    margin-bottom: 0;
    margin-top: 0;
    padding:var(--fanza-list-padding, 10px)!important;
    border-bottom: 1px solid var(--kugiri-color, #ddd);
  }
  .fts-related-widget.layout-list .fanza-related-item:last-child {
    border-bottom: none;
  }
  li.fanza-related-item,.fanza-img-ranking-widget li{
    padding: var(--fanza-list-padding, 10px)!important;
    transition: all ease 0.5s;
  }
  li.fanza-related-item:hover,.fanza-img-ranking-widget li:hover{
    background-color: #e8e8e8;
    opacity: 0.8;
  }
  .fts-related-widget.layout-list .fanza-related-item img {
    width: 200px;
    max-width: 100%;
    flex: 0 0 200px;
  }
  
  /* サイドバーなど狭い場所での調整 */
  @container (max-width: 500px) {
    .fts-related-widget.layout-list .fanza-related-item img {
      flex: 0 0 35%;
      width: 35%;
    }
    .fts-related-widget.layout-list .fanza-related-item .title {
      font-size: 14px !important;
      line-height: 1.3;
    }
  }
  
  @container (max-width: 300px) {
    .fts-related-widget.layout-list .fanza-related-item img {
      flex: 0 0 35%;
      width: 35%;
    }
    .fts-related-widget.layout-list .fanza-related-item .title {
      font-size: 14px !important;
      line-height: 1.3;
    }
  }
  
  .fts-related-widget.layout-list .fanza-related-item .title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    flex: 1;
  }
  li.fanza-related-item.layout-text{
    border-bottom: 1px solid;
    margin-bottom: 0;
    margin-top: 0;
    border-color: var(--kugiri-color, #ddd);
  }
li.fanza-related-item.layout-text:last-child {
  border-bottom: none;
}
/* カード形式 */
.fts-related-widget.layout-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fts-related-widget.layout-card li {
    flex: 0 0 calc(33.333% - 7px);
    min-width: 150px;
    box-sizing: border-box;
    width: auto;
}

/* サイドバーなど狭い場所での調整 */
@container (max-width: 500px) {
    .fts-related-widget.layout-card li {
        flex: 0 0 calc(50% - 5px);
        min-width: 120px;
    }
}

@container (max-width: 300px) {
    .fts-related-widget.layout-card li {
        flex: 0 0 100%;
        min-width: 100%;
    }
}

/* =============================================
   関連ウィジェット ─ 横長リスト崩れ対策
============================================= */
.fts-related-widget.layout-list{
  display:flex;
  flex-direction:column;
  padding-left: 0;
}
.fts-related-widget.layout-list a{display:flex;width:100%;align-items:flex-start;gap:10px}
.fts-related-widget.layout-list img{
  flex:0 0 200px;
  max-width: 100%;
  height:auto;
  aspect-ratio:3/2;
  object-fit:cover;
}

/* サイドバーなど狭い場所での調整 */
@container (max-width: 500px) {
  .fts-related-widget.layout-list img {
    flex: 0 0 35%;
    width: 35%;
  }
  .fts-related-widget.layout-list .fanza-related-item .title {
    font-size: 14px !important;
    line-height: 1.3;
  }
}

@container (max-width: 300px) {
  .fts-related-widget.layout-list img {
    flex: 0 0 35%;
    width: 35%;
  }
  .fts-related-widget.layout-list .fanza-related-item .title {
    font-size: 14px !important;
    line-height: 1.3;
  }
}
.fts-related-widget.layout-list .title{
  flex:1;
  font-size:18px;
  line-height:1.4;
  margin:0;
}

/* =============================================
   グリッド（カード）調整
============================================= */
.fts-related-widget.layout-card li:hover{background:#e8e8e8;opacity:.8}

/* =============================================
   レスポンシブ
============================================= */
@media (max-width:699px){
  /* 横長リストの画像を少し小さく */
  .fts-related-widget.layout-list img{flex:0 0 150px}

  /* カード 2 列 / ランキング 2 列 */
  .fts-related-widget.layout-card li{
    flex: 0 0 calc(50% - 5px);
    min-width: 120px;
  }
  .widget_fanza_img_ranking_widget ul.fanza-img-ranking-widget li{width:47%}
  .fts-related-widget.layout-card .title,
  .fts-related-widget.layout-list .title{font-size:13px}
  ul.fanza-actress-movies-widget li {
    width: 47%;
  }
}

/* 遅延読み込み用スタイル */
.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.lazy.loaded {
    opacity: 1;
}

/* =============================================
   カルーセル形式
============================================= */

/* CSS変数定義（カスタマイズ用） */
:root {
    --fanza-carousel-nav-size: 40px;
    --fanza-carousel-nav-bg: rgba(255, 255, 255, 0.9);
    --fanza-carousel-nav-color: #333;
    --fanza-carousel-nav-hover-bg: rgba(255, 255, 255, 1);
    --fanza-carousel-nav-disabled-opacity: 0.3;
    --fanza-carousel-scrollbar-width: 4px;
    --fanza-carousel-scrollbar-color: rgba(0, 0, 0, 0.2);
    --fanza-carousel-scrollbar-hover-color: rgba(0, 0, 0, 0.4);
}

/* カルーセルコンテナ */
.fanza-carousel-container {
    position: relative;
}

/* カルーセルラッパー */
.fanza-carousel-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    margin-left: -10px;
    margin-right: -10px;
    padding-right: 10px;
    
    /* モバイルではスクロールバーを非表示 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.fanza-carousel-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera（モバイル用） */
}

/* PC環境：細くてスタイリッシュなスクロールバー */
@media (min-width: 700px) {
    .fanza-carousel-wrapper {
        scrollbar-width: thin; /* Firefox */
        scrollbar-color: var(--fanza-carousel-scrollbar-color) transparent;
    }

    .fanza-carousel-wrapper::-webkit-scrollbar {
        display: block;
        height: var(--fanza-carousel-scrollbar-width);
    }

    .fanza-carousel-wrapper::-webkit-scrollbar-track {
        background: transparent;
    }

    .fanza-carousel-wrapper::-webkit-scrollbar-thumb {
        background-color: var(--fanza-carousel-scrollbar-color);
        border-radius: calc(var(--fanza-carousel-scrollbar-width) / 2);
        transition: background-color 0.2s ease;
    }

    .fanza-carousel-wrapper::-webkit-scrollbar-thumb:hover {
        background-color: var(--fanza-carousel-scrollbar-hover-color);
    }
}

/* 矢印ナビゲーションボタン */
.fanza-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: var(--fanza-carousel-nav-size);
    height: var(--fanza-carousel-nav-size);
    background: var(--fanza-carousel-nav-bg);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    color: var(--fanza-carousel-nav-color);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fanza-carousel-nav:hover {
    background: var(--fanza-carousel-nav-hover-bg);
    transform: translateY(-50%) scale(1.1);
}

/* 端まで来たら薄くするだけ。タップは受け止めて、下のカード（もっと見る等）が押されないようにする */
.fanza-carousel-nav.is-disabled {
    opacity: var(--fanza-carousel-nav-disabled-opacity);
    cursor: default;
}

.fanza-carousel-nav-prev {
    left: 10px;
}

.fanza-carousel-nav-next {
    right: 10px;
}

/* 矢印はどちらも右向きの SVG を使い、前へは回転させる（FUN-the-Press と同じ。このプラグインのウィジェット内だけに指定） */
.fscp-widget .fanza-carousel-nav-prev svg {
    transform: rotate(180deg);
}

/* モバイルでナビゲーションボタンを表示する場合 */
.fanza-carousel-container.show-mobile-nav .fanza-carousel-nav {
    display: flex;
}

@media (max-width: 699px) {
    .fanza-carousel-nav {
        display: none;
    }
}

/* カルーセルアイテム */
.fanza-carousel-wrapper .fts-related-widget.layout-carousel,
.fanza-carousel-wrapper ul.fts-related-widget.fts-related-widget.layout-carousel {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto;
}

.fanza-carousel-wrapper .fts-related-widget.layout-carousel .fanza-related-item {
    flex: 0 0 auto !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    scroll-snap-align: start;
    margin: 0 !important;
}

@media (max-width: 699px) {
    .fanza-carousel-wrapper .fts-related-widget.layout-carousel .fanza-related-item {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
    }
}


/* =============================================
   キャンペーンウィジェット（2.0）
   色・角丸は FUN-the-Press のデザイン設定（--fp-*）があればそれに合わせる
============================================= */
.fanza-carousel-nav::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 50%;
}
.fscp-widget .fscp-thumb-wrap {
    position: relative;
    display: block;
}
.fscp-widget .fscp-thumb-wrap img,
.fscp-widget .fanza-thumbnail-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    object-position: top;
    border-radius: var(--fp-radius-sm, 8px);
}
.fscp-widget .fanza-thumbnail-placeholder {
    display: grid;
    place-items: center;
    background: #f0f0f0;
    color: #999;
    font-size: 11px;
}
/* リスト：画像の幅は枠（.fscp-thumb-wrap）で決め、中の img は枠いっぱいに広げる
   （img 側にも 35% が効いて「35% の 35%」に縮んでいたのを防ぐ） */
.fscp-widget .fts-related-widget.layout-list .fscp-thumb-wrap {
    flex: 0 0 200px;
    width: 200px;
    max-width: 45%;
}
.fscp-widget .fts-related-widget.layout-list .fscp-thumb-wrap img,
.fscp-widget .fts-related-widget.layout-list .fanza-thumbnail-placeholder {
    flex: none;
    width: 100%;
    max-width: none;
}
.fscp-widget .fts-related-widget.layout-list .fp_post_meta {
    flex: 1;
    min-width: 0;
    padding: 0;
}
@container (max-width: 500px) {
    .fscp-widget .fts-related-widget.layout-list .fscp-thumb-wrap {
        flex-basis: 45%;
        width: 45%;
    }
}
@media (max-width: 699px) {
    .fscp-widget .fts-related-widget.layout-list .fscp-thumb-wrap {
        flex-basis: 45%;
        width: 45%;
    }
}

/* カルーセル最後の「もっと見る」カード（FUN-the-Press の関連動画と同じ見た目） */
.fscp-widget li.fanza-related-item.fanza-more-item,
.fscp-widget li.fanza-related-item.fanza-more-item:hover {
    background: transparent;
    opacity: 1;
}
.fscp-widget ul.fts-related-widget a.fanza-more-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-height: 160px;
    padding: 16px;
    border: 1px solid var(--fp-border, #dcdcdc);
    border-radius: var(--fp-radius, 8px);
    background: #fff;
    color: #555;
    text-align: center;
    line-height: 1.4;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}
.fscp-widget ul.fts-related-widget a.fanza-more-card:hover {
    border-color: var(--fp-accent-line, #999);
    background: var(--fp-accent-soft, #f7f7f7);
    color: var(--fp-accent, #222);
}
.fscp-widget .fanza-more-card__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: #f0f0f0;
    transition: transform .2s ease, background-color .2s ease;
}
.fscp-widget a.fanza-more-card:hover .fanza-more-card__icon {
    background: #e4e4e4;
    transform: translateX(3px);
}
.fscp-widget .fanza-more-card__label {
    font-size: 15px;
    font-weight: bold;
}
.fscp-widget .fanza-more-card__sub {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: normal;
    color: #888;
}
.fscp-off {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 8px;
    border-radius: var(--fp-radius-pill, 999px);
    background: var(--fp-accent, #e8284f);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
}
.fscp-widget .fanza-price {
    margin-top: 4px;
    font-size: 13px;
}
.fscp-widget .fanza-price del {
    margin-right: 4px;
    color: #999;
    font-size: 12px;
}
.fscp-widget .fanza-price strong {
    color: var(--fp-accent, #e8284f);
}
.fscp-period {
    margin: -.3em 0 .6em !important;
    color: #888;
    font-size: 12px;
}
.fanza-widget-campaign-title {
    margin: 1em 0 .5em;
}
.fscp-widget .fanza-more-link {
    margin: 12px 0 0;
    text-align: center;
}
.fscp-widget .fanza-more-link a {
    display: inline-block;
    padding: 8px 18px;
    border: 1px solid var(--fp-accent, #e8284f);
    border-radius: var(--fp-radius-pill, 999px);
    color: var(--fp-accent, #e8284f);
    font-size: 13px;
    text-decoration: none;
}
.fscp-widget .fanza-more-link a:hover {
    background: var(--fp-accent, #e8284f);
    color: #fff;
}
.fscp-widget__empty {
    color: #888;
    font-size: 13px;
}

/* タブ */
.fanza-widget-tabs .tab-headers-wrapper {
    overflow-x: auto;
    margin-bottom: .6em;
    padding-bottom: .3em;
    border-bottom: 1px solid #e2e8f0;
    -webkit-overflow-scrolling: touch;
}
.fanza-widget-tabs .tab-headers {
    display: flex;
    gap: 6px;
    min-width: max-content;
}
.fanza-widget-tabs .tab-link {
    flex-shrink: 0;
    padding: .3em .8em;
    border-radius: var(--fp-radius-pill, 999px);
    background: #f1f5f9;
    color: #334155;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}
.fanza-widget-tabs .tab-link.tab-active {
    background: var(--fp-accent, #e8284f);
    color: #fff;
}

/* 2列表示（ウィジェット「2列で表示」。サイドバーなど狭い場所でも2列のまま並べる） */
.fts-related-widget.layout-card.fp-cols-2 > li {
    flex: 0 0 calc(50% - 5px) !important;
    width: calc(50% - 5px) !important;
    min-width: 0 !important;
}
