/* キノコソース v2 — 情報密度重視デザイン
   テキスト主体・装飾最小限・スマホでも一覧性優先 */

:root {
  --accent: #cc3b52;      /* 抑えめの赤（ブランド継承） */
  --bg: #fafafa;
  --text: #222222;
  --muted: #777777;
  --link: #1a4fb8;
  --link-visited: #7a3fa0;
  --border: #dddddd;
  --thin: #ececec;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.65;
}

a { color: var(--link); text-decoration: none; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration: underline; }

.muted { color: var(--muted); font-weight: normal; }
.small { font-size: 11.5px; }

/* ---- ヘッダー：スリム1段 ---- */
.site-header {
  background: #ffffff;
  border-bottom: 2px solid var(--accent);
  padding: 6px 12px 0;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logo img { height: 34px; width: auto; display: block; }

.shop-banner img { display: block; max-width: 100%; height: auto; }
.shop-banner { max-width: 360px; }

.shop-banner-footer {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  max-width: none;
}

.global-nav {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: 14px;
  padding: 5px 0 6px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.global-nav a { color: #444; font-weight: bold; }
.global-nav a:visited { color: #444; }
.global-nav a:hover { color: var(--accent); }

/* ---- パンくず ---- */
.breadcrumbs {
  max-width: 1080px;
  margin: 0 auto;
  padding: 6px 12px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ---- レイアウト ---- */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 4px 12px 24px;
}

.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 700px) {
  .info-row { grid-template-columns: 1fr; gap: 8px; }
  /* スマホでは本文を先に、今話題・更新履歴は後ろへ */
  .page { display: flex; flex-direction: column; }
  .info-row { order: 2; margin-top: 12px; }
  .main { order: 1; }
}

/* カードは白背景+細罫のみ（影・角丸なし） */
.card {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 8px 12px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--thin);
  font-size: 13.5px;
  color: var(--accent);
}

.page-heading {
  color: var(--text);
  font-size: 17px;
  margin: 8px 0;
  border-left: 4px solid var(--accent);
  padding-left: 8px;
}

/* ---- リスト（サイドバー・スレ一覧共通で密に） ---- */
.region-card ul, .hot-threads, .thread-list, .news-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.hot-threads li, .thread-list li {
  padding: 3px 0;
  border-bottom: 1px dotted var(--thin);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-threads li:last-child, .thread-list li:last-child { border-bottom: none; }

.news-list { font-size: 11.5px; color: var(--muted); }
.news-list li { padding: 2px 0; }

/* ---- カテゴリツリー：多段組で圧縮 ---- */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.region-card { padding: 6px 10px; margin-bottom: 0; }

.region-card h3 {
  margin: 0 0 3px;
  font-size: 13px;
  color: var(--accent);
  border-bottom: 1px solid var(--thin);
  padding-bottom: 2px;
}

.region-card li { padding: 1px 0; font-size: 12.5px; }

/* ---- スレッド・投稿：密なBBS風 ---- */
.thread-title { font-size: 16px; }

.post {
  border-bottom: 1px solid var(--thin);
  padding: 6px 0;
}

.post:last-child { border-bottom: none; }

.post-meta {
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: baseline;
}

.post-number { font-weight: bold; color: var(--accent); font-size: 12.5px; }

.reply-link {
  background: none;
  border: none;
  color: var(--link);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
}

.reply-link:hover { text-decoration: underline; }

.post-body {
  margin: 2px 0 4px;
  word-break: break-word;
}

.reactions { display: flex; gap: 4px; }

.reactions button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1.7;
}

.reactions button:hover { border-color: var(--accent); color: var(--accent); }
.reactions button.reacted { border-color: var(--accent); color: var(--accent); background: #fdf0f2; }

.anchor-link { color: var(--accent); }

/* ---- フォーム ---- */
.post-form label { display: block; margin-bottom: 6px; font-weight: bold; font-size: 12.5px; }

.post-form input[type="text"],
.post-form input[type="password"],
.post-form textarea {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 0;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.post-form input:focus, .post-form textarea:focus {
  outline: 1px solid var(--accent);
  border-color: var(--accent);
}

.post-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 24px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
}

.post-form button:hover { opacity: 0.85; }

.hp-field { position: absolute; left: -9999px; }

.error { color: #c0392b; font-weight: bold; }
.notice-ok { color: #1e7e34; font-weight: bold; }

.badge-closed {
  background: var(--muted);
  color: #fff;
  font-size: 10px;
  padding: 0 4px;
}

.about h5 { margin: 12px 0 2px; font-size: 13px; color: var(--accent); }

/* ---- 管理画面 ---- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th, .admin-table td {
  border: 1px solid var(--border);
  padding: 3px 6px;
  text-align: left;
}

.row-deleted { opacity: 0.5; }
.inline-form { display: inline; }

/* ---- フッター ---- */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 12px;
  color: var(--muted);
  font-size: 11.5px;
  background: #fff;
  margin-top: 16px;
}

.card h1 { font-size: 16px; margin: 4px 0 8px; color: var(--accent); }

/* ---- v3 追加: 検索・ページャー・店舗情報・NEW・プレビュー ---- */
.nav-search {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-search input {
  border: 1px solid var(--border);
  padding: 2px 8px;
  font-size: 12px;
  width: 150px;
}

.nav-search button, .search-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
}

.search-form { display: flex; gap: 6px; align-items: center; }
.search-form input[type="search"], .search-form input[type="text"] { flex: 1; margin-top: 0; }
.search-form select { padding: 5px; border: 1px solid var(--border); font-size: 13px; }
.search-form button { padding: 6px 16px; font-size: 13px; }

.pager {
  margin: 8px 0;
  font-size: 13px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.pager a, .pager strong {
  border: 1px solid var(--border);
  padding: 1px 8px;
  background: #fff;
}

.pager strong { background: var(--accent); color: #fff; border-color: var(--accent); }

.shop-info { border-left: 3px solid var(--accent); }
.shop-info-body { white-space: normal; }

.badge-new {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 0 4px;
  border-radius: 2px;
}

.del-request { font-size: 11px; color: var(--muted); }
.del-request:visited { color: var(--muted); }

.anchor-tip {
  position: absolute;
  z-index: 100;
  max-width: 320px;
  background: #fffbe8;
  border: 1px solid #d5c98a;
  padding: 6px 8px;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  pointer-events: none;
}

/* ---- ダークモード（端末設定に追従） ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --text: #d6d6d6;
    --muted: #8a8a92;
    --link: #7aa5f0;
    --link-visited: #b28ad6;
    --border: #37373d;
    --thin: #2a2a2f;
    --accent: #e05a6e;
  }
  .site-header, .card, .site-footer, .pager a { background: #1f1f24; }
  .global-nav a, .global-nav a:visited { color: #c0c0c8; }
  .post-form input[type="text"],
  .post-form input[type="password"],
  .post-form textarea,
  .nav-search input,
  .search-form select {
    background: #26262c;
    color: var(--text);
    border-color: var(--border);
  }
  .reactions button { background: none; }
  .reactions button.reacted { background: #3a2228; }
  .anchor-tip { background: #2e2c20; border-color: #5a533a; color: #d6d6d6; }
  .admin-table th { background: #26262c; }
}
