@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@500;700&family=Noto+Sans+JP:wght@400;500&display=swap');

:root {
  --ink: #1E2B33;
  --paper: #F6F5F1;
  --sky: #6B7FD7;
  --sky-soft: #E3E6F8;
  --line: #D8D6CF;
  --sub: #6B7580;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── ヘッダー / ナビ ───────────────────────────── */
header {
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--line);
}

header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.logo {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}

.logo span {
  color: var(--sky);
}

nav.gnav {
  display: flex;
  gap: 28px;
}

nav.gnav a {
  font-size: 13.5px;
  color: var(--sub);
  position: relative;
  padding: 4px 0;
  transition: color 0.15s ease;
}

nav.gnav a:hover {
  color: var(--ink);
}

nav.gnav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 500;
}

nav.gnav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--sky);
  border-radius: 2px;
}

/* ── 共通の本文まわり ─────────────────────────── */
main {
  padding: 64px 0 48px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--sky);
  font-weight: 500;
  margin-bottom: 14px;
  text-transform: uppercase;
}

h1 {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.5;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
}

h2 {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1.6;
  margin: 44px 0 16px;
}

.lead {
  color: #4A5760;
  font-size: 15px;
  max-width: 46ch;
  margin-bottom: 14px;
}

.lead-note {
  color: #96A0A8;
  font-size: 13px;
  max-width: 50ch;
  line-height: 1.8;
  margin-bottom: 48px;
}

p {
  font-size: 14.5px;
  color: #40494F;
  max-width: 58ch;
  margin-bottom: 18px;
}

/* ── ツールカード ─────────────────────────────── */
.tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 40px;
}

.tool-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s ease, transform 0.15s ease;
  overflow: visible;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--sky);
  transform: translateY(-1px);
}

/* ── ホバー時のミニプレビュー ─────────────────── */
.tool-preview {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(100% + 8px);
  background: var(--ink, #1E2B33);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.tool-preview::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 28px;
  border: 6px solid transparent;
  border-top-color: var(--ink, #1E2B33);
}

.tool-preview .pv-before {
  color: #C9A98A;
  text-decoration: line-through;
  text-decoration-color: rgba(201,169,138,0.5);
}

.tool-preview .pv-after {
  color: #8FD1A8;
  font-weight: 500;
}

.tool-preview .pv-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 6px;
  text-transform: uppercase;
}

.tool-card:hover .tool-preview,
.tool-card:focus-visible .tool-preview {
  opacity: 1;
  transform: translateY(0);
}

@media (hover: none) {
  .tool-preview { display: none; }
}

.tool-info .tool-name {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 500;
  font-size: 16px;
  margin-bottom: 4px;
}

.tool-info .tool-desc {
  font-size: 13px;
  color: #6B7580;
}

.tool-tags {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tool-tag {
  font-size: 11px;
  color: var(--sky);
  background: var(--sky-soft);
  padding: 3px 9px;
  border-radius: 20px;
}

.tool-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sky-soft);
  color: var(--sky);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.soon {
  padding: 22px 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: #96A0A8;
  font-size: 13px;
}

/* ── 更新履歴 ─────────────────────────────── */
.changelog {
  margin-bottom: 32px;
  padding-top: 4px;
}

.changelog-title {
  font-size: 12px;
  color: #96A0A8;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.changelog-list {
  list-style: none;
}

.changelog-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  font-size: 13px;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
}

.changelog-list li:first-child {
  border-top: none;
}

.changelog-date {
  color: #96A0A8;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.changelog-text {
  color: var(--ink);
}

/* ── カード / ボックス（About・Contactで使う） ──── */
.box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}

.principles {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px 0 48px;
}

.principle {
  display: flex;
  gap: 16px;
  align-items: baseline;
}

.principle .num {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 13px;
  color: var(--sky);
  flex-shrink: 0;
  width: 22px;
}

.principle .text .t {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 4px;
}

.principle .text .d {
  font-size: 13.5px;
  color: var(--sub);
}

/* ── 連絡先カード ─────────────────────────────── */
.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.contact-card:hover,
.contact-card:focus-visible {
  border-color: var(--sky);
  transform: translateY(-1px);
}

.contact-card .c-info .c-label {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 4px;
}

.contact-card .c-info .c-value {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 500;
  font-size: 15.5px;
}

.note {
  font-size: 12.5px;
  color: #96A0A8;
  margin-top: 24px;
}

/* ── フッター ──────────────────────────────────── */
footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  font-size: 13px;
  color: #7C8891;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

footer a:hover {
  color: var(--sky);
}

footer .fnav {
  display: flex;
  gap: 16px;
}

@media (max-width: 480px) {
  .tool-card { padding: 18px; }
  nav.gnav { gap: 18px; }
}

/* ══════════════════ Blog専用コンポーネント ══════════════════ */

.blog-wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }

/* ── ツールバー(検索・書くボタン) ─────────────── */
.blog-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.blog-search {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-family: 'Noto Sans JP', sans-serif;
  background: #fff;
}
.blog-search:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }

.btn-write {
  flex-shrink: 0;
  background: var(--sky);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 20px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-write:hover { opacity: 0.9; }

/* ── タグチップ ───────────────────────────── */
.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag-chip {
  font-size: 12px;
  color: var(--sub);
  background: #fff;
  border: 1px solid var(--line);
  padding: 5px 14px;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
}
.tag-chip:hover { border-color: var(--sky); color: var(--sky); }
.tag-chip.active { background: var(--sky); border-color: var(--sky); color: #fff; }

/* ── 記事カード(一覧) ─────────────────────── */
.post-card {
  display: block;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.post-card:hover { border-color: var(--sky); transform: translateY(-1px); }

.post-card .p-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 16.5px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.post-card .p-excerpt {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.7;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: #96A0A8;
  flex-wrap: wrap;
}

.post-meta .author-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sky-soft);
  object-fit: cover;
  flex-shrink: 0;
}

.post-meta .tag-mini {
  background: var(--sky-soft);
  color: var(--sky);
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
}

.load-more-btn {
  display: block;
  width: 100%;
  padding: 14px;
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--sub);
  font-size: 13px;
  cursor: pointer;
  margin-top: 8px;
}
.load-more-btn:hover { border-color: var(--sky); color: var(--sky); }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #96A0A8;
  font-size: 13.5px;
}

/* ── 記事詳細ページ ───────────────────────── */
.post-header { margin-bottom: 28px; }

.post-header h1 {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.post-author-row img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sky-soft);
  object-fit: cover;
}

.post-author-row .a-name { font-size: 13.5px; font-weight: 500; }
.post-author-row .a-date { font-size: 11.5px; color: #96A0A8; }

.post-body {
  font-size: 15px;
  line-height: 2;
  color: var(--ink);
  margin-bottom: 32px;
}
.post-body h1, .post-body h2, .post-body h3 {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  margin: 32px 0 12px;
  line-height: 1.6;
}
.post-body h1 { font-size: 21px; }
.post-body h2 { font-size: 18.5px; }
.post-body h3 { font-size: 16px; }
.post-body p { margin-bottom: 16px; max-width: none; color: inherit; font-size: inherit; }
.post-body ul, .post-body ol { margin: 0 0 16px 24px; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--sky); text-decoration: underline; }
.post-body blockquote {
  border-left: 3px solid var(--sky-soft);
  padding-left: 16px;
  color: var(--sub);
  margin: 16px 0;
}
.post-body code {
  background: var(--sky-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-body pre {
  background: var(--ink);
  color: #fff;
  padding: 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin-bottom: 16px;
}
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body img { max-width: 100%; border-radius: 10px; margin: 12px 0; }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

/* ── いいね・アクションバー ────────────────── */
.action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
}
.like-btn.liked { background: #FEECEE; border-color: #F4A6B0; color: #E0576B; }
.like-btn:disabled { opacity: 0.6; cursor: default; }

.post-actions-owner {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.owner-btn {
  font-size: 12px;
  color: var(--sub);
  background: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 14px;
  cursor: pointer;
  text-decoration: none;
}
.owner-btn:hover { border-color: var(--sky); color: var(--sky); }
.owner-btn.danger:hover { border-color: #E0576B; color: #E0576B; }

/* ── コメント ─────────────────────────────── */
.comments-section h2 {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 16px;
}

.comment-form { margin-bottom: 24px; }

.comment-form textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 13.5px;
  background: var(--paper);
  resize: vertical;
  margin-bottom: 8px;
}

.comment-item {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px dashed var(--line);
}
.comment-item:first-child { border-top: none; }

.comment-item img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--sky-soft);
  object-fit: cover;
  flex-shrink: 0;
}

.comment-item .c-name { font-size: 12.5px; font-weight: 500; margin-bottom: 2px; }
.comment-item .c-date { font-size: 10.5px; color: #96A0A8; margin-left: 6px; font-weight: 400; }
.comment-item .c-body { font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.comment-item .c-del { font-size: 11px; color: #96A0A8; background: none; border: none; cursor: pointer; margin-top: 4px; }
.comment-item .c-del:hover { color: #E0576B; }

.login-prompt {
  background: var(--sky-soft);
  color: var(--sky);
  font-size: 12.5px;
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
}
.login-prompt a { text-decoration: underline; font-weight: 500; }

/* ── 投稿・編集フォーム ───────────────────── */
.editor-field { margin-bottom: 18px; }
.editor-field label {
  display: block;
  font-size: 12.5px;
  color: var(--sub);
  margin-bottom: 6px;
}
.editor-field input[type="text"],
.editor-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  background: #fff;
}
.editor-field input[type="text"]:focus-visible,
.editor-field textarea:focus-visible { outline: 2px solid var(--sky); outline-offset: 1px; }

#write-body {
  min-height: 400px;
  line-height: 1.9;
  font-size: 14.5px;
  resize: vertical;
}

.editor-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.editor-tab {
  font-size: 12.5px;
  color: var(--sub);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 16px;
  cursor: pointer;
}
.editor-tab.active { background: var(--sky); border-color: var(--sky); color: #fff; }

#write-preview {
  display: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  min-height: 400px;
}

.editor-submit-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.btn-publish {
  background: var(--sky);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 28px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
}
.btn-publish:hover { opacity: 0.9; }
.btn-publish:disabled { opacity: 0.5; cursor: default; }

.btn-draft {
  background: #fff;
  color: var(--sub);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 12px 22px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 13.5px;
  cursor: pointer;
}

.draft-badge {
  display: inline-block;
  background: #FFF3CD;
  color: #8A6D1D;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.my-drafts {
  background: #FFFBF0;
  border: 1px solid #F3E3B8;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.my-drafts-title {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #8A6D1D;
  margin-bottom: 10px;
}

.my-drafts .draft-card {
  background: #fff;
  border: 1px solid #F3E3B8;
  border-radius: 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
}
.my-drafts .draft-card:last-child { margin-bottom: 0; }
.my-drafts .draft-card .post-card {
  flex: 1;
  min-width: 0;
  border: none;
  padding: 8px 8px;
}
.my-drafts .draft-card .post-card:hover { transform: none; }

.draft-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  padding-right: 4px;
}

.draft-edit-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 6px 12px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 12px;
  color: var(--sub);
  white-space: nowrap;
}
.draft-edit-btn:hover { border-color: var(--sky); color: var(--sky); }

.draft-del-btn {
  background: #fff;
  border: 1px solid #F0C9C0;
  border-radius: 16px;
  padding: 6px 12px;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 12px;
  color: #C0503D;
  cursor: pointer;
  white-space: nowrap;
}
.draft-del-btn:hover { background: #FBEAE6; }

.draft-badge-mini {
  display: inline-block;
  background: #FFF3CD;
  color: #8A6D1D;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
}

/* ── 書式ツールバー(Note風、Markdown自動挿入) ────────────── */
.format-toolbar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 6px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.format-toolbar::-webkit-scrollbar { height: 0; }

.format-btn {
  flex-shrink: 0;
  min-width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--ink);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-size: 14px;
  cursor: pointer;
  padding: 0 8px;
}
.format-btn:hover, .format-btn:active { background: var(--sky-soft); color: var(--sky); }
.format-btn.b { font-weight: 700; }
.format-btn.i { font-style: italic; }
.format-btn.s { text-decoration: line-through; }
.format-divider { width: 1px; background: var(--line); margin: 6px 2px; flex-shrink: 0; }
