/* =====================================================
   Wisteria Ink — custom.css
   藤色と墨のエディトリアルデザイン
   ===================================================== */

/* ── CSS変数 ──────────────────────────────────────── */
:root {
  --c-accent:       #9075c2;
  --c-accent-deep:  #6b4fa0;
  --c-accent-light: #d4c8e8;
  --c-accent-pale:  #f3eeff;
  --c-bg:           #faf6f0;
  --c-text:         #3d3535;
  --c-muted:        #7a6e6e;
  --c-surface:      #ffffff;
  --c-border:       #e6ddf2;

  --f-round:  'M PLUS Rounded 1c', sans-serif;
  --f-mincho: 'M PLUS Rounded 1c', sans-serif;
  --f-mono:   'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;

  --shadow-sm:  0 2px 10px rgba(107, 79, 160, 0.10);
  --shadow-md:  0 6px 22px rgba(107, 79, 160, 0.18);
  --t-fast: 0.18s ease;
  --t-base: 0.28s ease;
  --radius: 8px;
}

/* ── ページ読み込みアニメーション ─────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.container--outer {
  animation: fadeInUp 0.45s ease both;
}

/* ── ベース ───────────────────────────────────────── */
body {
  font-family: var(--f-round);
  background-color: var(--c-bg);
  color: var(--c-text);
  /* 極薄の格子テクスチャで紙感を演出 */
  background-image:
    linear-gradient(rgba(144, 117, 194, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(144, 117, 194, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── 見出し（明朝体で格調） ──────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-mincho);
  color: var(--c-text);
}

/* ── リンク ──────────────────────────────────────── */
a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--t-fast);
}

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

/* 本文リンクはスライドアンダーライン */
.content a {
  color: var(--c-accent);
  font-weight: 700;
  position: relative;
}

.content a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--c-accent-deep);
  transition: width var(--t-base);
}

.content a:hover {
  color: var(--c-accent-deep);
  text-decoration: none;
}

.content a:hover::after {
  width: 100%;
}

/* ── ヘッダー ────────────────────────────────────── */
.header {
  background: linear-gradient(150deg, #f5efff 0%, #ede2ff 45%, #faf6f0 100%);
  border-bottom: none;
  position: relative;
}

/* グラデーションの装飾ライン */
.header::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--c-accent-light) 15%,
    var(--c-accent) 50%,
    var(--c-accent-light) 85%,
    transparent 100%
  );
}

/* ── ロゴ ────────────────────────────────────────── */
.logo a,
.logo__link {
  color: var(--c-accent-deep);
  text-decoration: none;
}

.logo__title {
  font-family: var(--f-mincho);
  font-size: 1.9rem;
  font-weight: 800;
  text-transform: none;
  color: var(--c-accent-deep);
  letter-spacing: 0.04em;
  line-height: 1;
  order: 2;
}

.logo__text {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 10px;
}

.logo__tagline {
  font-family: var(--f-mono);
  font-size: 1.1rem;
  color: var(--c-muted);
  opacity: 0.75;
  margin: 0;
  padding: 0;
  border: none;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-decoration: line-through;
  text-decoration-color: var(--c-accent);
  order: 1;
}

.logo__tagline::before {
  content: '~~';
  text-decoration: none;
  display: inline;
}

.logo__tagline::after {
  content: '~~';
  text-decoration: none;
  display: inline;
}

/* ── メニューのアクセントライン ──────────────────── */
@media screen and (min-width: 767px) {
  .menu {
    border-bottom-color: var(--c-accent);
    border-bottom-width: 3px;
  }
}

/* ── コンテナ ────────────────────────────────────── */
.container--outer {
  box-shadow: 0 0 48px rgba(107, 79, 160, 0.12);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── 記事カード ──────────────────────────────────── */
.list__item {
  padding: 18px 20px 18px 22px;
  margin-bottom: 14px;
  border-bottom: none;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid transparent;
  transition: transform var(--t-base), box-shadow var(--t-base), border-left-color var(--t-base);
  position: relative;
}

.list__item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--c-accent);
}

/* カードのフェードイン（stagger） */
.list__item:nth-child(1) { animation: fadeInUp 0.4s 0.06s both; }
.list__item:nth-child(2) { animation: fadeInUp 0.4s 0.13s both; }
.list__item:nth-child(3) { animation: fadeInUp 0.4s 0.20s both; }
.list__item:nth-child(4) { animation: fadeInUp 0.4s 0.27s both; }
.list__item:nth-child(5) { animation: fadeInUp 0.4s 0.34s both; }
.list__item:nth-child(n+6) { animation: fadeInUp 0.4s 0.40s both; }

/* ── 記事タイトル ────────────────────────────────── */
.list__title {
  font-family: var(--f-mincho);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.55;
}

.list__title a {
  color: var(--c-text);
  font-weight: inherit;
}

.list__title a:hover {
  color: var(--c-accent-deep);
}

.list__title a::after {
  display: none;
}

/* ── 「続きを読む」ボタン（インク塗りアニメ） ────── */
.btn,
.list__footer-readmore {
  display: inline-block;
  padding: 5px 18px;
  font-size: 0.78rem;
  font-family: var(--f-round);
  font-weight: 700;
  color: var(--c-accent);
  background: transparent;
  border: 1.5px solid var(--c-accent);
  border-radius: 20px;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  transition: color var(--t-fast);
  z-index: 0;
}

.btn::before,
.list__footer-readmore::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-base);
  z-index: -1;
}

.btn:hover,
.list__footer-readmore:hover {
  color: #fff;
  background: transparent;
}

.btn:hover::before,
.list__footer-readmore:hover::before {
  transform: scaleX(1);
}

/* ── メタ情報 ────────────────────────────────────── */
.meta,
.meta a {
  color: var(--c-muted);
  font-size: 0.775rem;
}

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

/* ── サイドバー ──────────────────────────────────── */
.sidebar {
  background: var(--c-surface);
  border-left: 2px solid var(--c-border);
  padding-left: 20px;
}

.widget {
  margin-bottom: 28px;
}

.widget__title {
  font-family: var(--f-mincho);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-accent-deep);
  border-bottom: 2px solid var(--c-accent);
  padding-bottom: 6px;
}

.widget__item {
  font-size: 0.865rem;
  border-bottom: 1px dashed var(--c-border);
  padding: 6px 0;
  color: var(--c-text);
  transition: color var(--t-fast), padding-left var(--t-fast);
}

.widget__item:hover {
  color: var(--c-accent);
  padding-left: 4px;
}

/* タグウィジェット（ピル） */
.widget-taglist__link {
  display: inline-block;
  margin: 0 4px 6px 0;
  padding: 3px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--c-accent);
  background: var(--c-accent-pale);
  border: 1px solid var(--c-accent-light);
  border-radius: 20px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.widget-taglist__link:hover {
  color: #fff;
  background: var(--c-accent);
  border-color: var(--c-accent);
}

/* ── 投稿タグ ────────────────────────────────────── */
.tags {
  display: flex;
  align-items: center;
}

.tags__badge {
  float: none;
  flex-shrink: 0;
}

.tags__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tags__item {
  float: none;
  margin: 0;
}

.tags__item {
  background: var(--c-accent-pale);
  border: 1px solid var(--c-accent-light);
  border-radius: 20px;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.tags__item:hover {
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.tags__link,
.tags__link:hover {
  display: block;
  padding: 3px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  border-radius: 20px;
}

.tags__link {
  color: var(--c-accent);
}

.tags__link:hover {
  color: var(--c-accent);
}

.tags__item:hover .tags__link {
  color: #fff;
}

/* ── コードブロック ──────────────────────────────── */
pre,
code,
kbd,
samp {
  font-family: var(--f-mono);
}

/* インラインコード */
code {
  padding: 2px 7px;
  background: var(--c-accent-pale);
  border: 1px solid var(--c-accent-light);
  border-radius: 4px;
  color: var(--c-accent-deep);
  font-size: 0.875em;
}

/* コードブロック */
pre {
  background: #1e1830;
  border: none;
  border-radius: var(--radius);
  color: #e8e0f8;
  box-shadow: var(--shadow-sm);
  position: relative;
  padding-top: 1.5rem;
}

pre::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-accent-light), var(--c-accent));
  border-radius: var(--radius) var(--radius) 0 0;
}

pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* ── 引用ブロック ────────────────────────────────── */
blockquote {
  border-left: 4px solid var(--c-accent);
  background: var(--c-accent-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  color: var(--c-muted);
  font-style: italic;
  margin: 0 0 1.25rem;
}

/* ── 記事詳細ページ ──────────────────────────────── */
.post__title {
  font-family: var(--f-mincho);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.content h2 {
  margin-top: 2rem;
  padding-bottom: 8px;
  position: relative;
}

.content h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 2px;
  background: var(--c-accent);
  border-radius: 1px;
}

/* ── 目次 ────────────────────────────────────────── */
.toc {
  background: var(--c-accent-pale);
  border: 1px solid var(--c-accent-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.toc__title {
  background: var(--c-accent);
  color: #fff;
  letter-spacing: 0.1em;
}

.toc__menu a {
  color: var(--c-accent-deep);
  border-bottom-color: var(--c-border);
  transition: padding-left var(--t-fast), color var(--t-fast);
}

.toc__menu a:hover {
  color: var(--c-accent);
  padding-left: 16px;
  text-decoration: none;
}

/* ── ページネーション ────────────────────────────── */
.pagination__item {
  border-radius: 4px;
  transition: background var(--t-fast), color var(--t-fast);
  background: var(--c-surface);
  color: var(--c-text);
}

.pagination__item:hover,
.pagination__item--current {
  background: var(--c-accent);
  color: #fff;
}

/* ── フッター ────────────────────────────────────── */
.footer {
  background: var(--c-accent-deep) !important;
  color: #e8deff !important;
  border-top: 3px solid var(--c-accent) !important;
  font-family: var(--f-round);
}

.footer a {
  color: var(--c-accent-light) !important;
}

.footer a:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* ── ディバイダー ────────────────────────────────── */
.divider {
  height: 3px !important;
  background: linear-gradient(90deg, transparent, var(--c-accent), transparent) !important;
  border: none !important;
}

/* ── テーブル ────────────────────────────────────── */
table {
  border-top-color: var(--c-border);
  border-left-color: var(--c-border);
  overflow: hidden;
}

th {
  background: var(--c-accent-pale);
  color: var(--c-accent-deep);
}

td, th {
  border-right-color: var(--c-border);
  border-bottom-color: var(--c-border);
}

/* ── スクロールバー (WebKit) ──────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-accent-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-accent); }
