/* ===== upppp — ソフトペーパーデザイン ===== */

:root {
  --bg: #fdf8f0;
  --bg-card: #fffbf4;
  --bg-accent: #ffeecc;
  --ink: #2a2420;
  --line: #e8ddc9;
  --primary: #e66b3f;
  --primary-soft: #ffd9c4;
  --sub: #3d8d7a;
  --sub-soft: #c4e0d6;
  --yellow: #f5c543;
  --font: "Zen Maru Gothic", sans-serif;
  --font-logo: "Fraunces", "Zen Maru Gothic", serif;
  --max-w: 1180px;
  --radius: 14px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
svg { vertical-align: -0.15em; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

body {
  font-family: var(--font);
  font-weight: 500;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.8;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(230,107,63,0.04) 0, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(61,141,122,0.04) 0, transparent 40%);
}

/* ===== ヘッダー ===== */
.site-header { padding: 24px 0; border-bottom: 1px dashed var(--line); }
.site-header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.site-logo {
  font-family: var(--font-logo); font-weight: 800; font-size: 40px;
  letter-spacing: -0.02em; line-height: 1;
  position: relative; display: inline-block;
}
.site-logo .dot { color: var(--primary); font-style: italic; }
.site-logo::after {
  content: ""; position: absolute; bottom: -6px; left: 0;
  width: 100%; height: 4px; background: var(--yellow);
  border-radius: 2px; opacity: 0.7; transform: skew(-8deg);
}
.header-meta { font-size: 13px; display: flex; align-items: center; gap: 8px; }
.header-meta::before { content: "\273F"; color: var(--primary); font-size: 16px; }

/* ===== レイアウト ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ===== セクションタイトル ===== */
.sec-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 48px 0 24px; gap: 16px;
}
.sec-title:first-child { margin-top: 32px; }
.sec-title h2 {
  font-weight: 800; font-size: 32px;
  display: flex; align-items: center; gap: 12px;
}
.sec-title h2::before {
  content: ""; width: 14px; height: 14px;
  background: var(--primary); border-radius: 50%;
  border: 2px solid var(--ink); display: inline-block;
}
.sec-title .more {
  font-size: 13px; background: var(--bg-card);
  padding: 6px 14px; border-radius: 100px;
  border: 1px solid var(--ink); transition: all .2s;
}
.sec-title .more:hover { background: var(--ink); color: var(--bg); }

/* ===== カテゴリバッジ ===== */
.cat {
  align-self: flex-start; background: var(--primary-soft);
  padding: 3px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 700;
  color: var(--primary); border: 1px solid var(--primary);
  display: inline-block;
}
.cat.green { background: var(--sub-soft); color: var(--sub); border-color: var(--sub); }
.cat.yellow { background: #fff3c4; color: #8c6a00; border-color: #d4a90f; }
.cat.blue { background: #d4e8ff; color: #1a5fa8; border-color: #4a90d9; }
.cat.purple { background: #ece0ff; color: #6b3fa0; border-color: #9b6fd0; }

/* ===== ホーム: カードグリッド ===== */
.home-layout {
  max-width: var(--max-w); margin: 0 auto; padding: 0 24px;
}

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.card h3 { font-weight: 700; font-size: 19px; line-height: 1.4; }
.card .excerpt { font-size: 14px; line-height: 1.75; }
.card .meta {
  font-size: 12px; margin-top: auto; padding-top: 8px;
  border-top: 1px dashed var(--line); display: flex; gap: 10px;
}

/* ===== ホーム: ランキング ===== */
.ranking-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.rank-card {
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 16px;
  transition: transform .2s, box-shadow .2s;
}
.rank-card:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.rank-card .num {
  font-style: italic; font-weight: 800; font-size: 44px;
  line-height: 1; color: var(--primary); margin-bottom: 10px;
}
.rank-card:nth-child(2) .num { color: var(--sub); }
.rank-card:nth-child(3) .num { color: var(--yellow); }
.rank-card h4 { font-size: 14px; line-height: 1.5; }

/* ===== タグクラウド ===== */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.tag-cloud a {
  font-size: 13px; padding: 6px 14px;
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: 100px; transition: all .2s;
}
.tag-cloud a:hover { background: var(--yellow); transform: translateY(-2px); }

/* ===== 広告スロット ===== */
.ad-slot {
  border: 2px dashed var(--ink); border-radius: var(--radius);
  padding: 28px; text-align: center; font-size: 12px;
  letter-spacing: 0.2em; margin: 32px 0;
  background: var(--bg-card); position: relative;
}
.ad-slot::before {
  content: "AD"; position: absolute; top: 10px; left: 14px;
  background: var(--yellow); padding: 2px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em; border: 1px solid var(--ink);
}

/* ===== マーカーリンク ===== */
.marker-link {
  background: linear-gradient(to top, var(--primary-soft) 40%, transparent 40%);
  padding: 0 2px; transition: background .2s;
}
.marker-link:hover { background: var(--primary-soft); }

/* ===== 記事詳細 ===== */
.article-layout {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 48px; padding: 32px 0 64px;
}
.article-layout > * { min-width: 0; }
.breadcrumbs {
  font-size: 12px; margin-bottom: 20px;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.article-head {
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: var(--radius-lg); padding: 36px 40px;
  margin-bottom: 32px; box-shadow: 5px 5px 0 var(--ink);
}
.article-head .cat-badge {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 5px 14px; border-radius: 100px;
  font-weight: 700; font-size: 12px;
  margin-bottom: 16px; border: 2px solid var(--ink);
}
.article-head .cat-badge.green { background: var(--sub); }
.article-head .cat-badge.yellow { background: var(--yellow); color: var(--ink); }
.article-head .cat-badge.blue { background: #4a90d9; }
.article-head .cat-badge.purple { background: #9b6fd0; }
.article-head h1 {
  font-weight: 800; font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.3; letter-spacing: -0.01em; margin-bottom: 24px;
}
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; }
.article-meta .chip {
  background: var(--bg); padding: 4px 12px;
  border-radius: 100px; border: 1px solid var(--ink); font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ===== 記事本文 ===== */
.article-body { font-size: 16px; line-height: 1.95; padding: 0 8px; overflow-wrap: break-word; }
.article-body p { margin-bottom: 1.4em; }
.article-body h2 {
  font-weight: 800; font-size: 26px;
  margin: 2em 0 0.8em; display: flex; align-items: center;
  gap: 12px; line-height: 1.3;
}
.article-body h2::before {
  content: ""; width: 20px; height: 20px;
  background: var(--yellow); border: 2px solid var(--ink);
  border-radius: 6px; flex-shrink: 0; transform: rotate(-6deg);
}
.article-body h3 {
  font-weight: 700; font-size: 19px;
  margin: 1.6em 0 0.6em; padding-left: 12px;
  border-left: 4px solid var(--primary); line-height: 1.4;
}
.article-body h4 {
  font-weight: 700; font-size: 17px;
  margin: 1.4em 0 0.5em; line-height: 1.4;
}
.article-body blockquote {
  background: var(--bg-accent); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 20px 24px;
  margin: 1.5em 0; font-weight: 600; font-size: 18px;
  line-height: 1.7; position: relative;
}
.article-body blockquote::before {
  content: "\201C"; position: absolute; top: -6px; left: 12px;
  font-size: 48px; color: var(--primary); line-height: 1;
}
.article-body blockquote p { margin: 0; padding-left: 28px; }
.article-body a:not(.blogcard__link) {
  color: var(--primary);
  background: linear-gradient(to top, var(--primary-soft) 40%, transparent 40%);
  padding: 0 2px;
}
.article-body a:not(.blogcard__link):hover { background: var(--primary-soft); }
.article-body .wp-block-table { margin: 1.5em 0; overflow-x: auto; }
.article-body .wp-block-table thead { border-bottom: none; }
.article-body .wp-block-table tfoot { border-top: none; }
.article-body .wp-block-table table,
.article-body table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 14px; border: 1px solid #d4c9b5;
  border-radius: var(--radius); overflow: hidden;
}
.article-body .wp-block-table th,
.article-body .wp-block-table td,
.article-body th, .article-body td {
  padding: 10px 14px; text-align: left; border: none;
  border-bottom: 1px solid #d4c9b5; border-right: 1px solid #d4c9b5;
}
.article-body .wp-block-table th:last-child,
.article-body .wp-block-table td:last-child,
.article-body th:last-child, .article-body td:last-child {
  border-right: none;
}
.article-body .wp-block-table tbody tr:last-child td,
.article-body tbody tr:last-child td { border-bottom: none; }
.article-body .wp-block-table th,
.article-body th {
  background: var(--bg-accent); font-weight: 700;
}
.article-body .wp-block-table tr:nth-child(even) td,
.article-body tr:nth-child(even) td { background: var(--bg-card); }
.article-body code {
  background: var(--bg-accent); padding: 2px 8px; border-radius: 6px;
  font-family: "Courier New", monospace; font-size: 14px; border: 1px solid var(--line);
}
.article-body pre {
  position: relative;
  background: var(--ink); color: #e8ddc9; padding: 20px 24px;
  border-radius: var(--radius); margin: 1.5em 0;
  overflow-x: auto; font-size: 14px; line-height: 1.6;
}
.code-copy-btn {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; padding: 0;
  color: #e8ddc9; cursor: pointer; line-height: 0;
  opacity: 0; transition: opacity .2s;
}
.article-body pre:hover .code-copy-btn,
.code-copy-btn:focus { opacity: 1; }
.code-copy-btn.is-copied { color: #e8ddc9; }
.article-body pre code {
  background: none; border: none; padding: 0; color: inherit; font-size: inherit;
}
.article-body figure { margin: 1.8em 0; }
.article-body img {
  max-width: 100%; height: auto; border: 2px solid var(--ink);
  border-radius: var(--radius); display: block;
}
.article-body figcaption { font-size: 12px; margin-top: 10px; text-align: center; }
.article-body ul, .article-body ol {
  margin: 1em 0; padding-left: 1.5em;
}
.article-body li { margin-bottom: 0.4em; }

/* ===== ブログカード ===== */
.blogcard {
  margin: 1.5em 0; border: 2px solid var(--ink);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.blogcard:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.blogcard__link {
  display: flex; align-items: stretch;
  text-decoration: none; color: inherit; background: var(--bg-card);
}
.blogcard__thumb {
  flex-shrink: 0; width: 180px; min-height: 130px; overflow: hidden;
}
.blogcard__thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border: none; border-radius: 0;
}
.blogcard__body {
  flex: 1; padding: 16px 20px; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.blogcard__title {
  font-weight: 700; font-size: 15px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.blogcard__desc {
  margin-top: 8px; font-size: 13px; line-height: 1.6; color: #6b5e52;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.blogcard__meta {
  margin-top: 8px; font-size: 11px; color: var(--sub); font-weight: 700;
}
.tags-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 32px 0; padding: 24px; background: var(--bg-card);
  border: 2px dashed var(--line); border-radius: var(--radius); align-items: center;
}
.tags-row .label { font-size: 12px; font-weight: 700; margin-right: 4px; }

/* ===== サイドバー ===== */
.sidebar { position: sticky; top: 80px; align-self: start; }
.widget {
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: var(--radius-lg); padding: 20px;
  margin-bottom: 20px; box-shadow: 4px 4px 0 var(--ink);
}
.widget h3 {
  font-weight: 800; font-size: 18px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.widget h3::before {
  content: ""; width: 10px; height: 10px;
  background: var(--primary); border: 2px solid var(--ink); border-radius: 50%;
}
.widget.w-sub h3::before { background: var(--sub); }
.widget-list { list-style: none; }
.widget-list li {
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  font-size: 13.5px; line-height: 1.55;
}
.widget-list li:last-child { border-bottom: none; }
.widget-list li a {
  display: flex; gap: 10px; align-items: flex-start;
  transition: color .2s;
}
.widget-list li a:hover { color: var(--primary); }
.widget-list .num {
  font-weight: 800; font-size: 18px; color: var(--primary);
  min-width: 22px; line-height: 1.4; flex-shrink: 0;
}
.widget-list .date { font-size: 10px; display: block; margin-top: 3px; color: var(--sub); }

/* ===== アーカイブ・検索・タグ ===== */
.page-head { padding: 48px 24px; text-align: center; }
.page-head h1 {
  font-weight: 800; font-size: clamp(36px, 6vw, 64px);
  line-height: 1.1; display: inline-block; position: relative;
}
.page-head h1::after {
  content: ""; position: absolute; bottom: -8px; left: 0; right: 0;
  height: 8px; background: var(--yellow); border-radius: 4px; z-index: -1;
}
.page-head p { font-size: 14px; margin-top: 20px; }

.list-v {
  display: flex; flex-direction: column; gap: 16px;
  padding: 24px 0; max-width: 860px; margin: 0 auto;
}
.list-item {
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 20px 24px;
  display: grid; grid-template-columns: 100px 1fr; gap: 20px;
  transition: transform .2s, box-shadow .2s; align-items: center;
}
.list-item:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.list-item .date-block {
  text-align: center; line-height: 1;
  border-right: 2px dashed var(--line); padding-right: 20px;
}
.list-item .date-block .day { font-weight: 800; font-size: 32px; color: var(--primary); }
.list-item .date-block .mon { font-size: 11px; margin-top: 6px; letter-spacing: 0.1em; }
.list-item h3 { font-weight: 700; font-size: 18px; line-height: 1.4; }
.list-item p { font-size: 13px; margin-top: 4px; line-height: 1.6; }

/* ===== ページネーション ===== */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 2px solid var(--ink);
  font-weight: 700; font-size: 14px; border-radius: 10px; transition: all .2s;
}
.pagination a:hover,
.pagination .is-active {
  background: var(--primary); color: #fff;
  transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--ink);
}
.pagination .dots {
  background: transparent; border: none;
  min-width: 30px;
}

/* ===== 検索フォーム ===== */
.search-form-inline {
  display: flex; max-width: 480px; margin: 0 auto 24px;
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: 100px; padding: 4px; overflow: hidden;
}
.search-form-inline input {
  flex: 1; background: transparent; border: none;
  padding: 10px 18px; font-size: 14px; outline: none;
}
.search-form-inline button {
  background: var(--primary); border: none; color: #fff;
  padding: 10px 20px; border-radius: 100px;
  font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background .2s;
}
.search-form-inline button:hover { background: #d45a30; }

/* ===== 404 ===== */
.notfound {
  min-height: 60vh; display: flex; align-items: center;
  justify-content: center; padding: 60px 24px;
}
.nf-card {
  max-width: 520px; text-align: center;
  background: var(--bg-card); border: 2px solid var(--ink);
  border-radius: var(--radius-lg); padding: 48px 32px;
  box-shadow: 6px 6px 0 var(--ink);
}
.nf-num {
  font-weight: 800; font-size: clamp(96px, 18vw, 160px);
  line-height: 1; color: var(--primary); letter-spacing: -0.03em;
  display: inline-block;
}
.nf-num span { color: var(--sub); display: inline-block; transform: rotate(-8deg); }
.nf-card h1 { font-weight: 800; font-size: 26px; margin: 12px 0 10px; }
.nf-card p { font-size: 14px; line-height: 1.8; margin-bottom: 28px; }
.nf-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.nf-links a {
  font-weight: 700; font-size: 13px; padding: 10px 22px;
  background: var(--bg); border: 2px solid var(--ink);
  border-radius: 100px; transition: all .2s;
}
.nf-links a:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--ink); }
.nf-links a.primary { background: var(--primary); color: #fff; }

/* ===== フッター ===== */
.site-footer {
  background: var(--ink); color: #e8ddc9;
  padding: 48px 0 24px; margin-top: 64px; position: relative;
}
.site-footer::before {
  content: ""; display: block; height: 12px;
  background: radial-gradient(circle at 10px 0, var(--bg) 10px, transparent 11px) repeat-x;
  background-size: 20px 12px; position: absolute; top: -1px; left: 0; right: 0;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 16px 24px 0;
  display: grid; grid-template-columns: 2fr 1fr 1.5fr; gap: 40px;
}
.footer-brand .site-logo { color: #fdf8f0; }
.footer-brand .site-logo .dot { color: #ffa57a; }
.footer-brand .site-logo::after { background: #ffa57a; }
.footer-brand p { font-size: 12px; color: #a89b8b; margin-top: 20px; line-height: 1.8; }
.footer-nav h4,
.footer-search h4 { font-weight: 800; font-size: 15px; margin-bottom: 14px; color: #fdf8f0; }
.footer-nav ul { list-style: none; }
.footer-nav li { padding: 5px 0; }
.footer-nav a { color: #d9cfbf; font-size: 14px; transition: color .2s; }
.footer-nav a:hover { color: #ffa57a; }
.footer-search form {
  display: flex; background: #3a3329;
  border-radius: 100px; padding: 4px; border: 2px solid #5a4f45;
}
.footer-search input {
  flex: 1; background: transparent; border: none;
  color: #fdf8f0; padding: 8px 14px; font-size: 13px; outline: none;
}
.footer-search input::placeholder { color: #8c7f6f; }
.footer-search button {
  background: var(--primary); border: none; color: #fff;
  padding: 8px 16px; border-radius: 100px;
  font-weight: 700; font-size: 12px; cursor: pointer;
}
.footer-bottom {
  max-width: var(--max-w); margin: 32px auto 0; padding: 20px 24px 0;
  border-top: 1px dashed #5a4f45;
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; font-size: 11px; color: #a89b8b;
}

/* ===== レスポンシブ ===== */
@media (max-width: 900px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .ranking-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; gap: 32px; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; }
  .ranking-grid { grid-template-columns: repeat(2, 1fr); }
  .article-head { padding: 24px 20px; box-shadow: 3px 3px 0 var(--ink); }
  .list-item { grid-template-columns: 70px 1fr; gap: 14px; padding: 16px; }
  .list-item .date-block .day { font-size: 24px; }
  .sec-title h2 { font-size: 24px; }
  .blogcard__link { flex-direction: column; }
  .blogcard__thumb { width: 100%; height: 160px; min-height: auto; }
  .blogcard__body { padding: 12px 16px; }
}
