/* ===== Tea World minimal utilities ===== */

/* 視覚的に非表示（読み上げ対象） */
.tw-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.tw-sr-only:focus,
.tw-sr-only:active {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* スキップリンク（必要なページで <a class="tw-skip-link" href="#main">本編へスキップ</a> など） */
.tw-skip-link {
  position: absolute;
  top: 0; left: 0;
  transform: translateY(-120%);
  background: #111; color: #fff;
  padding: .5rem .75rem; border-radius: .25rem;
  z-index: 1000;
}
.tw-skip-link:focus { transform: translateY(0); outline: 2px solid #fff; }

/* テーブルの可読性（PHP側で figure.wp-block-table に tw-a11y-table を付ける想定） */
figure.wp-block-table.tw-a11y-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
figure.wp-block-table.tw-a11y-table table { border-collapse: collapse; width: 100%; }
figure.wp-block-table.tw-a11y-table caption {
  caption-side: top; text-align: left; font-weight: 600; margin-bottom: .5rem;
}
figure.wp-block-table.tw-a11y-table th,
figure.wp-block-table.tw-a11y-table td { padding: .5rem .75rem; border: 1px solid #e5e7eb; }
figure.wp-block-table.tw-a11y-table thead th { background: #f8fafc; font-weight: 700; }
@media (prefers-color-scheme: dark) {
  figure.wp-block-table.tw-a11y-table th,
  figure.wp-block-table.tw-a11y-table td { border-color: #374151; }
  figure.wp-block-table.tw-a11y-table thead th { background: #111827; }
}

/* ちょい便利 */
.tw-center { text-align: center !important; }
.tw-muted  { color: #6b7280 !important; }
.tw-mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* 動きが苦手な人への配慮 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* 投稿タイプ絞り込みサブナビ（taxonomy-dictionary_tag 用） */
.tw-type-filter{
  display:flex;
  flex-wrap:wrap;
  column-gap:.30rem;   /* 横のすき間 ← ここが「(ここ)」 */
  row-gap:.25rem;      /* 折返し時の縦のすき間 */
  align-items:center;
  margin:.25rem 0 .75rem;
}

/* 触り心地の微調整（任意） */
.tw-type-filter a{
  padding:.125rem .375rem;
  border-radius:.25rem;
}
.tw-type-filter a:is(:hover,:focus){ text-decoration:underline; }
.tw-type-filter a.is-active,[aria-current="page"]{ font-weight:600; }

/* 古いブラウザ向けの保険（gap未対応でも最低限の横マージン） */
.tw-type-filter a + a{ margin-left:.75rem; }