/* ============================================================
   さんじょるの スタイルシート
   配色：D案「ミント×ベージュ」
     背景 #FAF4E8 / メイン #5FA88E / 文字 #4A3F35 /
     アクセント #D97B54 / カード背景 #FFFFFF
   スマホ優先のレスポンシブ
   ============================================================ */

:root {
  --bg: #FAF4E8;
  --main: #5FA88E;
  --main-dark: #4C8A73;
  --text: #4A3F35;
  --text-light: #8A7B6C;
  --accent: #D97B54;
  --card: #FFFFFF;
  --border: #E7DCC8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--main-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--main);
  position: relative;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text);
  line-height: 1.2;
}
.site-logo:hover { text-decoration: none; }
.site-logo img { max-height: 72px; width: auto; }

.nav-toggle {
  background: var(--main);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  flex-shrink: 0;
}
.site-nav {
  display: none;
  flex-direction: column;
  background: var(--card);
  border-top: 1px solid var(--border);
}
.site-nav.open { display: flex; }
.site-nav a {
  padding: 12px 20px;
  color: var(--text);
  font-weight: bold;
  border-bottom: 1px solid var(--border);
}
.site-nav a:last-child { border-bottom: none; }
.site-nav a:hover { background: var(--bg); text-decoration: none; }

@media (min-width: 720px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 8px;
    border-top: none;
    padding-bottom: 8px;
  }
  .site-nav a { border-bottom: none; border-radius: 20px; padding: 6px 16px; }
}

/* ---------- 見出し ---------- */
.section-title {
  font-size: 1.25rem;
  border-left: 6px solid var(--main);
  padding-left: 10px;
  margin: 28px 0 14px;
}
.more-link { text-align: right; }

/* ---------- 記事カード ---------- */
.card-list { display: flex; flex-direction: column; gap: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  gap: 14px;
}
.card-thumb { flex-shrink: 0; }
.card-thumb img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
}
.card-body { min-width: 0; }
/* 固定記事のバッジ（TOPページの固定記事カードに表示） */
.pinned-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 1px 10px;
  font-size: 0.78rem;
  font-weight: bold;
  margin-bottom: 4px;
}
/* イベントカード：リンク先設定時はカード全体がリンク（別タブ）になる */
.card--event { position: relative; }
.card--event:hover { border-color: var(--main); }
.event-card-link { position: absolute; inset: 0; border-radius: 12px; }
.card--event .card-related { position: relative; z-index: 1; }
.card-date { font-size: 0.8rem; color: var(--text-light); }
.card-title { margin: 2px 0 6px; font-size: 1.05rem; line-height: 1.4; }
.card-title a { color: var(--text); }
.card-excerpt {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (min-width: 720px) {
  .card-thumb img { width: 140px; height: 140px; }
}

/* ---------- タグ ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  background: var(--bg);
  border: 1px solid var(--main);
  color: var(--main-dark);
  border-radius: 20px;
  padding: 1px 10px;
  font-size: 0.78rem;
}
.tag:hover { background: var(--main); color: #fff; text-decoration: none; }

/* ---------- イラストタイル ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 720px) {
  .tile-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
}
.tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.tile:hover img { opacity: 0.85; }

/* ---------- ページャ ---------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
}
.pager a, .pager-current, .pager-ellipsis {
  padding: 4px 11px;
  border-radius: 8px;
  font-size: 0.9rem;
}
.pager a { background: var(--card); border: 1px solid var(--border); color: var(--text); }
.pager a:hover { border-color: var(--main); text-decoration: none; }
.pager-current { background: var(--main); color: #fff; font-weight: bold; }
.pager-btn { font-weight: bold; }

/* ---------- 記事詳細 ---------- */
.article-title { font-size: 1.6rem; line-height: 1.4; margin: 10px 0 4px; }
.article-date { color: var(--text-light); font-size: 0.85rem; margin-bottom: 8px; }
.article-body { margin-top: 18px; }
.article-body h2 {
  font-size: 1.3rem;
  border-left: 6px solid var(--main);
  padding-left: 10px;
  margin: 26px 0 10px;
}
.article-body h3 { font-size: 1.12rem; margin: 22px 0 8px; }
.article-body p { margin: 0 0 1em; }
.article-body blockquote {
  margin: 0 0 1em;
  padding: 8px 14px;
  border-left: 4px solid var(--border);
  color: var(--text-light);
  background: var(--card);
}
.article-body pre {
  background: #3B332B;
  color: #F5EFE3;
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
}
.article-body code {
  background: #EFE7D3;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 0.88em;
}
.article-body pre code { background: transparent; padding: 0; }
.article-body ul, .article-body ol { margin: 0 0 1em; padding-left: 1.4em; }
.article-body li.task-item { list-style: none; }
.article-body table { border-collapse: collapse; margin: 0 0 1em; max-width: 100%; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 6px 10px; }
.article-body th { background: var(--card); }
.article-body img { border-radius: 8px; margin: 8px auto; }
.illust-embed { margin: 12px 0; text-align: center; }
.illust-embed img { border-radius: 8px; }

/* ---------- コピー枠（```copy）・囲み枠（```box） ---------- */
.copy-box, .text-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 0 0 1em;
}
.copy-box { overflow: hidden; }
.copy-box-head {
  display: flex;
  justify-content: flex-end;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
}
.copy-btn {
  background: var(--main);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 4px 16px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
}
.copy-btn:hover { background: var(--main-dark); }
.copy-btn.copied { background: var(--accent); }
.copy-text {
  padding: 12px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.text-box { padding: 12px 16px; }
.text-box > *:first-child { margin-top: 0; }
.text-box > *:last-child { margin-bottom: 0; }
/* 枠の説明文（キャプション）：```copy 説明文 / ```box 説明文 */
.box-caption { font-weight: bold; }
.copy-box-head .box-caption {
  margin-right: auto;
  align-self: center;
  padding: 2px 6px;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.text-box .box-caption {
  border-left: 4px solid var(--main);
  padding-left: 8px;
  margin-bottom: 8px;
}

/* ---------- イラスト詳細 ---------- */
.illust-pixiv { margin-bottom: 8px; }
.illust-full img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.illust-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}
.pixiv-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: bold;
  border-radius: 20px;
  padding: 4px 16px;
}
.pixiv-link:hover { opacity: 0.88; text-decoration: none; }
.illust-desc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
}
.wip-completed-note {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 8px;
}

/* ---------- プロフィール ---------- */
.profile-icon {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  margin: 0 auto 16px;
}

/* ---------- コメント ---------- */
.comment-list { list-style: none; margin: 0 0 18px; padding: 0; }
.comment {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.comment-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.comment-name { font-weight: bold; }
.comment-date { font-size: 0.78rem; color: var(--text-light); }
.comment-body { margin-top: 4px; }

.comment-form, .search-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comment-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; font-weight: bold; }
.comment-form input[type="text"], .comment-form textarea,
.search-form input[type="text"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: var(--text);
  width: 100%;
}
.comment-form button, .search-form button {
  background: var(--main);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 20px;
  font: inherit;
  font-weight: bold;
  cursor: pointer;
  align-self: flex-start;
}
.comment-form button:hover, .search-form button:hover { background: var(--main-dark); }
.form-error {
  background: #FBE9E2;
  border: 1px solid var(--accent);
  color: #9A4526;
  border-radius: 8px;
  padding: 8px 12px;
}
/* ハニーポット（人間には見えない位置に配置） */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- いいね（記事詳細・本文の下） ---------- */
.like-box { margin: 22px 0 6px; }
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 999px;
  padding: 8px 20px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.like-btn:hover { border-color: var(--accent); }
.like-btn:disabled { opacity: 0.6; cursor: default; }
.like-btn .like-heart { color: #CDBFA5; font-size: 1.2rem; line-height: 1; }
.like-btn.liked { border-color: var(--accent); background: #FBEFE7; }
.like-btn.liked .like-heart { color: var(--accent); }
.like-btn .like-count { font-weight: bold; }

/* ---------- Xでポスト（詳細ページの共有ボタン） ---------- */
.article-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 22px 0 6px;
}
.article-actions .like-form { margin: 0; }
.share-box { margin: 10px 0 6px; }
.share-btn {
  display: inline-block;
  background: #000;
  color: #fff;
  border-radius: 999px;
  padding: 8px 20px;
  font-weight: bold;
  font-size: 0.9rem;
}
.share-btn:hover { opacity: 0.8; text-decoration: none; }

/* ---------- 検索 ---------- */
.search-modes { display: flex; gap: 18px; font-weight: bold; }
.search-box { display: flex; gap: 8px; }
.search-box input[type="text"] { flex: 1; }

/* ---------- 前後ナビ（記事・イラスト詳細の最下段） ---------- */
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}
.prev-next-link, .prev-next-thumb {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  max-width: 48%;
}
.prev-next-link:hover, .prev-next-thumb:hover { border-color: var(--main); text-decoration: none; }
.prev-next-link { display: flex; flex-direction: column; gap: 2px; }
.prev-next-next { margin-left: auto; text-align: right; }
.prev-next-link.prev-next-next { align-items: flex-end; }
.prev-next-label { font-size: 0.8rem; color: var(--text-light); font-weight: bold; white-space: nowrap; }
.prev-next-title { font-size: 0.95rem; overflow-wrap: anywhere; }
.prev-next-thumb { display: flex; align-items: center; gap: 10px; }
.prev-next-thumb img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

/* ---------- プロフィール / フッター ---------- */
.profile-body {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 18px;
}
.site-footer {
  text-align: center;
  color: var(--text-light);
  font-size: 0.85rem;
  padding: 26px 16px 34px;
}
