/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* =========================================================
 * COLOR TOKENS（ここを変えるだけで全体の配色を一括変更可能）
 * ======================================================= */
:root {
  --accent: #3A4A7A;        /* 深いインディゴ／藍 */
  --accent-dark: #2C3A63;
  --accent-soft: rgba(58,74,122,.06);
  --accent-soft2: rgba(58,74,122,.10);
  --accent2: #8C6A3F;       /* 琥珀・古木 */
  --marker: rgba(214,178,94,.55); /* 蛍光ペン（落ち着いた金茶） */
  --ink: #2A2622;
}

/* ===== 見出し（本文内に限定して目次・ウィジェットへの漏れを防止）===== */
.entry-content h2 {
  font-size: 24px !important;
  border-left: 10px solid var(--accent) !important;
  padding: .5em .7em !important;
  background: var(--accent-soft) !important;
  color: var(--ink) !important;
  margin-bottom: 15px !important;
}

.entry-content h3 {
  font-size: 20px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  background: var(--accent-soft2) !important;
  padding: .6em .8em .4em !important;
  margin: 1.6em 0 .9em !important;
  border-top: 4px solid var(--accent) !important;
}

.entry-content h4 {
  font-size: 18px !important;
  font-weight: 600 !important;
  color: var(--ink) !important;
  margin: 1.4em 0 .6em !important;
  padding-bottom: .3em !important;
  border-bottom: 2px dashed var(--accent2) !important;
}

/* ======
 * FONT SETTINGS
 * ==== */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&family=Noto+Serif+JP:wght@500;600;700&display=swap");

body,
p,
li,
a,
span,
div,
table,
th,
td,
input,
textarea,
button {
  font-family: "Noto Sans JP", "Hiragino Sans", "BIZ UDPGothic", "Yu Gothic", "YuGothic", "Meiryo", sans-serif !important;
  font-weight: 400;
}

/* 見出しは明朝に（本文＋記事タイトルに限定して目次タイトルには当てない） */
.entry-title,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-family: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif !important;
}

h1 {
  font-weight: 700;
  font-size: 28px;
  color: var(--ink);
}
h5,
h6 { font-weight: 300; }

strong,
b {
  font-weight: 600;
  color: var(--accent-dark);
}

body {
  line-height: 1.8;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ink);
}
/* ======
 * END FONT SETTINGS
 * ==== */

/* 蛍光ペン（落ち着いた金茶） */
.marker {
  background-image: -webkit-linear-gradient(transparent 60%, var(--marker) 0%);
  background-image: linear-gradient(transparent 60%, var(--marker) 0%);
  font-weight: bold;
}

/* ======
 * テーブル
 * ==== */
.sortable {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-family: sans-serif;
}

.sortable th,
.sortable td {
  border: 1px solid #ddd;
  padding: 12px 15px;
  text-align: left;
}

.sortable thead th {
  background-color: var(--accent-soft);
  font-weight: 700;
  font-size: 1.1em;
  color: var(--accent-dark);
  cursor: pointer;
}

.sortable tbody tr:nth-child(even) {
  background-color: #f7f8fb;
}

.sortable tbody tr:hover {
  background-color: var(--accent-soft);
}

@media screen and (max-width: 768px) {
  .sortable, .sortable thead, .sortable tbody, .sortable th, .sortable td, .sortable tr {
    display: block;
  }

  .sortable thead {
    display: none;
  }

  .sortable tr {
    border: 1px solid #ccc;
    margin-bottom: 1em;
  }

  .sortable td {
    border: none;
    border-bottom: 1px solid #eee;
    position: relative;
    padding-left: 50%;
    text-align: right;
  }

  .sortable td:before {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    width: 45%;
    padding-right: 10px;
    white-space: nowrap;
    text-align: left;
    font-weight: bold;
    content: attr(data-label);
  }

  .sortable td:last-child {
    border-bottom: 0;
  }

  .sortable tbody tr:nth-child(even),
  .sortable tbody tr:hover {
    background-color: #fff;
  }
}

.table-scroll{
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.table-scroll > table{
  display: table !important;
  width: auto !important;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: auto;
}

@media (min-width: 769px){
  .table-scroll{ overflow: visible; }
  .table-scroll > table{ min-width: auto; }
}

@media (max-width: 768px){
  .table-scroll .sortable,
  .table-scroll .sortable thead,
  .table-scroll .sortable tbody,
  .table-scroll .sortable tr,
  .table-scroll .sortable th,
  .table-scroll .sortable td{
    display: table !important;
  }
  .table-scroll .sortable thead{ display: table-header-group !important; }
  .table-scroll .sortable tbody{ display: table-row-group !important; }
  .table-scroll .sortable tr   { display: table-row !important; }
  .table-scroll .sortable th,
  .table-scroll .sortable td   { display: table-cell !important; }

  .table-scroll .sortable tr{
    border: none !important;
    margin: 0 !important;
  }
  .table-scroll .sortable th,
  .table-scroll .sortable td{
    border: 1px solid #eee;
    text-align: left !important;
    vertical-align: middle;
    white-space: nowrap;
    position: static !important;
    float: none !important;
    width: auto !important;
    padding: 8px 12px !important;
  }

  .table-scroll .sortable td:before{
    content: none !important;
  }

  .table-scroll .sortable tbody tr:nth-child(even),
  .table-scroll .sortable tbody tr:hover{
    background: inherit !important;
  }
}

@media (max-width: 768px){
  .table-scroll > table:not(.sortable){
    min-width: 720px;
  }
  .table-scroll > table:not(.sortable) th,
  .table-scroll > table:not(.sortable) td{
    white-space: nowrap;
    text-align: left;
    padding: 8px 12px !important;
  }
}
@media (max-width: 768px){
  .table-scroll{
    position: relative;
    padding-bottom: 20px;
  }

  .table-scroll::after{
    content: "→ 横にスクロールできます";
    position: absolute;
    left: 6px;
    bottom: 10px;
    font-size: 12px;
    color: #666;
    background: rgba(240,240,240,0.85);
    padding: 2px 7px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
    transition: opacity .3s ease;
  }

  .table-scroll.scrolled::after{
    opacity: 0;
  }
}
/* ======
 * END テーブル
 * ==== */

/* ======
 * 特定のリストだけに適用するカスタムスタイル
 * ==== */
.custom-list {
  width: 85%;
  margin: 1.5em auto;
  background: #fbfaf7;
  border: 1px solid #ece7dc;
  border-radius: 8px;
  box-shadow: 0px 0px 5px #d9d2c4;
  padding: 0.8em 1em 0.8em 1.5em;
  list-style-position: inside;
}

.custom-list li {
  line-height: 1.6;
  padding: 0.6em 0.5em;
  border-bottom: 1px dotted #cbb894;
}

.custom-list li:last-child {
  border-bottom: none;
}
/* ======
 * END 特定のリストだけに適用するカスタムスタイル
 * ==== */

/* ======
 * 公開日を非表示化
 * ==== */
.entry-header .entry-meta:not(.custom-meta-right) .posted-on {
  display: none !important;
}

.custom-meta-right {
  text-align: right;
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  opacity: .85;
}
.entry-header .custom-meta-right .posted-on {
  display: inline !important;
  visibility: visible !important;
}
.custom-meta-right {
  text-align: right;
  margin-top: 6px;
  margin-bottom: 10px;
  font-size: 0.9rem;
  opacity: .85;
  line-height: 1.6;
}

.entry-title {
  margin-bottom: 0.2em;
  word-break: normal;
  overflow-wrap: anywhere;
}

.entry-header .entry-meta:not(.custom-meta-right) .byline,
.entry-header .entry-meta:not(.custom-meta-right) .author-name {
  display: none !important;
}
/* ======
 * END 公開日を非表示化
 * ==== */

/* ===== Related (CRP)  ===== */
h2.related-title{
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--accent-soft);
  border: 1px solid rgba(58,74,122,.12);
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  --rel-max: 640px;
  max-width: min(var(--rel-max), 100%);
}

ul.crp_related{
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  background: #f6f7fb;
  border: 1px solid rgba(58,74,122,.12);
  border-radius: 12px;
  max-width: min(var(--rel-max, 640px), 100%);
}

ul.crp_related > li{
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(58,74,122,.10);
  position: relative;
}
ul.crp_related > li:last-child{ border-bottom: none; }
ul.crp_related > li::before{ content: none !important; }

.related-wrap{ margin-top: 24px; }
.related-wrap > *{ max-width: min(var(--rel-max, 640px), 100%); }
/* ===== END Related (CRP)  ===== */

/* RankMathのパンくず */
.breadcrumbs-wrapper {
  padding: 0.1em 1em 0em;
  margin-bottom: 0.05rem;
  font-size: 14px;
  line-height: 1.4;
  color: #666;
  background-color: var(--accent-soft);
}

.breadcrumbs-wrapper a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumbs-wrapper a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .breadcrumbs-wrapper {
    padding: 0.1em 1em 0.05em;
    font-size: 13px;
  }
}
/* END RankMathのパンくず */

/* ======
 * 記事本文のリスト装飾（ul / ol）— 枠囲み・90%幅・中央寄せ
 *  ※ :not(.rtoc-mokuji) と li:not(.rtoc-item) でRTOC目次への漏れを防止
 * ==== */

/* --- リスト全体を細枠ボックスで囲う（ul / ol 共通）--- */
.entry-content ul:not(.custom-list):not(.crp_related):not(.rtoc-mokuji),
.entry-content ol:not(.custom-list):not(.rtoc-mokuji) {
  list-style: none;
  width: 90%;
  margin: 1.8em auto;
  padding: 1.1em 1.5em;
  background: #fbfaf7;
  border: 1px solid #e2dccd;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(140,106,63,.08);
}

/* --- 箇条書き（ul）--- */
.entry-content ul:not(.custom-list):not(.crp_related):not(.rtoc-mokuji) li:not(.rtoc-item) {
  position: relative;
  padding: .5em 0 .5em 1.7em;
  line-height: 1.7;
  border-bottom: 1px dashed rgba(140,106,63,.28);
}
.entry-content ul:not(.custom-list):not(.crp_related):not(.rtoc-mokuji) li:not(.rtoc-item):last-child {
  border-bottom: none;
}

/* 箇条書きマーカー：琥珀の菱形 */
.entry-content ul:not(.custom-list):not(.crp_related):not(.rtoc-mokuji) li:not(.rtoc-item)::before {
  content: "";
  position: absolute;
  left: .15em;
  top: 1.05em;
  width: 9px;
  height: 9px;
  background: var(--accent2);
  border-radius: 2px;
  transform: rotate(45deg);
}

/* --- 番号付きリスト（ol）--- */
.entry-content ol:not(.custom-list):not(.rtoc-mokuji) {
  counter-reset: yurai-counter;
}
.entry-content ol:not(.custom-list):not(.rtoc-mokuji) li:not(.rtoc-item) {
  position: relative;
  padding: .55em 0 .55em 2.6em;
  line-height: 1.7;
  border-bottom: 1px dashed rgba(58,74,122,.20);
}
.entry-content ol:not(.custom-list):not(.rtoc-mokuji) li:not(.rtoc-item):last-child {
  border-bottom: none;
}

/* 連番バッジ：藍の丸 */
.entry-content ol:not(.custom-list):not(.rtoc-mokuji) li:not(.rtoc-item)::before {
  counter-increment: yurai-counter;
  content: counter(yurai-counter);
  position: absolute;
  left: 0;
  top: .5em;
  width: 1.7em;
  height: 1.7em;
  line-height: 1.7em;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: .9em;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(58,74,122,.3);
}

/* --- ネスト（入れ子）リストは枠・背景・幅指定を解除 --- */
.entry-content ul:not(.rtoc-mokuji) ul:not(.rtoc-mokuji),
.entry-content ul:not(.rtoc-mokuji) ol:not(.rtoc-mokuji),
.entry-content ol:not(.rtoc-mokuji) ul:not(.rtoc-mokuji),
.entry-content ol:not(.rtoc-mokuji) ol:not(.rtoc-mokuji) {
  width: auto;
  margin: .5em 0 .2em .6em;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
/* ======
 * END 記事本文のリスト装飾
 * ==== */

/* Cloudflare Turnstileの配置調整 */
.cf-turnstile {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    margin-bottom: -50px;
}

/* ====== お問い合わせフォーム全体 ====== */
.wpcf7 {
    max-width: 700px;
}

.wpcf7 p {
    margin-bottom: 18px;
    font-weight: 600;
    color: #333;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea {
    width: 100%;
    padding: 12px 14px;
    margin-top: 6px;
    border: 1px solid #d5d5d5;
    border-radius: 6px;
    background-color: #fff;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus {
    border-color: #2f7fc4;
    box-shadow: 0 0 0 3px rgba(47, 127, 196, 0.15);
    outline: none;
}

.cf-turnstile {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.wpcf7 input[type="submit"] {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 10px auto 0;
    padding: 14px 0;
    background-color: #2f7fc4;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.wpcf7 input[type="submit"]:hover {
    background-color: #256aa6;
    transform: translateY(-1px);
}
/* ====== END お問い合わせフォーム全体 ====== */

/* ======================================================
 * RTOC目次：本文CSSは漏れない設計なので「打ち消し」は一切不要。
 * 開閉トグルボタンの文字だけ可視化する（別ブログ実績版）。
 * 目次本体（枠・番号・色・開閉動作）はプラグイン本来の表示に任せる。
 * ==================================================== */
.entry-content #rtoc-mokuji-wrapper .rtoc_open_close {
  color: #111 !important;
  background: #f3f4f6 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 4px;
  padding: 2px 8px !important;
  font-size: .8rem;
  line-height: 1.4;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
  text-indent: 0 !important;
}
.entry-content #rtoc-mokuji-wrapper .rtoc_open_close:hover {
  background: #e5e7eb !important;
  color: #000 !important;
}
.entry-content #rtoc-mokuji-wrapper .rtoc_open_close * {
  color: inherit !important;
  opacity: 1 !important;
  filter: none !important;
}
/* ====== END RTOC目次 ====== */
