/* ===========================
   日本語ガジェットブログ CSS
   =========================== */

/* フォント */
body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans",
    "BIZ UDPGothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  color: #333;
  background: #f9f9f9;
  margin: 0;
  padding: 0;
}

/* コンテナ */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ヘッダー */
.site-header {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

.site-title {
  color: #fff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 700;
}

.site-nav a {
  color: #ccc;
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: #7ec8e3;
}

/* メインコンテンツ */
main.container {
  padding-top: 40px;
  padding-bottom: 60px;
}

/* 記事一覧 */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list-item {
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.post-list-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.post-list-item h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.post-list-item h2 a {
  color: #1a1a2e;
  text-decoration: none;
}

.post-list-item h2 a:hover {
  color: #0066cc;
}

.post-excerpt {
  color: #666;
  font-size: 0.9rem;
  margin: 8px 0 0;
}

/* 記事メタ情報 */
.post-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 16px;
}

.post-meta time { margin-right: 12px; }

.post-category a {
  background: #e8f4fd;
  color: #0066cc;
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.8rem;
}

/* 記事本文 */
.post-title {
  font-size: 1.8rem;
  line-height: 1.4;
  margin-bottom: 12px;
  color: #1a1a2e;
}

.post-content h2 {
  font-size: 1.3rem;
  border-left: 4px solid #0066cc;
  padding-left: 12px;
  margin-top: 2em;
}

.post-content h3 {
  font-size: 1.1rem;
  margin-top: 1.5em;
}

.post-content a {
  color: #0066cc;
}

.post-content img {
  max-width: 100%;
  border-radius: 4px;
}

.post-content code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.post-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
}

/* タグ */
.tag {
  display: inline-block;
  background: #f0f0f0;
  color: #555;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  text-decoration: none;
  margin: 3px;
  transition: background 0.2s;
}

.tag:hover {
  background: #ddd;
}

/* フッター */
.site-footer {
  background: #1a1a2e;
  color: #aaa;
  padding: 30px 0;
  margin-top: 60px;
  text-align: center;
  font-size: 0.85rem;
}

.site-footer p { margin: 0 0 10px; }

.footer-nav a {
  color: #aaa;
  text-decoration: none;
  margin: 0 12px;
}

.footer-nav a:hover { color: #fff; }

/* アイキャッチ画像 */
.post-thumbnail {
  margin: 0 0 24px;
  border-radius: 8px;
  overflow: hidden;
  max-height: 400px;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 一覧カードのサムネイル */
.post-list-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.post-list-item .card-thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  background: #eee;
}

.post-list-item .card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-list-item .card-body {
  flex: 1;
  min-width: 0;
}

/* SNSシェアボタン */
.share-buttons {
  margin: 40px 0 20px;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 8px;
  text-align: center;
}

.share-label {
  margin: 0 0 12px;
  font-size: 0.9rem;
  color: #666;
  font-weight: 600;
}

.share-btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 4px;
  transition: opacity 0.2s;
}

.share-btn:hover { opacity: 0.85; }

.share-x {
  background: #000;
  color: #fff;
}

.share-threads {
  background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
  color: #fff;
}

.share-line {
  background: #06c755;
  color: #fff;
}

/* 前後ナビゲーション */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0;
}

.nav-prev, .nav-next {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: #333;
  transition: box-shadow 0.2s;
  display: block;
}

.nav-prev:hover, .nav-next:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.nav-next { text-align: right; }

.nav-label {
  display: block;
  font-size: 0.75rem;
  color: #0066cc;
  margin-bottom: 4px;
}

.nav-title {
  font-size: 0.85rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 関連記事 */
.related-posts {
  margin: 40px 0;
}

.related-posts h2 {
  font-size: 1.1rem;
  border-left: 4px solid #0066cc;
  padding-left: 12px;
  margin-bottom: 16px;
}

.related-posts ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.related-posts li {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
}

.related-posts li:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.related-posts li img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.related-posts li a {
  display: block;
  padding: 10px;
  color: #1a1a2e;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.related-posts li time {
  display: block;
  padding: 0 10px 8px;
  font-size: 0.75rem;
  color: #888;
}

/* お問い合わせフォーム */
.contact-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

.submit-btn {
  display: inline-block;
  padding: 12px 32px;
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.submit-btn:hover {
  background: #0052a3;
}

.form-note {
  margin-top: 16px;
  font-size: 0.85rem;
  color: #888;
}

/* 記事本文内の画像を見やすく */
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5em 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: block;
}

.post-content figure {
  margin: 1.5em 0;
  text-align: center;
}

.post-content figcaption {
  font-size: 0.8rem;
  color: #888;
  margin-top: 6px;
}

/* 広告枠 */
.ad-unit {
  margin: 24px 0;
  text-align: center;
}

/* トップページ セクション */
.top-section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.2rem;
  border-left: 4px solid #0066cc;
  padding-left: 12px;
  margin: 0 0 16px;
}

.section-header .section-title {
  margin-bottom: 0;
}

.section-more {
  font-size: 0.85rem;
  color: #0066cc;
  text-decoration: none;
  white-space: nowrap;
}

.section-more:hover {
  text-decoration: underline;
}

/* カテゴリ別カードグリッド */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card-compact {
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card-compact:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.card-compact-thumb {
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: #eee;
}

.card-compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-compact-body {
  padding: 10px 12px;
}

.card-compact-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-compact-body time {
  font-size: 0.75rem;
  color: #888;
}

/* 目次 (ToC) */
.toc {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 32px;
}

.toc-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 10px;
  color: #333;
}

.toc-list {
  margin: 0;
  padding-left: 20px;
}

.toc-list li {
  margin: 6px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.toc-list a {
  color: #0066cc;
  text-decoration: none;
}

.toc-list a:hover {
  text-decoration: underline;
}

/* 検索 */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.site-search form {
  display: flex;
  align-items: center;
}

.search-input {
  width: 140px;
  padding: 5px 10px;
  border: 1px solid #555;
  border-radius: 4px 0 0 4px;
  background: #2a2a4e;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: width 0.3s;
}

.search-input:focus {
  width: 200px;
  border-color: #7ec8e3;
}

.search-input::placeholder {
  color: #999;
}

.search-btn {
  padding: 5px 10px;
  border: 1px solid #555;
  border-left: none;
  border-radius: 0 4px 4px 0;
  background: #3a3a5e;
  color: #fff;
  cursor: pointer;
  font-size: 0.85rem;
}

.search-btn:hover {
  background: #4a4a6e;
}

/* メリット/デメリット ボックス */
.post-content strong:first-child {
  display: inline;
}

/* 良い点: ボックス */
.post-content ul:has(> li:first-child) {
  list-style: none;
  padding-left: 0;
}

/* 著者情報 */
.post-author {
  font-size: 0.85rem;
  color: #888;
}

.post-author::before {
  content: "| ";
}

/* 商品リンクボックス */
.product-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 24px;
}

/* カテゴリCTA */
.category-cta {
  margin: 24px 0;
  padding: 16px 20px;
  background: #f0f7ff;
  border-radius: 8px;
  border-left: 4px solid #0066cc;
}

.category-cta a {
  color: #0066cc;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: block;
  margin: 4px 0;
}

.category-cta a:hover {
  text-decoration: underline;
}

/* 購入リンクボタン (記事内) */
.post-content a[href*="amazon.co.jp"],
.post-content a[href*="rakuten.co.jp"] {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  margin: 4px 4px 4px 0;
  transition: opacity 0.2s;
}

.post-content a[href*="amazon.co.jp"] {
  background: #ff9900;
  color: #111;
}

.post-content a[href*="rakuten.co.jp"] {
  background: #bf0000;
  color: #fff;
}

.post-content a[href*="amazon.co.jp"]:hover,
.post-content a[href*="rakuten.co.jp"]:hover {
  opacity: 0.85;
}

/* レスポンシブ */
@media (max-width: 600px) {
  .post-title { font-size: 1.4rem; }
  .site-header .container { flex-direction: column; align-items: flex-start; }
  .site-nav a:first-child { margin-left: 0; }
  .post-navigation { grid-template-columns: 1fr; }
  .post-list-item { flex-direction: column; }
  .post-list-item .card-thumbnail { width: 100%; height: 160px; }
  .related-posts ul { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .card-compact-thumb { height: 160px; }
  .header-right { flex-direction: column; align-items: flex-start; gap: 8px; }
  .search-input { width: 120px; }
  .search-input:focus { width: 160px; }
  .toc { padding: 12px 16px; }
}
