/* タグ掛け合わせ検索（おすすめ作品ウィジェットの掛け算検索と同じ見た目） */

/* ===== タグで記事を絞り込む（読者用） ===== */
.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; }
}
