/*
Theme Name: なんで？
Theme URI: 
Author: 
Description: 「なんで？」サイト用WordPressテーマ
Version: 1.8.0
License: GNU General Public License v2 or later
Text Domain: nande
*/

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;800;900&display=swap');

:root {
  --blue: #2563EB;
  --yellow: #FFCD00;
  --red: #E32C2C;
}

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

body {
  font-family: 'M PLUS Rounded 1c', sans-serif;
  background: var(--blue);
  color: #111;
  width: 100%;
}

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

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

.site-catchcopy {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

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

.site-logo .q-box {
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-left: -10px;
}

.logo-kun {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}

/* ===== SEARCH BAR ===== */
.header-search {
  display: flex;
  align-items: center;
  background: #fff;
  border: 3px solid #111;
  border-radius: 100px;
  padding: 7px 8px 7px 16px;
  gap: 8px;
  flex: 1;
  min-width: 180px;
}

.header-search input[type="search"] {
  border: none;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  flex: 1;
  color: #111;
  min-width: 0;
  -webkit-appearance: none;
}

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

.header-search button {
  background: var(--blue);
  color: #fff;
  border: 2px solid #111;
  border-radius: 100px;
  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: 0 1.5rem 1rem;
}

.tag-links a {
  font-size: 12px;
  padding: 3px 12px;
  border-radius: 100px;
  border: 1.5px solid rgba(255,255,255,0.6);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255,255,255,0.2);
}

.tag-links a:hover {
  background: rgba(255,255,255,0.35);
}

/* ===== CONTENT AREA ===== */
.content-area {
  background: #fff;
  margin: 0 1.2rem;
  border-radius: 20px;
  padding: 1.2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

/* トップページ専用：ボタンと#タグの隙間 */
.today-post-body .action-btns {
  margin-bottom: 16px;
}

/* 投稿ページ：post-nav-wrapと一体化するため上角丸なし・margin-topなし */
.post-content-area {
  border-radius: 0 0 20px 20px;
  margin-top: 0;
}

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

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

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

.post-card {
  border: 5px solid #111;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

/* 投稿ページのpost-card専用（PCの隙間調整） */
.single-post-card {
  margin-top: -17px;
}

.post-eyecatch {
  background: #FFF3C4;
  border-bottom: 3px solid #111;
  padding: 1.8rem 2rem 1.8rem;
  position: relative;
  overflow: hidden;
}

.post-eyecatch::before {
  content: '?';
  position: absolute;
  right: -10px;
  bottom: -50px;
  font-size: 220px;
  font-weight: 900;
  color: rgba(180, 140, 0, 0.25);
  line-height: 1;
  pointer-events: none;
}

.post-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.3;
  color: #111;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

/* 赤文字（なんでXXXは の XXX部分） */
.post-title em {
  font-style: normal;
  color: var(--red);
}

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

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

.post-answer {
  font-size: 15px;
  line-height: 1.75;
  color: #333;
  background: #fff;
  padding: 0;
  border-radius: 0;
}

/* ===== 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: #111;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 100px;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: opacity 0.15s;
}

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

/* ===== RANKING ===== */
.ranking-card {
  border: 5px solid #111;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

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

.ranking-col-left {
  border-right: 1.5px solid #eee;
  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: 1.5px solid #eee;
  text-decoration: none;
  transition: background 0.12s;
  min-width: 0;
}

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

.ranking-item:hover {
  background: var(--yellow);
}

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

.rank-1 { color: var(--red); }
.rank-2 { color: #E37A2C; }
.rank-3 { color: #E3BB2C; }
.rank-other { color: #ccc; }

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

.rank-question {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  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: #fff;
  border-radius: 20px 20px 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: 100px;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: opacity 0.12s;
  text-decoration: none;
}

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

.nav-prev,
.nav-next {
  background: var(--blue);
  color: #fff;
}

.nav-similar {
  background: var(--yellow);
  color: #111;
}

/* ===== 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.2);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 100px;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: opacity 0.12s;
}

.btn-back-top:hover {
  opacity: 0.8;
}

/* ===== FOOTER ===== */
.site-footer {
  padding: 0.5rem 2rem 1.5rem;
  text-align: center;
  background: var(--blue);
}

.site-footer p {
  font-size: 13px;
  color: #fff;
  font-weight: 900;
}

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

.post-category-label a {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 10px;
  border-radius: 100px;
  border: 1.5px solid var(--blue);
}

.post-category-label a:hover {
  background: rgba(37, 99, 235, 0.2);
}

/* ===== 検索結果 ===== */
.search-results-title {
  font-size: 16px;
  font-weight: 900;
  color: #111;
  margin-bottom: 0;
}

.search-result-item {
  display: block;
  padding: 0.9rem 0;
  border-bottom: 1.5px solid #eee;
  text-decoration: none;
  color: #111;
  font-size: 15px;
  font-weight: 700;
  transition: color 0.12s;
}

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

.search-result-item:hover {
  color: var(--blue);
}

/* ===== 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(--blue);
}

.search-result-item:hover {
  color: #111;
  background: var(--yellow);
  padding-left: 8px;
  margin: 0 -8px;
}

/* ===== ソートボタン（カテゴリページ・右寄せ・青） ===== */
.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: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 100px;
  cursor: pointer;
  border: 2.5px solid #111;
  background: #fff;
  color: #111;
  text-decoration: none;
  transition: background 0.12s;
}

.sort-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: #111;
}

.sort-btn:hover { background: #f0f0f0; }
.sort-btn.active:hover { background: #1a4fd8; }

/* ===== ページネーション ===== */
.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: 'M PLUS Rounded 1c', sans-serif;
  font-weight: 700;
  font-size: 13px;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: 100px;
  text-decoration: none;
  color: #111;
  border: none;
  background: transparent;
  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: #f0f0f0;
}

.nav-links .page-numbers.current {
  background: var(--yellow);
  color: #111;
  border: 2px solid #111;
}

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

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

/* ===== カテゴリ・タグラベル（共通） ===== */
.post-category-label,
.eyecatch-category-label {
  position: absolute;
  bottom: 1rem;
  right: 1.2rem;
  z-index: 2;
  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(--blue);
  text-decoration: none;
  background: rgba(37, 99, 235, 0.1);
  padding: 2px 10px;
  border-radius: 100px;
  border: 1.5px solid var(--blue);
}

.post-category-label a:hover,
.eyecatch-category-label a:hover {
  background: rgba(37, 99, 235, 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: 1.5px solid #eee;
  }

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

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

  .post-body { padding: 1.2rem 1rem 1.4rem; }

  .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: #fff; border-radius: 20px 20px 0 0; margin: 0 1.2rem; }

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

  /* ボタンとタグの間の余白（スマホ） */
  .feedback-btns { margin-bottom: 28px; }

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

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

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

/* ===== フィードバックセクション ===== */
.feedback-section {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.feedback-label {
  display: inline-block;
  background: var(--yellow);
  color: #111;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 1px 8px 2px;
  border-radius: 4px;
}

/* ===== フィードバックボタン ===== */
.feedback-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* ボタンとタグの間の余白（PC） */
  margin-bottom: 28px;
  width: 100%;
}

/* PCでは横並び */
@media (min-width: 601px) {
  .feedback-btns {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .btn-like,
  .btn-error {
    flex: 1;
    width: auto;
  }
}

.btn-like,
.btn-error {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 100px;
  cursor: pointer;
  border: 3px solid #111;
  transition: opacity 0.15s, background 0.15s, border-color 0.15s;
  width: 100%;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  min-height: 50px;
  box-sizing: border-box;
}

.btn-like {
  background: #fff;
  color: #111;
  position: relative;
}

.btn-like.liked {
  background: #FFF3C4;
  border-color: #111;
  color: #111;
}

.btn-error {
  background: #fff;
  color: #111;
  position: relative;
}

.btn-error.reported {
  background: #FFF3C4;
  border-color: #111;
  color: #111;
  font-size: 15px;
}

.btn-error:hover,
.btn-like:hover {
  opacity: 0.85;
}

.btn-like:disabled,
.btn-error:disabled {
  cursor: default;
}

/* 押したようなアニメーション */
@keyframes btn-press {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.93); }
  70%  { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.btn-like.shine,
.btn-error.shine {
  animation: btn-press 0.35s ease forwards;
}

/* ===== なんで君：全非表示（ロゴに移動） ===== */
.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: #111;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid #111;
}

.page-body {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

.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: #111;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  padding: 10px 14px;
  border: 2.5px solid #111;
  border-radius: 10px;
  background: #fff;
  color: #111;
  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(--blue);
}

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

.wpcf7 input[type="submit"] {
  display: inline-block;
  background: #111;
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 40px;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: opacity 0.15s;
}

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

/* Contact Form 7 送信完了メッセージ */
.wpcf7 .wpcf7-response-output {
  border-color: var(--blue) !important;
  color: #111;
  font-weight: 700;
  border-radius: 10px;
  padding: 12px 16px;
}
