/* =========================================================
   投稿oppai の出演作品一覧とサンプルモーダル
   ---------------------------------------------------------
   組み立ては inc/oppai-works.php、動きは js/oppai-works.js
   ========================================================= */

:root{
    --opwk-pink:#e0245e;
    --opwk-pink-d:#b81a4b;
    --opwk-ink:#2b2b33;
    --opwk-sub:#8a8a99;
    --opwk-line:#ececf2;
}

.opwk{ margin:40px 0 0; }

.oppai-sec-ttl--newworks{ margin-bottom:14px; }

/* ---------------------------------------------------------
   カードの並び
   ---------------------------------------------------------
   旧：SWELL の .p-postList -sp-col1 を流用していたため
   スマホで1列になり、1作品で画面が埋まっていた。
   サムネイルは 16:9 固定なので、どの作品でも段がそろう。
   --------------------------------------------------------- */
.opwk__grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px 10px;
    margin:0;
    padding:0;
    list-style:none;
}
@media (min-width:600px){
    .opwk__grid{ grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px 14px; }
}
@media (min-width:1000px){
    .opwk__grid{ grid-template-columns:repeat(4,minmax(0,1fr)); }
}
.opwk__item{ margin:0; padding:0; }
.opwk__item::before{ content:none; } /* テーマ側のリストマーカー除去 */

.opwk__card{
    display:flex;
    flex-direction:column;
    height:100%;
    border-radius:12px;
    background:#fff;
    border:1px solid var(--opwk-line);
    overflow:hidden;
    color:inherit;
    text-decoration:none;
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.opwk__card:hover{
    transform:translateY(-2px);
    border-color:#ffd3e0;
    box-shadow:0 6px 18px rgba(224,36,94,.14);
}

/* ---------------------------------------------------------
   サムネイル
   --------------------------------------------------------- */
.opwk__thumb{
    position:relative;
    display:block;
    aspect-ratio:16/9;
    background:#1a1a1f;
    overflow:hidden;
}
.opwk__thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition:transform .3s ease;
}
.opwk__card:hover .opwk__thumb img{ transform:scale(1.04); }

/* 札。左上にたてに積む */
.opwk__badges{
    position:absolute;
    top:6px; left:6px;
    z-index:2;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:4px;
    max-width:calc(100% - 12px);
}
.opwk__badge{
    display:inline-block;
    padding:2px 7px;
    border-radius:4px;
    font-size:10px;
    font-weight:900;
    line-height:1.5;
    letter-spacing:.02em;
    color:#fff;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:100%;
}
.opwk__badge.is-new{ background:linear-gradient(135deg,#ff6b8b,#e0245e); }
.opwk__badge.is-soon{ background:linear-gradient(135deg,#6ba8ff,#2f6fd0); }

/*
 * セール札は左下。
 * 左上に積むと、真ん中の再生ボタンと必ずぶつかる。
 */
.opwk__sale{
    position:absolute;
    left:6px; bottom:6px;
    z-index:2;
    max-width:calc(100% - 12px);
    padding:2px 7px;
    border-radius:4px;
    background:linear-gradient(135deg,#f5456f,#d01a4c);
    box-shadow:0 2px 6px rgba(208,26,76,.45);
    color:#fff;
    font-size:10px;
    font-weight:900;
    line-height:1.5;
    letter-spacing:.02em;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* 再生の印。常に出すが控えめ、hoverで前に出す */
.opwk__play{
    position:absolute;
    top:50%; left:50%;
    transform:translate(-50%,-50%);
    z-index:2;
    display:grid;
    place-items:center;
    width:40px; height:40px;
    border-radius:50%;
    background:rgba(0,0,0,.45);
    border:1.5px solid rgba(255,255,255,.75);
    color:#fff;
    font-size:14px;
    padding-left:2px; /* ▶ の重心ずれ分 */
    transition:background .18s ease, transform .18s ease;
}
.opwk__card:hover .opwk__play{
    background:var(--opwk-pink);
    border-color:#fff;
    transform:translate(-50%,-50%) scale(1.08);
}

/* ---------------------------------------------------------
   本文
   --------------------------------------------------------- */
.opwk__body{
    display:flex;
    flex-direction:column;
    gap:6px;
    flex:1 1 auto;
    padding:8px 10px 10px;
}
.opwk__ttl{
    font-size:12.5px;
    font-weight:700;
    line-height:1.45;
    color:var(--opwk-ink);
    /* 旧：nowrap で1行だったので何の作品か読めなかった */
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    min-height:calc(1.45em * 2);
}
@media (min-width:600px){
    .opwk__ttl{ font-size:13px; }
}
/*
 * 評点と日付の行。
 * 【折り返させない】
 * wrap を許すと、レビュー件数が3桁の作品だけ2行になって
 * 同じ段のカードと高さがそろわない（18pxずれる）。
 * 狭いときは件数を落として1行に収める。
 */
.opwk__meta{
    display:flex;
    align-items:center;
    flex-wrap:nowrap;
    gap:7px;
    margin-top:auto;
    font-size:11px;
    line-height:1.45;
    color:var(--opwk-sub);
    white-space:nowrap;
}
.opwk__cnt{ display:none; }
@media (min-width:600px){
    .opwk__cnt{ display:inline; }
}
.opwk__stars{ font-size:11.5px; letter-spacing:-.5px; color:#ffcc00; }
.opwk__stars[data-v="none"]{ color:#dcdce4; }
.opwk__stars[data-v="top"]{ color:#cd4187; }
.opwk__stars[data-v="high"]{ color:#ff3355; }
.opwk__stars[data-v="mid"]{ color:#f58220; }
.opwk__stars[data-v="low"]{ color:#ffcc00; }
.opwk__stars[data-v="poor"]{ color:#67a7cc; }
.opwk__stars[data-v="bad"]{ color:#aaa; }
.opwk__cnt{ font-size:10.5px; font-weight:700; flex:0 0 auto; }
.opwk__date{ margin-left:auto; font-size:10.5px; font-variant-numeric:tabular-nums; }

/* =========================================================
   サンプルモーダル
   ---------------------------------------------------------
   旧：インラインCSSで 16:9 の箱を出し、FANZAボタンを
   bottom:-5%（スマホは -50%）で箱の外にぶら下げていたので
   画面からはみ出していた。ここでは縦に積んで畳んでいる。
   ========================================================= */
.opwkm{
    position:fixed;
    inset:0;
    z-index:100000;
    display:none;
    align-items:center;
    justify-content:center;
    padding:16px;
}
.opwkm.is-open{ display:flex; }

.opwkm__veil{
    position:absolute;
    inset:0;
    background:rgba(10,8,14,.82);
    -webkit-backdrop-filter:blur(3px);
    backdrop-filter:blur(3px);
}

.opwkm__panel{
    position:relative;
    z-index:1;
    display:flex;
    flex-direction:column;
    width:100%;
    max-width:900px;
    max-height:calc(100dvh - 32px);
    border-radius:14px;
    background:#15131a;
    box-shadow:0 24px 70px rgba(0,0,0,.6);
    overflow:hidden;
    animation:opwkm-in .18s ease-out;
}
@keyframes opwkm-in{
    from{ opacity:0; transform:translateY(10px) scale(.985); }
    to{ opacity:1; transform:none; }
}

/* 見出し行 */
.opwkm__head{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 10px 10px 14px;
    border-bottom:1px solid rgba(255,255,255,.08);
}
.opwkm__ttl{
    flex:1 1 auto;
    min-width:0;
    font-size:13px;
    font-weight:700;
    line-height:1.4;
    color:#fff;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.opwkm__date{
    flex:0 0 auto;
    font-size:11px;
    color:rgba(255,255,255,.5);
    font-variant-numeric:tabular-nums;
}
.opwkm__x{
    flex:0 0 auto;
    display:grid;
    place-items:center;
    width:34px; height:34px;
    border:0;
    border-radius:8px;
    background:rgba(255,255,255,.08);
    color:#fff;
    font-size:16px;
    cursor:pointer;
    transition:background .15s ease;
}
.opwkm__x:hover{ background:rgba(255,255,255,.2); }

/* 再生面 */
.opwkm__stage{
    position:relative;
    flex:0 0 auto;
    aspect-ratio:16/9;
    max-height:min(56.25vw,calc(100dvh - 230px));
    background:#000;
}
.opwkm__stage iframe{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    border:0;
    display:block;
}
.opwkm__stage img{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}
/* 読み込み中のくるくる */
.opwkm__spin{
    position:absolute;
    top:50%; left:50%;
    width:30px; height:30px;
    margin:-15px 0 0 -15px;
    border:3px solid rgba(255,255,255,.22);
    border-top-color:#fff;
    border-radius:50%;
    animation:opwkm-spin .8s linear infinite;
}
.opwkm.is-ready .opwkm__spin{ display:none; }
@keyframes opwkm-spin{ to{ transform:rotate(360deg); } }

/* 前後の作品へ */
.opwkm__nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    z-index:3;
    display:grid;
    place-items:center;
    width:36px; height:52px;
    border:0;
    border-radius:8px;
    background:rgba(0,0,0,.42);
    color:#fff;
    font-size:15px;
    cursor:pointer;
    transition:background .15s ease;
}
.opwkm__nav:hover{ background:var(--opwk-pink); }
.opwkm__nav[hidden]{ display:none; }
.opwkm__nav.is-prev{ left:6px; }
.opwkm__nav.is-next{ right:6px; }

/* サンプル画像の帯 */
.opwkm__strip{
    flex:0 0 auto;
    display:flex;
    gap:6px;
    padding:8px 10px;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scrollbar-width:thin;
    border-top:1px solid rgba(255,255,255,.07);
}
.opwkm__strip:empty{ display:none; }
.opwkm__shot{
    flex:0 0 auto;
    width:84px;
    aspect-ratio:16/10;
    padding:0;
    border:2px solid transparent;
    border-radius:6px;
    background:#000 center/cover no-repeat;
    cursor:pointer;
    opacity:.72;
    transition:opacity .15s ease, border-color .15s ease;
}
.opwkm__shot:hover{ opacity:1; }
.opwkm__shot.is-on{ opacity:1; border-color:var(--opwk-pink); }

/* 下のボタン行 */
.opwkm__foot{
    flex:0 0 auto;
    display:flex;
    gap:8px;
    padding:10px;
    border-top:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.03);
}
.opwkm__btn{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:44px;
    padding:0 16px;
    border-radius:10px;
    font-size:13.5px;
    font-weight:800;
    text-decoration:none;
    white-space:nowrap;
    transition:filter .15s ease, background .15s ease;
}
.opwkm__btn:hover{ filter:brightness(1.08); }
.opwkm__btn.is-main{
    flex:1 1 auto;
    background:linear-gradient(135deg,#f5456f,#d01a4c);
    color:#fff;
    box-shadow:0 4px 14px rgba(208,26,76,.4);
}
.opwkm__btn.is-sub{
    flex:0 0 auto;
    background:rgba(255,255,255,.1);
    color:#fff;
}
.opwkm__btn.is-sub[hidden]{ display:none; }

/* スマホ：横幅いっぱい、ボタンは縦積み */
@media (max-width:600px){
    .opwkm{ padding:0; align-items:flex-end; }
    .opwkm__panel{
        max-width:none;
        max-height:100dvh;
        height:auto;
        border-radius:14px 14px 0 0;
    }
    .opwkm__stage{ max-height:none; }
    .opwkm__ttl{ font-size:12px; -webkit-line-clamp:2; }
    .opwkm__date{ display:none; }
    .opwkm__foot{ flex-direction:column; padding-bottom:max(10px,env(safe-area-inset-bottom)); }
    .opwkm__btn.is-sub{ flex:1 1 auto; }
    .opwkm__shot{ width:72px; }
}

/* モーダルが開いている間は裏をスクロールさせない */
body.opwkm-lock{ overflow:hidden; }
