/*
Theme Name: Giin Base（議員ベース）
Description: 地方議員のための活動発信テーマ v0.1（たたき台）。議会質問アーカイブ・実現したこと・市政レポート・活動予定・政策・市民相談・選挙モード表示に対応。機能プラグイン「Giin Base Core」との併用を前提としています。
Version: 0.1.0
Author: Takahashi Kentaro Office
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: giin-base
*/

/* =========================================================
   0. トークン
   ========================================================= */
:root {
  --gb-accent: #1F3C68;          /* 藍：信頼の基調色（カスタマイザーで上書き） */
  --gb-accent-soft: #1F3C6812;
  --gb-bg: #FAFAF8;              /* 白練：紙に近い地色 */
  --gb-surface: #FFFFFF;
  --gb-ink: #24272B;             /* 墨 */
  --gb-muted: #6B7686;
  --gb-line: #E2E6EC;
  --gb-done: #2F7D5B;            /* 若竹：実現 */
  --gb-consider: #A8720A;        /* 検討中 */
  --gb-watch: #64748B;           /* 継続注視 */
  --gb-alert: #B3261E;           /* 選挙モード帯 */
  --gb-serif: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --gb-sans: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", Meiryo, sans-serif;
  --gb-maxw: 1080px;
  --gb-radius: 10px;
}

/* =========================================================
   1. ベース
   ========================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--gb-bg);
  color: var(--gb-ink);
  font-family: var(--gb-sans);
  font-size: 16px;
  line-height: 1.9;
  font-feature-settings: "palt";
}
img { max-width: 100%; height: auto; }
a { color: var(--gb-accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration: none; }
:focus-visible { outline: 3px solid var(--gb-accent); outline-offset: 2px; border-radius: 2px; }

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

.gb-skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--gb-accent); color: #fff; padding: 8px 16px; z-index: 100;
}
.gb-skip:focus { left: 8px; top: 8px; }

/* =========================================================
   2. 選挙モード帯
   ========================================================= */
.gb-election-bar {
  background: var(--gb-alert); color: #fff;
  font-size: 13px; line-height: 1.6;
  padding: 8px 0; text-align: center;
}
.gb-election-bar strong { letter-spacing: .12em; }
.gb-election-bar .gb-election-contact { display: block; font-size: 12px; opacity: .95; }

/* =========================================================
   3. ヘッダー・ナビ
   ========================================================= */
.gb-header {
  background: var(--gb-surface);
  border-bottom: 1px solid var(--gb-line);
}
.gb-header-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  padding: 14px 0;
}
.gb-brand { display: block; text-decoration: none; color: inherit; }
.gb-brand-title {
  font-family: var(--gb-serif);
  font-size: 24px; font-weight: 600; letter-spacing: .06em; line-height: 1.3;
}
.gb-brand-sub {
  font-size: 12px; color: var(--gb-muted); letter-spacing: .14em;
}
.gb-nav { margin-left: auto; }
.gb-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; padding: 0; }
.gb-nav a {
  display: inline-block; padding: 6px 2px;
  font-size: 14px; letter-spacing: .04em;
  color: var(--gb-ink); text-decoration: none;
  border-bottom: 2px solid transparent;
}
.gb-nav a:hover { border-bottom-color: var(--gb-accent); }

/* =========================================================
   4. ヒーロー（シグネチャ：縦書きキャッチ）
   ========================================================= */
.gb-hero {
  background: var(--gb-surface);
  border-bottom: 4px solid var(--gb-accent);
}
.gb-hero-inner {
  display: grid; grid-template-columns: 1fr minmax(280px, 420px);
  gap: 32px; align-items: stretch;
  padding: 48px 0 40px;
}
.gb-hero-text { display: flex; gap: 28px; align-items: flex-start; }
.gb-catch {
  font-family: var(--gb-serif);
  font-size: clamp(26px, 3.4vw, 40px);
  font-weight: 600; line-height: 1.7; letter-spacing: .14em;
  margin: 0;
  writing-mode: vertical-rl;
  max-height: 420px;
  border-right: 1px solid var(--gb-line);
  padding-right: 22px;
}
.gb-hero-id { padding-top: 6px; }
.gb-hero-kicker {
  font-size: 13px; letter-spacing: .22em; color: var(--gb-accent);
  margin: 0 0 6px;
}
.gb-hero-name {
  font-family: var(--gb-serif);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700; letter-spacing: .1em; line-height: 1.4;
  margin: 0 0 6px;
}
.gb-hero-party { font-size: 13px; color: var(--gb-muted); margin: 0 0 22px; }
.gb-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gb-hero-photo { position: relative; }
.gb-hero-photo img {
  width: 100%; height: 100%; min-height: 320px; object-fit: cover;
  border-radius: var(--gb-radius);
  display: block;
}
.gb-hero-photo::after {
  content: ""; position: absolute; inset: 12px -12px -12px 12px;
  border: 1px solid var(--gb-accent);
  border-radius: var(--gb-radius);
  z-index: -1;
}
.gb-hero-photo--empty {
  min-height: 320px; border-radius: var(--gb-radius);
  background: linear-gradient(160deg, var(--gb-accent), #0e2242);
  display: flex; align-items: flex-end; padding: 20px;
  color: #fff; font-size: 13px; letter-spacing: .1em;
}

/* =========================================================
   5. ボタン
   ========================================================= */
.gb-btn {
  display: inline-block; padding: 12px 26px;
  border-radius: 999px; border: 1px solid var(--gb-accent);
  font-size: 15px; letter-spacing: .06em; line-height: 1.5;
  text-decoration: none; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.gb-btn--primary { background: var(--gb-accent); color: #fff; }
.gb-btn--primary:hover { background: var(--gb-bg); color: var(--gb-accent); }
.gb-btn--ghost { background: transparent; color: var(--gb-accent); }
.gb-btn--ghost:hover { background: var(--gb-accent-soft); }
.gb-btn--small { padding: 8px 18px; font-size: 13px; }

/* =========================================================
   6. セクション
   ========================================================= */
.gb-section { padding: 52px 0; }
.gb-section--alt { background: var(--gb-surface); border-top: 1px solid var(--gb-line); border-bottom: 1px solid var(--gb-line); }
.gb-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 26px;
}
.gb-section-title {
  font-family: var(--gb-serif);
  font-size: 24px; font-weight: 600; letter-spacing: .1em;
  margin: 0; padding-left: 16px;
  border-left: 4px solid var(--gb-accent);
  line-height: 1.4;
}
.gb-section-more { font-size: 13px; white-space: nowrap; }
.gb-section-note { font-size: 13px; color: var(--gb-muted); margin-top: 14px; }

/* =========================================================
   7. カード・一覧
   ========================================================= */
.gb-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gb-cards--2 { grid-template-columns: repeat(2, 1fr); }
.gb-card {
  background: var(--gb-surface);
  border: 1px solid var(--gb-line);
  border-radius: var(--gb-radius);
  padding: 22px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.gb-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(31, 60, 104, .08); }
.gb-card-meta { font-size: 12px; color: var(--gb-muted); letter-spacing: .06em; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.gb-card-title { font-size: 17px; font-weight: 700; line-height: 1.6; margin: 0 0 10px; }
.gb-card-title a { color: inherit; text-decoration: none; }
.gb-card-title a:hover { color: var(--gb-accent); }
.gb-card-text { font-size: 14px; color: #3d434b; margin: 0; }
.gb-card--report img { border-radius: 6px; margin-bottom: 12px; display: block; }

.gb-list { list-style: none; margin: 0; padding: 0; }
.gb-list li { border-bottom: 1px solid var(--gb-line); padding: 14px 4px; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }
.gb-list time { font-size: 13px; color: var(--gb-muted); min-width: 7em; }
.gb-list a { text-decoration: none; color: inherit; }
.gb-list a:hover { color: var(--gb-accent); }

/* =========================================================
   8. バッジ（状況・進捗・種別）
   ========================================================= */
.gb-badge {
  display: inline-block; padding: 2px 12px;
  border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  border: 1px solid currentColor; line-height: 1.7;
}
.gb-badge--done    { background: var(--gb-done); border-color: var(--gb-done); color: #fff; }
.gb-badge--partial { color: var(--gb-done); background: #fff; }
.gb-badge--consider{ color: var(--gb-consider); background: #fff; }
.gb-badge--watch   { color: var(--gb-watch); background: #fff; }
.gb-badge--working { color: var(--gb-accent); background: #fff; }
.gb-badge--notyet  { color: var(--gb-muted); background: #fff; border-style: dashed; }
.gb-chip {
  display: inline-block; padding: 1px 10px; border-radius: 4px;
  background: var(--gb-accent-soft); color: var(--gb-accent);
  font-size: 12px; letter-spacing: .06em;
}

/* =========================================================
   9. 質問→答弁→その後（議事録スレッド）
   ========================================================= */
.gb-qa { margin: 28px 0; }
.gb-qa-block {
  position: relative;
  border-left: 3px solid var(--gb-line);
  padding: 4px 0 22px 26px;
}
.gb-qa-block:last-child { padding-bottom: 4px; }
.gb-qa-block::before {
  content: attr(data-mark);
  position: absolute; left: -17px; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gb-surface);
  border: 2px solid var(--gb-accent); color: var(--gb-accent);
  font-family: var(--gb-serif); font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.gb-qa-block--a::before { background: var(--gb-accent); color: #fff; }
.gb-qa-label { font-size: 13px; letter-spacing: .16em; color: var(--gb-accent); font-weight: 700; margin: 0 0 4px; }
.gb-qa-text { margin: 0; }

/* =========================================================
   10. 予定（日付ボックス）
   ========================================================= */
.gb-event { display: flex; gap: 18px; align-items: flex-start; background: var(--gb-surface); border: 1px solid var(--gb-line); border-radius: var(--gb-radius); padding: 18px 20px; }
.gb-event + .gb-event { margin-top: 14px; }
.gb-datebox {
  min-width: 74px; text-align: center;
  border: 1px solid var(--gb-accent); border-radius: 8px; overflow: hidden;
}
.gb-datebox-month { display: block; background: var(--gb-accent); color: #fff; font-size: 12px; letter-spacing: .1em; padding: 2px 0; }
.gb-datebox-day { display: block; font-family: var(--gb-serif); font-size: 26px; font-weight: 700; line-height: 1.4; padding: 4px 0 2px; }
.gb-datebox-dow { display: block; font-size: 11px; color: var(--gb-muted); padding-bottom: 4px; }
.gb-event-body { flex: 1; }
.gb-event-title { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.gb-event-meta { font-size: 13px; color: var(--gb-muted); margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* =========================================================
   11. 記事本文・単一ページ
   ========================================================= */
.gb-main { padding: 48px 0 64px; }
.gb-entry-header { margin-bottom: 26px; }
.gb-page-title {
  font-family: var(--gb-serif);
  font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: .08em; line-height: 1.5;
  margin: 0 0 10px; padding-left: 16px; border-left: 4px solid var(--gb-accent);
}
.gb-entry-meta { font-size: 13px; color: var(--gb-muted); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.gb-entry { max-width: 760px; }
.gb-entry p { margin: 0 0 1.4em; }
.gb-entry h2 { font-family: var(--gb-serif); font-size: 22px; letter-spacing: .08em; border-left: 4px solid var(--gb-accent); padding-left: 14px; margin: 2em 0 .8em; line-height: 1.5; }
.gb-entry h3 { font-size: 18px; margin: 1.8em 0 .6em; }
.gb-entry ul, .gb-entry ol { margin: 0 0 1.4em; padding-left: 1.6em; }
.gb-entry blockquote { margin: 0 0 1.4em; padding: 12px 18px; border-left: 3px solid var(--gb-accent); background: var(--gb-accent-soft); }
.gb-entry img { border-radius: 8px; }
.gb-entry a { word-break: break-all; }
.gb-video { position: relative; aspect-ratio: 16 / 9; margin: 24px 0; }
.gb-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.gb-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.gb-backlink { display: inline-block; margin-top: 36px; font-size: 14px; }

/* =========================================================
   12. フォーム（市民相談）
   ========================================================= */
.gb-soudan-form { max-width: 640px; }
.gb-soudan-form p { margin: 0 0 18px; }
.gb-soudan-form label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.gb-soudan-form input[type="text"],
.gb-soudan-form input[type="email"],
.gb-soudan-form input[type="tel"],
.gb-soudan-form select,
.gb-soudan-form textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--gb-line); border-radius: 8px;
  font: inherit; background: var(--gb-surface); color: inherit;
}
.gb-soudan-form input:focus,
.gb-soudan-form select:focus,
.gb-soudan-form textarea:focus { border-color: var(--gb-accent); outline: none; box-shadow: 0 0 0 3px var(--gb-accent-soft); }
.gb-req { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 4px; background: var(--gb-alert); color: #fff; font-size: 11px; font-weight: 700; }
.gb-agree label { font-weight: 400; }
.gb-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.gb-form-notice { padding: 14px 18px; border-radius: 8px; font-weight: 700; }
.gb-form-notice--ok { background: #eaf5ef; color: var(--gb-done); border: 1px solid var(--gb-done); }
.gb-form-notice--err { background: #fbeeed; color: var(--gb-alert); border: 1px solid var(--gb-alert); }

/* =========================================================
   13. CTA帯・フッター
   ========================================================= */
.gb-cta-band { background: var(--gb-accent); color: #fff; padding: 44px 0; }
.gb-cta-band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.gb-cta-band h2 { font-family: var(--gb-serif); font-size: 22px; letter-spacing: .1em; margin: 0 0 6px; }
.gb-cta-band p { margin: 0; font-size: 14px; opacity: .92; }
.gb-cta-band .gb-btn { border-color: #fff; background: #fff; color: var(--gb-accent); }
.gb-cta-band .gb-btn:hover { background: transparent; color: #fff; }

.gb-footer { background: #17233a; color: #d8dee9; font-size: 13px; }
.gb-footer a { color: #fff; }
.gb-footer-inner { padding: 40px 0 28px; display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.gb-footer-name { font-family: var(--gb-serif); font-size: 20px; letter-spacing: .08em; margin: 0 0 4px; color: #fff; }
.gb-footer-sub { margin: 0; opacity: .8; }
.gb-sns { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; }
.gb-sns a { display: inline-block; padding: 6px 16px; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; text-decoration: none; letter-spacing: .06em; }
.gb-sns a:hover { background: rgba(255,255,255,.12); }
.gb-footer-contact { font-size: 12px; opacity: .85; white-space: pre-line; }
.gb-copyright { border-top: 1px solid rgba(255,255,255,.15); padding: 16px 0; text-align: center; font-size: 12px; opacity: .7; }

/* =========================================================
   14. ページネーション・その他
   ========================================================= */
.gb-pagination { margin-top: 40px; text-align: center; }
.gb-pagination .page-numbers { display: inline-block; min-width: 40px; padding: 8px 10px; margin: 0 3px; border: 1px solid var(--gb-line); border-radius: 8px; text-decoration: none; }
.gb-pagination .page-numbers.current { background: var(--gb-accent); border-color: var(--gb-accent); color: #fff; }
.gb-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 30px; background: var(--gb-surface); border: 1px solid var(--gb-line); border-radius: var(--gb-radius); padding: 14px 18px; }
.gb-filter label { font-size: 13px; font-weight: 700; }
.gb-filter select { padding: 8px 12px; border: 1px solid var(--gb-line); border-radius: 8px; font: inherit; background: #fff; }
.gb-empty { color: var(--gb-muted); padding: 30px 0; }

/* =========================================================
   15. レスポンシブ
   ========================================================= */
@media (max-width: 900px) {
  .gb-cards { grid-template-columns: repeat(2, 1fr); }
  .gb-hero-inner { grid-template-columns: 1fr; }
  .gb-hero-photo img, .gb-hero-photo--empty { min-height: 260px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .gb-cards, .gb-cards--2 { grid-template-columns: 1fr; }
  .gb-hero-text { flex-direction: column; gap: 18px; }
  .gb-catch {
    writing-mode: horizontal-tb;
    max-height: none; border-right: 0; padding-right: 0;
    border-bottom: 1px solid var(--gb-line); padding-bottom: 14px;
    font-size: 23px; line-height: 1.8;
  }
  .gb-header-inner { padding: 12px 0; }
  .gb-nav { margin-left: 0; width: 100%; }
  .gb-nav ul { gap: 2px 16px; }
  .gb-section { padding: 40px 0; }
  .gb-event { flex-direction: row; }
}

/* =========================================================
   16. アクセシビリティ・動作抑制
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
