@charset "UTF-8";
/*
Theme Name: Arkhe Child
Template: arkhe
Description: Nijimiru Custom Theme
Version: 1.0.0
*/

/* ベースカラー定義 */
:root {
  --main-color: #ff6b9d;
  --accent-color: #6bbeff;
  --bg-color: #fff5f8;
  --card-bg: #ffffff;
  --text-color: #333333;
  --border-color: #ffd1e0;
  --shadow-color: rgba(255, 107, 157, 0.1);
  --fanza-color: #ee2737;
  --dlsite-color: #052a83;
  --tag-bg: #fff0f5;
  --star-color: #ffa500;
  --star-shadow: rgba(255, 165, 0, 0.1);
}

body {
  background-color: var(--bg-color);
}

/* ヘッダー・フッターカスタマイズ */
.l-header {
  box-shadow: 0 2px 10px var(--shadow-color);
}

/* 星評価表示 */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.9rem;
  color: var(--text-color);
  margin: 8px 0;
}

.star-rating .stars {
  color: var(--star-color);
  letter-spacing: 2px;
}

.star-rating .count {
  font-size: 0.8rem;
  color: #666;
}

/* 詳細ページの星評価 */
.doujin-spec-table .star-rating {
  font-size: 1.1rem;
}

.doujin-spec-table .star-rating .count {
  font-size: 0.9rem;
}

/* トップページ・アーカイブページのカード表示 */
.doujin-list-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-top: 30px;
  margin-bottom: 30px;
}

.doujin-card-row {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-color);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.doujin-card-row:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow-color);
}

.card-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  background-color: #f7f7f7;
  text-align: center;
  padding: 10px 0;
}

.card-thumb img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  margin: 0 auto;
  transition: transform 0.3s;
}

.card-thumb:hover img {
  transform: scale(1.05);
}

.badge-ai {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.7);
  color: #00ffcc;
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
  z-index: 15;
  border: 1px solid #00ffcc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-title a {
  color: var(--text-color);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--main-color);
}

.card-circle {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 8px;
}

.card-tags-list {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-tag-table {
  border-collapse: collapse;
  width: 100%;
  margin: 10px 0;
  font-size: 0.85rem;
}

.card-tag-table th {
  width: 70px;
  background: var(--tag-bg);
  padding: 4px 6px;
  text-align: left;
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: bold;
  color: #555;
  vertical-align: top;
}

.card-tag-table td {
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  background: white;
}

.card-tag-table .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.card-tag-table .spec-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
}

.card-btn-area {
  margin-top: auto;
}

/* ショップボタン */
.shop-btns-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-shop {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: bold;
  transition: transform 0.2s, opacity 0.2s;
  flex: 1;
  color: white;
}

.btn-shop:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn-fanza {
  background: var(--fanza-color);
  color: white !important;
}

.btn-dlsite {
  background: var(--dlsite-color);
  color: white !important;
}

.btn-detail {
  background: #888888;
  text-align: center;
  justify-content: center;
}

.btn-label {
  font-size: 0.85rem;
}

.btn-val {
  font-size: 0.85rem;
  font-weight: normal;
}

/* ========================================
   バッジ配置システム（優先順位対応）
   ======================================== */

/* キャンペーンバッジ（最優先・最上部） */
.badge-campaign {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white;
  font-size: 0.65rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  z-index: 16; /* 割引バッジより上 */
  max-width: calc(100% - 60px); /* 右のAIバッジ分を確保 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 割引率バッジ */
.badge-off {
  position: absolute;
  top: 8px; /* デフォルトは最上部 */
  left: 8px;
  background: #ff4081;
  color: #fff;
  font-size: 0.7rem;
  padding: 3px 6px;
  border-radius: 5px;
  transform: rotate(-5deg);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 15;
  transition: top 0.3s ease;
}

/* キャンペーンがある場合は下に移動 */
.badge-off.has-campaign {
  top: 40px; /* キャンペーンバッジの下 */
}

/* ページネーション */
.p-pagination {
  margin: 40px 0;
  text-align: center;
}

.p-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  margin: 0 4px;
  background: white;
  border-radius: 20px;
  color: var(--text-color);
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: background 0.3s, color 0.3s;
}

.p-pagination .current {
  background: var(--main-color);
  color: white;
}

.p-pagination a.page-numbers:hover {
  background: #f0f0f0;
}

/* 詳細ページのスタイル */
.product-title {
  margin-bottom: 25px;
  font-size: 1.5rem;
  border-bottom: 2px solid var(--main-color);
  padding-bottom: 15px;
  font-weight: bold;
  color: #333;
  position: relative;
}

.product-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30%;
  height: 2px;
  background: linear-gradient(to right, var(--main-color), transparent);
}

.doujin-header {
  display: flex;
  gap: 30px;
  margin-bottom: 40px;
  flex-wrap: nowrap;
  align-items: flex-start;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 15px var(--shadow-color);
  padding: 25px;
  position: relative;
}

.doujin-image {
  flex: 0 0 38%;
  max-width: 38%;
}

.doujin-info {
  flex: 1 1 58%;
  min-width: 0;
}

.img-wrapper {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 20px var(--shadow-color);
  background-color: #f7f7f7;
  text-align: center; 
}

.main-image {
  max-width: 100%;
  width: 100%;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
  display: block;
  vertical-align: middle;
}

/* SEO/OGP用メイン画像を視覚的に非表示 */
.main-image-seo {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
}

.img-badge-container {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10;
}

.img-badge {
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 詳細ページ：AIバッジ */
.img-badge.badge-ai {
  background: #1a1a1a;
  color: #00ffcc;
  border: 1px solid #00ffcc;
  font-weight: bold;
  padding: 6px 12px;
  letter-spacing: 0.5px;
  animation: pulse 2s infinite;
  order: 0; /* 最上部 */
}

/* 詳細ページ：キャンペーンバッジ */
.img-badge.badge-campaign {
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white;
  font-size: 0.75rem;
  padding: 6px 12px;
  order: 1; /* AIの次 */
}

/* 詳細ページ：セールバッジ */
.img-badge.badge-sale {
  background: linear-gradient(135deg, #ff4081, #ff6b9d);
  color: white;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  order: 2; /* キャンペーンの次 */
}

/* 詳細ページ：専売バッジ */
.img-badge.badge-exclusive {
  background: var(--fanza-color);
  color: white;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  order: 3; /* セールの次 */
}

.img-badge.badge-exclusive.-dlsite {
  background: var(--dlsite-color);
}

.ai-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300ffcc'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-5-8a5 5 0 0110 0c0 2.76-2.24 5-5 5s-5-2.24-5-5z'/%3E%3C/svg%3E");
  background-size: contain;
  margin-right: 5px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 255, 204, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(0, 255, 204, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 204, 0);
  }
}

.badge-exclusive {
  background: var(--fanza-color);
  color: white;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-exclusive.-dlsite {
  background: var(--dlsite-color);
}

.badge-sale {
  background: linear-gradient(135deg, #ff4081, #ff6b9d);
  color: white;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 詳細ページの仕様表 */
.doujin-spec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 25px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.doujin-spec-table th,
.doujin-spec-table td {
  padding: 10px 12px;
  line-height: 1.5;
}

.doujin-spec-table th {
  width: 100px;
  background: var(--tag-bg);
  border-bottom: 1px solid var(--border-color);
  font-weight: bold;
  color: #555;
  text-align: left;
  font-size: 0.9rem;
}

.doujin-spec-table td {
  background: white;
  border-bottom: 1px solid var(--border-color);
}

.doujin-spec-table tr:last-child th,
.doujin-spec-table tr:last-child td {
  border-bottom: none;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-tag {
  display: inline-block;
  background: var(--tag-bg);
  border-radius: 15px;
  padding: 4px 12px;
  font-size: 0.8rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background 0.2s;
  border: 1px solid var(--border-color);
}

.spec-tag:hover {
  background: var(--border-color);
}

.circle-link {
  color: var(--main-color);
  text-decoration: none;
  font-weight: bold;
}

.circle-link:hover {
  text-decoration: underline;
}

/* CVエリア */
.cv-area {
  display: flex;
  flex-direction: row;
  gap: 15px;
  margin-bottom: 30px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 15px var(--shadow-color);
  padding: 20px;
}

.cv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
  color: white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.cv-row::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.cv-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.cv-row.fanza {
  background: var(--fanza-color);
}

.cv-row.dlsite {
  background: var(--dlsite-color);
}

.cv-label {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.cv-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: white;
  color: #333;
  border-radius: 12px;
  font-weight: bold;
  margin-right: 8px;
}

.cv-exclusive {
  display: inline-block;
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 12px;
}

.cv-price-box {
  text-align: right;
}

.cv-list-price {
  font-size: 0.8rem;
  text-decoration: line-through;
  opacity: 0.8;
}

.cv-price {
  font-size: 1.2rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-off-badge {
  background: white;
  color: #ff4081;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 12px;
}

/* 詳細ページコンテンツエリア */
.doujin-content-area {
  margin-top: 25px;
  position: relative;
  z-index: 1;
}

/* 価格チャートセクション */
.price-chart-section {
  margin: 0 0 40px 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--shadow-color);
  background: white;
  border: 1px solid var(--border-color);
}

.chart-title {
  padding: 15px 20px;
  margin: 0;
  background: var(--tag-bg);
  font-weight: bold;
  color: var(--text-color);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border-color);
}

.chart-content {
  padding: 20px;
}

.price-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  justify-content: center;
}

.current-price {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.current-price.fanza {
  border-left: 4px solid var(--fanza-color);
}

.current-price.dlsite {
  border-left: 4px solid var(--dlsite-color);
}

.store-label {
  font-weight: bold;
  color: #666;
}

.price-value {
  font-weight: bold;
  color: #333;
  font-size: 1.1rem;
}

.discount-badge {
  background: #f0f0f0;
  color: #333;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: bold;
}

.discount-badge.fanza {
  background: var(--fanza-color);
  color: white;
}

.discount-badge.dlsite {
  background: var(--dlsite-color);
  color: white;
}

/* 作品あらすじ */
.p-entry__content {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.p-entry__content h2 {
  font-size: 1.3rem;
  margin-top: 30px;
  margin-bottom: 15px;
  padding-left: 12px;
  border-left: 4px solid var(--main-color);
  line-height: 1.4;
}

.p-entry__content h3 {
  font-size: 1.1rem;
  margin-top: 25px;
  margin-bottom: 15px;
}

.p-entry__content p {
  margin-bottom: 1em;
  line-height: 1.7;
}

.p-entry__content ul {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.p-entry__content li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

.content-title {
  margin-top: 0;
  padding-bottom: 15px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-color);
  font-size: 1.2rem;
}

/* ピックアップエリア */
.pickup-container {
  background: #fff;
  border: 2px solid #ff9cc7;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 40px;
  box-shadow: 0 5px 20px var(--shadow-color);
}

.pickup-title {
  text-align: center;
  color: var(--main-color);
  font-size: 1.3em;
  margin-bottom: 20px;
  font-weight: bold;
}

.pickup-grid {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.pickup-item {
  display: block;
  width: 30%;
  min-width: 150px;
  text-decoration: none;
  color: var(--text-color);
  transition: opacity 0.3s, transform 0.3s;
}

.pickup-item:hover {
  opacity: 0.9;
  transform: translateY(-5px);
}

.pickup-img {
  width: 100%;
  height: 220px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #f7f7f7;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.pickup-text {
  font-size: 0.9em;
  font-weight: bold;
  line-height: 1.5;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-color);
}

/* AIフィルタースイッチ */
.ai-filter-switch {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 25px;
  font-size: 0.9em;
  background: white;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 3px 10px var(--shadow-color);
}

.switch-label {
  font-weight: bold;
  color: var(--text-color);
}

.switch-buttons {
  display: flex;
  gap: 8px;
}

.sw-btn {
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid #ddd;
  color: #666;
  background: #fff;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.sw-btn:hover {
  background: #f0f0f0;
}

.sw-btn.active {
  background: var(--main-color);
  color: #fff;
  border-color: var(--main-color);
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(255, 107, 157, 0.3);
}

/* ヘッダーバナー */
.header-campaign-banner {
  margin: 25px 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 15px var(--shadow-color);
}

/* 見出し装飾 */
.c-heading.-main {
  border-bottom: 2px solid var(--main-color);
  padding-bottom: 10px;
  position: relative;
  margin-bottom: 30px;
}

.c-heading.-main::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40%;
  height: 2px;
  background: linear-gradient(to right, var(--main-color), transparent);
}

/* スマホ固定フッター */
.sticky-footer-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  border-top: 2px solid var(--border-color);
  display: flex;
  padding: 8px 5px;
  z-index: 9999;
  box-shadow: 0 -2px 15px var(--shadow-color);
}

.sticky-btn {
  flex: 1;
  margin: 0 4px;
  text-decoration: none;
  text-align: center;
  border-radius: 8px;
  padding: 6px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s;
}

.sticky-btn:hover {
  transform: translateY(-3px);
}

.btn-sub {
  font-size: 0.75em;
  opacity: 0.9;
}

.btn-main {
  font-weight: bold;
  font-size: 1.1em;
}

/* ========================================
   サンプルギャラリー機能（Phase 3）
   ======================================== */

/* サンプルギャラリー共通 */
.doujin-samples {
  margin: 40px 0;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.doujin-samples .content-title {
  margin-bottom: 20px;
  font-size: 20px;
}

/* スライダー */
.sample-gallery-slider {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

/* メイン画像位置のスライダー用スタイル */
.doujin-image .sample-gallery-slider {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: none; /* img-wrapperで既にシャドウがある */
}

.slider-container {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
}

.slider-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-item.active {
  opacity: 1;
}

.slider-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.slider-prev,
.slider-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 40px;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
}

.slider-prev:hover,
.slider-next:hover {
  background: rgba(0,0,0,0.7);
}

.slider-prev {
  left: 10px;
}

.slider-next {
  right: 10px;
}

.slider-indicators {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.indicator.active,
.indicator:hover {
  background: rgba(255,255,255,1);
}

.slider-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 14px;
  z-index: 10;
}

/* グリッドギャラリー */
.sample-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.grid-item {
  aspect-ratio: 4/3;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s;
}

.grid-item:hover {
  transform: scale(1.05);
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
}

.lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-size: 40px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-size: 50px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 16px;
}

/* ========================================
   PC用：画面追従購入ボタン
   ======================================== */

.cv-area-sticky {
  position: fixed;
  top: 100px;
  right: 20px;
  width: 300px;
  z-index: 1000;
  background: white;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  padding: 15px;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  border: 2px solid var(--border-color);
}

.cv-area-sticky.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.cv-area-sticky .cv-row {
  margin-bottom: 10px;
  font-size: 0.9rem;
  padding: 12px;
}

.cv-area-sticky .cv-row:last-of-type {
  margin-bottom: 0;
}

.cv-area-sticky .cv-label {
  font-size: 0.95rem;
}

.cv-area-sticky .cv-price {
  font-size: 1.1rem;
}

.sticky-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #333;
  color: white;
  border: 2px solid white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sticky-close:hover {
  background: #555;
}

/* タブレット以下では非表示 */
@media screen and (max-width: 1199px) {
  .cv-area-sticky {
    display: none !important;
  }
}

/* ========================================
   レスポンシブ調整
   ======================================== */

@media screen and (max-width: 1024px) {
  .doujin-header {
    flex-wrap: wrap;
  }
  
  .doujin-image {
    flex: 0 0 35%;
    max-width: 35%;
  }
  
  .doujin-info {
    flex: 1 1 60%;
  }
}

@media screen and (max-width: 768px) {
  .doujin-header {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 30px;
    padding: 20px;
  }
  
  .doujin-image {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
  }
  
  .doujin-info {
    flex: 1 1 100%;
  }
  
  /* モバイル：スライダー表示の調整 */
  .doujin-image .img-wrapper {
    box-shadow: 0 3px 10px var(--shadow-color);
    border-radius: 8px;
  }
  
  .doujin-image .sample-gallery-slider {
    border-radius: 8px;
    background: #f5f5f5;
  }
  
  .doujin-image .slider-container {
    padding-top: 133%; /* モバイルでは縦長比率（3:4）に変更 */
  }
  
  .cv-area {
    flex-direction: column;
    max-width: 100%;
  }

  .product-title {
    font-size: 1.3rem;
    line-height: 1.4;
    margin-bottom: 15px;
  }
  
  .doujin-content-area {
    padding: 0 15px;
  }
  
  /* ギャラリー：スライダーボタン */
  .slider-prev,
  .slider-next {
    font-size: 30px;
    padding: 5px 10px;
  }
  
  /* ギャラリー：グリッド */
  .sample-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* ギャラリー：Lightbox */
  .lightbox-prev,
  .lightbox-next {
    font-size: 30px;
    padding: 5px 15px;
  }
}

@media screen and (max-width: 600px) {
  .doujin-list-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .doujin-spec-table th {
    width: 80px;
    font-size: 0.85rem;
    padding: 8px;
  }
  
  .doujin-spec-table td {
    font-size: 0.85rem;
    padding: 8px;
  }
  
  .shop-btns-row {
    flex-direction: column;
  }
  
  .pickup-item {
    width: 45%;
  }
  
  .price-summary {
    flex-direction: column;
    align-items: stretch;
  }
  
  .cv-row.fanza, .cv-row.dlsite {
    padding: 12px;
  }
  
  .cv-label {
    font-size: 1rem;
  }
  
  .cv-price {
    font-size: 1.1rem;
  }
  
  .doujin-content-area {
    padding: 0 10px;
  }
  
  .p-entry__content {
    padding: 15px;
  }
}

@media screen and (max-width: 480px) {
  .doujin-box {
    flex-direction: column;
  }
  
  .doujin-img {
    width: 100%;
  }
  
  .doujin-buttons {
    flex-direction: column;
  }
  
  .sticky-footer-nav {
    display: flex;
  }
  
  .cv-label, .cv-price {
    font-size: 0.9rem;
  }
  
  .pickup-item {
    width: 100%;
  }
  
  .card-thumb img {
    aspect-ratio: 3/4;
  }
  
  /* モバイル用バッジ調整 */
  .badge-campaign {
    font-size: 0.6rem;
    padding: 3px 6px;
    max-width: calc(100% - 50px);
  }
  
  .badge-off {
    font-size: 0.65rem;
  }
  
  .badge-off.has-campaign {
    top: 35px; /* モバイルでは少し詰める */
  }
  
  .img-badge.badge-campaign {
    font-size: 0.7rem;
    padding: 5px 10px;
  }
  
  .img-badge.badge-sale {
    font-size: 0.75rem;
  }
}

@media screen and (min-width: 481px) {
  .sticky-footer-nav {
    display: none;
  }
}

/* Arkheとの互換性調整 */
.l-content {
  padding-bottom: 70px; /* スマホ固定フッターの高さ分 */
}

/* Arkheのブロックエディタ対応 */
.wp-block-group {
  margin-top: 2em;
  margin-bottom: 2em;
}

/* パフォーマンス最適化 */
img {
  content-visibility: auto;
}

.doujin-card-row img, 
.pickup-item img {
  will-change: transform;
}

@media screen and (max-width: 768px) {
  /* モバイル時の不要なアニメーションを削減 */
  .doujin-card-row:hover {
    transform: none;
    box-shadow: 0 5px 15px var(--shadow-color);
  }
  
  .card-thumb:hover img {
    transform: none;
  }
}

/* 印刷用スタイル */
@media print {
  .sticky-footer-nav, 
  .ai-filter-switch,
  .btn-shop {
    display: none !important;
  }
  
  .doujin-header {
    flex-direction: row;
    break-inside: avoid;
  }
}

/* ========================================
   ヘッダー・フッター追加スタイル
   ======================================== */

/* ヘッダー */
.l-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 0;
  gap: 20px;
}

.l-header__logo .site-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--main-color);
  text-decoration: none;
}

.l-header__logo .site-title:hover {
  opacity: 0.8;
}

.l-header__nav {
  flex: 1;
}

.header-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 25px;
}

.header-menu li {
  margin: 0;
}

.header-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s;
}

.header-menu a:hover {
  color: var(--main-color);
}

.l-header__search {
  min-width: 200px;
}

.l-header__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.l-header__toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--text-color);
  transition: all 0.3s;
}

/* 検索フォーム */
.search-form {
  display: flex;
  gap: 5px;
  align-items: center;
}

.search-field {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  width: 100%;
  transition: border-color 0.3s;
}

.search-field:focus {
  outline: none;
  border-color: var(--main-color);
}

.search-submit {
  background: var(--main-color);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-submit:hover {
  opacity: 0.9;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* フッター */
.l-footer {
  background: #f9f9f9;
  border-top: 1px solid var(--border-color);
  padding: 40px 0 20px;
  margin-top: 60px;
}

.l-footer__widgets {
  margin-bottom: 30px;
}

.footer-widget-area {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.footer-widget {
  font-size: 0.9rem;
}

.footer-widget .widget-title {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--text-color);
  border-bottom: 2px solid var(--main-color);
  padding-bottom: 8px;
}

.l-footer__bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  text-align: center;
}

.footer-nav {
  margin-bottom: 15px;
}

.footer-menu {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-menu a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.9rem;
}

.footer-menu a:hover {
  color: var(--main-color);
}

.footer-copyright {
  font-size: 0.85rem;
  color: #666;
}

.footer-disclaimer {
  margin-top: 5px;
  font-size: 0.8rem;
  color: #999;
}

/* アーカイブヘッダー */
.archive-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}

.archive-description {
  margin-top: 15px;
  color: #666;
  line-height: 1.6;
}

.taxonomy-header .taxonomy-label {
  font-size: 0.9rem;
  color: #999;
  font-weight: normal;
  display: block;
  margin-bottom: 5px;
}

.taxonomy-meta {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #666;
}

/* 404エラーページ */
.error-404-content {
  text-align: center;
  padding: 60px 20px;
}

.error-404-title {
  font-size: 8rem;
  font-weight: bold;
  color: var(--main-color);
  margin: 0;
  line-height: 1;
}

.error-404-message {
  font-size: 1.5rem;
  margin: 20px 0 40px;
  color: var(--text-color);
}

.error-404-search {
  max-width: 500px;
  margin: 0 auto 40px;
}

.error-404-search p {
  margin-bottom: 15px;
  font-weight: bold;
}

.error-404-links {
  margin: 40px 0;
}

.error-404-links h2 {
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.error-404-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.error-404-links li {
  margin: 10px 0;
}

.error-404-links a {
  color: var(--main-color);
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
}

.error-404-links a:hover {
  text-decoration: underline;
}

.error-404-recent {
  margin-top: 60px;
}

.error-404-recent h2 {
  font-size: 1.5rem;
  margin-bottom: 30px;
}

/* ソートリンク */
.sort-link {
  display: inline-block;
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid #ddd;
  color: #666;
  background: #fff;
  text-decoration: none;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.sort-link:hover {
  background: #f0f0f0;
}

.sort-link.active {
  background: var(--main-color);
  color: #fff;
  border-color: var(--main-color);
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(255, 107, 157, 0.3);
}

/* サイドバー対応レイアウト */
.l-container.-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
}

.l-primary {
  min-width: 0;
}

.l-sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
}

.c-widget .widget {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 15px var(--shadow-color);
  margin-bottom: 25px;
}

.c-widget .widget-title {
  font-size: 1.1rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--main-color);
}

/* レスポンシブ: タブレット */
@media screen and (max-width: 1024px) {
  .l-container.-sidebar {
    grid-template-columns: 1fr 250px;
    gap: 30px;
  }
  
  .footer-widget-area {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* レスポンシブ: モバイル */
@media screen and (max-width: 768px) {
  .l-header__inner {
    flex-wrap: wrap;
  }
  
  .l-header__nav {
    display: none;
    width: 100%;
    order: 4;
  }
  
  .l-header__toggle {
    display: flex;
  }
  
  .l-header__search {
    width: 100%;
    order: 3;
  }
  
  .header-menu {
    flex-direction: column;
    gap: 10px;
    padding: 15px 0;
  }
  
  .l-container.-sidebar {
    grid-template-columns: 1fr;
  }
  
  .l-sidebar {
    position: static;
  }
  
  .footer-widget-area {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .error-404-title {
    font-size: 5rem;
  }
  
  .error-404-message {
    font-size: 1.2rem;
  }
}

@media screen and (max-width: 480px) {
  .search-text {
    display: none;
  }
  
  .search-submit {
    padding: 8px 12px;
  }
}

/* ========================================
   ソート機能スタイル（Phase 4）
   ======================================== */

/* ソートボタン（デスクトップ） */
.doujin-sort-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.sort-label {
  font-weight: bold;
  color: var(--text-color);
  white-space: nowrap;
  font-size: 0.95rem;
}

.sort-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 20px;
  color: #666;
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.3s;
  cursor: pointer;
  white-space: nowrap;
}

.sort-btn:hover {
  border-color: var(--main-color);
  color: var(--main-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(255, 107, 157, 0.2);
}

.sort-btn.active {
  background: linear-gradient(135deg, var(--main-color) 0%, #ff8fb3 100%);
  border-color: var(--main-color);
  color: #fff;
  font-weight: bold;
  box-shadow: 0 3px 10px rgba(255, 107, 157, 0.3);
  pointer-events: none;
}

.sort-icon {
  font-size: 16px;
  line-height: 1;
}

.sort-text {
  white-space: nowrap;
}

/* ドロップダウン（モバイル用） */
.doujin-sort-dropdown {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 10px var(--shadow-color);
  border: 1px solid var(--border-color);
}

.doujin-sort-dropdown label {
  font-weight: bold;
  color: var(--text-color);
  white-space: nowrap;
  font-size: 0.95rem;
}

.sort-select {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 20px;
  font-size: 0.9rem;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.3s;
  color: var(--text-color);
}

.sort-select:hover,
.sort-select:focus {
  border-color: var(--main-color);
  outline: none;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  /* モバイルではボタンを非表示、ドロップダウンを表示 */
  .doujin-sort-buttons {
    display: none;
  }
  
  .doujin-sort-dropdown {
    display: flex;
  }
}

@media (min-width: 769px) {
  /* デスクトップではドロップダウンを非表示 */
  .doujin-sort-dropdown {
    display: none;
  }
  
  .doujin-sort-buttons {
    display: flex;
  }
}

/* タブレット用の調整 */
@media (max-width: 1024px) and (min-width: 769px) {
  .sort-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .sort-icon {
    font-size: 14px;
  }
}

/* 小さいモバイル用の調整 */
@media (max-width: 480px) {
  .doujin-sort-dropdown {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .doujin-sort-dropdown label {
    text-align: center;
  }
  
  .sort-select {
    width: 100%;
  }
}
