/* ========================================
   Kenta's Notes — 読みやすさ最優先のシンプルCSS
   ======================================== */

/* ===== カラーパレット（KENTA WORKSの落ち着いた配色を最小限） ===== */
:root {
  --bg: #fafaf8;          /* やや暖かい白（紙の質感） */
  --bg-code: #f1efea;     /* コードブロック・引用の薄い背景 */
  --text: #1a1a1a;        /* 本文（強コントラスト） */
  --text-muted: #6b6b6b;  /* 補足・メタ情報 */
  --border: #e5e2dc;      /* 区切り線 */
  --accent: #b58a2e;      /* KENTAブランドのゴールド（リンク等の差し色） */
  --accent-hover: #8a6820;
  --max-width: 720px;     /* 読み物として理想的な行長 */
}

/* ===== ベース ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans",
               "Hiragino Kaku Gothic ProN", "Noto Sans JP",
               "Yu Gothic Medium", "Meiryo", sans-serif;
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== ヘッダ（サイト共通の薄い帯） ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.site-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== メイン領域 ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ===== 見出し ===== */
h1, h2, h3, h4 {
  line-height: 1.4;
  font-weight: 700;
  color: var(--text);
}

h1 {
  font-size: 28px;
  margin: 0 0 24px;
}

h2 {
  font-size: 22px;
  margin: 56px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

h3 {
  font-size: 18px;
  margin: 36px 0 12px;
}

/* ===== 本文要素 ===== */
p {
  margin: 0 0 1.4em;
}

ul, ol {
  margin: 0 0 1.4em;
  padding-left: 1.6em;
}

li {
  margin-bottom: 0.4em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s;
}

a:hover {
  color: var(--accent-hover);
}

strong {
  font-weight: 700;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ===== コード ===== */
code {
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 0.92em;
  background: var(--bg-code);
  padding: 2px 6px;
  border-radius: 3px;
}

pre {
  background: var(--bg-code);
  padding: 16px 18px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.92em;
  line-height: 1.6;
  margin: 0 0 1.4em;
}

/* ===== コードコピーボタン ===== */
.code-wrap {
  position: relative;
  margin: 0 0 1.4em;
}

.code-wrap pre {
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  background: #fff;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s, background-color 0.15s;
}

.code-wrap:hover .copy-btn,
.copy-btn:hover,
.copy-btn:focus {
  opacity: 1;
  color: var(--text);
  border-color: var(--accent);
}

.copy-btn.is-done {
  opacity: 1;
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ===== 引用 ===== */
blockquote {
  margin: 0 0 1.4em;
  padding: 12px 20px;
  border-left: 4px solid var(--accent);
  background: var(--bg-code);
  color: var(--text-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ===== 表 ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.4em;
  font-size: 0.95em;
}

th, td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 700;
  background: var(--bg-code);
}

/* ===== トップページ用：イントロ ===== */
.intro {
  margin: 0 0 48px;
  padding: 24px;
  background: var(--bg-code);
  border-radius: 6px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.8;
}

.intro p:last-child {
  margin-bottom: 0;
}

/* ===== カテゴリ一覧 ===== */
.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  transition: border-color 0.15s;
}

.category-list li:hover {
  border-color: var(--accent);
}

.category-list a {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.category-list h2 {
  margin: 0 0 6px;
  padding: 0;
  border: none;
  font-size: 18px;
}

.category-list .desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== 記事一覧 ===== */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.article-list li:first-child {
  border-top: 1px solid var(--border);
}

.article-list a {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.article-list a:hover {
  color: var(--accent);
}

.article-list .date {
  display: inline-block;
  color: var(--text-muted);
  font-size: 13px;
  margin-right: 12px;
  font-variant-numeric: tabular-nums;
}

.article-list .title {
  font-weight: 500;
}

/* ===== 空状態（記事0件） ===== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  background: var(--bg-code);
  border-radius: 6px;
  font-size: 15px;
}

.empty-state p {
  margin: 0;
}

/* ===== パンくず ===== */
.breadcrumb {
  margin: 0 0 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* ===== 記事メタ ===== */
.article-meta {
  margin: -8px 0 32px;
  color: var(--text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

/* ===== 問い合わせフォーム ===== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 16px 0 0;
  padding: 24px;
  background: var(--bg-code);
  border-radius: 6px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.form-row .required {
  font-size: 12px;
  color: #b34a3a;
  font-weight: 500;
  margin-left: 4px;
}

.contact-form input,
.contact-form textarea {
  font-family: inherit;
  font-size: 15px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.submit-btn {
  align-self: flex-start;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 24px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.submit-btn:hover {
  background: var(--accent);
}

/* ===== フッタ ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  margin-top: 80px;
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
  body {
    font-size: 16px;
    line-height: 1.8;
  }

  main {
    padding: 32px 18px 60px;
  }

  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 17px; }

  .site-header-inner {
    padding: 14px 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .site-tagline {
    font-size: 12px;
  }
}
