/*
Theme Name: Dictionnaire Infernal
Theme URI: https://dictionnaireinfernal.info/
Author: 
Description: 地獄の辞典 日本語翻訳サイト用テーマ
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: dictionnaire-infernal
*/

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;700;900&display=swap');

:root {
  --bg-color: #121212;       /* 全体背景：暗いグレー */
  --card-bg: #1e1e1e;        /* カード背景：やや明るいダークグレー */
  --text-main: #dddddd;      /* 主な文字：明るいグレー */
  --text-muted: #8c8c8c;     /* 控えめな文字 */
  --accent-red: #8b0000;     /* アクセント：深紅（バーガンディ） */
  --border-color: #3a3a3a;   /* 境界線：落ち着いたグレー */
  --gold-muted: #8f763f;     /* 補助色：古書風のくすんだゴールド */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Noto Serif JP', 'Georgia', 'MS Mincho', serif;
  background: var(--bg-color);
  color: var(--text-main);
  width: 100%;
}

/* ===== SITE HEADER ===== */
.site-header {
  padding: 1.2rem 1.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.site-logo-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.site-logo {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main);
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0;
  letter-spacing: -0.02em;
  text-decoration: none;
}

/* ===== SEARCH BAR ===== */
.header-search {
  display: flex;
  align-items: center;
  background: #252525;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 7px 8px 7px 16px;
  gap: 8px;
  flex: 1;
  min-width: 180px;
}

.header-search input[type="search"] {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  flex: 1;
  color: var(--text-main);
  min-width: 0;
  -webkit-appearance: none;
}

.header-search input[type="search"]::placeholder {
  color: #555;
}

.header-search button {
  background: var(--accent-red);
  color: #fff;
  border: 1px solid #000;
  border-radius: 4px;
  padding: 6px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== TAG LINKS ===== */
.tag-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  padding: 1rem 1.5rem;
}

.tag-links a {
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 700;
  background: rgba(255,255,255,0.05);
}

.tag-links a:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-main);
}

/* ===== CONTENT AREA ===== */
.content-area {
  background: var(--card-bg);
  margin: 0 1.2rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  padding: 1.2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

/* 投稿ページ：post-nav-wrapと一体化 */
.post-content-area {
  border-radius: 0 0 6px 6px;
  margin-top: 0;
}

/* ===== SECTION LABEL ===== */
.section-label {
  font-size: 14px;
  font-weight: 900;
  color: var(--gold-muted);
  letter-spacing: 0.04em;
  display: inline-block;
  background: transparent;
  border-bottom: 2px double var(--gold-muted);
  padding: 3px 0px 5px;
  border-radius: 0;
  margin-bottom: 0.6rem;
}

/* ===== クリッカブルカード ===== */
.post-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.post-card-link:hover .post-eyecatch {
  background: #252525;
}

.post-card {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
}

.single-post-card {
  margin-top: -17px;
}

.post-eyecatch {
  background: #222;
  border-bottom: 1px solid var(--border-color);
  padding: 1.8rem 2rem 1.8rem;
  position: relative;
  overflow: hidden;
}

.post-eyecatch::before {
  content: '†';
  position: absolute;
  right: 10px;
  bottom: -40px;
  font-size: 200px;
  font-weight: 900;
  color: rgba(139, 0, 0, 0.08);
  line-height: 1;
  pointer-events: none;
}

.post-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.3;
  color: var(--text-main);
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

/* タイトル強調部分（em）の変更 */
.post-title em {
  font-style: normal;
  color: var(--accent-red);
}

.post-body {
  padding: 1.5rem 2rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  background: transparent;
  position: relative;
}

.post-answer-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent-red);
  display: inline-block;
  padding: 1px 8px 2px;
  border-radius: 2px;
  margin-bottom: 8px;
}

.post-answer {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-main);
  background: transparent;
}

/* トップページ：抜粋のフェードアウト用追加CSS */
.post-excerpt-fade-wrap {
  position: relative;
  max-height: 120px;
  overflow: hidden;
  margin-bottom: 15px;
}

.post-excerpt {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-main);
}

.fade-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(to bottom, rgba(26, 26, 26, 0) 0%, rgba(26, 26, 26, 1) 100%);
  pointer-events: none;
}

.read-more-btn-wrap {
  text-align: center;
  margin-top: 10px;
}

.read-more-btn {
  display: inline-block;
  padding: 8px 24px;
  background: var(--accent-red);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
  border: 1px solid #000;
  text-decoration: none;
}

/* ===== ACTION BUTTONS ===== */
.action-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-share-x,
.btn-share-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #333;
  color: #fff;
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.btn-share-x:hover,
.btn-share-line:hover {
  opacity: 0.75;
}

/* ===== RANKING ===== */
.ranking-card {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  background: #1a1a1a;
}

.ranking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ranking-col-left {
  border-right: 1px solid var(--border-color);
  min-width: 0;
  overflow: hidden;
}

.ranking-col-right {
  min-width: 0;
  overflow: hidden;
}

.ranking-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  transition: background 0.12s;
  min-width: 0;
}

.ranking-item:last-child {
  border-bottom: none;
}

.ranking-item:hover {
  background: rgba(143, 118, 63, 0.15);
}

.rank-num {
  font-size: 20px;
  font-weight: 900;
  width: 26px;
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
}

.rank-1 { color: var(--accent-red); }
.rank-2 { color: #b75a1d; }
.rank-3 { color: var(--gold-muted); }
.rank-other { color: #555; }

.rank-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.rank-question {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== POST NAV (投稿ページ) ===== */
.post-nav-wrap {
  max-width: 60%;
  margin: 0 auto;
  padding: 0.8rem 1.5rem 0.6rem;
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-radius: 6px 6px 0 0;
}

.post-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  transition: opacity 0.12s;
  text-decoration: none;
}

.nav-btn:hover {
  opacity: 0.8;
}

.nav-prev,
.nav-next {
  background: #333;
  color: var(--text-main);
}

.nav-similar {
  background: var(--accent-red);
  color: #fff;
  border: 1px solid #000;
}

/* ===== BELOW CONTENT ===== */
.below-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem 1.2rem 0;
}

.btn-back-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: opacity 0.12s;
}

.btn-back-top:hover {
  opacity: 0.8;
  color: var(--text-main);
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 0.5rem 2rem 1.5rem;
  text-align: center;
  background: var(--bg-color);
  border-top: 1px solid var(--border-color);
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.8rem 0 0.5rem;
}

.footer-nav a {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.12s;
}

.footer-nav a:hover {
  color: var(--text-main);
}

.site-footer p {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 900;
}

/* ===== 投稿ページ カテゴリラベル ===== */
.post-category-label {
  margin-bottom: 0.6rem;
}

.post-category-label a {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-muted);
  text-decoration: none;
  background: rgba(143, 118, 63, 0.1);
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid var(--gold-muted);
}

.post-category-label a:hover {
  background: rgba(143, 118, 63, 0.2);
}

/* ===== 検索結果 ===== */
.search-results-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0;
}

.search-result-item {
  display: block;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-main);
  font-size: 15px;
  font-weight: 700;
  transition: color 0.12s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  color: #fff;
  background: rgba(143, 118, 63, 0.15);
  padding-left: 8px;
  margin: 0 -8px;
}

/* ===== PC: 横幅60% ===== */
@media (min-width: 601px) {
  .site-header {
    max-width: 60%;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: nowrap;
  }

  .header-search {
    flex: 1;
    min-width: 0;
  }

  .tag-links {
    max-width: 60%;
    margin: 0 auto;
    padding-left: 0;
    padding-right: 0;
  }

  .content-area {
    max-width: 60%;
    margin-left: auto;
    margin-right: auto;
  }

  .below-content {
    max-width: 60%;
    margin: 0 auto;
  }

  .site-footer {
    max-width: 100%;
  }
}

.search-result-item::before {
  content: '† ';
  color: var(--accent-red);
}

/* ===== ソートボタン ===== */
.sort-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: #1a1a1a;
  color: var(--text-main);
  text-decoration: none;
  transition: background 0.12s;
}

.sort-btn.active {
  background: var(--accent-red);
  color: #fff;
  border-color: #000;
}

.sort-btn:hover { background: #252525; }
.sort-btn.active:hover { background: #600000; }

/* ===== ページネーション ===== */
.nav-links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 1rem;
}

.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  background: #1a1a1a;
  transition: background 0.12s;
}

.nav-links ul { list-style: none; display: flex; gap: 6px; align-items: center; padding: 0; margin: 0; }
.nav-links li { list-style: none; }

.nav-links .page-numbers:hover {
  background: #252525;
}

.nav-links .page-numbers.current {
  background: var(--gold-muted);
  color: #fff;
  border: 1px solid #000;
}

.nav-links .page-numbers.next,
.nav-links .page-numbers.prev {
  background: #333;
  color: #fff;
  border: 1px solid var(--border-color);
  padding: 0 16px;
}

.nav-links .page-numbers.next:hover,
.nav-links .page-numbers.prev:hover {
  background: #252525;
}

/* ===== カテゴリ・タグラベル ===== */
.eyecatch-category-label {
  position: static;
  margin-top: -1rem;
  margin-bottom: 0.5rem;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.post-category-label {
  position: static;
  margin-top: 0rem;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.post-category-label a,
.eyecatch-category-label a {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-muted);
  text-decoration: none;
  background: rgba(143, 118, 63, 0.1);
  padding: 2px 10px;
  border-radius: 4px;
  border: 1px solid var(--gold-muted);
}

.post-category-label a:hover,
.eyecatch-category-label a:hover {
  background: rgba(143, 118, 63, 0.2);
}

/* ===== スマホ ===== */
@media (max-width: 600px) {
  .action-btns {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }

  .btn-share-x,
  .btn-share-line {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 10px 8px;
    white-space: nowrap;
    overflow: hidden;
  }

  .post-nav { gap: 5px; }

  .nav-btn {
    font-size: 11px;
    padding: 6px 8px;
    gap: 2px;
    flex: 1;
    justify-content: center;
  }

  .ranking-grid { grid-template-columns: 1fr; }

  .ranking-col-left {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .post-title { font-size: 26px; }

  .post-eyecatch { padding: 1.2rem 1rem 1.2rem; }

  .post-body { padding: 1.2rem 1rem 0.5rem; gap: 8px; }

  .content-area { padding: 1.2rem 0.8rem 1.5rem; margin: 0 1.2rem; }

  .post-nav-wrap { max-width: 100%; padding: 0.8rem 1.2rem 0.6rem; background: var(--card-bg); border-radius: 6px 6px 0 0; margin: 0 1.2rem; }

  .single-post-card { margin-top: -12px; }

  .site-header {
    flex-wrap: nowrap;
    padding: 0.8rem 1rem;
    gap: 0.6rem;
  }

  .header-search {
    flex: 1;
    min-width: 0;
  }

  .eyecatch-category-label {
    position: static;
    display: flex;
    justify-content: flex-end;
    margin-top: 0rem;
  }

  .post-category-label {
    position: static;
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
  }
}

.nande-kun-fixed,
.nande-kun-single {
  display: none !important;
}

/* ===== 固定ページ ===== */
.page-content-area {
  margin-top: 1.2rem;
}

.page-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--border-color);
}

.page-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-main);
}

.page-body p {
  margin-bottom: 1em;
}

.below-content-inline {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/* ===== Contact Form 7 ===== */
.wpcf7 {
  width: 100%;
}

.wpcf7 .wpcf7-form {
  width: 100%;
}

.wpcf7 p {
  margin-bottom: 1.2em;
}

.wpcf7 label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-main);
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #1a1a1a;
  color: var(--text-main);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
  border-color: var(--accent-red);
}

.wpcf7 textarea {
  min-height: 160px;
  resize: vertical;
}

.wpcf7 input[type="submit"] {
  display: inline-block;
  background: var(--accent-red);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 40px;
  border: 1px solid #000;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.wpcf7 input[type="submit"]:hover {
  opacity: 0.75;
}

.wpcf7 .wpcf7-response-output {
  border-color: var(--accent-red) !important;
  color: var(--text-main);
  font-weight: 700;
  border-radius: 4px;
  padding: 12px 16px;
}