/* ============================================================
   とーんと日本橋 サイト内 横断検索 結果ページ（search.php）
   対象: 検索窓(tn-hero-search) ＋ 結果(tn-search / tn-sr-*)
   方針: AI生成感排除マニュアル準拠 / トップ改修(redesign.css)と同トーン
   - 墨色 #1a1a1a / 茜 #b8242b / 単色 / 角丸最小 / 英字eyebrow・装飾下線・
     border-left・::before罫線・::after矢印 なし
   - これらは .l-mainContent 直下（.post_content 外）に出るため SWELL本文
     セレクタ(0,1,1)との競合は無い。リンク色は要素側で明示して親に勝つ。
   ============================================================ */

/* ===== 横断検索ボックス（結果ページの再検索窓。トップ窓は redesign.css 側） ===== */
.tn-hero-search { max-width: 680px; margin: 0 auto; width: 100%; position: relative; }
.tn-hero-search__field {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #e2ddd9;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(31,28,26,0.06);
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.tn-hero-search__field:focus-within {
  border-color: #b8242b;
  box-shadow: 0 6px 20px rgba(184,36,43,0.12);
}
.tn-hero-search__icon {
  display: flex; align-items: center;
  padding-left: 16px;
  color: #9a8f8a;
}
.tn-hero-search__icon svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}
.tn-hero-search__input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 1rem; color: #1a1a1a;
  padding: 14px 12px;
}
.tn-hero-search__input::placeholder { color: #b3aaa4; }
.tn-hero-search__btn {
  flex: 0 0 auto;
  border: 0; cursor: pointer;
  background: #b8242b; color: #fff;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.92rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 0 24px;
  transition: background 0.25s ease;
}
.tn-hero-search__btn:hover { background: #a01f25; }

/* ===== リアルタイム候補ドロップダウン（assets/tn-search.js が生成） ===== */
/* 検索窓を置くブロックを stacking context 化し、ドロップダウンを後続セクションより前面へ。
   z-index は固定ヘッダー(101)より小さくしてヘッダーは隠さない。
   - .tn-hsearch-wrap : トップ(3977)のKV直下 検索バンド（full-wide）
   - .tn-search__refine: 検索結果ページの再検索枠 */
.tn-hsearch-wrap { position: relative; z-index: 40; }
.tn-search__refine { position: relative; z-index: 40; }
.tn-hsug {
  position: absolute; z-index: 60;
  top: calc(100% + 8px); left: 0; right: 0;
  background: #fff;
  border: 1px solid #e2ddd9;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(31,28,26,0.14);
  padding: 6px;
  max-height: min(70vh, 460px);
  overflow-y: auto;
  text-align: left;
}
.tn-hsug[hidden] { display: none; }
.tn-hsug__grp {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.7rem; font-weight: 700; color: #9a8f8a; letter-spacing: 0.06em;
  padding: 8px 10px 4px;
}
.tn-hsug .tn-hsug__opt {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 7px;
  text-decoration: none; color: #1a1a1a;
}
.tn-hsug .tn-hsug__opt:hover,
.tn-hsug .tn-hsug__opt.is-active { background: #f5efec; }
.tn-hsug__name {
  flex: 1 1 auto; min-width: 0;
  font-family: "Noto Sans JP", sans-serif; font-size: 0.9rem; font-weight: 500; color: #1a1a1a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tn-hsug__meta {
  flex: 0 0 auto; max-width: 38%;
  font-family: "Noto Sans JP", sans-serif; font-size: 0.72rem; color: #9a8f8a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tn-hsug__tag {
  flex: 0 0 auto;
  font-family: "Noto Sans JP", sans-serif; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em;
}
.tn-hsug__tag--term { color: #b8242b; }
.tn-hsug__tag--post { color: #9aa3aa; }
.tn-hsug__empty {
  padding: 16px 12px; color: #8a8a8a; font-size: 0.85rem;
  font-family: "Noto Sans JP", sans-serif;
}
.tn-hsug .tn-hsug__all {
  display: block; margin-top: 4px; padding: 11px 12px;
  border-top: 1px solid #f0ebe8;
  font-family: "Noto Sans JP", sans-serif; font-size: 0.82rem; font-weight: 700; color: #b8242b;
  text-decoration: none; border-radius: 0 0 7px 7px;
}
.tn-hsug .tn-hsug__all:hover,
.tn-hsug .tn-hsug__all.is-active { background: #f5efec; }

/* ===== 結果ページ本体 ===== */
.tn-search .tn-search__inner { padding-top: clamp(24px, 3vw, 44px); padding-bottom: clamp(40px, 5vw, 72px); }

.tn-search__header { text-align: center; margin: 0 0 22px; }
.tn-search__title {
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.95rem);
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.04em;
  line-height: 1.45;
  margin: 0;
}
.tn-search__count {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.85rem;
  color: #6b6b6b;
  letter-spacing: 0.02em;
  margin: 10px 0 0;
}
.tn-search__refine { margin: 0 auto clamp(32px, 4vw, 48px); }

/* 空・該当なし */
.tn-search__empty {
  text-align: center;
  font-family: "Noto Sans JP", sans-serif;
  color: #555;
  line-height: 1.9;
  padding: 32px 0;
}
.tn-search__empty-hint { font-size: 0.85rem; color: #8a8a8a; margin-top: 4px; }
.tn-search .tn-search__home {
  display: inline-block;
  margin-top: 16px;
  color: #b8242b;
  font-weight: 700;
  text-decoration: none;
}
.tn-search .tn-search__home:hover { color: #a01f25; }

/* セクション見出し（用語集 / 記事） */
.tn-search__sec { margin: 0 0 clamp(36px, 4vw, 52px); }
.tn-search__sechead {
  display: flex; align-items: baseline; gap: 10px;
  margin: 0 0 16px;
}
.tn-search__seclabel {
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 1.18rem; font-weight: 700;
  color: #1a1a1a; letter-spacing: 0.05em;
}
.tn-search__seccount {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.78rem; color: #9a8f8a;
}
.tn-search__more-note {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.76rem; color: #9a9a9a;
  margin: 14px 0 0; text-align: center;
}

/* 用語カード（3列） */
.tn-sr-terms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tn-search a.tn-sr-term {
  display: flex; flex-direction: column; gap: 7px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  padding: 16px 18px;
  text-decoration: none; color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tn-search a.tn-sr-term:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
  border-color: #e3c2c0;
}
.tn-sr-term__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tn-sr-term__name {
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 1.04rem; font-weight: 700; color: #1a1a1a; letter-spacing: 0.02em;
}
.tn-sr-term__reading {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.72rem; color: #9a8f8a;
}
.tn-sr-term__excerpt {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.8rem; line-height: 1.7; color: #555;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 記事カード（2列・横サムネ） */
.tn-sr-posts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.tn-search a.tn-sr-post {
  display: flex; gap: 14px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tn-search a.tn-sr-post:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.08);
}
.tn-sr-post__media {
  flex: 0 0 116px; width: 116px;
  aspect-ratio: 4 / 3;
  background: #f3f3f3; overflow: hidden;
}
.tn-search .tn-sr-post__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tn-sr-post__noimg {
  display: block; width: 100%; height: 100%;
  background: linear-gradient(135deg, #f3efec, #ece6e2);
}
.tn-sr-post__body {
  display: flex; flex-direction: column; gap: 5px;
  padding: 12px 14px 12px 0; min-width: 0; flex: 1 1 auto;
}
.tn-sr-post__cat {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.68rem; font-weight: 700; color: #b8242b; letter-spacing: 0.02em;
}
.tn-sr-post__title {
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 0.95rem; font-weight: 700; color: #1a1a1a; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tn-sr-post__date {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.72rem; color: #9a9a9a; margin-top: auto;
}

/* レスポンシブ */
@media screen and (max-width: 1024px) {
  .tn-sr-terms { grid-template-columns: repeat(2, 1fr); }
}
@media screen and (max-width: 600px) {
  .tn-sr-terms { grid-template-columns: 1fr; }
  .tn-sr-posts { grid-template-columns: 1fr; }
  .tn-sr-post__media { flex-basis: 104px; width: 104px; }
}
@media screen and (max-width: 768px) {
  .tn-hero-search__input { font-size: 16px; padding: 12px 10px; } /* 16px=iOSの自動ズーム防止 */
  .tn-hero-search__btn { padding: 0 16px; }
}
