@charset "UTF-8";
/*
    Template: swell
    Theme Name: SWELL CHILD
    Theme URI: https://swell-theme.com/
    Description: SWELLの子テーマ
    Version: 1.0.0
    Author: LOOS WEB STUDIO
    Author URI: https://loos-web-studio.com/

    License: GNU General Public License
    License URI: http://www.gnu.org/licenses/gpl.html
*/

/* タグ人気ランキング */
.tag-rank-grid {
  --tr-gap: 12px;
  --tr-radius: 12px;
  --tr-badge: 30px;
  --tr-title: 15px;
  --tr-meta: 12px;
  --tr-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* SP: 2列 */
  gap: var(--tr-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 960px) {
  .tag-rank-grid { grid-template-columns: repeat(3, 1fr); } /* PC: 3列 */
}
.tag-rank-grid .tr-item { position: relative; }

.tag-rank-grid .tr-card {
  display: block;
  text-decoration: none;
  border-radius: var(--tr-radius);
  background: #fff;
  box-shadow: var(--tr-shadow);
  overflow: hidden;
}

.tag-rank-grid .tr-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4/3;         /* サムネ比率は必要に応じて変更可 */
  background: #f2f3f5;
  overflow: hidden;
}
.tag-rank-grid .tr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tag-rank-grid .tr-title {
  display: block;
  padding: 10px 12px 4px;
  font-size: var(--tr-title);
  line-height: 1.45;
  color: inherit;
}

.tag-rank-grid .tr-meta {
  display: block;
  padding: 0 12px 12px;
  font-size: var(--tr-meta);
  opacity: .75;
}

/* 順位バッジ */
.tag-rank-grid .tr-badge {
  position: absolute;
  top: 8px; left: 8px;
  width: var(--tr-badge);
  height: var(--tr-badge);
  border-radius: 999px;
  background: linear-gradient(135deg, #6a5cff, #00c2ff);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  z-index: 2;
}

/* 画像無しのダミー */
.tag-rank-grid .tr-noimg {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    45deg, #e9ebef, #e9ebef 10px, #f5f6f8 10px, #f5f6f8 20px
  );
}

/* ======================
   アーカイブ並び替えボタン
   ====================== */

/* 1) 一覧がCSS Gridでもボタン行を“1行まるごと”にする */
.p-postList > .ts-ctrls,
.archive-list > .ts-ctrls,
.l-cardList > .ts-ctrls,
.post_list > .ts-ctrls{
  grid-column: 1 / -1;   /* 全カラムまたぎ */
  align-self: start;     /* 自分の高さだけ */
  position: relative;    /* z-indexを効かせるため */
  z-index: 2;            /* カードのオーバーレイより前へ */
}

/* 2) 行の基本レイアウト */
.ts-ctrls{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .5rem 0 1rem;
  align-items: center;   /* stretch防止 */
}

/* 3) 個別ボタン（伸びない・自分サイズ） */
.ts-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: .5rem .8rem;
  font-size: 14px;
  line-height: 1.2;
  border: 1px solid var(--color-border, #ddd);
  border-radius: .5rem;
  background: #fff;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.ts-btn.is-active{
  border-color: var(--color-accent, #06c);
  box-shadow: 0 0 0 2px rgba(0,102,204,.12) inset;
  font-weight: 600;
}

/* 4) 狭い端末で少し詰める */
@media (max-width: 360px){
  .ts-btn{ padding: .45rem .65rem; font-size: 13px; }
}
