/* 関連動画リスト形式 */
.fanza-related-widget{
  container-type: inline-size;
}
.fanza-press ul.fanza-related-widget {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}
ul.fanza-related-widget a {
  text-decoration: none;
  color: inherit;
  font-weight: bold;
  line-height: 1.1em;
}
ul.fanza-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.fanza-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{
  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;
}
.fanza-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);
  }
  .fanza-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;
  }
  .fanza-related-widget.layout-list .fanza-related-item img {
    width: 200px;
    max-width: 100%;
    flex: 0 0 200px;
  }
  
  /* サイドバーなど狭い場所での調整 */
  @container (max-width: 500px) {
    .fanza-related-widget.layout-list .fanza-related-item img {
      flex: 0 0 35%;
      width: 35%;
    }
    .fanza-related-widget.layout-list .fanza-related-item .title {
      font-size: 14px !important;
      line-height: 1.3;
    }
  }
  
  @container (max-width: 300px) {
    .fanza-related-widget.layout-list .fanza-related-item img {
      flex: 0 0 35%;
      width: 35%;
    }
    .fanza-related-widget.layout-list .fanza-related-item .title {
      font-size: 14px !important;
      line-height: 1.3;
    }
  }
  
  .fanza-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;
}
/* カード形式 */
.fanza-related-widget.layout-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fanza-related-widget.layout-card li {
    flex: 0 0 calc(33.333% - 7px);
    min-width: 150px;
    box-sizing: border-box;
}

/* サイドバーなど狭い場所での調整 */
@container (max-width: 500px) {
    .fanza-related-widget.layout-card li {
        flex: 0 0 calc(50% - 5px);
        min-width: 120px;
    }
}

@container (max-width: 300px) {
    .fanza-related-widget.layout-card li {
        flex: 0 0 100%;
        min-width: 100%;
    }
}

/* =============================================
   関連ウィジェット ─ 横長リスト崩れ対策
============================================= */
.fanza-related-widget.layout-list{
  display:flex;
  flex-direction:column;
  padding-left: 0;
}
.fanza-related-widget.layout-list a{display:flex;width:100%;align-items:flex-start;gap:10px}
.fanza-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) {
  .fanza-related-widget.layout-list img {
    flex: 0 0 35%;
    width: 35%;
  }
  .fanza-related-widget.layout-list .fanza-related-item .title {
    font-size: 14px !important;
    line-height: 1.3;
  }
}

@container (max-width: 300px) {
  .fanza-related-widget.layout-list img {
    flex: 0 0 35%;
    width: 35%;
  }
  .fanza-related-widget.layout-list .fanza-related-item .title {
    font-size: 14px !important;
    line-height: 1.3;
  }
}
.fanza-related-widget.layout-list .title{
  flex:1;
  font-size:18px;
  line-height:1.4;
  margin:0;
}

/* =============================================
   グリッド（カード）調整
============================================= */
.fanza-related-widget.layout-card li{width:31%}
.fanza-related-widget.layout-card li:hover{background:#e8e8e8;opacity:.8}

/* =============================================
   レスポンシブ
============================================= */
@media (max-width:699px){
  /* 横長リストの画像を少し小さく */
  .fanza-related-widget.layout-list img{flex:0 0 150px}

  /* カード 2 列 / ランキング 2 列 */
  .fanza-related-widget.layout-card li,
  .widget_fanza_img_ranking_widget ul.fanza-img-ranking-widget li{width:47%}
  .fanza-related-widget.layout-card .title,
  .fanza-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: not-allowed;
    pointer-events: none;
}

.fanza-carousel-nav-prev {
    left: 10px;
}

.fanza-carousel-nav-next {
    right: 10px;
}

/* モバイルでナビゲーションボタンを表示する場合 */
.fanza-carousel-container.show-mobile-nav .fanza-carousel-nav {
    display: flex;
}

@media (max-width: 699px) {
    .fanza-carousel-nav {
        display: none;
    }
}

/* カルーセルアイテム */
.fanza-carousel-wrapper .fanza-related-widget.layout-carousel,
.fanza-press .fanza-carousel-wrapper ul.fanza-related-widget.layout-carousel {
    display: flex;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.fanza-carousel-wrapper .fanza-related-widget.layout-carousel .fanza-related-item {
    flex: 0 0 auto;
    width: 200px;
    scroll-snap-align: start;
}

@media (max-width: 699px) {
    .fanza-carousel-wrapper .fanza-related-widget.layout-carousel .fanza-related-item {
        width: 150px;
    }
}

