/*
 Theme Name:   13년차의 서버실
 Template:     twentytwentyfive
 Description:  Custom tech blog theme for blog.pswq.net
 Version:      1.0.0
*/

/* ── Base ─────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  color: #1a1a2e;
  line-height: 1.75;
  background: #f8f9fa;
}

/* ── Layout — wider content area ──── */
.wp-site-blocks {
  max-width: 100% !important;
  padding: 0 !important;
}
.wp-site-blocks > .wp-block-group,
.wp-site-blocks > main > .wp-block-group,
.wp-site-blocks > main.wp-block-group {
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 1280px !important;
}

/* ── Header / Site Title ──────────── */
.wp-block-site-title a {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a1a2e !important;
  text-decoration: none !important;
}
.wp-block-site-tagline {
  color: #9ca3af !important;
  font-size: 0.8rem;
}

/* ── Navigation ───────────────────── */
.wp-block-navigation {
  gap: 0.25rem;
}
.wp-block-navigation a.wp-block-navigation-item__content {
  font-size: 0.88rem !important;
  font-weight: 500;
  color: #4a5568 !important;
  text-decoration: none !important;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  transition: all 0.2s;
}
.wp-block-navigation a.wp-block-navigation-item__content:hover {
  background: #f3f4f6;
  color: #1a1a2e !important;
}

/* ── Post Cards (Blog Listing) ────── */
.wp-block-post-template {
  gap: 1.5rem !important;
}
.wp-block-post-template.is-layout-grid {
  grid-template-columns: repeat(3, 1fr) !important;
}
.wp-block-post {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.wp-block-post:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* ── Flex children must shrink ─────── */
.wp-block-post .wp-block-group {
  min-width: 0 !important;
  overflow: hidden !important;
}

/* ── Post Card Title ──────────────── */
.wp-block-post-template .wp-block-post-title,
.wp-block-post .wp-block-post-title {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
  min-width: 0 !important;
  width: 100% !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}
.wp-block-post-template .wp-block-post-title a,
.wp-block-post .wp-block-post-title a {
  display: inline !important;
  color: #1a1a2e !important;
  text-decoration: none !important;
}
.wp-block-post-template .wp-block-post-title a:hover,
.wp-block-post .wp-block-post-title a:hover {
  color: #0066cc !important;
}

/* ── Post Excerpt Clamp ───────────── */
.wp-block-post-template .wp-block-post-excerpt__excerpt,
.wp-block-post .wp-block-post-excerpt__excerpt {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

/* ── Category term badges ─────────── */
.wp-block-post-terms a {
  display: inline-block;
  font-size: 0.7rem !important;
  font-weight: 600;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  color: #fff !important;
  text-decoration: none !important;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #6b7280;
}
.wp-block-post-terms a:hover { opacity: 0.85; }
.wp-block-post-terms a[href*="proxmox"]    { background: #E57000 !important; }
.wp-block-post-terms a[href*="k8s"]        { background: #326CE5 !important; }
.wp-block-post-terms a[href*="/nas"]       { background: #00A67E !important; }
.wp-block-post-terms a[href*="homelab"]    { background: #8B5CF6 !important; }
.wp-block-post-terms a[href*="/ai"]        { background: #EC4899 !important; }
.wp-block-post-terms a[href*="cloud"]      { background: #0EA5E9 !important; }
.wp-block-post-terms a[href*="3d_printer"] { background: #F59E0B !important; }
.wp-block-post-terms a[href*="gaming"]     { background: #EF4444 !important; }
.wp-block-post-terms { line-height: 1; }

/* ── Category Badge (functions.php) ── */
.category-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
  text-decoration: none;
}
.category-badge:hover { opacity: 0.85; color: #fff; }
.cat-proxmox    { background: #E57000; }
.cat-k8s        { background: #326CE5; }
.cat-nas        { background: #00A67E; }
.cat-homelab    { background: #8B5CF6; }
.cat-ai         { background: #EC4899; }
.cat-cloud      { background: #0EA5E9; }
.cat-3d_printer { background: #F59E0B; }
.cat-gaming     { background: #EF4444; }
.cat-uncategorized { background: #6b7280; }

/* ── Single Post ──────────────────── */
.single .entry-content,
.single .wp-block-post-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 1.0625rem;
}
.post-meta-line {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

/* ── TOC (Table of Contents) ──────── */
.toc {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.9rem;
}
.toc > strong, .toc > b, .toc > p:first-child {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
  display: block;
  margin-bottom: 0.75rem;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { padding: 0.3rem 0; border-bottom: 1px solid #f0f0f0; }
.toc li:last-child { border-bottom: none; }
.toc a { color: #4a5568; text-decoration: none; }
.toc a:hover { color: #0066cc; }

/* ── Code Blocks ──────────────────── */
pre {
  background: #1a1a2e !important;
  color: #e0e0e0;
  border-radius: 10px;
  padding: 1.5em;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  position: relative;
}
pre code {
  background: transparent !important;
  color: inherit;
  font-family: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.875rem;
  padding: 0;
}
code {
  background: #f1f5f9;
  color: #e11d48;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
}
pre code { color: #e0e0e0; }
.code-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #9ca3af;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
}
.code-copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Tables ───────────────────────── */
table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; border-radius: 8px; overflow: hidden; }
thead th { background: #1a1a2e; color: #fff; padding: 0.75rem 1rem; text-align: left; font-weight: 600; }
tbody td { padding: 0.75rem 1rem; border-bottom: 1px solid #e5e7eb; }
tbody tr:nth-child(even) { background: #f8f9fa; }
tbody tr:hover { background: #f0f4ff; }
@media (max-width: 768px) { table { display: block; overflow-x: auto; white-space: nowrap; } }

/* ── Images ───────────────────────── */
figure.wp-block-image { margin: 2rem auto; text-align: center; }
figure.wp-block-image img { border-radius: 10px; max-width: 100%; height: auto; }
.image-caption, figcaption { font-size: 0.85rem; color: #9ca3af; text-align: center; margin-top: 0.5rem; font-style: italic; }

/* ── Related Posts ─────────────────── */
.related-posts {
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1.5rem;
  margin: 2rem 0;
}

/* ── Footer ───────────────────────── */
.wp-block-template-part footer { margin-top: 4rem; padding: 2rem 0; border-top: 1px solid #e5e7eb; font-size: 0.85rem; color: #9ca3af; text-align: center; }

/* ── Responsive ───────────────────── */
@media (max-width: 1024px) {
  .wp-block-post-template.is-layout-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
  .wp-block-post-template.is-layout-grid { grid-template-columns: 1fr !important; }
  pre { font-size: 0.8rem; padding: 1em; }
  .single .entry-content, .single .wp-block-post-content { font-size: 1rem; padding: 0 1rem; }
}
