/* FANZA Auto-Post フロントエンドスタイル */

.fanza-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.fanza-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s;
}

.fanza-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.fanza-card__jacket img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.fanza-card__body {
    padding: 8px 10px;
}

.fanza-card__title {
    font-size: 13px;
    font-weight: bold;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fanza-card__actresses,
.fanza-card__maker,
.fanza-card__meta {
    font-size: 12px;
    color: #555;
    margin: 0;
}

.fanza-card__actresses a {
    color: #0073aa;
    text-decoration: none;
}

.fanza-card__actresses a:hover {
    text-decoration: underline;
}

.fanza-label {
    font-weight: 600;
    margin-right: 4px;
}

.fanza-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.fanza-card__price {
    font-weight: bold;
    color: #e00;
    font-size: 14px;
}

.fanza-card__video {
    margin-top: 4px;
}

.fanza-card__video video {
    width: 100%;
    max-height: 200px;
    background: #000;
    border-radius: 4px;
}

.fanza-card__samples {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.fanza-card__samples img {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
}

.fanza-card__cta {
    margin-top: auto;
    padding-top: 10px;
}

.fanza-btn {
    display: block;
    background: #e8001c;
    color: #fff;
    text-align: center;
    padding: 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    transition: background .2s;
}

.fanza-btn:hover {
    background: #c0001a;
    color: #fff;
}

/* ── 投稿本文レイアウト（カラーボックス） ── */

.fanza-box {
    border: 2px solid;
    border-radius: 0 5px 5px 5px;
    margin-bottom: 20px;
}

.fanza-box__hd {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.fanza-box__label {
    display: inline-block;
    padding: 4px 12px;
    font-weight: bold;
    font-size: 13px;
    border-radius: 0 0 5px 0;
}

.fanza-box__body {
    padding: 14px 16px;
}

.fanza-box__body p {
    margin: 6px 0;
}

/* サンプル動画（ピンク） */
.fanza-box--video {
    background-color: #fdf0f2;
    border-color: #f78da7;
}
.fanza-box--video .fanza-box__label--pink {
    background-color: #f78da7;
    color: #fdf0f2;
}

/* 作品情報（黄） */
.fanza-box--info {
    background-color: #fffde7;
    border-color: #ffc107;
}
.fanza-box--info .fanza-box__label--yellow {
    background-color: #ffc107;
    color: #fffde7;
}

/* 高画質完全版（緑） */
.fanza-box--cta {
    background-color: #d8ffd6;
    border-color: #00B900;
}
.fanza-box--cta .fanza-box__label--green {
    background-color: #00B900;
    color: #d8ffd6;
}

/* 動画iframe レスポンシブ */
.fanza-box__video-wrap {
    text-align: center;
    overflow: hidden;
}
.fanza-box__video-wrap iframe {
    max-width: 100%;
}

/* ジャケット画像 */
.fanza-box__jacket {
    text-align: center;
    margin-bottom: 12px;
}
.fanza-box__jacket img {
    max-width: 100%;
    height: auto;
}

/* FANZAで見るボタン */
.fanza-cta-btn {
    display: inline-block;
    background: #00B900;
    color: #fff;
    text-align: center;
    padding: 12px 32px;
    border-radius: 60px;
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
    transition: background .2s;
}
.fanza-cta-btn:hover {
    background: #009900;
    color: #fff;
}
.fanza-box--cta .fanza-box__body {
    text-align: center;
}

/* ── シンプルレイアウト（スマホ重視） ── */

.fanza-simple {
    max-width: 640px;
    margin: 0 auto;
}

.fanza-simple__jacket {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 16px;
}

.fanza-simple__meta {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.fanza-simple__meta th,
.fanza-simple__meta td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}

.fanza-simple__meta th {
    color: #888;
    font-weight: normal;
    white-space: nowrap;
    width: 6em;
}

.fanza-simple__cta {
    display: block;
    background: #e8001c;
    color: #fff;
    text-align: center;
    padding: 14px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 24px;
    transition: background .2s;
}

.fanza-simple__cta:hover {
    background: #c0001a;
    color: #fff;
}

.fanza-simple__section {
    font-size: 13px;
    font-weight: bold;
    color: #555;
    border-left: 3px solid #e8001c;
    padding-left: 8px;
    margin-bottom: 10px;
}

/* レスポンシブiframe（600:500比率） */
.fanza-simple__video {
    position: relative;
    padding-bottom: 83.33%;
    height: 0;
    overflow: hidden;
    margin-bottom: 6px;
}

.fanza-simple__video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.fanza-simple__video-note {
    font-size: 12px;
    color: #888;
    margin: 0 0 20px;
}

.fanza-simple__video-note a {
    color: #888;
}

.fanza-no-items {
    color: #666;
    font-style: italic;
}

.fanza-pagination {
    margin: 20px 0;
    text-align: center;
}

.fanza-pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #0073aa;
}

.fanza-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* ================================================================
   クラス名略語凡例（L-3）
   sbs = side-by-side（左右分割レイアウト）
   vm  = video-main（動画メインレイアウト）
   tg  = thumbnail-grid（サムネグリッドレイアウト）
   ms  = media-site（メディアサイト風レイアウト）
================================================================ */

/* ================================================================
   共通: レイアウトラッパー・共通パーツ
================================================================ */

.fanza-layout {
    margin: 0 0 24px;
}

/* レスポンシブ動画ラップ（16:12 ≒ 600x500） */
.fanza-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 83.33%;
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}
.fanza-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* 共通メタテーブル */
.fanza-meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 12px 0;
}
.fanza-meta-table th,
.fanza-meta-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
    vertical-align: top;
}
.fanza-meta-table th {
    color: #888;
    font-weight: normal;
    white-space: nowrap;
    width: 6em;
}

/* CTAボタン（大） */
.fanza-cta-btn--large {
    display: block;
    background: #e8001c;
    color: #fff;
    text-align: center;
    padding: 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 17px;
    transition: background .2s;
}
.fanza-cta-btn--large:hover { background: #c0001a; color: #fff; }

/* 動画再生できない場合リンク */
.fanza-video-fallback {
    font-size: 12px;
    color: #888;
    margin: 4px 0 0;
}
.fanza-video-fallback a { color: #888; }

/* サンプル画像グリッド（共通） */
.fanza-sample-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    margin: 16px 0;
}
.fanza-sample-images img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

/* ジャンルタグ */
.fanza-genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}
.fanza-genre-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 20px;
    font-size: 12px;
    color: #2c3338;
    text-decoration: none;
    transition: background .15s;
}
.fanza-genre-tag:hover { background: #dcdcde; color: #2c3338; }

/* ================================================================
   Layout: classic
================================================================ */

/* タイトルから適度に離す */
.fanza-layout--classic {
    margin-top: 16px;
}

/* サンプル動画を中央寄せ（最大600px） */
.fanza-box--video .fanza-video-wrap {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ジャケット画像の最大幅（大きすぎる場合に抑制） */
.fanza-box__jacket img {
    max-width: 100%;
    max-height: 480px;
    height: auto;
    width: auto;
}

.fanza-layout--classic .fanza-box__video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 83.33%;
    height: 0;
    overflow: hidden;
}
.fanza-layout--classic .fanza-box__video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}

/* ================================================================
   Layout: side-by-side
   PC(>=768px): 左=動画70% 右=情報30%
   タブレット/スマホ: 縦積み
================================================================ */
.fanza-layout--side-by-side .fanza-sbs__main {
    display: grid;
    grid-template-columns: 70fr 30fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}
.fanza-sbs__jacket {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}
.fanza-sbs__info .fanza-meta-table {
    margin-top: 0;
}

@media (max-width: 767px) {
    .fanza-layout--side-by-side .fanza-sbs__main {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   Layout: video-main
   動画フル幅（最大800px） → CTA → メタ → ジャケット
================================================================ */
.fanza-layout--video-main .fanza-vm__video {
    max-width: 800px;
    margin: 0 auto 16px;
}
/* video-mainの動画は16:12ではなく4:3気味に */
.fanza-layout--video-main .fanza-video-wrap {
    padding-bottom: 75%;
}
.fanza-layout--video-main .fanza-vm__cta {
    text-align: center;
    margin-bottom: 16px;
}
.fanza-vm__jacket {
    display: block;
    max-width: 250px;
    height: auto;
    border-radius: 4px;
    margin: 12px auto;
}

@media (min-width: 768px) {
    .fanza-layout--video-main .fanza-vm__meta {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* ================================================================
   Layout: thumbnail-grid
   PC: 上部=ジャケット+メタ横並び、サンプル3列グリッド
   スマホ: 縦積み
================================================================ */
.fanza-layout--thumbnail-grid .fanza-tg__header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}
.fanza-tg__jacket {
    width: 140px;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
}
.fanza-tg__meta .fanza-cta-btn {
    display: block;
    margin-top: 12px;
    text-align: center;
}
.fanza-tg__images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 16px 0;
}
.fanza-tg__images img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}
.fanza-tg__video {
    margin: 16px 0;
}
.fanza-tg__cta-bottom {
    text-align: center;
    margin-top: 12px;
}

@media (max-width: 599px) {
    .fanza-layout--thumbnail-grid .fanza-tg__header {
        grid-template-columns: 1fr;
    }
    .fanza-tg__jacket { width: 100%; max-height: 220px; object-fit: cover; }
    .fanza-tg__images { grid-template-columns: repeat(2, 1fr); }
    .fanza-tg__images img { height: 90px; }
}

/* ================================================================
   Layout: media-site
   PC(>=900px): 動画70% + サイドバー30%
   タブレット(600〜899px): 動画フル幅、サイドバー横スクロール
   スマホ(<600px): 完全縦積み
================================================================ */
.fanza-layout--media-site .fanza-ms__stage {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 12px;
    align-items: start;
    margin-bottom: 16px;
}
.fanza-ms__player { min-width: 0; }
.fanza-ms__sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 480px;
    overflow-y: auto;
}
.fanza-ms__thumb {
    width: 100%;
    height: auto;
    border-radius: 3px;
    display: block;
    cursor: pointer;
    transition: opacity .15s;
}
.fanza-ms__thumb:hover { opacity: .85; }

.fanza-ms__body { }
.fanza-ms__title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 12px;
    line-height: 1.5;
}
.fanza-ms__cta { margin-bottom: 16px; }
.fanza-ms__meta { margin: 12px 0; }
.fanza-ms__jacket {
    display: block;
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

/* タブレット・スマホ共通（<900px）: 縦積み・サイドバー横スクロール化 */
@media (max-width: 899px) {
    .fanza-layout--media-site .fanza-ms__stage {
        grid-template-columns: 1fr;
    }
    .fanza-ms__sidebar {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        max-height: none;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .fanza-ms__thumb {
        width: 120px;
        height: 90px;
        object-fit: cover;
        flex-shrink: 0;
    }
}

/* スマホ（<600px）: サムネイル縮小 */
@media (max-width: 599px) {
    .fanza-ms__thumb {
        width: 100px;
        height: 75px;
    }
    .fanza-ms__title { font-size: 15px; }
    .fanza-sample-images { grid-template-columns: repeat(2, 1fr); }
}

/* ================================================================
   フォーカス可視化（M-8: WCAG 2.4.7）
================================================================ */
.fanza-cta-btn:focus,
.fanza-simple__cta:focus,
.fanza-genre-tag:focus {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
}
.fanza-card:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ================================================================
   既存 classic/simple の動画wrapをレスポンシブ化（後方互換）
================================================================ */
.fanza-box__video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 83.33%;
    height: 0;
    overflow: hidden;
}
.fanza-box__video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
