/* おすすめ作品ウィジェット
   色を変えたい時は下の変数だけ調整してください */
.ap-card {
  --ap-dlsite: #1e63c8;  /* DLsiteボタン（青） */
  --ap-fanza:  #d92b3a;  /* FANZAボタン（赤） */
  --ap-review: #f0a020;  /* レビュー記事ボタン（山吹色） */
  --ap-review-text: #3a2a00;
  --ap-sale:   #ff3d7f;  /* セールバッジ */

  overflow: hidden;
  margin: 0 0 1.4em;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.08);
  font-size: 14px;
  line-height: 1.5;
}
.ap-card:last-child { margin-bottom: 0; }

.ap-pr {
  margin: 0 0 .8em !important;
  font-size: 11px;
  opacity: .7;
}

/* 画像（カード上部いっぱい） */
.ap-thumb {
  position: relative;
  display: block;
  line-height: 0;
  border: 0 !important;
  background: #eee;
}
.ap-thumb img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 !important;
  transition: filter .2s;
}
a.ap-thumb:hover img { filter: brightness(1.06); }

/* ジャンル・専売タグ（商品名の下） */
.ap-tags-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 0 !important;
  line-height: 1.3;
}
.ap-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.ap-tag-genre {
  background: #eef0f3;
  color: #555;
}
.ap-tag-excl {
  background: #fff4e0;
  color: #9a5b00;
}

/* 画像右下のセール */
.ap-sale {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ap-sale);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}
.ap-sale small {
  font-size: 10px;
  font-weight: 400;
}

/* 商品名・ボタン部分 */
.ap-info { padding: 10px 12px 12px; }

.ap-name {
  margin: 0 !important;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
}
.ap-name a {
  color: inherit !important;
  text-decoration: none;
}
.ap-name a:hover { text-decoration: underline; }

/* ボタン */
.ap-btns {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.ap-btns-review { margin-top: 6px; }

.ap-btn {
  flex: 1;
  display: block;
  padding: 8px 4px;
  border-radius: 6px;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  transition: opacity .15s;
}
a.ap-btn:hover { opacity: .85; }
.ap-btn-dlsite { background: var(--ap-dlsite); }
.ap-btn-fanza  { background: var(--ap-fanza); }
.ap-btn-review {
  background: var(--ap-review);
  color: var(--ap-review-text) !important;
}

/* URLが無いボタン：グレーにして押せなくする */
.ap-btn.is-disabled {
  background: #d5d5d5;
  color: #9a9a9a !important;
  cursor: not-allowed;
  pointer-events: none;
}

/* 記事内ショートコード */
.ap-inline {
  max-width: 320px;
  margin: 1.5em auto;
}

/* ===== 発売カレンダー ===== */
.ap-cal {
  --ap-dlsite: #1e63c8;
  --ap-fanza:  #d92b3a;
  --ap-sale:   #ff3d7f;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.ap-cal-item {
  display: flex;
  gap: 10px;
  margin: 0 !important;
  padding: 10px 0 !important;
  border-bottom: 1px solid rgba(0,0,0,.08);
  list-style: none !important;
}
.ap-cal-item::before { content: none !important; }
.ap-cal-item:last-child { border-bottom: none; }

.ap-cal-date {
  flex: 0 0 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 52px;
  border-radius: 8px;
  background: #f1f3f6;
  color: #333;
  line-height: 1.2;
}
.ap-cal-date b { font-size: 15px; }
.ap-cal-date small { font-size: 11px; opacity: .7; }
.is-today .ap-cal-date { background: #ffe7a3; }
.is-soon  .ap-cal-date { background: #e6efff; }

.ap-cal-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ap-cal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.3;
}
.ap-cal-status,
.ap-cal-sale {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
}
.ap-cal-status { background: #eef0f3; color: #555; }
.is-today .ap-cal-status { background: #f0a020; color: #3a2a00; }
.is-soon  .ap-cal-status { background: #1e63c8; color: #fff; }
.ap-cal-sale { background: var(--ap-sale); color: #fff; }

.ap-cal-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: inherit !important;
  text-decoration: none !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
a.ap-cal-name:hover { text-decoration: underline !important; }

.ap-cal-btns {
  display: flex;
  gap: 4px;
}
.ap-cal-btns .ap-btn {
  flex: 0 0 auto;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
}

/* ===== タグで記事を絞り込む（読者用） ===== */
.ap-ts { font-size: 13px; }
.ap-ts-help {
  margin: 0 0 .7em !important;
  font-size: 12px;
  opacity: .75;
}
.ap-ts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ap-ts-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ap-ts-chip:hover { border-color: #1e63c8; }
.ap-ts-n {
  min-width: 1.6em;
  padding: 1px 5px;
  border-radius: 999px;
  background: #eef0f3;
  color: #666;
  font-size: 10.5px;
  text-align: center;
}
.ap-ts-chip.is-on {
  border-color: #1e63c8;
  background: #1e63c8;
  color: #fff;
}
.ap-ts-chip.is-on .ap-ts-n {
  background: rgba(255,255,255,.25);
  color: #fff;
}
.ap-ts-chip.is-zero {
  opacity: .35;
  cursor: not-allowed;
}
.ap-ts-chip.is-zero:hover { border-color: #d5d9e0; }

.ap-ts-foot {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}
.ap-ts-go {
  flex: 1;
  display: block;
  padding: 9px 8px;
  border-radius: 6px;
  background: #1e63c8;
  color: #fff !important;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  text-decoration: none !important;
  transition: opacity .15s;
}
.ap-ts-go:hover { opacity: .88; }
.ap-ts-go.is-disabled {
  background: #d5d5d5;
  color: #888 !important;
  cursor: default;
  pointer-events: none;
}
.ap-ts-clear {
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  background: #fff;
  color: #555;
  font-size: 12px;
  cursor: pointer;
}
.ap-ts-clear[hidden] { display: none; }

/* ===== 固定ページ用：その場で絞り込むタグ検索 ===== */
.ap-tf { margin: 1.5em 0; }
.ap-tf-panel {
  padding: 16px;
  border-radius: 12px;
  background: #f6f7f9;
}
.ap-tf-help {
  margin: 0 0 .8em !important;
  font-size: 13px;
  opacity: .8;
}
.ap-tf-panel .ap-ts-chip { font-size: 13px; padding: 6px 12px; }
.ap-tf-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0,0,0,.08);
  font-size: 13px;
}
.ap-tf-status .ap-ts-clear { padding: 5px 12px; }

.ap-tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.ap-tf-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  color: inherit !important;
  text-decoration: none !important;
  transition: transform .15s, box-shadow .15s;
  animation: ap-tf-in .25s ease;
}
.ap-tf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
}
@keyframes ap-tf-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.ap-tf-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: #e9ebef;
  overflow: hidden;
}
.ap-tf-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0 !important;
}
.ap-tf-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}
.ap-tf-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ap-tf-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ap-tf-tags span {
  padding: 1px 7px;
  border-radius: 999px;
  background: #eef0f3;
  color: #555;
  font-size: 10.5px;
  font-weight: 700;
}
.ap-tf-date {
  font-size: 11px;
  opacity: .6;
}
.ap-tf-empty {
  margin: 24px 0 !important;
  text-align: center;
  opacity: .7;
}
.ap-tf-more-wrap { text-align: center; }
.ap-tf-more {
  margin-top: 20px;
  padding: 10px 32px;
  border: 1px solid #1e63c8;
  border-radius: 999px;
  background: #fff;
  color: #1e63c8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ap-tf-more:hover { background: #1e63c8; color: #fff; }
.ap-tf-more[hidden] { display: none; }

@media (max-width: 600px) {
  .ap-tf-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .ap-tf-title { font-size: 12.5px; }
  .ap-tf-panel { padding: 12px; }
}
