/*
Theme Name: PopStage
Theme URI: https://yoursite.com
Author: Your Name
Description: 映像作品紹介サイト用 Netflix風ダークテーマ。出演者・作品グリッド、カード展開式サンプルスライダー、あいうえお行フィルター、ページネーション対応。
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: popstage
*/

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --bg:      #141414;
  --card:    #1f1f1f;
  --card2:   #2a2a2a;
  --border:  #282828;
  --border2: #3a3a3a;
  --red:     #e50914;
  --red-h:   #f40612;
  --gold:    #f5c518;
  --t1:      #ffffff;
  --t2:      #e5e5e5;
  --t3:      #a3a3a3;
  --t4:      #757575;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.7;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

/* ============================================================
   HEADER / NAV
   ============================================================ */
#site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  letter-spacing: .05em;
  color: var(--red);
}
.global-nav { display: flex; gap: 2px; list-style: none; }
.global-nav a {
  font-size: .8rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 3px;
  color: var(--t3);
  transition: color .15s;
}
.global-nav a:hover,
.global-nav li.current-menu-item a { color: var(--t1); font-weight: 700; }

/* ハンバーガー */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--t2);
  border-radius: 2px;
  transition: all .25s;
}
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .global-nav { display: none; }
  .global-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 4px;
  }
  .global-nav.open a {
    display: block;
    padding: 10px 12px;
    border-radius: 4px;
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero-banner {
  background: var(--bg);
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  padding: 2px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  letter-spacing: .06em;
  line-height: 1.05;
  color: var(--t1);
}
.hero-title span { color: var(--red); }
.hero-sub { margin-top: 8px; color: var(--t3); font-size: .82rem; }

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrap { padding: 14px 0 0; }
.search-box {
  display: flex;
  align-items: center;
  background: var(--card2);
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
  max-width: 480px;
}
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--t1);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .85rem;
  padding: 10px 14px;
}
.search-box input::placeholder { color: #666; }
.search-box button {
  background: #3a3a3a;
  border: none;
  border-left: 1px solid #555;
  color: var(--t3);
  padding: 10px 16px;
  cursor: pointer;
  font-size: .9rem;
  transition: background .15s;
}
.search-box button:hover { background: #4a4a4a; color: var(--t1); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 14px 0;
}
.filter-label {
  font-size: .66rem;
  font-weight: 700;
  color: var(--t4);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-right: 4px;
  white-space: nowrap;
}
.filter-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid #444;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .76rem;
  color: var(--t3);
  padding: 5px 14px;
  border-radius: 3px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.filter-btn:hover { background: rgba(255,255,255,.13); color: var(--t1); border-color: #666; }
.filter-btn.active { background: var(--red); color: #fff; border-color: var(--red); }

/* あ行フィルター */
.row-filter {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 0 0 14px;
}
.row-btn {
  background: rgba(255,255,255,.07);
  border: 1px solid #444;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .76rem;
  color: var(--t3);
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all .15s;
}
.row-btn:hover { background: rgba(255,255,255,.13); color: var(--t1); border-color: #666; }
.row-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.row-btn:disabled { opacity: .3; cursor: default; }

/* ============================================================
   SECTION TITLE
   ============================================================ */
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: .1em;
  color: var(--t2);
  margin: 4px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-wrap { padding: 20px 0 4px; }
.page-info { font-size: .75rem; color: var(--t4); margin-bottom: 10px; }
.pagination { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.page-numbers,
.pagination a,
.pagination span {
  background: var(--card2);
  border: 1px solid #444;
  color: var(--t3);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .78rem;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  min-width: 36px;
  text-align: center;
  transition: all .15s;
  display: inline-block;
}
.pagination a:hover { background: #3a3a3a; color: var(--t1); border-color: #666; }
.pagination .current,
.page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.pagination .dots { background: none; border: none; color: var(--t4); }

/* ============================================================
   PERFORMER GRID（画像なし・テキストカード）
   ============================================================ */
.performer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.performer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 12px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
}
.performer-card:hover {
  border-color: var(--red);
  background: var(--card2);
  transform: translateY(-2px);
}
.performer-card .p-name { font-weight: 700; font-size: .88rem; color: var(--t2); }
.performer-card .p-kana { font-size: .68rem; color: var(--t4); letter-spacing: .05em; }
.performer-card .p-count { font-size: .7rem; color: var(--t3); }
.badge {
  display: inline-block;
  font-size: .56rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  width: fit-content;
}
.badge-new { background: var(--red); color: #fff; }
.badge-amateur { background: #555; color: #ddd; }

/* ============================================================
   PERFORMER DETAIL PAGE
   ============================================================ */
.performer-hero {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.breadcrumb {
  font-size: .73rem;
  color: var(--t4);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--t3); transition: color .15s; }
.breadcrumb a:hover { color: var(--t1); }
.breadcrumb span { color: var(--t4); }

.performer-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: .05em;
  line-height: 1;
  color: var(--t1);
}
.performer-kana { font-size: .75rem; color: var(--t4); margin-top: 4px; letter-spacing: .1em; }
.performer-profile { margin-top: 12px; color: var(--t3); font-size: .82rem; line-height: 1.8; max-width: 600px; }
.performer-stats { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.stat-box { background: var(--card2); border: 1px solid #333; border-radius: 3px; padding: 8px 14px; text-align: center; }
.stat-num { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; letter-spacing: .05em; color: var(--red); }
.stat-lbl { font-size: .6rem; color: var(--t4); text-transform: uppercase; letter-spacing: .08em; margin-top: 1px; }

/* ============================================================
   WORK GRID
   ============================================================ */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

/* ============================================================
   WORK CARD
   ============================================================ */
.work-card {
  background: var(--card);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .22s, box-shadow .22s;
  display: flex;
  flex-direction: column;
}
.work-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 32px rgba(0,0,0,.7);
  border-color: var(--border2);
}

/* 表紙 16:9 */
.work-cover {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--card2);
  position: relative;
  flex-shrink: 0;
}
.work-cover img,
.work-cover-inner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  transition: transform .4s;
}
.work-card:hover .work-cover img,
.work-card:hover .work-cover-inner { transform: scale(1.05); }

/* 画像なし */
.work-cover-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}
.work-cover-noimg span { font-size: .72rem; color: #555; letter-spacing: .05em; }

/* NEW バッジ・PR */
.work-badge-new {
  position: absolute;
  top: 7px; left: 7px;
  background: var(--red);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 2px;
  z-index: 1;
}
.work-badge-pr {
  position: absolute;
  top: 7px; right: 7px;
  background: rgba(0,0,0,.6);
  border: 1px solid #aaa;
  color: #ddd;
  font-size: .56rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: .05em;
  z-index: 1;
}

/* カード本文 */
.work-body { padding: 11px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.work-title { font-weight: 700; font-size: .92rem; line-height: 1.35; color: var(--t1); }
.work-performer { font-size: .71rem; color: var(--t3); }
.work-rating { display: flex; align-items: center; gap: 4px; }
.work-rating-stars { font-size: .7rem; color: var(--gold); }
.work-rating-num { font-size: .7rem; color: var(--gold); font-weight: 700; }
.work-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.work-tag {
  font-size: .58rem;
  color: var(--t3);
  border: 1px solid #3a3a3a;
  padding: 2px 6px;
  border-radius: 2px;
}

/* サンプルトグルボタン */
.sample-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  background: var(--card2);
  border: none;
  border-top: 1px solid #333;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .71rem;
  font-weight: 600;
  color: var(--t2);
  padding: 9px;
  cursor: pointer;
  margin-top: auto;
  transition: background .15s, color .15s;
}
.sample-toggle:hover { background: #333; color: var(--t1); }
.toggle-arrow { display: inline-block; transition: transform .3s; font-style: normal; }
.work-card.expanded .toggle-arrow { transform: rotate(180deg); }

/* EXPAND */
.work-expand { overflow: hidden; max-height: 0; transition: max-height .45s ease, opacity .3s ease; opacity: 0; }
.work-card.expanded .work-expand { max-height: 600px; opacity: 1; }
.expand-inner { padding: 12px 12px 0; border-top: 1px solid var(--border); }

/* サンプルなし */
.no-sample-msg {
  text-align: center;
  padding: 16px 0 8px;
  color: #666;
  font-size: .78rem;
}

/* SLIDER */
.slider-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.slider-track { flex: 1; overflow: hidden; border-radius: 4px; }
.slider-inner { display: flex; transition: transform .3s ease; }
.slide-item {
  min-width: 100%;
  aspect-ratio: 16/9;
  background: var(--card2);
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color .15s;
}
.slide-item img { width: 100%; height: 100%; object-fit: cover; }
.slide-item:hover { border-color: var(--red); }
.slider-btn {
  width: 32px; height: 32px; min-width: 32px;
  background: rgba(255,255,255,.15);
  border: 1px solid #666;
  color: var(--t1);
  font-size: 1rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.slider-btn:hover:not(:disabled) { background: var(--red); border-color: var(--red); }
.slider-btn:disabled { opacity: .2; cursor: default; }
.slider-dots { display: flex; justify-content: center; gap: 5px; margin-bottom: 11px; }
.slider-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #444;
  cursor: pointer;
  transition: background .2s;
  border: none;
  padding: 0;
}
.slider-dot.active { background: var(--red); }

/* アフィリエイトボタン */
.aff-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin: 0 0 12px;
  background: var(--red);
  color: #fff;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  letter-spacing: .06em;
  padding: 12px 0;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background .15s;
}
.aff-btn:hover { background: var(--red-h); }

/* ============================================================
   LIGHTBOX
   ============================================================ */
#popstage-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.93);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
#popstage-lightbox.open { display: flex; }
.lb-box {
  position: relative;
  background: var(--card);
  border-radius: 6px;
  border: 1px solid #333;
  padding: 24px 40px;
  text-align: center;
  max-width: 80vw;
  width: 360px;
  animation: lbIn .18s ease;
}
.lb-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--card2);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.lb-img img { width: 100%; height: 100%; object-fit: cover; }
.lb-caption { font-size: .78rem; color: var(--t3); }
.lb-counter { position: absolute; top: 8px; left: 12px; font-size: .68rem; color: var(--t4); }
.lb-close {
  position: absolute; top: 7px; right: 9px;
  background: none; border: none;
  color: var(--t3); font-size: 1.1rem; cursor: pointer; padding: 3px;
  transition: color .15s;
}
.lb-close:hover { color: var(--t1); }
.lb-arrow {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1);
  border: none;
  color: var(--t1);
  font-size: 1.3rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-arrow:hover { background: rgba(229,9,20,.5); }
.lb-arrow.prev { left: 12px; }
.lb-arrow.next { right: 12px; }
@keyframes lbIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  background: #0a0a0a;
  border-top: 1px solid var(--border);
  padding: 32px 0 24px;
  margin-top: 56px;
}
.footer-inner { display: flex; flex-direction: column; gap: 14px; }
.footer-logo { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; color: var(--red); }
.footer-nav { display: flex; gap: 16px; flex-wrap: wrap; list-style: none; }
.footer-nav a { font-size: .78rem; color: var(--t3); transition: color .15s; }
.footer-nav a:hover { color: var(--t1); }
.footer-pr { font-size: .68rem; color: #666; line-height: 1.7; max-width: 640px; }
.footer-copy { font-size: .7rem; color: #555; }

/* ============================================================
   SUBPAGES（プライバシーポリシー・お問い合わせ）
   ============================================================ */
.subpage { padding: 40px 0; max-width: 660px; }
.subpage h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: .08em;
  color: var(--t1);
  margin-bottom: 20px;
}
.subpage p { font-size: .85rem; color: var(--t3); line-height: 1.9; margin-bottom: 12px; }
.subpage h3 { font-size: .92rem; font-weight: 700; color: var(--t2); margin: 18px 0 8px; }

/* お問い合わせフォーム */
.contact-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.contact-form input,
.contact-form textarea {
  background: var(--card2);
  border: 1px solid #444;
  border-radius: 4px;
  color: var(--t1);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: .85rem;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--red); }
.contact-form textarea { min-height: 120px; resize: vertical; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #666; }
.contact-submit {
  background: var(--red);
  color: #fff;
  border: none;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: .88rem;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  transition: background .15s;
}
.contact-submit:hover { background: var(--red-h); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .hero-banner { padding: 24px 0 18px; }
  .performer-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .performer-hero { padding: 20px 0; }
  .lb-box { padding: 20px 16px; width: 90vw; }
  .lb-arrow { width: 36px; height: 36px; font-size: 1.1rem; }
  .lb-arrow.prev { left: 6px; }
  .lb-arrow.next { right: 6px; }
}
@media (max-width: 400px) {
  .performer-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-btn { font-size: .7rem; padding: 4px 10px; }
}
