/* ===============================
   Theme Variables
   =============================== */

/* ===============================
   White Theme
   =============================== */
html[data-theme="white"] {
  --bg:        #ffffff;
  --bg-sub:    #faf7ff;
  --card:      #ffffff;
  --text:      #1f2937;
  --text-sub:  #6b7280;
  --border:    #e7dfff;
  --shadow:    0 4px 12px rgba(150,120,200,.10);

  --accent:        #a483ff;
  --accent-soft:   #f1e8ff;
  --link:          #7a4adb;
  --btn-bg:        #f1e8ff;
  --btn-text:      #5c3daa;

  --toggle-bg:   #ede6ff;
  --toggle-text: #5c3daa;

  --container: 1120px;
  --radius:    12px;

  --c-subtitle-grad-1: #8f7bbb;
  --c-subtitle-grad-2: #cc23ff;

  --c-ichigen-bg:   #f6f1ff;
  --c-uranai-bg:    #fff7e6;
  --c-newboard-bg:  #f7f9ff;
  --c-area-bg:      #f4e9ff;
  --c-lp-bg:        #e9f7ff;
  --c-articles-bg:  #fff7f0;
  --c-subbox-bg:    #f5f5f8;

  /* 画像/SVGアイコン（紫） */
  --icon-filter: brightness(0) saturate(100%) invert(22%) sepia(88%)
                 saturate(3387%) hue-rotate(246deg) brightness(96%) contrast(102%);
}

/* ===============================
   Black Theme
   =============================== */
html[data-theme="black"] {
  --bg:        #0f0f10;
  --bg-sub:    #17171a;
  --card:      #1d1d20;
  --text:      #e8e8ea;
  --text-sub:  #b8b8bb;
  --border:    #8966b1;
  --shadow:    0 6px 22px rgba(0,0,0,.55);

  --accent:        #b78dff;
  --accent-soft:   #2b233d;
  --link:          #c9a8ff;
  --btn-bg:        #32294a;
  --btn-text:      #e8dcff;

  --toggle-bg:   #2a2a35;
  --toggle-text: #d6c5ff;

  --container: 1120px;
  --radius:    12px;

  --c-subtitle-grad-1: #462c70;
  --c-subtitle-grad-2: #9223ff;

  --c-ichigen-bg:   #241e33;
  --c-uranai-bg:    #2b2418;
  --c-newboard-bg:  #20222f;
  --c-area-bg:      #262038;
  --c-lp-bg:        #122533;
  --c-articles-bg:  #2f2016;
  --c-subbox-bg:    #22232a;

  /* 画像/SVGアイコン（紫・黒向け） */
  --icon-filter: brightness(0.5) saturate(100%) invert(32%) sepia(88%)
                 saturate(3387%) hue-rotate(246deg) brightness(96%) contrast(102%);
}

/* ===============================
   Pink Theme
   =============================== */
html[data-theme="pink"] {
  --bg:        #FFF4F7;
  --bg-sub:    #FFE3EC;
  --card:      #FFFFFF;

  --text:      #4A2A35;
  --text-sub:  #7A5562;

  --border:    #FFC9D8;
  --shadow:    0 4px 10px rgba(255, 150, 180, .25);

  --accent:        #FF89B6;
  --accent-soft:   #FFE3EE;
  --link:          #D95E9F;

  --btn-bg:        #FFD8E7;
  --btn-text:      #822D56;

  --toggle-bg:     #FFD6E6;
  --toggle-text:   #7A3A58;

  --container: 1120px;
  --radius:    12px;

  --c-subtitle-grad-1: #F29BC2;
  --c-subtitle-grad-2: #FF75AE;

  --c-ichigen-bg:   #FFEFF5;
  --c-uranai-bg:    #FFF2EF;
  --c-newboard-bg:  #FFEFF7;
  --c-area-bg:      #FFDDE9;
  --c-lp-bg:        #FFEAF3;
  --c-articles-bg:  #FFF1F5;
  --c-subbox-bg:    #FFF4F8;

  /* 画像/SVGアイコン（ピンク） */
  --icon-filter: brightness(0) saturate(100%) invert(69%) sepia(23%)
                 saturate(2723%) hue-rotate(300deg) brightness(103%) contrast(101%);
}

/* ===============================
   Aqua Theme
   =============================== */
html[data-theme="aqua"] {
  --bg:        #f0faff;
  --bg-sub:    #e8f6ff;
  --card:      #ffffff;
  --text:      #1d2a35;
  --text-sub:  #5c6f7a;
  --border:    #cde9f5;
  --shadow:    0 4px 12px rgba(0, 110, 180, .12);

  --accent:        #4fb8ff;
  --accent-soft:   #e4f5ff;
  --link:          #2b9de8;
  --btn-bg:        #dff2ff;
  --btn-text:      #117ac0;

  --toggle-bg:   #dff2ff;
  --toggle-text: #0e678f;

  --container: 1120px;
  --radius:    12px;

  --c-subtitle-grad-1: #50a4d8;
  --c-subtitle-grad-2: #79caff;

  --c-ichigen-bg:   #e6f7ff;
  --c-uranai-bg:    #e8faff;
  --c-newboard-bg:  #ebf8ff;
  --c-area-bg:      #dff4ff;
  --c-lp-bg:        #d9f2ff;
  --c-articles-bg:  #f0faff;
  --c-subbox-bg:    #e8f6ff;

  /* 画像/SVGアイコン（青） */
  --icon-filter: brightness(0) saturate(100%) invert(55%) sepia(58%)
                 saturate(2400%) hue-rotate(180deg) brightness(101%) contrast(101%);
}


/* ===============================
   Theme-specific borders
   =============================== */
html[data-theme="white"] .card { border-color: rgba(150, 100, 200, 0.75); }
html[data-theme="black"] .card { border-color: rgba(137, 102, 177, 0.75); }
html[data-theme="pink"]  .card { border-color: rgba(255, 140, 180, 0.75); }
html[data-theme="aqua"]  .card { border-color: rgba(90, 170, 220, 0.55); }

html[data-theme="black"] .thread-title {
  color: #f9f2ff;
  background: #2a2338;
}
html[data-theme="black"] .thread-card {
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}


/* ===============================
   Reset / Base
   =============================== */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

html { overflow-y: scroll; }

body {
  margin: 0;
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.01em;
  background: var(--bg);
  color: var(--text);
  transition: background .25s ease, color .25s ease;

  padding-top: 70px;  /* 固定ヘッダー分 */
  padding-bottom: calc(64px + env(safe-area-inset-bottom)); /* ボトムナビ分 */
}

a { color: var(--link); text-decoration: none; }
a:hover { opacity: .8; }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.stack { display: grid; gap: 16px; }

/* ===============================
   ページ幅最大指定
   =============================== */
.page-container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ===============================
   パンくず設定
   =============================== */
.card.breadcrumb {
  max-width: var(--container);
  margin: 16px auto;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: block;

  font-size: 0.9rem;
  line-height: 1.6;
}
.card.breadcrumb a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.card.breadcrumb strong {
  font-weight: 700;
  color: var(--text);
}

/* ===============================
   共通カード / 見出し
   =============================== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 12px 16px;
  transition: background .25s ease, border .25s ease, box-shadow .25s ease, color .25s ease;
}

.card-section { padding: 12px 16px; }

.section-title {
  font-size: 1.1rem;
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 700;
}

.section-title.with-sub {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 1.2rem;
}

/* サイトトップサブタイトル */
.site-subtitle {
  width: 100%;
  letter-spacing: 0.2px;
  margin: 4px auto 4px;
  padding: 8px 10px;
  border-radius: 18px 18px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 500;
  color: #fff;
  background: linear-gradient(
    to right,
    var(--c-subtitle-grad-1),
    var(--c-subtitle-grad-2),
    var(--c-subtitle-grad-1)
  );
}

/* pill 日付バッジ */
.pill {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 25px 25px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  background: linear-gradient(
    to right,
    var(--c-subtitle-grad-1),
    var(--c-subtitle-grad-2),
    var(--c-subtitle-grad-1)
  );
  margin-left: 10px;
}


/* ===============================
   ヘッダー
   =============================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;

  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);

  padding: 6px 0;
  display: block;
  z-index: 15000;
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;

  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ★ヘッダー内幅を中央に揃える */
.site-header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo { height: 40px; width: auto; }

.site-catch {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  max-width: 65%;
}

/* PCのみ */
@media (min-width: 768px) {
  .site-catch {
    max-width: none;
  }
}

/* ハンバーガー（アイコン画像版） */
.menu-toggle.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  margin-top: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.menu-toggle.icon-button img { width: 100%; height: auto; }

.menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.menu-text {
  font-size: .75rem;
  margin: -4px 0 0;
  color: var(--accent);
  font-weight: 700;
}

.menu-label {
  margin-top: -1px;
  margin-left: -4px;
  font-size: 0.8em;
  font-weight: 700;
  color: var(--accent);
  transition: color .25s ease;
}

/* デフォルト（WHITE） */
.menu-icon {
  width: 32px;
  height: 32px;
  filter: var(--icon-filter);
  transition: filter .3s ease;
}
/* BLACKはメニューアイコンだけ少し明るく */
html[data-theme="black"] .menu-icon { filter: brightness(2); }


/* ===============================
   右スライドメニュー / オーバーレイ
   =============================== */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: .25s;
  z-index: 9000;
}
.menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* =========================================
   Side Menu（フェード無し・安定版）
========================================= */
.side-menu {
  position: fixed;
  top: 0;
  right: -260px;
  width: 240px;
  height: 100dvh;

  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);

  box-shadow: -4px 0 12px rgba(0,0,0,0.18);
  transition: right .28s ease;
  z-index: 11000;

  color: var(--text);

  display: flex;
  flex-direction: column;
}

html[data-theme="black"] .side-menu {
  background: rgba(26,26,28,0.96);
}

.side-menu.show {
  right: 0;
}

/* ヘッダー（固定） */
.side-menu .menu-header {
  flex-shrink: 0;
  padding: 8px 20px 10px;
  border-bottom: 1px solid var(--border);

  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* メニューリスト（スクロールのみ） */
.side-menu .menu-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 20px 20px;

  -webkit-overflow-scrolling: touch;
}

/* 閉じるボタン */
.side-menu .close-menu {
  position: absolute;
  top: 4px;
  right: 0;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text);
  padding: 0;
}

/* テーマ切替ラベル */
.theme-section .theme-label {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

/* テーマボタン（2×2） */
.theme-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter .2s ease, border .2s ease;
}
.theme-btn .icon {
  font-size: 1.3rem;
  line-height: 1;
}

/* テーマ別色 */
#theme-white { background:#f7f7f7; color:#555; }
#theme-black { background:#dedede; color:#111; }
#theme-pink  { background:#ffe4f0; color:#c13e82; }
#theme-aqua  { background:#e3f4ff; color:#227bc1; }

/* hover（PCのみ） */
@media (hover:hover) {
  .theme-btn:hover { filter: brightness(1.05); }
}

/* ナビ */
.side-menu .menu-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS 慣性スクロール */
  padding-bottom: 20px; /* 最下部の逃げ */
  list-style: none;
  margin: 0;
  padding: 6px 20px 0;
}
.side-menu .menu-list li { margin: 0; padding: 0; }

/* セクション見出し（区切り線付き） */
.side-menu .menu-section {
  position: relative;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--text-sub);
  margin-top: 14px;
  padding: 12px 2px 6px;
}
.side-menu .menu-section:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

/* メニューリンク（← 余白はここで制御：大きすぎないように） */
.side-menu .menu-list li a {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;

  padding: 20px 6px;       /* ★項目ごとの余白（ここが本体） */
  font-size: 0.92rem;

  color: var(--text);
  text-decoration: none;
  border-radius: 10px;
  transition: background-color .15s ease;
}

/* テキスト側を強制的に横書き */
.side-menu .menu-list li a span {
  display: inline-block;            /* ← block禁止 */
  white-space: nowrap;              /* ← 改行禁止 */
  writing-mode: horizontal-tb;      /* ← 縦書き殺す */
}

/* IMG/SVGアイコン（テーマ色） */
.side-menu .menu-list li a img {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  filter: var(--icon-filter);
}

/* タップ/ホバー */
.side-menu .menu-list li a:active { background: var(--card); }
@media (hover:hover) {
  .side-menu .menu-list li a:hover { background: var(--card); }
}

/* ===============================
   テーマヒント（MENUチュートリアル）

#themeHintOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 9990;
}
#themeHintOverlay .hint-box {
  position: absolute;
  top: 60px;
  right: 20px;
  max-width: 260px;
  color: var(--text);
  background: var(--bg);
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9999;
}
#themeHintOverlay .hint-box::after {
  content: "";
  position: absolute;
  top: -8px;
  right: 25px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #fff;
}
@media (min-width: 768px) {
  #themeHintOverlay .hint-box {
    right: calc(50% - 630px + 60px);
    top: 70px;
  }
  #themeHintOverlay .hint-box::after { right: 50px; }
}
   =============================== */

/* ===============================
   各セクション背景（bg-◯）
   =============================== */
.bg-ichigen  { background: var(--c-ichigen-bg); }
.bg-uranai   { background: var(--c-uranai-bg); }
.bg-newboard { background: var(--c-newboard-bg); }
.bg-area     { background: var(--c-area-bg); color: #fff; }
.bg-lp       { background: var(--c-lp-bg); }
.bg-articles { background: var(--c-articles-bg); }
.bg-subbox   { background: var(--c-subbox-bg); }


/* ===============================
   新着掲示板カード
   =============================== */
.section-bar,
.section-bar2,
.section-bar3  {
  width: 100%;
  text-align: center;
  margin: 30px 0 10px;
  position: relative;
}

.section-bar span,
.section-bar2 span,
.section-bar3 span {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);          /* ★未定義変数を排除 */
  padding: 0 10px;
  background: var(--bg);       /* ★未定義変数を排除 */
  position: relative;
  z-index: 2;
}

/* 左右のライン */
.section-bar::before,
.section-bar::after {
  content: "";
  position: absolute;
  top: 60%;
  width: 33%;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-50%);
}
.section-bar2::before,
.section-bar2::after {
  content: "";
  position: absolute;
  top: 60%;
  width: 10%;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-50%);
}
.section-bar3::before,
.section-bar3::after {
  content: "";
  position: absolute;
  top: 60%;
  width: 17%;
  height: 10px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateY(-50%);
}

.section-bar::before, .section-bar2::before, .section-bar3::before { left: 0; }
.section-bar::after,  .section-bar2::after,  .section-bar3::after  { right: 0; }


/* カードベース */
.thread-card {
  display: block;
  width: 100%;
  border-radius: 16px;
  padding: 14px;
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: 0 4px 12px var(--shadow);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* li のデフォルト余白を殺す */
.latest-board-list { padding: 0 !important; margin: 0 !important; }
.latest-board-list li {
  padding: 0 !important;
  margin: 0 0 16px 0;
  list-style: none;
}

/* thread 内の構造 */
.thread-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.thread-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
}

/* サムネ */
.thread-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

/* 情報部分 */
.thread-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* タイトル帯 */
.thread-title {
  position: relative;
  background: rgba(180,120,255,0.12);
  border-radius: 8px;
  padding: 4px 10px 4px 20px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}
.thread-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 5px;
  height: 100%;
  background: var(--accent);
  border-radius: 8px 0 0 8px;
}

/* メタ情報 */
.thread-meta {
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.4;
}
.thread-meta .sep { margin: 0 4px; }

/* 抜粋 */
.thread-excerpt {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

/* フッター */
.thread-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.thread-footer .replies {
  font-weight: 600;
  color: var(--primary);
}

.new-label {
  margin-left: 6px;
  font-size: 0.7rem;
}


/* ===============================
   トップ地域別ボタン
   =============================== */
.area-btn {
  display: block;
  text-align: center;
  padding: 8px 10px;
  margin: 0px 0px 10px;
  border-radius: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid var(--accent);
  background: var(--accent);
  text-decoration: none;
  transition: 0.2s;
  box-shadow: 0 5px 10px rgba(0,0,0,0.75);
}
.area-btn:hover { background: var(--accent); color: #fff; }

.bbs-btn { margin: 5px 0px 20px; }


/* ===============================
   記事リスト / サブ3列
   =============================== */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.list li {
  background: rgba(255,255,255,.65);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,.06) inset;
}
html[data-theme="black"] .list li {
  background: rgba(0,0,0,.25);
  box-shadow: none;
}
.list li a { font-weight: 600; }
.meta { color: var(--text-sub); font-size: .85rem; }

.row-articles { display: grid; gap: 16px; }

.subrow {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 14px;
}
.subrow .card {
  text-align: center;
  padding: 16px;
}


/* ===============================
   フッター
   =============================== */
footer.site-foot {
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: 24px;
  padding: 0px 0 calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  color: var(--text-sub);
  font-size: 0.95rem;
}

/* フッター内部 */
.footer-inner {
  text-align: center;
  padding: 18px 0 calc(18px + env(safe-area-inset-bottom));
  color: var(--text-sub);
  font-size: 12.5px;
}
.footer-inner .copy {
  margin-bottom: 16px;
  color: var(--text-sub);
}
.legal-links {
  font-size: 12.5px;
  color: var(--text-sub);
}
.legal-links .foot-link {
  color: var(--text-sub);
  cursor: pointer;
  transition: opacity .2s;
}
.legal-links .foot-link:hover { opacity: 0.8; }
.legal-links .sep { margin: 0 3px; opacity: 0.6; }


/* ===============================
   右下スクロールボタン
   =============================== */
#pageTopBtn {
  position: fixed;
  right: 16px;
  bottom: 90px;

  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  font-size: 12px;
  font-weight: 700;

  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: opacity .6s ease, transform .6s ease;

  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 5;
}
#pageTopBtn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#pageTopBtn .icon {
  font-size: 14px;
  line-height: 1;
}
#pageTopBtn .label {
  font-size: 11px;
  margin-top: 1px;
}

/* Pink/Aqua時だけ色を微調整（見た目優先） */
html[data-theme="pink"] #pageTopBtn { background: #ff7fbf; }
html[data-theme="aqua"] #pageTopBtn { background: #4bb8ff; }


/* ===============================
   ボトム固定ナビ（bottom-nav）
   =============================== */
.bottom-nav {
  will-change: transform;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding-bottom: env(safe-area-inset-bottom);

  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -1px 6px var(--shadow);

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 2000;
  transition: transform .25s ease, background;
}
.bottom-nav.is-hidden { transform: translateY(100%); }

.bottom-nav .wrap {
  width: 100%;
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  text-align: center;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  height: 100%;
  padding-top: 4px;

  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;

  border-right: 1px solid;
}
.nav-btn:last-child { border-right: none; }

.nav-btn img {
  width: 24px;
  height: 24px;
  margin: 0 auto 2px;
  display: block;
  filter: var(--icon-filter); /* ★統一 */
}

.nav-btn.active {
  background: rgba(200,179,244,0.25);
  border-radius: 6px;
}


/* ==============================
   共通ボタン（全ページ共通）
============================== */
.btn-primary {
  display: inline-block;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 12px var(--shadow);
  transition: 0.25s ease;
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-sub);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: background 0.25s ease;
}
.btn-secondary:hover { background: var(--accent-soft); }

.btn-primary,
.btn-secondary {
  width: 100%;
  display: block;
}

/* バックボタン */
.back-center-btn {
  width: 65% !important;
  max-width: 600px !important;
  margin: 25px auto !important;
  display: block !important;

  padding: 14px !important;
  font-size: 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0,0,0,0.15) !important;

  text-align: center !important;
  cursor: pointer !important;

  background: rgba(245, 245, 245, 0.8) !important;
  color: #222 !important;

  backdrop-filter: blur(4px) !important;
  z-index: 1;
}


/* ===============================
   Responsive
   =============================== */
@media (min-width: 768px) {
  .stack { gap: 24px; }
  .list { grid-template-columns: repeat(2,1fr); }
}
@media (min-width: 1024px) {
  .list { grid-template-columns: repeat(3,1fr); }
  .row-articles {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: flex-start;
  }
}


/* ===============================
   削除フォーム
   =============================== */
.delete-form label,
.delete-form input,
.delete-form button {
  display: block;
  width: 100%;
}
.delete-form {
  width: 100%;
  max-width: 500px;
  margin: 20px auto;
}


/* ===============================
   掲示板・記事の次ページ数字部分カード無効化
   =============================== */
.page-numbers,
.page-number-link,
.page-number-current {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.page-number-link {
  color: var(--link);
  text-decoration: underline !important;
}
.page-number-current {
  font-weight: 700;
  color: var(--text);
}


/* ================================
   人気記事 TOP5 セクション
================================ */
.popular-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.popular-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.popular-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.25s ease, transform 0.25s ease;

  position: relative;
  overflow: visible;
}
.popular-item:hover {
  background: var(--bg);
  transform: translateX(4px);
}

.popular-rank {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--btn-text);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popular-thumb img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--bg);
}
.popular-thumb { margin-left: 18px; }

.popular-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}
.popular-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.popular-item-date {
  font-size: 13px;
  color: var(--text-sub);
}

.rank-crown {
  position: absolute;
  left: 10px;
  top: -18px;
  width: 40px !important;
  transform: rotate(-28deg);
  transform-origin: 50% 80%;
  pointer-events: none;
}

.popular-rank-overlay {
  position: absolute;
  right: 8px;
  bottom: -10px;
  font-size: 80px;
  font-weight: 900;
  color: var(--accent);
  pointer-events: none;
  opacity: 0.25;
}

@media (max-width: 600px) {
  .popular-item { padding: 10px; gap: 10px; }
  .popular-thumb img { width: 60px; height: 60px; }
  .popular-item-title { font-size: 14px; }

  .rank-crown { left: 8px; width: 28px; top: -10px; }
  .popular-rank-overlay { font-size: 60px; right: 6px; }
}


/* =========================================
   関連記事アイコン（icon-related.svg）
   ========================================= */
.icon-related img {
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: -2px;
  filter: var(--icon-filter); /* ★統一 */
}

.related-title,
.articles-title,
.tag-articles-title {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.articles-title .icon-related img,
.tag-articles-title .icon-related img {
  width: 24px;
  height: 24px;
}


/* ===============================
   トップページのスライダー dots（Aqua微調整）
   =============================== */
html[data-theme="aqua"] .swiper-pagination-bullet {
  background: rgba(40, 120, 170, .35);
}
html[data-theme="aqua"] .swiper-pagination-bullet-active {
  background: #1c7db7;
}


/* ===============================
   記事ページ パンくず 文字色
   =============================== */
.articles-view nav.card { color: var(--text) !important; }
.articles-view nav.card a { color: var(--link) !important; }


/* ===============================
   「みんなのひとこと」
   =============================== */
.quick-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
}

.quick-input {
  flex: 1;
  width: 100%;
  height: 36px;
  min-height: 36px;
  max-height: 36px;

  resize: none;
  overflow: hidden;
  line-height: 36px;
  padding: 0 10px;

  font-size: 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.count-wrap {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-top: 2px;
  margin-bottom: 4px;
  text-align: right;
}

.quick-form button {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: .2s;
}
.quick-form button:hover { opacity: .9; }

.quick-error {
  background: #ffe4e8;
  color: #c80032;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
html[data-theme="black"] .quick-error {
  background: #451523;
  color: #ffb0c3;
}

.quick-comments {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}
.quick-comments li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  font-size: 1.0rem;
}
html[data-theme="black"] .quick-comments li {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.quick-comments li:last-child { border-bottom: none; }

.quick-comments .txt {
  display: block;
  max-width: calc(100% - 70px);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}
.quick-comments .ago {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-sub);
}
.quick-comments .empty { font-size: 0.8rem; color: var(--text-sub); }

.rule-btn {
  background: var(--btn-bg);
  color: var(--btn-text);
  padding: 4px 10px;
  font-size: 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
}

/* モーダル */
.rule-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.rule-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  backdrop-filter: blur(2px);
}
.rule-modal-content {
  position: relative;
  background: var(--card);
  color: var(--text);
  max-width: 360px;
  margin: 80px auto 0;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: popupFade .25s ease;
}
@keyframes popupFade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rule-modal-content h2 { margin-top: 0; font-size: 1.1rem; }
.rule-modal-content ul { padding-left: 20px; margin: 10px 0; }
.rule-close-btn {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: var(--accent-soft);
  color: var(--link);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
}


/* ===============================
   血液型占い（Swiper）
   =============================== */
#fortune.card {
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: transparent;
  box-shadow: none;
  border: none;
}

.fortune-swiper {
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 4px 10px;
}

.fortune-swiper .swiper-slide {
  width: 100% !important;
  flex: 0 0 100% !important;
}

.fortune-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 3px 8px rgba(0,0,0,.15);
  background-size: cover;
  background-position: right bottom;
  background-repeat: no-repeat;
}

/* ホワイトベール */
.fortune-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  pointer-events: none;
  z-index: 0;
}
html[data-theme="black"] .fortune-card::before { background: rgba(0,0,0,0.7); }

.fortune-card > * {
  position: relative;
  z-index: 1;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.7);
}
html[data-theme="black"] .fortune-card > * { text-shadow: none; }

.fortune-line {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.3em 0 0.8em;
}

.read-more-note { font-size: .85rem; color: var(--text-sub); }

.fortune-dots { text-align: center; margin-top: 6px; }
.fortune-dots .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 3px;
  background: rgba(0,0,0,0.25);
  opacity: 1;
}
.fortune-dots .swiper-pagination-bullet-active { background: #000; }

.fortune-date {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 10px 0 15px;
  color: var(--text);
}

/* 血液型ロゴ */
.blood-logo img {
  width: 100px !important;
  height: auto !important;
}
.blood-logo {
  display: flex;
  justify-content: center;
  margin: 20 auto 10px;
}

/* 他の血液型（2×2） */
.other-blood { text-align: center; }
.blood-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 260px;
  margin: 0 auto;
}
.blood-btn {
  display: flex;
  justify-content: center;
  align-items: center;

  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;

  height: 46px;
  border-radius: 23px;
  font-size: 1rem;
  transition: 0.2s;
}
.blood-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* SNSシェア */
.share-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}
.share-box .share-label {
  margin-right: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}
.share-box .share-icon img {
  width: 30px !important;
  height: 30px !important;
}

.share-icon {
  display: inline-flex  !important;          /* ← これが最重要 */
  align-items: center;           /* 縦中央 */
  gap: 8px;                      /* アイコンと文字の間 */
  padding: 12px 16px;
  border-radius: 18px;

  background: var(--accent);              /* Xカラー */
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.share-icon img {
  width: 18px;
  height: 18px;
  display: block;                /* 余計なズレ防止 */
}

.share-icon:hover {
  opacity: 0.9;
}

/* 戻るボタン */
.back-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: 0.25s ease;
}
.back-btn:hover { opacity: 0.85; }

/* 背景画像 */
.fortune-card[data-type="A"]  { background-image: url("../img/blood/blood_a.webp"); }
.fortune-card[data-type="B"]  { background-image: url("../img/blood/blood_b.webp"); }
.fortune-card[data-type="O"]  { background-image: url("../img/blood/blood_o.webp"); }
.fortune-card[data-type="AB"] { background-image: url("../img/blood/blood_ab.webp"); }

.fortune-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.fortune-card {
  contain: content;
}

/* ============================================
   ▼ メーカー 3 カード（テーマ完全対応）
   ============================================ */
.maker-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  margin: 26px auto 32px;
  padding: 0;
}

.maker-card {
  position: relative;
  overflow: hidden;

  flex: 1 1 calc(50% - 10px);
  max-width: 100px;
  width: auto;
  box-sizing: border-box;

  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);

  padding: 16px 10px 18px;
  text-align: center;
  text-decoration: none;

  display: flex;
  flex-direction: column;
  align-items: center;

  cursor: pointer;
  transition: background .25s ease, border .25s ease,
              box-shadow .25s ease, transform .15s ease;
}

.maker-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: 240px;
  background-repeat: repeat;
  pointer-events: none;
  z-index: 0;
}

.maker-card > * {
  position: relative;
  z-index: 1;
}

.maker-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px var(--shadow);
}

.maker-card img,
.maker-card svg {
  width: 50px !important;
  height: 50px !important;
  margin-bottom: 8px;
  filter: var(--icon-filter);
}

.maker-card-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 600;
  line-height: 1.3;
  color: var(--accent);
}

.maker-card-title .t1,
.maker-card-title .t2 {
  display: block;
  white-space: nowrap;
}

.maker-card-title .t1 {
  font-size: 1em;
  margin-bottom: 2px;
}

/* 768px以上は従来どおり3枚横並び */
@media (min-width: 768px) {
  .maker-links {
    flex-wrap: nowrap;
  }

  .maker-card {
    flex: 1 1 120px;
    max-width: 120px;
  }
}

html[data-theme="white"] .maker-card::before {
  background-image: url("/assets/img/icons/maker_bg_white.svg");
  opacity: 0.4;
}
html[data-theme="black"] .maker-card::before {
  background-image: url("/assets/img/icons/maker_bg_black.svg");
  opacity: 0.3;
}
html[data-theme="pink"] .maker-card::before {
  background-image: url("/assets/img/icons/maker_bg_pink.svg");
  opacity: 0.4;
}
html[data-theme="aqua"] .maker-card::before {
  background-image: url("/assets/img/icons/maker_bg_aqua.svg");
  opacity: 0.3;
}

.maker-area {
  background: var(--card);
  border: 4px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 12px 0;
  padding: 8px 14px 16px;
}

.maker-area-title {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--accent);
}

.maker-card.active {
  background: var(--accent-soft);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(0,0,0,0.15),
              0 0 8px var(--accent);
  transform: translateY(-2px);
}
.maker-card.active:hover {
  transform: none;
  box-shadow: 0 0 0 2px var(--accent);
  opacity: 1;
}


/* =====================================================
   地域別レズ掲示板（折りたたみ）
===================================================== */
.region-accordion {
  padding: 6px;
  background: var(--c-area-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.region-title {
  font-size: 20px;
  font-weight: 800;
  margin-top: 6px;
  margin-bottom: 6px;
  text-align: center;
  color: var(--text);
}

/* 各エリアボックス */
.region-box {
  margin-bottom: 14px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
}

/* 折りたたみヘッダー */
.region-box summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 15px;
  background: var(--bg);
  color: var(--accent);
  transition: 0.2s ease;
}

.region-box summary:hover {
  filter: brightness(1.05);
}

.region-box[open] summary {
  border-bottom: 1px solid var(--border);
}

/* リンクグリッド */
.region-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* 各都道府県リンク */
.region-link {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--btn-text);
  font-weight: 700;
  text-decoration: none;
  transition: 0.15s ease;
  border: 1px solid var(--border);
}

.region-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* PCは3列 */
@media (min-width: 768px) {
  .region-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
