/* =========================================================
   Orthodox Theme — オーソドックスなメディア向けテーマ
   白背景 / 2カラム / 読みやすい日本語タイポグラフィ
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f8fa;
  --color-border: #e3e6ea;
  --color-text: #1f2933;
  --color-text-soft: #52606d;
  --color-text-mute: #7b8794;
  --color-accent: #1d4ed8;
  --color-accent-soft: #3b82f6;
  --color-link: #1d4ed8;
  --color-link-hover: #1e3a8a;
  --color-code-bg: #f3f4f6;

  --radius-sm: 4px;
  --radius-md: 8px;

  --max-width: 1120px;
  --content-max: 760px;

  --font-sans: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI",
               "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --font-serif: "Shippori Mincho", "Noto Serif JP", "Hiragino Mincho ProN",
                "Yu Mincho", serif;

  --leading-body: 1.85;
  --leading-tight: 1.4;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(1.2) blur(6px);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px;
}
.site-title {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--color-text); text-decoration: none;
  font-weight: 700; font-size: 1.05rem;
}
.site-title:hover { color: var(--color-accent); text-decoration: none; }
.site-logo { height: 32px; width: auto; }
.site-nav {
  margin-left: auto;
  display: flex; gap: 1.25rem; align-items: center;
}
.site-nav a {
  color: var(--color-text-soft);
  font-size: 0.925rem; font-weight: 500;
  padding: 0.5rem 0.25rem;
}
.site-nav a:hover { color: var(--color-accent); text-decoration: none; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent; border: 0;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 5px;
  cursor: pointer;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--color-text); margin: 0 auto;
}

/* ===== Layout ===== */
.site-main { padding: 2rem 0 3rem; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.5rem;
  align-items: start;
}
.content { min-width: 0; }
.sidebar { position: sticky; top: 84px; }

/* ===== Post Header ===== */
.post-header { margin-bottom: 2rem; }
.post-category {
  font-size: 0.8rem; color: var(--color-accent);
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}
.post-category a { color: inherit; }
.post-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.4vw, 2.25rem);
  line-height: 1.35;
  margin: 0 0 0.75rem;
  letter-spacing: 0.01em;
}
.post-meta {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 0.85rem; color: var(--color-text-mute);
  margin-bottom: 1rem;
}
.post-updated::before { content: "／ "; color: var(--color-text-mute); }
.post-thumbnail { margin: 0 0 1.5rem; }
.post-thumbnail img {
  width: 100%; border-radius: var(--radius-md);
  aspect-ratio: 16 / 9; object-fit: cover;
}
.post-lead {
  padding: 1rem 1.25rem;
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-sm);
  color: var(--color-text-soft);
  margin: 0 0 1.5rem;
}

/* ===== TOC ===== */
.toc {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.5rem 0 2rem;
}
.toc-heading {
  font-weight: 700; margin: 0 0 0.5rem;
  color: var(--color-text);
}
.toc-body ul { margin: 0; padding-left: 1.25rem; }
.toc-body li { line-height: 1.7; }
.toc-body a { color: var(--color-text-soft); }
.toc-body a:hover { color: var(--color-accent); }

/* ===== Prose (記事本文) ===== */
.prose { font-size: 1rem; }
.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  margin: 2.5rem 0 1rem;
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 4px solid var(--color-accent);
  line-height: 1.4;
}
.prose h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.4;
}
.prose h4 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--color-text);
}
.prose p { margin: 0 0 1.2rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.5rem; }
.prose li { margin: 0.25rem 0; }
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 4px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-soft);
}
.prose a { color: var(--color-link); text-decoration: underline; text-underline-offset: 2px; }
.prose img {
  width: 100%; margin: 1rem 0;
  border-radius: var(--radius-sm);
}
.prose code {
  background: var(--color-code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.92em;
}
.prose pre {
  background: #0f172a; color: #f1f5f9;
  padding: 1rem 1.25rem; border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.9rem; line-height: 1.6;
}
.prose pre code { background: transparent; padding: 0; color: inherit; }
.prose table {
  width: 100%; border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.prose th, .prose td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--color-surface); font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--color-border); margin: 2rem 0; }

/* ===== Author Box ===== */
.author-box {
  display: flex; gap: 1rem;
  margin: 2.5rem 0;
  padding: 1.25rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.author-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.author-body { flex: 1; min-width: 0; }
.author-name { font-weight: 700; margin: 0 0 0.25rem; }
.author-bio { margin: 0 0 0.5rem; color: var(--color-text-soft); font-size: 0.925rem; }
.author-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.author-links a { font-size: 0.85rem; }

/* ===== Related Posts ===== */
.related-posts {
  margin: 2.5rem 0;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.related-heading { font-size: 1.1rem; margin: 0 0 1rem; }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.related-item a {
  display: block; padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}
.related-item a:hover { background: #e8ecf2; text-decoration: none; }
.related-title { font-weight: 600; display: block; }
.related-desc { display: block; font-size: 0.875rem; color: var(--color-text-mute); margin-top: 0.25rem; }

.post-footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.back-link { font-size: 0.9rem; color: var(--color-text-soft); }

/* ===== Page ===== */
.page-header { margin-bottom: 2rem; border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; }
.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.2vw, 2rem);
  margin: 0 0 0.5rem;
}
.page-meta { color: var(--color-text-mute); font-size: 0.875rem; }

/* ===== Post List ===== */
.list-header { margin-bottom: 1.5rem; border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; }
.list-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  margin: 0 0 0.5rem;
}
.list-description { color: var(--color-text-soft); margin: 0; }

.post-cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1rem;
}
.post-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.post-card:hover {
  border-color: var(--color-accent-soft);
  box-shadow: 0 4px 16px rgba(29, 78, 216, 0.08);
}
.post-card-link { display: grid; grid-template-columns: minmax(0, 1fr); color: inherit; }
.post-card-link:has(.post-card-thumb) { grid-template-columns: 220px minmax(0, 1fr); }
.post-card-link:hover { text-decoration: none; color: inherit; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.post-card-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; }
.post-card-category {
  align-self: flex-start;
  font-size: 0.75rem;
  color: var(--color-accent);
  background: rgba(29, 78, 216, 0.08);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.post-card-title { font-size: 1.1rem; margin: 0; line-height: 1.4; }
.post-card-desc { color: var(--color-text-soft); font-size: 0.9rem; margin: 0; }
.post-card-meta { color: var(--color-text-mute); font-size: 0.8rem; margin-top: auto; }

.empty-list { color: var(--color-text-mute); text-align: center; padding: 3rem 0; }

/* ===== Pagination ===== */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; margin: 2rem 0 0;
  font-size: 0.925rem;
}
.page-indicator { color: var(--color-text-mute); }

/* ===== Sidebar Widgets ===== */
.widget {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  background: var(--color-bg);
}
.widget-title {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}
.widget-body { font-size: 0.925rem; color: var(--color-text-soft); margin: 0; }

/* ===== Footer ===== */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0 2rem;
  margin-top: 3rem;
}
.footer-inner { text-align: center; }
.footer-nav {
  display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.footer-nav a { color: var(--color-text-soft); font-size: 0.875rem; }
.copyright { color: var(--color-text-mute); font-size: 0.8rem; margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .post-card-link { grid-template-columns: 1fr; }
  .post-card-thumb img { aspect-ratio: 16 / 8; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; inset: 64px 0 auto 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column; gap: 0; padding: 0.5rem 1.25rem 1rem;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.65rem 0; border-bottom: 1px solid var(--color-border); width: 100%; }
  .site-nav a:last-child { border-bottom: 0; }
  .container { padding: 0 1rem; }
  .post-title, .list-title, .page-title { font-size: 1.4rem; }
  .prose h2 { font-size: 1.25rem; }
  .prose h3 { font-size: 1.1rem; }
}

/* ===== 座談会UI (YouTubeコメント欄風) ===== */
.conv-thread {
  margin: 2rem 0;
  padding: 0;
}
.conv-heading {
  font-size: 1.2rem;
  margin: 0 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
}
.conv-count {
  font-size: .85rem;
  color: #6b7280;
  font-weight: normal;
}
.conv-seed {
  background: #f8fafc;
  border-left: 4px solid #2563eb;
  padding: .75rem 1rem;
  margin: 0 0 1.25rem;
  border-radius: 6px;
  font-size: .95rem;
}
.conv-seed-label {
  font-size: .75rem;
  color: #2563eb;
  font-weight: 600;
  letter-spacing: .05em;
  margin-bottom: .25rem;
  text-transform: uppercase;
}
.conv-seed-body {
  color: #111827;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.conv-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
}
.conv-role-synthesis {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: .75rem;
}
.conv-role-disclaimer {
  background: #f3f4f6;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: .75rem;
  margin-top: .5rem;
  color: #475569;
}
.conv-role-disclaimer .conv-role {
  background: #e2e8f0;
  color: #334155;
}
.conv-role-disclaimer .conv-text {
  font-size: .88rem;
  color: #475569;
  line-height: 1.6;
}
.conv-role-seed {
  display: none; /* seed は上の .conv-seed で表示済み */
}
.conv-avatar {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
}
.conv-body {
  flex: 1 1 auto;
  min-width: 0;
}
.conv-head {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .25rem;
}
.conv-name {
  font-weight: 600;
  font-size: .95rem;
  color: #111827;
}
.conv-role {
  font-size: .72rem;
  color: #6b7280;
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 999px;
}
.conv-role-synthesis .conv-role {
  background: #fde68a;
  color: #92400e;
}
.conv-text {
  font-size: .95rem;
  line-height: 1.65;
  color: #1f2937;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.conv-text p { margin: 0 0 .5rem; }
.conv-text p:last-child { margin-bottom: 0; }
.conv-text blockquote {
  margin: .5rem 0;
  padding: .35rem .75rem;
  border-left: 3px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
}
.conv-text ul, .conv-text ol {
  margin: .35rem 0 .5rem 1.25rem;
  padding: 0;
}
.conv-text code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .88em;
}
.conv-text a { color: #2563eb; text-decoration: underline; }
.conv-text h2, .conv-text h3, .conv-text h4 {
  font-size: 1rem;
  margin: .5rem 0 .25rem;
  font-weight: 600;
}
.conv-actions {
  display: flex;
  gap: .75rem;
  margin-top: .35rem;
}
.conv-like,
.conv-reply {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  font-size: .8rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.conv-like:hover,
.conv-reply:hover {
  background: #f3f4f6;
  color: #111827;
}
.conv-like.liked {
  color: #2563eb;
}
.conv-like.liked .conv-like-icon {
  filter: none;
}
.conv-prose {
  margin-top: 2rem;
  padding: .75rem;
  background: #f9fafb;
  border-radius: 6px;
}
.conv-prose > summary {
  cursor: pointer;
  font-weight: 500;
  color: #374151;
  padding: .25rem 0;
}
.conv-prose .prose {
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .conv-avatar { flex-basis: 32px; width: 32px; height: 32px; font-size: .9rem; }
  .conv-name { font-size: .9rem; }
  .conv-text { font-size: .9rem; }
}

/* ===== トップページ「最新記事」セクション ===== */
.home-recent {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}
.home-recent-heading {
  font-size: 1.3rem;
  margin: 0 0 1rem;
}
.home-recent-more {
  text-align: right;
  margin-top: 1rem;
  font-size: .9rem;
}
.home-recent-more a {
  color: var(--color-accent);
  text-decoration: none;
}
.home-recent-more a:hover { text-decoration: underline; }
