/*
Theme Name: Tochigi AI Note
Theme URI: https://tochigi-ai.com/
Author: 株式会社Nexa
Description: 栃木AI（tochigi-ai.com）のオリジナルテーマ。地方紙の経済面をイメージした明朝×深緑のエディトリアルデザイン。
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: tochigi-ai
*/

/* ===== トークン ===== */
:root {
  --bg:        #faf8f3;
  --bg-sub:    #f2efe6;
  --bg-card:   #eae6da;
  --ink:       #23291f;
  --ink-2:     #33392c;
  --ink-3:     #4a5142;
  --ink-4:     #5c6353;
  --muted:     #6b7263;
  --muted-2:   #8a8f80;
  --line:      #cfcabb;
  --line-2:    #ddd8cc;
  --green:     #1f3a2e;
  --red:       #b5372e;
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans:  "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --pad: 64px;
  --maxw: 1440px;
}

/* ===== リセット ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; transition: color .15s; }
a:hover { color: var(--red); }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; color: var(--green); margin: 0; }
p { margin: 0; }
.serif { font-family: var(--serif); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== 告知バー ===== */
.topbar {
  background: var(--green); color: #e8e4d9;
  font-size: 13px; letter-spacing: .04em;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; padding-block: 9px; }
.topbar span:last-child { opacity: .75; }

/* ===== ヘッダー ===== */
.site-header { border-bottom: 1px solid var(--green); }
.site-header .wrap {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding-block: 26px 20px; gap: 24px;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand__name { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: .06em; color: var(--green); line-height: 1.2; white-space: nowrap; }
.brand__en { font-size: 11px; letter-spacing: .22em; color: var(--muted); }
.gnav { display: flex; gap: 34px; font-size: 14px; font-weight: 500; padding-bottom: 4px; }
.gnav ul { display: flex; gap: 34px; list-style: none; margin: 0; padding: 0; }
.gnav a.is-cta { color: var(--red); font-weight: 700; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--green); margin: 5px 0; }

/* ===== ボタン ===== */
.btn {
  display: inline-block; font-size: 15px; font-weight: 700;
  padding: 15px 34px; letter-spacing: .04em; text-align: center;
}
.btn--dark { background: var(--green); color: var(--bg); }
.btn--dark:hover { background: #172c22; color: var(--bg); }
.btn--red { background: var(--red); color: var(--bg); }
.btn--red:hover { background: #9a2d25; color: var(--bg); }
.btn--line { padding: 15px 6px; border-bottom: 1px solid var(--green); font-weight: 500; }

/* ===== ヒーロー ===== */
.hero { border-bottom: 3px double var(--green); }
.hero .wrap {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 40px; padding-block: 56px 52px; align-items: center;
}
.hero__body { grid-column: span 7; }
.hero__media { grid-column: span 5; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.eyebrow i { width: 28px; height: 2px; background: var(--red); display: block; }
.eyebrow span { font-size: 12px; letter-spacing: .18em; color: var(--red); font-weight: 700; font-style: normal; }
.hero h1 { font-size: 52px; line-height: 1.42; margin-bottom: 26px; letter-spacing: .01em; text-wrap: pretty; }
.hero__lead { font-size: 16px; line-height: 2; margin-bottom: 32px; color: var(--ink-3); max-width: 30em; text-wrap: pretty; }
.hero__actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero__media img { width: 100%; height: 300px; object-fit: cover; border: 1px solid var(--line-2); }
.hero__cap { font-size: 11px; color: var(--muted-2); margin-top: 8px; letter-spacing: .04em; }

/* ===== セクション見出し ===== */
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 34px; gap: 16px;
}
.sec-head h2 { font-size: 24px; letter-spacing: .06em; }
.sec-head a { font-size: 13px; color: var(--muted); }

/* ===== 記事カード ===== */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px; }
.card { display: flex; flex-direction: column; gap: 12px; }
.card__thumb {
  height: 152px; background: var(--bg-card); border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.card__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-tag { font-size: 11px; background: var(--green); color: var(--bg); padding: 3px 9px; letter-spacing: .06em; }
.cat-tag:hover { background: var(--red); color: var(--bg); }
.date { font-size: 12px; color: var(--muted-2); }
.card h3 { font-size: 19px; line-height: 1.6; font-weight: 600; color: var(--ink); text-wrap: pretty; }
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--red); }
.card__ex { font-size: 13.5px; line-height: 1.9; color: var(--ink-4); }

/* ===== 数字セクション ===== */
.facts { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: 38px; margin-top: 56px; }
.facts__label { font-family: var(--serif); font-size: 15px; color: var(--muted); margin-bottom: 26px; letter-spacing: .08em; }
.facts__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px; }
.fact { display: flex; flex-direction: column; gap: 7px; }
.fact b { font-family: var(--serif); font-size: 40px; font-weight: 700; color: var(--green); line-height: 1; }
.fact b.is-red { color: var(--red); }
.fact span { font-size: 13px; color: var(--ink-4); line-height: 1.7; }
.fact small { color: var(--muted-2); font-size: 11.5px; }

/* ===== CTA ===== */
.cta {
  background: var(--green); color: #f0ede4; padding: 46px 52px; margin-block: 56px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px; align-items: center;
}
.cta h2 { font-size: 27px; color: inherit; margin-bottom: 16px; line-height: 1.6; letter-spacing: .02em; }
.cta__body { grid-column: span 8; }
.cta__body p { font-size: 14.5px; line-height: 2; opacity: .86; max-width: 34em; }
.cta__act { grid-column: span 4; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.cta__act .btn { font-size: 16px; padding: 17px 40px; }
.cta__note { font-size: 12px; opacity: .7; }

/* ===== フッター ===== */
.site-footer { border-top: 1px solid var(--green); margin-top: 40px; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: flex-start; padding-block: 34px 40px; gap: 40px; flex-wrap: wrap; }
.site-footer .brand__name { font-size: 20px; }
.foot__addr { font-size: 12.5px; color: var(--muted); line-height: 1.9; margin-top: 9px; }
.foot__cols { display: flex; gap: 52px; font-size: 13px; }
.foot__col { display: flex; flex-direction: column; gap: 11px; }
.foot__col > span { color: var(--muted-2); font-size: 11px; letter-spacing: .12em; }
.foot__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.copyright { border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted-2); }
.copyright .wrap { padding-block: 16px; }

/* ===== 記事詳細 ===== */
.article-layout {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 48px; padding-block: 34px 60px; align-items: start;
}
.article-main { grid-column: span 8; min-width: 0; }
.article-side { grid-column: span 4; display: flex; flex-direction: column; gap: 34px; position: sticky; top: 24px; }
.breadcrumb { font-size: 12.5px; color: var(--muted-2); margin-bottom: 22px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted-2); }
.entry-header { margin-bottom: 30px; }
.entry-header .card__meta { margin-bottom: 18px; }
.entry-title { font-size: 38px; line-height: 1.55; text-wrap: pretty; }

/* AIOサマリーボックス */
.aio-summary-box {
  background: var(--bg-sub); border-left: 3px solid var(--green);
  padding: 26px 30px; margin-bottom: 38px;
  display: flex; flex-direction: column; gap: 13px;
}
.aio-summary-box > p:first-child { font-size: 15.5px; line-height: 1.9; font-weight: 700; color: var(--green); }
.aio-summary-box p { font-size: 14px; line-height: 1.95; color: var(--ink-3); margin: 0; }
.aio-summary-box ul { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.95; color: var(--ink-3); }
.aio-summary-box strong { color: var(--green); }

/* 本文 */
.entry-content { font-size: 16px; line-height: 2.15; color: var(--ink-2); }
.entry-content > * + * { margin-top: 22px; }
.entry-content h2 {
  font-size: 26px; margin-top: 46px; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 2px solid var(--green);
}
.entry-content h3 { font-size: 20px; margin-top: 36px; margin-bottom: 14px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li + li { margin-top: 8px; }
.entry-content strong { font-weight: 700; color: var(--ink); }
.entry-content a { border-bottom: 1px solid var(--line); }
.entry-content blockquote {
  border-left: 3px solid var(--green); background: var(--bg-sub);
  padding: 20px 26px; margin-inline: 0;
}
.entry-content table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.entry-content thead { background: var(--green); color: var(--bg); }
.entry-content th { text-align: left; padding: 12px 16px; font-weight: 500; }
.entry-content td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.entry-content tbody tr:nth-child(even) { background: #f4f1e9; }
.table-scroll { overflow-x: auto; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin-block: 40px; }

/* 記事内インラインCTA */
.inline-cta {
  border-top: 1px solid var(--green); border-bottom: 1px solid var(--green);
  padding: 26px 0; margin-block: 40px;
  display: flex; justify-content: space-between; align-items: center; gap: 30px; flex-wrap: wrap;
}
.inline-cta__t { display: flex; flex-direction: column; gap: 7px; }
.inline-cta b { font-family: var(--serif); font-size: 18px; color: var(--green); }
.inline-cta span { font-size: 13.5px; color: var(--ink-4); line-height: 1.85; }
.inline-cta .btn { font-size: 14.5px; padding: 14px 30px; white-space: nowrap; }

/* サイドバー */
.side-box { border: 1px solid var(--green); padding: 22px 24px; }
.side-box__t { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--green); letter-spacing: .06em; display: block; margin-bottom: 16px; }
.toc { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; line-height: 1.65; }
.toc a { border-left: 2px solid var(--line-2); padding-left: 12px; }
.toc a:hover { border-left-color: var(--red); }
.side-cta { background: var(--green); color: #f0ede4; padding: 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.side-cta b { font-family: var(--serif); font-size: 17px; line-height: 1.6; }
.side-cta p { font-size: 13px; line-height: 1.9; opacity: .85; }
.side-cta .btn { padding: 13px 0; font-size: 14px; }
.side-rel__t { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--green); letter-spacing: .06em; display: block; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.side-rel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.side-rel a { display: flex; gap: 13px; align-items: flex-start; font-size: 13.5px; line-height: 1.7; }
.side-rel i { width: 62px; height: 48px; background: var(--bg-card); border: 1px solid var(--line-2); flex-shrink: 0; display: block; }

/* ===== 固定ページ／アーカイブ ===== */
.page-head { padding-block: 52px 0; }
.page-head h1 { font-size: 40px; line-height: 1.5; margin-bottom: 18px; }
.page-head .lead { font-size: 16px; line-height: 2.05; color: var(--ink-3); max-width: 46em; text-wrap: pretty; }
.page-body { padding-block: 46px 64px; }
.archive-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px; padding-block: 40px 64px; }

/* ===== Contact Form 7 ===== */
.cf7-layout { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 52px; align-items: start; }
.cf7-form { grid-column: span 7; }
.cf7-side { grid-column: span 5; display: flex; flex-direction: column; gap: 26px; }
.wpcf7 form > div, .wpcf7 .field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.wpcf7 label { font-size: 13.5px; font-weight: 700; color: var(--green); display: flex; align-items: center; gap: 8px; }
.req { background: var(--red); color: var(--bg); font-size: 10px; padding: 2px 7px; font-weight: 500; }
.wpcf7 input[type=text], .wpcf7 input[type=email], .wpcf7 input[type=tel], .wpcf7 textarea {
  width: 100%; border: 1px solid var(--line); background: #fffefb;
  padding: 13px 15px; font-size: 15px; font-family: inherit; color: var(--ink); border-radius: 0;
}
.wpcf7 input:focus, .wpcf7 textarea:focus { outline: 2px solid var(--green); outline-offset: -2px; }
.wpcf7 .wpcf7-list-item { display: block; margin: 0 0 9px; }
.wpcf7 .wpcf7-list-item-label { font-size: 14.5px; color: var(--ink-2); font-weight: 400; }
.wpcf7 input[type=radio], .wpcf7 input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); margin-right: 8px; }
.wpcf7 input[type=submit] {
  background: var(--green); color: var(--bg); border: 0; font-size: 16px; font-weight: 700;
  padding: 17px 52px; font-family: inherit; letter-spacing: .06em; cursor: pointer; border-radius: 0;
}
.wpcf7 input[type=submit]:hover { background: #172c22; }
.flow { display: flex; flex-direction: column; gap: 18px; }
.flow__row { display: flex; gap: 14px; align-items: flex-start; }
.flow__n { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--red); line-height: 1.3; flex-shrink: 0; }
.flow__row span { font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.prep { background: var(--bg-sub); padding: 26px 28px; }
.prep b { font-family: var(--serif); font-size: 16px; color: var(--green); display: block; margin-bottom: 14px; }
.prep ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; font-size: 14px; line-height: 1.8; color: var(--ink-2); }
.prep li { display: flex; gap: 11px; align-items: flex-start; }
.prep svg { flex-shrink: 0; margin-top: 3px; }
.prep p { font-size: 12.5px; color: var(--muted); margin-top: 16px; line-height: 1.85; }

/* ===== ページネーション ===== */
.pagination { display: flex; gap: 8px; justify-content: center; padding-bottom: 64px; }
.pagination .page-numbers {
  padding: 10px 16px; border: 1px solid var(--line); font-size: 14px; background: #fffefb;
}
.pagination .current { background: var(--green); color: var(--bg); border-color: var(--green); }

/* ===== レスポンシブ ===== */
@media (max-width: 1100px) {
  :root { --pad: 32px; }
  .hero h1 { font-size: 40px; }
  .cards, .archive-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  :root { --pad: 20px; }
  body { font-size: 15.5px; }
  .topbar .wrap span:last-child { display: none; }
  .site-header .wrap { align-items: center; padding-block: 16px; }
  .nav-toggle { display: block; }
  .gnav { display: none; }
  .gnav.is-open {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--green); padding: 20px var(--pad); z-index: 40;
  }
  .gnav.is-open ul { flex-direction: column; gap: 18px; }
  .site-header { position: relative; }
  .brand__name { font-size: 18px; letter-spacing: .02em; }
  .brand__en { display: none; }
  .hero .wrap { grid-template-columns: 1fr; gap: 28px; padding-block: 34px; }
  .hero__body, .hero__media, .cta__body, .cta__act, .article-main, .article-side, .cf7-form, .cf7-side { grid-column: 1 / -1; }
  .hero h1 { font-size: 30px; line-height: 1.5; }
  .hero__media img { height: 200px; }
  .cards, .archive-list { grid-template-columns: 1fr; }
  .facts__grid { grid-template-columns: 1fr 1fr; gap: 22px; }
  .fact b { font-size: 30px; }
  .cta { padding: 32px 24px; grid-template-columns: 1fr; gap: 24px; }
  .cta h2 { font-size: 21px; }
  .article-layout { grid-template-columns: 1fr; gap: 40px; padding-block: 24px 48px; }
  .article-side { position: static; }
  .entry-title { font-size: 27px; }
  .entry-content { font-size: 15.5px; line-height: 2.05; }
  .entry-content h2 { font-size: 21px; margin-top: 36px; }
  .page-head h1 { font-size: 28px; }
  .cf7-layout { grid-template-columns: 1fr; gap: 34px; }
  .inline-cta { flex-direction: column; align-items: flex-start; }
  .site-footer .wrap { flex-direction: column; gap: 28px; }
  .foot__cols { gap: 34px; }
}

/* ===== テーマから探す ===== */
.entries { padding-block: 56px 0; }
.entries__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 34px; }
.entry {
  display: flex; flex-direction: column; gap: 14px;
  border: 1px solid var(--line); background: #fffefb; padding: 26px 26px 28px;
  transition: border-color .15s, transform .15s;
}
.entry:hover { border-color: var(--green); transform: translateY(-2px); }
.entry__img { display: block; width: 96px; height: 96px; overflow: hidden; }
.entry__img img { width: 100%; height: 100%; object-fit: cover; }
.entry__t { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--green); line-height: 1.5; }
.entry__d { font-size: 13.5px; line-height: 1.95; color: var(--ink-4); }
.entry__more { font-size: 13px; font-weight: 700; color: var(--red); margin-top: auto; padding-top: 6px; }

/* ===== 帯（私たちについて） ===== */
.band { position: relative; margin-top: 56px; overflow: hidden; }
.band__img { width: 100%; height: 420px; object-fit: cover; display: block; }
.band__inner { position: absolute; inset: 0; display: flex; align-items: center; }
.band__box {
  background: rgba(250, 248, 243, .93); border-left: 3px solid var(--green);
  padding: 34px 38px; max-width: 44em;
  display: flex; flex-direction: column; gap: 16px; align-items: flex-start;
}
.band__box h2 { font-size: 26px; line-height: 1.6; letter-spacing: .02em; }
.band__box p { font-size: 14.5px; line-height: 2.05; color: var(--ink-3); }

/* ===== 記事内の図解 ===== */
.entry-content figure { margin-inline: 0; }
.entry-content figure img { width: 100%; border: 1px solid var(--line-2); }
.entry-content figcaption { font-size: 12.5px; color: var(--muted-2); margin-top: 8px; line-height: 1.8; }

@media (max-width: 1100px) {
  .entries__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .entry { padding: 20px; }
  .band__img { height: 360px; }
}
@media (max-width: 820px) {
  .entries { padding-block: 36px 0; }
  .entries__grid { grid-template-columns: 1fr; gap: 18px; }
  .entry__img { width: 72px; height: 72px; }
  .entry__t { font-size: 18px; }
  .band { margin-top: 36px; }
  .band__img { height: 460px; }
  .band__inner { padding-block: 24px; }
  .band__box { padding: 24px 22px; }
  .band__box h2 { font-size: 20px; }
}
