/*
  デザイン方針「和モダン」
  浮世絵・名画が主役のサイトなので、藍色と生成りでまとめている。
  見出しは明朝体、角は立てて、影は使わない。
*/
:root {
  --bg: #f4f1ea;          /* 生成り */
  --bg-card: #fffefb;
  --text: #1f1c19;
  --text-light: #6b6459;
  --accent: #1b3b5f;      /* 藍色 */
  --accent-dark: #12283f;
  --accent-soft: #e4e9ef;
  --gold: #9c7c4a;
  --gold-soft: #efe6d4;
  --border: #ddd6c6;
  --shadow: none;         /* 影は使わず、罫線で仕切る */
  --radius: 2px;          /* 角を立てて、きりっとさせる */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  /* 日本語の単語(特にカタカナ)が途中で改行されないようにする */
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 見出しは明朝体。作品名と馴染み、図案集らしい落ち着いた印象になる */
h1, h2, h3, .site-title {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
  font-weight: 600;
  letter-spacing: 0.04em;
}

h1, h2, h3 {
  text-wrap: balance;
}

.nowrap {
  white-space: nowrap;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header.site-header {
  background: var(--bg-card);
  border-bottom: 2px solid var(--accent);
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.35rem;
  color: var(--accent-dark);
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-tagline {
  font-size: 0.85rem;
  color: var(--text-light);
}

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.hero {
  text-align: center;
  padding: 30px 10px 46px;
}

.hero h1 {
  font-size: 2.05rem;
  line-height: 1.6;
  margin: 0 0 14px;
  text-wrap: wrap;
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }
}

.hero p {
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  font-size: 0.95rem;
}

.pillar-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.pillar-badge {
  background: transparent;
  color: var(--text-light);
  border-radius: 2px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pillar-badge:hover {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-dark);
}

.pillar-badge.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.no-results {
  text-align: center;
  color: var(--text-light);
  padding: 40px 0;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 22px;
}

.item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

/* マウスを乗せたら罫線が藍色になる(浮き上がらせず、静かに反応させる) */
.item-card:hover {
  border-color: var(--accent);
}

.item-card a.card-link {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.item-thumb {
  background: var(--accent-soft);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 10px;
}

.item-thumb img {
  width: 100%;
  height: 100%;
  /* 縦長の絵(大はしあたけの夕立・ひまわり・ピーターラビットなど)も
     耳や足など端が切れないよう、はみ出さず全体を表示する */
  object-fit: contain;
  display: block;
}

.item-body {
  padding: 16px 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.item-body .artist {
  font-size: 0.8rem;
  color: var(--text-light);
}

.item-meta {
  font-size: 0.78rem;
  color: var(--text-light);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 2px;
  padding: 2px 10px;
  font-size: 0.75rem;
}

.badge.free {
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 700;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.item-detail-head {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  margin-bottom: 36px;
}

@media (max-width: 640px) {
  .item-detail-head {
    grid-template-columns: 1fr;
  }
}

.item-detail-thumb {
  background: var(--accent-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.item-detail-thumb img {
  width: 100%;
  display: block;
}

.item-detail-info h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
}

.item-detail-info .artist {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.item-detail-info p.lead {
  color: var(--text-light);
  margin: 0 0 16px;
}

section.block {
  margin-bottom: 34px;
}

section.block h2 {
  font-size: 1.15rem;
  border-left: 5px solid var(--accent);
  padding-left: 10px;
  margin-bottom: 14px;
}

table.spec {
  border-collapse: collapse;
  width: 100%;
  max-width: 640px;
  font-size: 0.92rem;
}

table.spec th, table.spec td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

table.spec th {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.download-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.download-list li {
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-card);
}

.download-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: var(--text);
  font-weight: 600;
}

.download-list a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.download-list .dl-icon {
  color: var(--accent-dark);
  font-size: 1.1rem;
}

.download-list .dl-sub {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-light);
}

ol.steps, ul.notes-list {
  padding-left: 1.4em;
}

ol.steps li, ul.notes-list li {
  margin-bottom: 8px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 780px) {
  .tier-grid { grid-template-columns: 1fr; }
}

.tier-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.tier-card-img {
  background: var(--accent-soft);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.tier-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.tier-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.tier-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-dark);
}

.tier-desc {
  font-size: 0.76rem;
  color: var(--text-light);
}

table.tier-stats {
  border-collapse: collapse;
  font-size: 0.8rem;
  width: 100%;
}

table.tier-stats th, table.tier-stats td {
  padding: 4px 0;
  text-align: left;
  vertical-align: top;
}

table.tier-stats th {
  color: var(--text-light);
  font-weight: 500;
  width: 5.5em;
  white-space: nowrap;
}

.download-gate {
  margin-top: auto;
}

.ad-slot {
  border: 1px dashed var(--border);
  border-radius: 2px;
  padding: 14px 10px;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-light);
  background: var(--bg);
  margin-bottom: 6px;
}

.gate-countdown {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.tier-download {
  display: block;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 2px;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: auto;
}

.tier-download:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

.share-block {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--accent-soft);
  border-radius: 2px;
}

.share-links {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.share-btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 2px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.share-btn:hover {
  text-decoration: none;
  opacity: 0.9;
}

.share-btn.x { background: #14171a; }
.share-btn.line { background: #06c755; }

.share-callout {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text);
}

.related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.related-list a {
  display: block;
  color: inherit;
}

.related-list a:hover {
  text-decoration: none;
}

.related-list img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--accent-soft);
  border-radius: 2px;
  border: 1px solid var(--border);
  padding: 8px;
  display: block;
}

.related-list span {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.thread-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  /* 色見本 + 糸番号 + 「Amazon」「楽天」ボタン2つが収まる幅を確保する。
     これより狭いと「楽天」ボタンが枠からはみ出してしまう。 */
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
}

.thread-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 8px 10px;
  background: var(--bg-card);
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.thread-info {
  flex: 1 1 100px;
  /* min-width の初期値(auto)のままだと文字数ぶんの幅を要求してしまい、
     ボタンを押し出してはみ出す原因になるので 0 にしておく */
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.thread-info .code {
  font-weight: 700;
}

.thread-buy {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.thread-buy a {
  font-size: 0.72rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px 9px;
  color: var(--accent-dark);
  white-space: nowrap;
}

.thread-buy a:hover {
  background: var(--accent-soft);
  text-decoration: none;
}

.source-note {
  background: var(--accent-soft);
  border-radius: 2px;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text);
}

footer.site-footer {
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--text-light);
  font-size: 0.82rem;
}

footer.site-footer a {
  color: var(--text-light);
  text-decoration: underline;
}

/* 広告であることの表示(ステマ規制対応)。目立たせすぎず、確実に読める大きさにする */
.footer-ad-notice {
  margin: 14px auto 0;
  max-width: 620px;
  font-size: 0.78rem;
  opacity: 0.9;
}

.footer-links {
  margin: 10px 0 0;
  font-size: 0.8rem;
}
