/*!
Theme Name:   Gravure Theme
Description:  グラビアアイドル写真集アフィリエイトサイト専用テーマ
Version:      1.0.0
Author:       gravure-templates
Text Domain:  gravure-theme
*/

/* ==========================================================================
   0. CSS カスタムプロパティ
   ========================================================================== */
:root {
  --color-primary:    #c8003c;
  --color-primary-dk: #a0002e;
  --color-dmm:        #000000;
  --color-dmm-hover:  #333333;
  --color-bg:         #f5f5f5;
  --color-surface:    #ffffff;
  --color-border:     #e0e0e0;
  --color-text:       #333333;
  --color-text-muted: #888888;
  --color-price:      #c8003c;

  --radius-card:  8px;
  --radius-btn:   4px;
  --shadow-card:  0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.14);

  --font-base:   'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  --font-size:   16px;
  --line-height: 1.7;

  --container-width: 1200px;
  --gap-grid:        20px;
}

/* ==========================================================================
   1. リセット & ベース
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

/* ==========================================================================
   2. レイアウト共通
   ========================================================================== */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

.site-main {
  padding: 40px 0 60px;
}

/* ==========================================================================
   3. ヘッダー
   ========================================================================== */
.site-header {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 16px;
  max-width: var(--container-width);
  margin: 0 auto;
}

.site-header__logo a {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--color-text);
  text-decoration: none;
}

.site-header__logo a:hover {
  color: var(--color-primary);
}

/* グローバルナビ */
.global-nav ul {
  display: flex;
  gap: 24px;
}

.global-nav a {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 500;
  transition: color 0.2s;
}

.global-nav a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* ハンバーガー（スマホ） */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s;
}

/* ==========================================================================
   4. フッター
   ========================================================================== */
.site-footer {
  background: #1a1a1a;
  color: #ccc;
  text-align: center;
  padding: 30px 16px;
  font-size: 0.85rem;
}

.site-footer a {
  color: #ccc;
}

.site-footer a:hover {
  color: #fff;
}

/* ==========================================================================
   5. トップページ：女優グリッド
   ========================================================================== */
.section-title {
  font-size: 1.3rem;
  font-weight: bold;
  margin-bottom: 24px;
  padding-left: 10px;
  border-left: 4px solid var(--color-primary);
}

/* 女優カードグリッド：4列 */
.idol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-grid);
}

/* 女優カード */
.idol-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.idol-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* カード：写真エリア */
.idol-card__photo {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: #eee;
}

.idol-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.idol-card:hover .idol-card__photo img {
  transform: scale(1.04);
}

.idol-card__photo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(200, 0, 60, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
  color: #fff;
  font-size: 0.9rem;
  font-weight: bold;
}

.idol-card:hover .idol-card__photo-overlay {
  opacity: 1;
}

/* カード：情報エリア */
.idol-card__body {
  padding: 12px;
}

.idol-card__name {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 2px;
}

.idol-card__name a {
  color: var(--color-text);
}

.idol-card__name a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.idol-card__kana {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

/* カード：プロフィール表 */
.idol-card__table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.idol-card__table th,
.idol-card__table td {
  padding: 3px 4px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.idol-card__table th {
  color: var(--color-text-muted);
  width: 44px;
  font-weight: normal;
}

/* カード：ボタンエリア */
.idol-card__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ==========================================================================
   6. 女優詳細ページ
   ========================================================================== */
.idol-detail__header {
  margin-bottom: 30px;
}

.idol-detail__title {
  font-size: 1.8rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.idol-detail__kana {
  color: var(--color-text-muted);
  font-size: 1rem;
}

.idol-detail__layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 40px;
}

.idol-detail__photo {
  flex: 0 0 300px;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.idol-detail__info {
  flex: 1;
}

/* プロフィール表（詳細ページ） */
.idol-profile-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.idol-profile-table th,
.idol-profile-table td {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  font-size: 0.95rem;
}

.idol-profile-table th {
  background: #f9f9f9;
  width: 100px;
  font-weight: bold;
  color: var(--color-text-muted);
}

/* 出演作品グリッド（3列） */
.works-section {
  margin-top: 50px;
}

.works-section__title {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 20px;
  padding-left: 10px;
  border-left: 4px solid var(--color-primary);
}

/* ==========================================================================
   7. 写真集カード（Chrome拡張生成HTML対応）
   ========================================================================== */

/* 複数カードを並べるグリッドコンテナ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

/* 写真集カード本体（Chrome拡張が出力する .item-card に対応） */
.item-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.item-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.item-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.item-card img {
  width: 100%;
  height: auto;
  display: block;
}

/* .item-info：Chrome拡張生成HTMLの情報エリア */
.item-info {
  padding: 10px 12px;
}

.item-title {
  font-size: 0.85rem;
  font-weight: bold;
  line-height: 1.4;
  margin: 0 0 6px;
  /* 2行でクランプ */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-price {
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--color-price);
  margin: 0 0 4px;
}

.item-date {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* ==========================================================================
   8. ボタン共通
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.2s, opacity 0.2s;
}

.btn:hover {
  text-decoration: none;
  opacity: 0.85;
}

/* 詳細ページリンクボタン */
.btn--detail {
  background: var(--color-primary);
  color: #fff;
  width: 100%;
}

/* DMMブックスボタン */
.btn--dmm {
  background: var(--color-dmm);
  color: #fff;
  width: 100%;
}

.btn--dmm:hover {
  background: var(--color-dmm-hover);
  opacity: 1;
}

/* もっと見るボタン */
.btn--more {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
  padding: 10px 40px;
  display: block;
  margin: 40px auto 0;
  width: fit-content;
}

.btn--more:hover {
  background: var(--color-primary);
  color: #fff;
  opacity: 1;
}

/* ==========================================================================
   9-A. 写真集詳細ページ（single-works.php）
   ========================================================================== */

/* メインレイアウト（表紙 + 仕様表） */
.work-detail__layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin: 30px 0 40px;
}

.work-detail__cover {
  flex: 0 0 280px;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.work-detail__cover img {
  width: 100%;
  height: auto;
}

.work-detail__info {
  flex: 1;
}

/* 仕様表 */
.work-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.work-spec-table th,
.work-spec-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.work-spec-table th {
  width: 90px;
  color: var(--color-text-muted);
  font-weight: normal;
  white-space: nowrap;
}

.work-spec-table__actress-link {
  color: var(--color-primary);
  font-weight: bold;
  margin-right: 6px;
}

.work-spec-table__actress-link:hover {
  text-decoration: underline;
}

/* 購入ボタンエリア */
.work-detail__actions {
  margin-top: 20px;
}

/* 本文エリア */
.work-detail__content {
  margin-top: 40px;
  line-height: var(--line-height);
}

/* 衣装タグ */
.costume-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 28px;
}

.costume-tags__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.costume-tags__parent {
  background: var(--color-primary);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
  text-decoration: none;
}

.costume-tags__parent:hover {
  background: var(--color-primary-dk);
  text-decoration: none;
}

.costume-tags__child {
  background: #f0f0f0;
  color: var(--color-text);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid var(--color-border);
}

.costume-tags__child:hover {
  background: var(--color-border);
  text-decoration: none;
}

/* レビューボックス */
.review-box {
  background: #fff5f7;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  margin-top: 48px;
  text-align: center;
}

.review-box__label {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--color-primary);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.review-box__catch {
  font-size: 1.15rem;
  font-weight: bold;
  margin-bottom: 14px;
}

.review-box__stars {
  font-size: 1rem;
  margin-bottom: 18px;
}

.review-box__star-filled {
  color: #ffaa00;
  font-size: 1.5rem;
}

.review-box__star-empty {
  color: #ddd;
  font-size: 1.5rem;
}

.review-box__btn {
  background: var(--color-primary);
  color: #fff;
  padding: 14px 36px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: bold;
  display: inline-block;
}

.review-box__btn:hover {
  background: var(--color-primary-dk);
  text-decoration: none;
  opacity: 1;
}

/* ==========================================================================
   9-B. 通常投稿（single.php）
   ========================================================================== */
.post-single__header {
  margin-bottom: 24px;
}

.post-single__title {
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1.4;
  margin-bottom: 10px;
}

.post-single__meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.post-single__meta a {
  color: var(--color-text-muted);
}

.post-single__eyecatch {
  margin-bottom: 30px;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.post-single__content {
  line-height: var(--line-height);
}

/* 前後記事ナビ */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.post-nav a {
  color: var(--color-primary);
}

/* ==========================================================================
   9-C. レスポンシブ（works詳細）
   ========================================================================== */
@media screen and (max-width: 767px) {
  .work-detail__layout {
    flex-direction: column;
  }

  .work-detail__cover {
    flex: unset;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* ==========================================================================
   9. ページネーション
   ========================================================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 50px;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-size: 0.9rem;
  color: var(--color-text);
  transition: background 0.2s;
}

.pagination a:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  text-decoration: none;
}

.pagination .current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ==========================================================================
   10. 女優一覧 検索・絞り込みフォーム
   ========================================================================== */

/* ヘッダー */
.archive-idol__header {
  margin-bottom: 20px;
}

.archive-idol__desc {
  color: var(--color-text-muted);
  margin-top: 8px;
}

/* フォーム全体 */
.idol-search-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  padding: 20px 20px 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-card);
}

/* 入力行 */
.idol-search-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

/* 各フィールド */
.idol-search-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.idol-search-form__field--keyword {
  flex: 1 1 220px;
}

/* ラベル */
.idol-search-form__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
}

/* テキスト入力ラッパー */
.idol-search-form__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

/* テキスト入力 */
.idol-search-form__input {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color 0.2s;
  outline: none;
}

.idol-search-form__input:focus {
  border-color: var(--color-primary);
  background: #fff;
}

/* クリアボタン（✕） */
.idol-search-form__clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  line-height: 1;
  padding: 2px;
  transition: color 0.2s;
}

.idol-search-form__clear-btn:hover {
  color: var(--color-primary);
}

/* セレクト */
.idol-search-form__select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-btn);
  font-size: 0.95rem;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  min-width: 130px;
}

.idol-search-form__select:focus {
  border-color: var(--color-primary);
}

/* ボタン類ラッパー */
.idol-search-form__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 0;
}

/* 絞り込むボタン */
.idol-search-form__btn-submit {
  height: 40px;
  padding: 0 20px;
  white-space: nowrap;
}

/* リセットリンク */
.idol-search-form__btn-reset {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.idol-search-form__btn-reset:hover {
  color: var(--color-primary);
}

/* 結果件数バー */
.idol-search-form__result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.88rem;
}

/* 絞り込みタグ */
.idol-search-form__tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: rgba(200, 0, 60, 0.08);
  color: var(--color-primary);
  border: 1px solid rgba(200, 0, 60, 0.22);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
}

/* 件数テキスト */
.idol-search-form__count {
  margin-left: auto;
  color: var(--color-text-muted);
}

/* 結果なしメッセージ */
.idol-search-form__no-result {
  text-align: center;
  padding: 60px 0;
  color: var(--color-text-muted);
  line-height: 2;
}

.idol-search-form__no-result a {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ==========================================================================
   11. ユーティリティ
   ========================================================================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }

/* ==========================================================================
   11. レスポンシブ
   ========================================================================== */

/* タブレット（〜1023px） */
@media screen and (max-width: 1023px) {
  .idol-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .idol-detail__layout {
    gap: 24px;
  }

  .idol-detail__photo {
    flex: 0 0 240px;
  }
}

/* スマートフォン（〜767px） */
@media screen and (max-width: 767px) {
  .idol-search-form__row {
    flex-direction: column;
    gap: 10px;
  }

  .idol-search-form__field--keyword {
    flex: 1 1 auto;
  }

  .idol-search-form__select {
    width: 100%;
  }

  .idol-search-form__actions {
    flex-wrap: wrap;
  }

  .idol-search-form__btn-submit {
    flex: 1;
  }

  .idol-search-form__count {
    margin-left: 0;
  }

  .idol-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .idol-detail__layout {
    flex-direction: column;
  }

  .idol-detail__photo {
    flex: unset;
    width: 100%;
  }

  /* ハンバーガーメニュー表示 */
  .nav-toggle {
    display: flex;
  }

  .global-nav {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  }

  .global-nav.is-open {
    display: block;
  }

  .global-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .global-nav li a {
    display: block;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
  }
}

/* 小型スマートフォン（〜479px） */
@media screen and (max-width: 479px) {
  .idol-grid {
    grid-template-columns: 1fr;
  }

  .photo-grid {
    grid-template-columns: 1fr;
  }

}
