/*
Theme Name: Keiichi Toyoda 2026
Description: Keiichi Toyoda Official Website（keiichi-toyoda.com）用テーマ。Ameba Ownd からの移行（2026-11）
Author: Steamboat
Version: 1.0.0
Requires PHP: 7.4
Text Domain: keiichi2026
*/

/* ヘッダー画像（和紙・墨）に合わせた配色 */
:root {
  --paper: #f6efdf;
  --paper-2: #efe5cf;
  --card: #fffdf8;
  --ink: #1f1d1a;
  --ink-soft: #5d574d;
  --line: #ddd1b7;
  --accent: #a8352a;
  --serif: "Noto Serif JP", "Hiragino Mincho ProN", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", sans-serif;
  --wide: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
img, video, iframe { max-width: 100%; }
img { height: auto; }
a { color: inherit; }
.container { width: min(var(--wide), 100% - 32px); margin-inline: auto; }
.container.narrow { width: min(760px, 100% - 32px); }
.container.mid { width: min(960px, 100% - 32px); }

/* ---------- ヘッダー ---------- */
.site-header { background: var(--paper); }
.site-title { display: block; margin: 0; line-height: 0; }
.banner, .banner img { display: block; width: 100%; }
.banner img { max-width: 2400px; margin-inline: auto; aspect-ratio: 3 / 1; object-fit: cover; }
/* 記事・一覧などは高さを抑える（中央の文字が残る比率で切り取る） */
.banner:not(.is-front) img { aspect-ratio: 5 / 1; object-position: 50% 48%; }

.global-nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(246, 239, 223, .94);
  backdrop-filter: blur(6px);
  border-block: 1px solid var(--line);
}
.nav-list {
  display: flex; justify-content: center; gap: clamp(12px, 4vw, 48px);
  margin: 0; padding: 0 16px; list-style: none;
  overflow-x: auto; scrollbar-width: none;
}
.nav-list a {
  display: block; padding: 14px 2px;
  font-family: var(--serif); font-size: 14px; font-weight: 700; letter-spacing: .14em;
  text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav-list a:hover, .nav-list .current-menu-item > a { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- 共通 ---------- */
.site-main { min-height: 50vh; }
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section + .section-home { padding-top: 0; }
.section-title {
  margin: 0 0 28px;
  font-family: var(--serif); font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: .12em; line-height: 1.4;
}
.section-title::after { content: ""; display: block; width: 40px; height: 2px; margin-top: 12px; background: var(--accent); }
.section-title.is-jp { letter-spacing: .04em; }
.list-label { margin: 0 0 4px; font-family: var(--serif); font-size: 13px; letter-spacing: .2em; color: var(--accent); }
.more { margin: 36px 0 0; text-align: center; }
.btn {
  display: inline-block; padding: 12px 32px;
  border: 1px solid var(--ink); font-family: var(--serif); font-size: 14px; font-weight: 700; letter-spacing: .12em;
  text-decoration: none; transition: background .2s, color .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.empty { color: var(--ink-soft); }

/* ---------- 記事カード ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; margin: 0; padding: 0; list-style: none; }
.card a { display: flex; flex-direction: column; height: 100%; background: var(--card); text-decoration: none; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.card a:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(60, 45, 20, .1); }
.card-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--paper-2); }
.card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-noimage { display: grid; place-items: center; height: 100%; font-family: var(--serif); font-size: 28px; color: var(--line); }
.card-body { padding: 14px 16px 18px; }
.card-meta, .article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-soft); }
.card-cat { padding: 1px 8px; border: 1px solid var(--line); font-size: 12px; line-height: 1.7; text-decoration: none; }
a.card-cat:hover { border-color: var(--accent); color: var(--accent); }
.card-title {
  margin: 8px 0 0; font-size: 16px; font-weight: 700; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 一覧 ---------- */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0 24px; }
.list-head > p, .list-head > .section-title { flex-basis: 100%; }
.list-head .search-form { margin: -12px 0 24px auto; }
.search-form { display: flex; max-width: 320px; }
.search-form label { flex: 1; }
.search-form .search-field { width: 100%; padding: 8px 12px; border: 1px solid var(--line); background: var(--card); font: inherit; font-size: 14px; }
.search-form .search-submit { padding: 8px 14px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font: inherit; font-size: 14px; cursor: pointer; }
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 40px; }
.pagination .page-numbers { min-width: 40px; padding: 6px 10px; border: 1px solid var(--line); background: var(--card); text-align: center; text-decoration: none; font-size: 14px; }
.pagination .current { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pagination .dots { border: 0; background: none; }

/* ---------- 記事 ---------- */
.article, .page-article { padding: clamp(32px, 5vw, 56px) 0 64px; }
.article-head { margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-title { margin: 12px 0 0; font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); font-weight: 700; line-height: 1.5; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav a { display: block; text-decoration: none; }
.post-nav .next { text-align: right; }
.post-nav .label { display: block; font-size: 12px; letter-spacing: .1em; color: var(--accent); }
.post-nav .title { display: block; font-size: 14px; line-height: 1.6; }

/* 本文（Ownd から移した段落・画像・YouTube 埋め込み・カラム） */
.entry-content > * { margin-block: 0 1.4em; }
.entry-content p:empty { display: none; }
.entry-content a { color: var(--accent); }
.entry-content h2, .entry-content h3 { margin-top: 2em; font-family: var(--serif); line-height: 1.5; }
.entry-content h2 { font-size: 22px; padding-left: 12px; border-left: 3px solid var(--accent); }
.entry-content h3 { font-size: 19px; }
.entry-content figure { margin-inline: 0; }
.entry-content .wp-block-image img { display: block; margin-inline: auto; }
.entry-content figcaption { font-size: 13px; color: var(--ink-soft); text-align: center; }
.entry-content blockquote { margin-inline: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--line); color: var(--ink-soft); }
.entry-content .wp-block-embed__wrapper { position: relative; }
.entry-content iframe { display: block; margin-inline: auto; }
.entry-content .wp-block-columns { display: flex; flex-wrap: wrap; gap: 24px; }
.entry-content .wp-block-column { flex: 1 1 0; min-width: 0; }
.entry-content .wp-block-column > * { margin-block: 0 1em; }

/* トップの HOME 本文（動画など） */
.section-home .entry-content { max-width: 960px; margin-inline: auto; }

/* ---------- フッター ---------- */
.site-footer { padding: 40px 0; background: var(--ink); color: var(--paper-2); text-align: center; font-size: 13px; }
.site-footer p { margin: 0 0 6px; }
.footer-name { font-family: var(--serif); font-size: 16px; letter-spacing: .1em; }
.footer-name span { margin-left: 8px; font-size: 12px; color: #a8a090; letter-spacing: .14em; }
.site-footer a { color: var(--paper-2); }
.copyright { color: #8f887a; font-size: 12px; }

/* ---------- スマホ・タブレット ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .banner img, .banner:not(.is-front) img { aspect-ratio: 16 / 9; object-position: 50% 50%; }
  .banner:not(.is-front) img { aspect-ratio: 12 / 5; }
  .nav-list { justify-content: flex-start; gap: 20px; }
  .nav-list a { font-size: 13px; padding: 12px 0; }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card a { flex-direction: row; }
  .card-thumb { flex: 0 0 120px; aspect-ratio: 1; }
  .card-body { padding: 10px 12px; }
  .card-title { font-size: 15px; margin-top: 4px; }
  .list-head .search-form { margin: 0 0 20px; max-width: none; width: 100%; }
  .entry-content .wp-block-columns { flex-direction: column; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
}
