/*
Theme Name: PC Atelier Journal
Author: PC Atelier / CIT
Description: ワークステーション・業務用PC専門メディア用テーマ
Version: 1.0
Text Domain: pc-atelier-journal
*/

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #152d6e;
  --blue-dark: #0d1f52;
  --blue-light: #eceffe;
  --text: #1a1a1a;
  --text-sub: #555;
  --text-muted: #888;
  --border: #e5e7eb;
  --surface: #f8f8f8;
  --white: #fff;
  --radius: 6px;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== HEADER ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  flex-shrink: 0;
}

.site-logo .name {
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--blue);
  letter-spacing: 0.02em;
}

.site-logo .name span {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #888;
  margin-left: 6px;
  letter-spacing: 0.08em;
  vertical-align: middle;
  border: 1px solid #ddd;
  padding: 1px 6px;
  border-radius: 3px;
}

.site-logo .tagline {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  gap: 8px;
  width: 240px;
}

.header-search input {
  border: none;
  background: transparent;
  font-size: 13px;
  outline: none;
  width: 100%;
  color: var(--text);
}

.header-search input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }

/* ===== GLOBAL NAV ===== */
.global-nav { background: var(--blue); }

.global-nav ul {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  list-style: none;
}

.global-nav ul li a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.03em;
  transition: background 0.15s, color 0.15s;
}

.global-nav ul li a:hover,
.global-nav ul li.current-menu-item > a {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-bar {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--blue); text-decoration: underline; }
.breadcrumb .sep { color: #ccc; }
.breadcrumb .current { color: var(--text-sub); }

/* ===== CATEGORY TAGS ===== */
.article-cat {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.article-cat.cat-ws     { background: #1e3a99; }
.article-cat.cat-nb     { background: #0d7a5f; }
.article-cat.cat-guide  { background: #7c3aed; }
.article-cat.cat-review { background: #b45309; }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--blue);
  border-radius: 2px;
}

.section-more {
  font-size: 12px;
  color: var(--blue);
  font-weight: 500;
}

/* ===== ARTICLE META ===== */
.article-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== THUMBNAIL PLACEHOLDERS ===== */
.thumb-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  border-radius: var(--radius);
}

/* ===== HOME: SITE HERO ===== */
.site-hero {
  background-color: #edf0f5;
  background-image:
    linear-gradient(45deg, #d8dde8 25%, transparent 25%),
    linear-gradient(-45deg, #d8dde8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8dde8 75%),
    linear-gradient(-45deg, transparent 75%, #d8dde8 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  padding: 64px 0 60px;
  text-align: center;
}

.site-hero-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.site-hero-title span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-top: 10px;
  font-family: 'Inter', sans-serif;
  text-transform: uppercase;
}

/* ===== HOME: BANNER ===== */
.banner-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

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

.banner-item {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  transition: opacity 0.15s, transform 0.15s;
}

.banner-item:hover { opacity: 0.88; transform: translateY(-2px); }

.banner-img {
  width: 100%;
  aspect-ratio: 3/1;
  display: flex;
  align-items: center;
  position: relative;
}

.banner-img.has-img {
  background-size: cover;
  background-position: center;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.banner-inner { padding: 0 20px; position: relative; z-index: 1; }
.banner-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.banner-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 3px;
}

.banner-sub { font-size: 11px; color: rgba(255,255,255,0.75); }

/* ===== HOME: HERO FEATURE ===== */
.hero-section { padding: 40px 0 0; }

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

.hero-main { border-radius: var(--radius); overflow: hidden; }

.hero-main-img {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
}

.hero-main-img img { width: 100%; height: 100%; object-fit: cover; }

.hero-main-body { padding: 20px 0 0; }

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

.hero-main .article-excerpt {
  font-size: 13.5px;
  color: var(--text-sub);
  line-height: 1.75;
}

.hero-side { display: flex; flex-direction: column; gap: 16px; }

.hero-side-card {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.hero-side-card:last-child { border-bottom: none; padding-bottom: 0; }

.hero-side-card .body {
  min-width: 0;
  overflow: hidden;
}

.hero-side-card .article-cat { display: none; }

.hero-side-card .thumb {
  width: 90px;
  aspect-ratio: 4/3;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  flex-shrink: 0;
  overflow: hidden;
}

.hero-side-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.hero-side-card .article-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== HOME: SECTIONS ===== */
.section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type { border-bottom: none; }

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

.article-card { display: flex; flex-direction: column; }

.article-card .thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  margin-bottom: 12px;
  overflow: hidden;
}

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

.article-card .article-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* ===== HOME: 2-COL WITH SIDEBAR ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

/* ===== ARTICLE LIST ===== */
.article-list { display: flex; flex-direction: column; gap: 20px; }

.article-list-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.article-list-item:last-child { border-bottom: none; padding-bottom: 0; }

.article-list-item .thumb {
  width: 120px;
  aspect-ratio: 4/3;
  border-radius: 4px;
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  flex-shrink: 0;
  overflow: hidden;
}

.article-list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }

.article-list-item .article-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 6px;
}

.article-list-item .article-excerpt {
  font-size: 12.5px;
  color: var(--text-sub);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== SIDEBAR (HOME & ARCHIVE) ===== */
.sidebar { display: flex; flex-direction: column; gap: 32px; }

.sidebar-widget {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
}

.widget-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--blue);
}

/* 人気記事 */
.popular-list { display: flex; flex-direction: column; gap: 12px; }

.popular-item {
  display: grid;
  grid-template-columns: 24px 60px 1fr;
  gap: 10px;
  align-items: center;
}

.popular-item .rank {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--blue);
  text-align: center;
}

.popular-item .rank.r1 { color: #d4af37; }
.popular-item .rank.r2 { color: #9e9e9e; }
.popular-item .rank.r3 { color: #b87333; }

.popular-item .thumb {
  width: 60px;
  aspect-ratio: 4/3;
  border-radius: 3px;
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  overflow: hidden;
}

.popular-item .thumb img { width: 100%; height: 100%; object-fit: cover; }

.popular-item .title {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* カテゴリー */
.cat-list { display: flex; flex-direction: column; gap: 2px; }

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.15s;
}

.cat-item:hover { background: var(--border); }
.cat-item .count { font-size: 11px; color: var(--text-muted); }

/* ===== ARCHIVE PAGE ===== */
.archive-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}

.archive-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.archive-count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.archive-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* ===== SINGLE ARTICLE PAGE ===== */
.article-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 32px;
}

.article-header h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}

.article-header-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.meta-update {
  font-size: 11px;
  color: #aaa;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 8px;
}

.article-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* ===== ARTICLE BODY ===== */
.article-eyecatch {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  margin-bottom: 32px;
  overflow: hidden;
}

.article-eyecatch img { width: 100%; height: 100%; object-fit: cover; }

/* 目次ボックス */
.toc-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 40px;
}

.toc-box-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  counter-reset: toc-counter;
}

.toc-list > li { font-size: 13px; }

.toc-list > li > a {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--blue);
  font-weight: 500;
  transition: background 0.1s;
}

.toc-list > li > a:hover { background: var(--blue-light); }

.toc-num {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-light);
  border-radius: 3px;
  padding: 1px 6px;
  flex-shrink: 0;
}

.toc-list .toc-sub {
  list-style: none;
  margin: 2px 0 2px 28px;
}

.toc-list .toc-sub li a {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.1s;
}

.toc-list .toc-sub li a:hover { background: var(--surface); color: var(--blue); }
.toc-list .toc-sub li a::before { content: '- '; color: #ccc; }

/* 記事本文 */
.article-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 16px;
  padding: 14px 18px;
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  line-height: 1.5;
}

.article-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-content h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--blue);
  border-radius: 2px;
  flex-shrink: 0;
}

.article-content h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text);
}

.article-content p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
  padding-left: 24px;
  margin-bottom: 18px;
}

.article-content li {
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 4px;
}

.article-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: #c7d2f5;
}

.article-content a:hover { text-decoration-color: var(--blue); }

.article-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 18px;
  margin: 20px 0;
  color: var(--text-sub);
  font-size: 14.5px;
  line-height: 1.9;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 13.5px;
}

.article-content table th {
  background: var(--blue);
  color: #fff;
  padding: 10px 14px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

.article-content table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: middle;
  line-height: 1.7;
}

.article-content table tr:nth-child(even) td { background: var(--surface); }

/* ポイント・注意ボックス */
.paj-point {
  background: var(--blue-light);
  border: 1px solid #c7d2f5;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0;
}

.paj-point-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 10px;
}

.paj-point ul { padding-left: 20px; }
.paj-point li { font-size: 14px; line-height: 1.8; color: var(--text); }

.paj-caution {
  background: #fef9ec;
  border: 1px solid #f0d060;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.8;
}

.paj-caution-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 8px;
}

/* 商品ボックス (shortcode) */
.paj-product {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 32px 0;
}

.paj-product-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.paj-product-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--border);
}

.paj-product-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  align-items: start;
}

.paj-product-img {
  width: 140px;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  border-radius: 4px;
  overflow: hidden;
}

.paj-product-img img { width: 100%; height: 100%; object-fit: cover; }

.paj-product-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 6px;
}

.paj-product-spec {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 12px;
}

.paj-product-price {
  font-size: 20px;
  font-weight: 700;
  color: #c0392b;
  font-family: 'Inter', sans-serif;
  margin-bottom: 12px;
}

.paj-product-price span {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}

.paj-product-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.paj-btn {
  display: inline-block;
  text-align: center;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.paj-btn.amazon  { background: #FF9900; color: #111; }
.paj-btn.rakuten { background: #BF0000; color: #fff; }
.paj-btn.yahoo   { background: #FF0033; color: #fff; }

/* まとめボックス */
.paj-summary {
  background: #111827;
  color: #fff;
  border-radius: var(--radius);
  padding: 28px;
  margin: 48px 0 32px;
}

.paj-summary-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.paj-summary ul { padding-left: 20px; }
.paj-summary li { font-size: 14px; line-height: 1.85; margin-bottom: 6px; color: rgba(255,255,255,0.88); }

/* シェアボタン */
.share-buttons {
  margin: 32px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.share-label { font-size: 12px; font-weight: 700; color: var(--text-muted); }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.share-btn.x    { background: #000; color: #fff; }
.share-btn.line { background: #06C755; color: #fff; }
.share-btn.copy { background: var(--surface); border: 1px solid var(--border); color: var(--text); }

/* 著者プロフィール */
.author-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
  align-items: start;
  margin: 40px 0;
  background: var(--surface);
}

.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  overflow: hidden;
  flex-shrink: 0;
}

.author-avatar img { width: 100%; height: 100%; object-fit: cover; }

.author-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-role {
  font-size: 11px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 3px;
  padding: 1px 7px;
  font-weight: 600;
}

.author-bio { font-size: 13px; color: var(--text-sub); line-height: 1.8; margin-top: 8px; }

/* 前後記事ナビ */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 32px 0;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.article-nav-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.article-nav-label { font-size: 11px; color: var(--text-muted); font-weight: 700; display: block; margin-bottom: 6px; }
.article-nav-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--blue);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

/* 関連記事 */
.related-section { margin: 48px 0 0; border-top: 1px solid var(--border); padding-top: 40px; }

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

.related-card { display: flex; flex-direction: column; }

.related-card .thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1a2a6c, #2A4FBE);
  margin-bottom: 10px;
  overflow: hidden;
}

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

.related-card .article-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.55;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== ARTICLE SIDEBAR (sticky) ===== */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: sticky;
  top: 120px;
}

.sidebar-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-toc-list li a {
  display: block;
  font-size: 12px;
  color: var(--text-sub);
  padding: 5px 8px;
  border-radius: 4px;
  line-height: 1.5;
  transition: background 0.1s, color 0.1s;
}

.sidebar-toc-list li a:hover,
.sidebar-toc-list li.active a { background: var(--blue-light); color: var(--blue); font-weight: 500; }

.sidebar-toc-list .toc-sub { list-style: none; margin-left: 12px; }
.sidebar-toc-list .toc-sub li a { font-size: 11.5px; color: #aaa; }

/* ===== FOOTER ===== */
.site-footer {
  background: #111827;
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  margin-bottom: 8px;
}

.footer-brand .desc { font-size: 12px; line-height: 1.8; }

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 12px; color: rgba(255,255,255,0.6); transition: color 0.15s; }
.footer-links a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom .copy { font-size: 11px; color: rgba(255,255,255,0.4); }
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { font-size: 11px; color: rgba(255,255,255,0.4); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 32px 0 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.1s;
}

.pagination a:hover { background: var(--blue-light); border-color: var(--blue); color: var(--blue); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ===== 404 / NO RESULTS ===== */
.not-found { padding: 80px 0; text-align: center; }
.not-found h1 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.not-found p { font-size: 14px; color: var(--text-sub); }

/* ===== HAMBURGER BUTTON (hidden on desktop) ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--blue);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== MOBILE (max 767px) ===== */
@media (max-width: 767px) {

  /* --- コンテナ --- */
  .container { padding: 0 16px; }

  /* --- ヘッダー --- */
  .header-top {
    height: 52px;
    padding: 0 14px;
    gap: 8px;
  }

  .site-logo .name { font-size: 14px; }
  .site-logo .tagline { display: none; }

  .header-search {
    flex: 1;
    width: auto;
    min-width: 0;
    padding: 5px 10px;
  }

  .header-search input { font-size: 12px; }

  .nav-toggle { display: flex; }

  /* --- グローバルナビ --- */
  .global-nav { display: none; }
  .global-nav.is-open { display: block; }

  .global-nav ul {
    flex-direction: column;
    padding: 0;
    max-width: 100%;
  }

  .global-nav ul li a {
    padding: 13px 20px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  /* --- ヒーロー --- */
  .site-hero { padding: 36px 16px 32px; }
  .site-hero-title { font-size: 22px; }

  /* --- バナー（スマホでは1枚ランダム表示） --- */
  .banner-grid { grid-template-columns: 1fr; }
  .banner-grid .banner-item { display: none; }
  .banner-grid .banner-item.is-active { display: block; }

  /* --- ホーム ヒーローグリッド（2列 → 1列） --- */
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-main .article-title { font-size: 18px; }

  .hero-side-card {
    grid-template-columns: 70px 1fr;
    gap: 10px;
    align-items: start;
  }

  .hero-side-card .thumb { width: 70px; }

  .hero-side-card .body { min-width: 0; }

  /* --- セクション --- */
  .section { padding: 32px 0; }

  /* --- 記事グリッド（3列 → 1列） --- */
  .article-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* --- 2カラムレイアウト（→ 1列） --- */
  .two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* --- アーカイブ（→ 1列） --- */
  .archive-layout {
    grid-template-columns: 1fr;
    padding: 24px 16px 56px;
    gap: 0;
  }

  /* --- 記事詳細（→ 1列） --- */
  .article-header {
    padding: 24px 16px 20px;
  }

  .article-header h1 {
    font-size: 20px;
    margin-bottom: 14px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    padding: 0 16px 56px;
    gap: 0;
  }

  /* サイドバーはメインコンテンツの後に表示 */
  .sidebar,
  .article-sidebar {
    order: 2;
    position: static;
    margin-top: 40px;
  }

  /* --- 記事リスト --- */
  .article-list-item {
    grid-template-columns: 90px 1fr;
    gap: 12px;
  }

  .article-list-item .thumb { width: 90px; }

  .article-list-item .article-title { font-size: 13.5px; }

  /* --- 関連記事（3列 → 2列） --- */
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* --- 前後記事ナビ --- */
  .article-nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .article-nav-item.next { text-align: left; }

  /* --- 商品ボックス --- */
  .paj-product-body {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .paj-product-img {
    width: 100%;
    aspect-ratio: 16/9;
  }

  /* --- フッター（4列 → 2列） --- */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
  }

  .footer-grid .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .footer-bottom-links { justify-content: center; }

  /* --- セクションヘッダー --- */
  .section-header { margin-bottom: 16px; }

  /* --- アーカイブヘッダー --- */
  .archive-header { padding: 20px 16px 16px; }
  .archive-title { font-size: 18px; }
}

/* ===== AdSense 広告枠 ===== */
.paj-ad-slot {
  text-align: center;
  overflow: hidden;
}

/* ダミー広告枠（開発用・管理者ログイン中のみ表示）
   ※ slot固有のdisplay:noneより前に定義して上書きされるようにする */
.paj-ad-dummy {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    #e8e8e8,
    #e8e8e8 8px,
    #f5f5f5 8px,
    #f5f5f5 16px
  );
  border: 2px dashed #aaa;
  border-radius: 4px;
  min-height: 90px;
  color: #666;
  font-size: 12px;
  font-weight: 600;
}

/* サイドバー広告: PCのみ表示 */
.paj-ad-sidebar {
  margin-bottom: 24px;
}

/* モバイルインライン広告: スマホのみ表示 */
.paj-ad-mobile {
  display: none;
  margin: 24px 0;
}

/* フッター内広告: スマホのみ表示（footer-gridの空きセルに入る） */
.paj-ad-footer-mobile {
  display: none;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767px) {
  .paj-ad-sidebar       { display: none; }
  .paj-ad-mobile        { display: flex; }
  .paj-ad-footer-mobile { display: flex; }
}
