/*
Theme Name: urilog Blog
Theme URI: https://blog.urilog.app
Author: urilog
Author URI: https://urilog.app
Description: urilog公式ブログテーマ。メルカリ・ヤフオク・せどり副業者向け情報メディア。副業の利益を見える化するツール「urilog」の公式ブログ。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: Private
Text Domain: urilog-blog
*/

/* ========================================
   リセット・基底
======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-deep:  #3730a3;
  --bg:            #f8fafc;
  --card-bg:       #ffffff;
  --border:        #e2e8f0;
  --text-main:     #1e293b;
  --text-sub:      #64748b;
  --text-muted:    #94a3b8;
  --red:           #ef4444;
  --red-bg:        #fff1f2;
  --radius-lg:     12px;
  --radius-md:     8px;
  --max-w:         720px;
  --font:          -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* ========================================
   ヘッダー
======================================== */
.site-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.site-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-link {
  font-size: 14px;
  color: var(--text-sub);
  text-decoration: none;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-link--cta {
  background: var(--primary);
  color: #fff !important;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
}
.nav-link--cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

/* ========================================
   メインコンテンツ領域
======================================== */
.site-main {
  flex: 1;
  padding: 48px 16px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

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

/* ========================================
   ブログ一覧（archive.php）
======================================== */
.blog-heading {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.blog-subheading {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 36px;
}

/* 利益計算ツールバナー */
.tool-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, #7c3aed 100%);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  text-decoration: none;
  color: #fff;
  margin-bottom: 36px;
  transition: opacity 0.2s, box-shadow 0.2s;
}
.tool-banner:hover {
  opacity: 0.93;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
  text-decoration: none;
}

.tool-banner-icon {
  font-size: 30px;
  flex-shrink: 0;
}

.tool-banner-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tool-banner-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.tool-banner-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
}

/* 記事カード一覧 */
.article-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.article-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.article-card a {
  display: block;
  padding: 24px;
  text-decoration: none;
  color: inherit;
}
.article-card a:hover {
  text-decoration: none;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.article-date {
  font-size: 12px;
  color: var(--text-muted);
}

.article-category {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: #ede9fe;
  padding: 2px 8px;
  border-radius: 20px;
}

.article-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 10px;
}

.article-excerpt {
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 14px;
}

.article-read-more {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
}

/* サムネイル付きカード */
.article-card--thumb {
  display: grid;
  grid-template-columns: 1fr 200px;
}

.article-card--thumb .article-thumb {
  overflow: hidden;
}
.article-card--thumb .article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-sub);
  text-decoration: none;
  background: var(--card-bg);
  transition: background 0.15s;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  text-decoration: none;
}
.pagination .page-numbers.dots {
  border: none;
  background: none;
}

/* ========================================
   記事詳細（single.php）
======================================== */
.single-header {
  margin-bottom: 28px;
}

.single-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
  margin-bottom: 14px;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.single-date {
  font-size: 13px;
  color: var(--text-muted);
}

.single-categories a {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #ede9fe;
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
}
.single-categories a:hover {
  background: #ddd6fe;
  text-decoration: none;
}

/* アイキャッチ画像 */
.single-thumbnail {
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.single-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 0;
  display: block;
}

/* 記事本文 */
.entry-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  line-height: 1.85;
  color: #374151;
  font-size: 15px;
  margin-bottom: 24px;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  font-weight: 700;
  color: var(--text-main);
  margin: 28px 0 14px;
  line-height: 1.4;
}
.entry-content h1 { font-size: 22px; }
.entry-content h2 {
  font-size: 19px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
}
.entry-content h3 { font-size: 17px; }
.entry-content h4 { font-size: 15px; }

.entry-content p {
  margin-bottom: 18px;
}

.entry-content ul,
.entry-content ol {
  padding-left: 28px;
  margin-bottom: 18px;
}
.entry-content li {
  margin-bottom: 6px;
}

.entry-content a {
  color: var(--primary);
  text-decoration: underline;
}

.entry-content strong { font-weight: 700; }
.entry-content em { font-style: italic; }

.entry-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Courier New', 'SF Mono', monospace;
}

.entry-content pre {
  background: var(--text-main);
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.6;
}
.entry-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.entry-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 10px 18px;
  margin: 20px 0;
  background: #f5f3ff;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--primary-dark);
  font-style: normal;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
  font-size: 14px;
}
.entry-content th,
.entry-content td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.entry-content th {
  background: #f1f5f9;
  font-weight: 700;
}
.entry-content tr:nth-child(even) td {
  background: #f8fafc;
}

.entry-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 8px 0;
}

.entry-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 28px 0;
}

/* ========================================
   CTA ブロック
======================================== */

/* 記事冒頭CTA */
.cta-top {
  background: linear-gradient(135deg, #f0f4ff, #faf5ff);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  text-decoration: none;
}
.cta-top:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
  text-decoration: none;
}

.cta-top__text {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

.cta-top__btn {
  display: inline-block;
  background: var(--primary-dark);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.cta-top__btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* 記事中盤CTA */
.cta-mid {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin: 28px 0;
}
.cta-mid__text {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 14px;
}
.cta-mid__btn {
  display: inline-block;
  background: var(--primary-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 28px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: opacity 0.15s;
}
.cta-mid__btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* 記事末尾CTA */
.cta-bottom {
  background: var(--red-bg);
  border: 2px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin-top: 32px;
  margin-bottom: 20px;
}
.cta-bottom__title {
  font-size: 16px;
  font-weight: 800;
  color: var(--red);
  margin-bottom: 8px;
}
.cta-bottom__sub {
  font-size: 13px;
  color: #b91c1c;
  margin-bottom: 16px;
}
.cta-bottom__btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 32px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: opacity 0.15s;
}
.cta-bottom__btn:hover {
  opacity: 0.88;
  text-decoration: none;
}

/* ========================================
   SNSシェアボタン
======================================== */
.share-section {
  margin-top: 32px;
  text-align: center;
}

.share-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.15s;
}
.share-btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

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

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

/* ========================================
   関連記事
======================================== */
.related-section {
  margin-top: 40px;
}

.related-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item a {
  display: flex;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}
.related-item a:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.07);
  text-decoration: none;
}

.related-item-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.related-item-body {
  flex: 1;
}

.related-item-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 4px;
}

.related-item-date {
  font-size: 12px;
  color: var(--text-muted);
}

/* 記事下部ナビゲーション */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 28px;
}

.post-nav a {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-decoration: none;
  font-size: 13px;
  color: var(--text-sub);
  transition: border-color 0.15s;
}
.post-nav a:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

.post-nav__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.post-nav__title {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav--prev { text-align: left; }
.post-nav--next { text-align: right; }

/* ========================================
   固定ページ（page.php）
======================================== */
.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 28px;
}

/* ========================================
   404ページ
======================================== */
.not-found-wrap {
  text-align: center;
  padding: 80px 16px;
}

.not-found-code {
  font-size: 72px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 12px;
}

.not-found-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.not-found-text {
  font-size: 15px;
  color: var(--text-sub);
  margin-bottom: 28px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 28px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* ========================================
   フッター
======================================== */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 28px 24px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
}
.footer-logo:hover { text-decoration: none; opacity: 0.85; }

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.footer-nav a {
  font-size: 13px;
  color: var(--text-sub);
  text-decoration: none;
}
.footer-nav a:hover {
  color: var(--primary);
  text-decoration: none;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* ========================================
   レスポンシブ
======================================== */
@media (max-width: 640px) {
  .site-main {
    padding: 32px 14px;
  }

  .blog-heading {
    font-size: 24px;
  }

  .single-title {
    font-size: 22px;
  }

  .entry-content {
    padding: 22px 18px;
  }

  .article-card--thumb {
    grid-template-columns: 1fr;
  }
  .article-card--thumb .article-thumb {
    display: none;
  }

  .cta-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .header-nav .nav-link:not(.nav-link--cta) {
    display: none;
  }
}
