/*
Theme Name: Noritama AI
Theme URI: http://ai-media.localhost/
Author: Noritama AI 編集部
Description: AI＋システム開発メディア「Noritama AI」用の自作テーマ。デザインモック準拠・実データ(9カテゴリ)連携。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: Proprietary
Text Domain: noritama-ai
*/

:root {
  --blue: #0b61d8;
  --blue-dark: #0647a8;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #dde3ec;
  --soft: #f5f7fb;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  background: #f4f6f9;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}

body {
  margin: 0;
  min-width: 320px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: auto 1fr auto;
  height: 64px;
  padding: 0 42px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand span {
  color: var(--blue);
}

.main-nav {
  display: flex;
  gap: 24px;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
}

.main-nav a {
  align-items: center;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  height: 64px;
  position: relative;
  white-space: nowrap;
}

.main-nav a.active::after,
.main-nav a.current-cat::after {
  background: var(--blue);
  bottom: 0;
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
}

.search-form {
  align-items: center;
  background: var(--soft);
  border: 1px solid transparent;
  border-radius: 999px;
  display: flex;
  height: 36px;
  padding: 0 4px 0 14px;
  transition: border-color 0.2s, background 0.2s;
}

.search-form:focus-within {
  background: #fff;
  border-color: var(--blue);
}

.search-form input[type="search"] {
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  height: 100%;
  outline: none;
  width: 160px;
}

.search-form input[type="search"]::placeholder {
  color: #94a3b8;
}

.search-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  height: 32px;
  position: relative;
  width: 32px;
  flex: 0 0 32px;
}

.search-button::before {
  border: 2px solid #111827;
  border-radius: 999px;
  content: "";
  height: 13px;
  left: 6px;
  position: absolute;
  top: 5px;
  width: 13px;
}

.search-button::after {
  background: #111827;
  content: "";
  height: 9px;
  left: 20px;
  position: absolute;
  top: 18px;
  transform: rotate(-45deg);
  transform-origin: top center;
  width: 2px;
}

.page {
  background: #fff;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.08);
  margin: 0 auto;
  max-width: 1536px;
  min-height: calc(100vh - 64px);
  padding: 48px 42px 80px;
}

.home-layout,
.article-layout,
.archive-layout {
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.content-column {
  min-width: 0;
}

.hero {
  margin: 20px 0 28px;
}

.hero h1 {
  font-size: clamp(22px, 2.15vw, 32px);
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0 0 14px;
}

.hero p,
.lead {
  color: #536171;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.7;
  margin: 0;
}

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

.section-title h2,
.side-card h2,
.follow-box h2,
.learn-box h2 {
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
}

.section-title a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.article-list {
  display: grid;
  gap: 28px;
}

.article-card {
  display: grid;
  gap: 28px;
  grid-template-columns: 240px 1fr;
}

.thumb {
  align-items: center;
  border-radius: 6px;
  color: #e7f0ff;
  display: flex;
  font-size: 22px;
  font-weight: 900;
  height: 170px;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.thumb::before,
.thumb::after {
  content: "";
  position: absolute;
}

.thumb::before {
  border: 1px solid rgba(255, 255, 255, 0.18);
  inset: 18px;
}

.thumb::after {
  background: radial-gradient(circle, rgba(60, 180, 255, 0.55), transparent 60%);
  height: 160px;
  width: 160px;
}

.thumb span {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 12px;
  font-size: 14px;
  line-height: 1.4;
}

/* 9カテゴリ別のサムネ色 (slug → クラス) */
.thumb-intro-basics       { background: linear-gradient(135deg, #07192f, #064f92 55%, #071322); }
.thumb-tools-environment  { background: linear-gradient(135deg, #062337, #083f52 55%, #071829); }
.thumb-architecture-design{ background: linear-gradient(135deg, #111827, #172a45 55%, #060a12); }
.thumb-prompt-context     { background: linear-gradient(135deg, #071b37, #073f78 52%, #0a1326); }
.thumb-process-team       { background: linear-gradient(135deg, #101231, #143a98 55%, #070914); }
.thumb-security-ops       { background: linear-gradient(135deg, #1a0a2e, #471560 55%, #150723); }
.thumb-languages-stack    { background: linear-gradient(135deg, #0a2f2f, #105b5b 55%, #082020); }
.thumb-case-studies       { background: linear-gradient(135deg, #2e1106, #6e2d12 55%, #1f0a04); }
.thumb-career-future      { background: linear-gradient(135deg, #1f0a2e, #3d1466 55%, #150723); }
.thumb-default            { background: linear-gradient(135deg, #2a2f3c, #455066 55%, #1a1e27); }

.article-copy {
  align-self: center;
  min-width: 0;
}

.badge {
  background: var(--blue);
  border-radius: 5px;
  color: #fff;
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 14px;
  padding: 8px 11px;
}

.article-copy h3 {
  font-size: 18px;
  line-height: 1.45;
  margin: 0 0 12px;
}

.article-copy h3 a:hover,
.section-title a:hover,
.related-item:hover strong {
  color: var(--blue);
}

.article-copy p {
  color: #536171;
  font-size: 15px;
  line-height: 1.8;
  margin: 0 0 14px;
}

.meta {
  align-items: center;
  color: #536171;
  display: flex;
  gap: 20px;
  font-size: 13px;
}

.load-more {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 800;
  gap: 18px;
  height: 54px;
  justify-content: center;
  margin-top: 50px;
  text-decoration: none;
  width: 100%;
}

.load-more:hover { background: var(--soft); }

.load-more span,
.breadcrumb span,
.flow-diagram > span {
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  display: inline-block;
  height: 8px;
  transform: rotate(45deg);
  width: 8px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 30px;
}

.side-card,
.follow-box,
.learn-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.side-card {
  padding: 26px;
}

.side-card h2 {
  margin-bottom: 20px;
}

.category-list,
.ranking ol,
.toc ol,
.learn-box ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-list {
  display: grid;
  gap: 18px;
}

.category-list li {
  align-items: center;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  justify-content: space-between;
}

.category-list a {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.category-list a:hover { color: var(--blue); }

.category-list a::before {
  align-items: center;
  border: 1.5px solid #1f2937;
  border-radius: 5px;
  color: #1f2937;
  content: attr(data-icon);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  line-height: 1;
  width: 18px;
}

.category-list b {
  color: #64748b;
  font-size: 13px;
}

.ranking ol {
  display: grid;
  gap: 16px;
}

.ranking li {
  display: grid;
  gap: 6px 12px;
  grid-template-columns: 28px 1fr;
}

.ranking li span.num {
  align-items: center;
  background: var(--blue);
  border-radius: 999px;
  color: #fff;
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.ranking a {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.ranking a:hover { color: var(--blue); }

.ranking time {
  color: #64748b;
  font-size: 12px;
  grid-column: 2;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list a {
  background: #f1f5f9;
  border-radius: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 9px;
}

.tag-list a:hover { background: #e2e8f0; }

.article-layout,
.archive-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

.article-body {
  min-width: 0;
}

.breadcrumb {
  align-items: center;
  color: #6b7280;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
  margin-bottom: 32px;
}

.breadcrumb a {
  color: #475569;
}

.breadcrumb a:hover { color: var(--blue); }

.article-body > h1 {
  font-size: clamp(28px, 2.9vw, 40px);
  line-height: 1.35;
  margin: 0 0 18px;
}

.article-meta-row {
  align-items: center;
  display: flex;
  gap: 18px;
  margin: 36px 0 38px;
}

.avatar {
  background: linear-gradient(#dce8f7, #f1cab0);
  border-radius: 999px;
  height: 38px;
  width: 38px;
}

.article-meta-row time {
  color: #475569;
  font-size: 13px;
}

.share-links {
  display: flex;
  gap: 18px;
  margin-left: auto;
}

.share-links a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.learn-box {
  margin-bottom: 54px;
  padding: 30px 34px;
}

.learn-box h2 {
  margin-bottom: 18px;
}

.learn-box li {
  color: #1f2937;
  font-size: 15px;
  line-height: 2;
}

.learn-box li::before {
  color: var(--blue);
  content: "✓";
  font-weight: 900;
  margin-right: 14px;
}

.article-content {
  color: #1f2937;
  font-size: 16px;
  line-height: 2;
}

.article-content h2 {
  border-bottom: 1px solid var(--line);
  font-size: 24px;
  line-height: 1.4;
  margin: 48px 0 22px;
  padding: 0 0 12px;
}

.article-content h3 {
  font-size: 18px;
  line-height: 1.5;
  margin: 36px 0 14px;
}

.article-content p {
  margin: 0 0 18px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 22px;
  padding-left: 28px;
}

.article-content li {
  margin: 0 0 8px;
}

.article-content strong { font-weight: 800; }
.article-content em { font-style: normal; background: linear-gradient(transparent 60%, #fff3a8 60%); padding: 0 2px; }
.article-content blockquote {
  background: var(--soft);
  border-left: 4px solid var(--blue);
  color: #334155;
  margin: 24px 0;
  padding: 18px 22px;
}

.article-content code {
  background: #f1f5f9;
  border-radius: 4px;
  color: #be185d;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.93em;
  padding: 2px 6px;
}

.article-content pre {
  background: #17212d;
  border-radius: 6px;
  color: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.8;
  margin: 24px 0;
  overflow-x: auto;
  padding: 20px 24px;
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

.article-side {
  padding-top: 0;
}

.toc ol {
  display: grid;
  gap: 16px;
}

.toc a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

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

.related {
  display: grid;
  gap: 18px;
}

.related h2 {
  margin-bottom: 4px;
}

.related-item {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: 76px 1fr;
}

.mini-thumb {
  border-radius: 4px;
  display: block;
  height: 50px;
  width: 76px;
}

.related-item strong {
  font-size: 13px;
  line-height: 1.55;
}

.related-item time {
  color: #64748b;
  font-size: 12px;
  grid-column: 2;
}

.follow-box {
  background: linear-gradient(135deg, #ffffff, #edf5ff);
  padding: 34px;
}

.follow-box h2 {
  color: #0f172a;
  font-size: 22px;
}

.follow-box p {
  color: #536171;
  font-size: 14px;
  line-height: 1.8;
  margin: 20px 0;
}

.follow-box div {
  display: flex;
  gap: 20px;
}

.follow-box a {
  color: var(--blue);
  font-weight: 900;
}

/* アーカイブページのタイトル */
.archive-header {
  margin-bottom: 36px;
}

.archive-header h1 {
  font-size: clamp(24px, 2.4vw, 32px);
  margin: 0 0 10px;
}

.archive-header p {
  color: #536171;
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

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

.pagination a,
.pagination span {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  height: 38px;
  justify-content: center;
  min-width: 38px;
  padding: 0 10px;
}

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

/* フッター */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 36px 42px;
  text-align: center;
}

.site-footer a { color: #93c5fd; }
.site-footer small { font-size: 13px; }

/* 投稿が無い場合 */
.no-posts {
  background: var(--soft);
  border-radius: 8px;
  color: #64748b;
  font-size: 15px;
  padding: 48px;
  text-align: center;
}

/* レスポンシブ */
@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
    height: auto;
    padding: 18px 24px;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .main-nav a {
    height: 38px;
  }

  .page {
    padding: 36px 24px 64px;
  }

  .home-layout,
  .article-layout,
  .archive-layout {
    gap: 36px;
    grid-template-columns: 1fr;
  }

  .sidebar,
  .article-side {
    padding-top: 0;
  }
}

@media (max-width: 760px) {
  .site-header { gap: 14px; }
  .main-nav { gap: 18px; }
  .search-form input[type="search"] { width: 110px; }
  .page { padding: 28px 16px 56px; }
  .hero { margin: 8px 0 20px; }
  .section-title { align-items: flex-start; gap: 12px; }
  .article-card { gap: 16px; grid-template-columns: 1fr; }
  .thumb { height: auto; min-height: 180px; }
  .article-copy h3 { font-size: 18px; }
  .article-meta-row { align-items: flex-start; flex-wrap: wrap; }
  .share-links { flex-basis: 100%; margin-left: 0; }
}
