/* ============================================================
   xuexi.kr/blog — OpenClaw custom design layer
   Loaded AFTER blog.css. Safe across generator rebuilds
   because it lives in openclaw-blog/assets/css/custom.css
   and is copied verbatim by builder.py.
   ============================================================ */

:root {
  --oc-blue: #2563eb;
  --oc-cyan: #0284c7;
  --oc-blue-grad: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  --oc-blue-soft: #eff6ff;
  --oc-ink: #0f172a;
  --oc-body: #334155;
  --oc-muted: #64748b;
  --oc-line: #e8edf4;
  --oc-bg: #f5f8fe;
  --oc-card: #ffffff;
  --oc-radius: 18px;
  --oc-radius-sm: 12px;
  --oc-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --oc-shadow: 0 10px 30px -14px rgba(37, 99, 235, .22);
  --oc-shadow-lg: 0 24px 60px -24px rgba(37, 99, 235, .35);
}

/* ---------- page canvas ---------- */
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, #e8f1ff 0%, rgba(232, 241, 255, 0) 60%),
    radial-gradient(1000px 500px at -10% 0%, #eafaf1 0%, rgba(234, 250, 241, 0) 55%),
    var(--oc-bg);
  color: var(--oc-body);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.7;
}

/* ---------- hide info topbar ---------- */
.site-topbar { display: none !important; }

/* ---------- gradient header + nav ---------- */
.site-header {
  background: var(--oc-blue-grad) !important;
  border-bottom: none !important;
  box-shadow: 0 6px 24px -10px rgba(37, 99, 235, .55);
}
.brand-logo { color: #fff !important; letter-spacing: -.02em; }
.brand-badge {
  background: rgba(255, 255, 255, .18) !important;
  color: #fff !important;
  backdrop-filter: blur(4px);
}
.main-nav .nav-link { color: rgba(255, 255, 255, .9) !important; transition: background .15s, color .15s; }
.main-nav .nav-link:hover { background: rgba(255, 255, 255, .16) !important; color: #fff !important; }
.main-nav .nav-link.active { background: rgba(255, 255, 255, .24) !important; color: #fff !important; }
.header-actions .btn-cta {
  background: #fff !important;
  color: var(--oc-blue) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.menu-toggle-btn span { background: #fff !important; }

/* ---------- layout grid ---------- */
.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 36px;
  align-items: start;
  padding: 36px 0 64px;
}
@media (max-width: 980px) {
  .layout-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- HERO ---------- */
.blog-hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 54px 48px;
  margin-bottom: 38px;
  background: var(--oc-blue-grad);
  color: #fff;
  box-shadow: var(--oc-shadow-lg);
}
.blog-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 220px at 88% 12%, rgba(255, 255, 255, .22), transparent 60%),
    radial-gradient(360px 200px at 12% 120%, rgba(255, 255, 255, .14), transparent 60%);
  pointer-events: none;
}
.blog-hero > * { position: relative; z-index: 1; }
.blog-hero .hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  background: rgba(255, 255, 255, .18);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.blog-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2; font-weight: 800; letter-spacing: -.02em;
  margin: 0 0 14px;
}
.blog-hero p { font-size: 17px; opacity: .94; max-width: 60ch; margin: 0 0 26px; }
.hero-search {
  display: flex; gap: 10px; max-width: 560px;
}
.hero-search input {
  flex: 1; border: none; border-radius: 999px;
  padding: 14px 22px; font-size: 15px; color: var(--oc-ink);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.hero-search input:focus { outline: 3px solid rgba(255, 255, 255, .5); }
.hero-search button {
  border: none; cursor: pointer; border-radius: 999px;
  padding: 0 24px; font-weight: 700; color: var(--oc-blue);
  background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.hero-stats { display: flex; gap: 28px; margin-top: 26px; flex-wrap: wrap; }
.hero-stats div { font-size: 14px; opacity: .95; }
.hero-stats strong { display: block; font-size: 22px; font-weight: 800; }

/* ---------- category quick nav ---------- */
.cat-nav {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px;
}
.cat-nav a {
  font-size: 13.5px; font-weight: 700; color: var(--oc-blue);
  background: var(--oc-blue-soft); border: 1px solid #dbeafe;
  padding: 8px 16px; border-radius: 999px; transition: .15s;
}
.cat-nav a:hover { background: var(--oc-blue); color: #fff; transform: translateY(-1px); }

/* ---------- section heading ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 6px 0 18px;
}
.section-head h2 {
  font-size: 22px; font-weight: 800; color: var(--oc-ink); letter-spacing: -.01em;
  display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
  content: ""; width: 6px; height: 22px; border-radius: 999px; background: var(--oc-blue-grad);
}
.section-head a { font-size: 13px; color: var(--oc-muted); font-weight: 600; }

/* ---------- post cards ---------- */
.post-card {
  position: relative;
  background: var(--oc-card);
  border: 1px solid var(--oc-line);
  border-radius: var(--oc-radius);
  padding: 24px 24px 20px;
  margin-bottom: 22px;
  box-shadow: var(--oc-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}
.post-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--oc-blue-grad); opacity: 0; transition: opacity .18s;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--oc-shadow);
  border-color: #cfe0ff;
}
.post-card:hover::before { opacity: 1; }
.card-meta-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.category-badge {
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700; color: var(--oc-blue);
  background: var(--oc-blue-soft); border: 1px solid #dbeafe;
  padding: 4px 12px; border-radius: 999px;
}
.post-date { font-size: 12.5px; color: var(--oc-muted); }
.post-title { font-size: 19px; line-height: 1.4; margin: 4px 0 10px; }
.post-title a { color: var(--oc-ink); text-decoration: none; transition: color .15s; }
.post-title a:hover { color: var(--oc-blue); }
.post-summary { font-size: 14.5px; color: var(--oc-body); margin: 0 0 16px; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.btn-read-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; font-weight: 700; color: var(--oc-blue);
  text-decoration: none;
}
.btn-read-more span:last-child { transition: transform .15s; }
.btn-read-more:hover span:last-child { transform: translateX(4px); }
.card-author-info { font-size: 12.5px; color: var(--oc-muted); }

/* ---------- featured post ---------- */
.featured-post {
  background: var(--oc-card); border: 1px solid var(--oc-line);
  border-radius: var(--oc-radius); overflow: hidden;
  box-shadow: var(--oc-shadow); margin-bottom: 34px;
}
.featured-post .fp-body { padding: 32px 34px; }
.featured-post .fp-tag {
  font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--oc-blue);
}
.featured-post h2 { font-size: 26px; line-height: 1.3; margin: 10px 0 12px; letter-spacing: -.01em; }
.featured-post h2 a { color: var(--oc-ink); text-decoration: none; }
.featured-post p { color: var(--oc-body); font-size: 15px; }

/* ---------- pagination ---------- */
.pagination-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.page-btn {
  min-width: 40px; text-align: center; padding: 9px 14px;
  border-radius: 12px; border: 1px solid var(--oc-line);
  background: #fff; color: var(--oc-body); font-weight: 700; font-size: 14px;
  text-decoration: none; transition: .15s;
}
.page-btn:hover { border-color: var(--oc-blue); color: var(--oc-blue); }
.page-btn.active { background: var(--oc-blue-grad); color: #fff; border-color: transparent; box-shadow: var(--oc-shadow-sm); }

/* ---------- sidebar ---------- */
.sidebar-sticky { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 22px; }
.sidebar-box {
  background: var(--oc-card); border: 1px solid var(--oc-line);
  border-radius: var(--oc-radius); padding: 20px; box-shadow: var(--oc-shadow-sm);
}
.sidebar-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--oc-ink); margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 2px solid var(--oc-blue-soft);
  display: flex; align-items: center; gap: 8px;
}

/* capsule search with magnifier */
.search-input-group {
  position: relative; display: flex; align-items: center;
  background: #fff; border: 1.5px solid #bfdbfe; border-radius: 999px;
  padding: 3px 14px 3px 40px; box-shadow: 0 1px 6px rgba(37,99,235,.1);
  transition: border-color .15s, box-shadow .15s;
}
.search-input-group::before {
  content: "\1F50D"; position: absolute; left: 15px; top: 50%;
  transform: translateY(-50%); font-size: 14px; opacity: .55;
}
.search-input-group input {
  border: none !important; background: transparent !important;
  padding: 10px 28px 10px 0 !important; box-shadow: none !important; width: 100%;
}
.search-input-group input:focus { outline: none; }
.search-input-group:focus-within { border-color: var(--oc-blue); box-shadow: 0 0 0 4px rgba(37,99,235,.16); }
.search-clear-btn { right: 14px; cursor: pointer; color: var(--oc-muted); font-weight: 700; }

/* quick links — 6 colors */
.sidebar-buttons { display: flex; flex-direction: column; gap: 8px; }
.sb-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: 12px; padding: 11px 14px; font-weight: 700; font-size: 14px;
  text-decoration: none; color: var(--oc-ink); background: #f8fafc;
  border: 1px solid var(--oc-line); transition: transform .12s, box-shadow .12s;
}
.sb-btn:hover { transform: translateX(3px); box-shadow: var(--oc-shadow-sm); }
.sb-btn .sb-arrow { color: var(--oc-muted); }
.sidebar-buttons .sb-btn:nth-child(6n+1) { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.sidebar-buttons .sb-btn:nth-child(6n+2) { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.sidebar-buttons .sb-btn:nth-child(6n+3) { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.sidebar-buttons .sb-btn:nth-child(6n+4) { background: #fefce8; color: #ca8a04; border-color: #fde68a; }
.sidebar-buttons .sb-btn:nth-child(6n+5) { background: #faf5ff; color: #7c3aed; border-color: #ddd6fe; }
.sidebar-buttons .sb-btn:nth-child(6n+6) { background: #fff7ed; color: #ea580c; border-color: #fed7aa; }

/* colorful tag cloud — 8 hues */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item {
  font-size: 12.5px !important; font-weight: 700 !important; border-radius: 999px !important;
  padding: 5px 12px !important; text-decoration: none; transition: transform .15s, filter .15s;
}
.tag-item:hover { transform: translateY(-1px); filter: brightness(1.05); }
.tag-item:nth-child(8n+1) { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.tag-item:nth-child(8n+2) { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.tag-item:nth-child(8n+3) { background: #fefce8; color: #ca8a04; border: 1px solid #fde68a; }
.tag-item:nth-child(8n+4) { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.tag-item:nth-child(8n+5) { background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }
.tag-item:nth-child(8n+6) { background: #faf5ff; color: #7c3aed; border: 1px solid #ddd6fe; }
.tag-item:nth-child(8n+7) { background: #fdf2f8; color: #db2777; border: 1px solid #fbcfe8; }
.tag-item:nth-child(8n+8) { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }

/* ---------- CTA band ---------- */
.cta-band {
  margin: 8px 0 40px; border-radius: 24px; padding: 36px 40px;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  box-shadow: var(--oc-shadow-lg);
}
.cta-band h3 { font-size: 22px; margin: 0 0 6px; }
.cta-band p { margin: 0; opacity: .9; }
.cta-band a {
  background: #fff; color: var(--oc-blue); font-weight: 800; text-decoration: none;
  padding: 13px 26px; border-radius: 999px; white-space: nowrap;
}

/* ---------- article page polish ---------- */
.article-container { max-width: 760px; margin: 0 auto; }
.breadcrumb-nav { font-size: 13px; color: var(--oc-muted); margin-bottom: 18px; }
.breadcrumb-nav a { color: var(--oc-blue); text-decoration: none; }
.article-header { margin-bottom: 26px; }
.article-title { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.25; letter-spacing: -.02em; color: var(--oc-ink); }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 13.5px; color: var(--oc-muted); align-items: center; }
.author-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--oc-blue-soft); color: var(--oc-blue); padding: 5px 12px; border-radius: 999px; font-weight: 700; }
.geo-direct-answer {
  background: linear-gradient(135deg, #f0f7ff 0%, #fefce8 100%);
  border: 1px solid #dbeafe; border-left: 4px solid var(--oc-blue);
  border-radius: 14px; padding: 18px 20px; margin: 22px 0;
}
.geo-badge-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.geo-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--oc-ink); }
.geo-badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--oc-blue); padding: 3px 10px; border-radius: 999px; }
.geo-summary-text { font-size: 15px; color: var(--oc-body); }
.article-body { font-size: 16px; color: var(--oc-body); }
.article-body h2, .article-body h3 { color: var(--oc-ink); margin-top: 28px; }
.article-body img { max-width: 100%; border-radius: 12px; }
.article-body blockquote { border-left: 4px solid var(--oc-blue); background: var(--oc-blue-soft); margin: 18px 0; padding: 12px 18px; border-radius: 0 12px 12px 0; color: var(--oc-body); }
.article-body table { width: 100%; border-collapse: collapse; margin: 18px 0; }
.article-body th, .article-body td { border: 1px solid var(--oc-line); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--oc-blue-soft); color: var(--oc-ink); }
.faq-section { margin: 30px 0; }
.faq-title { font-size: 20px; color: var(--oc-ink); margin-bottom: 14px; }
.faq-item { border: 1px solid var(--oc-line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.faq-question { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; font-weight: 700; color: var(--oc-ink); cursor: pointer; background: #fff; }
.faq-answer { padding: 0 18px 16px; color: var(--oc-body); }
.author-cta-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  margin-top: 34px; padding: 24px 28px; border-radius: var(--oc-radius);
  background: var(--oc-blue-soft); border: 1px solid #dbeafe;
}
.author-cta-info h4 { margin: 0 0 6px; color: var(--oc-ink); font-size: 17px; }
.author-cta-info p { margin: 0; color: var(--oc-body); font-size: 14px; }
.author-cta-card .btn-cta { background: var(--oc-blue-grad); color: #fff !important; border: none; border-radius: 999px; padding: 12px 24px; font-weight: 800; text-decoration: none; white-space: nowrap; }

/* ---------- reading progress (ensure visible on gradient header) ---------- */
#reading-progress { z-index: 2000 !important; }

/* ---------- footer spacing ---------- */
.site-footer, footer { margin-top: 40px; }

/* ---------- mobile ---------- */
@media (max-width: 768px) {
  .blog-hero { padding: 38px 24px; border-radius: 20px; }
  .hero-search { flex-direction: column; }
  .hero-search button { padding: 12px; }
  .sidebar-sticky { position: static; }
  .main-nav {
    background: var(--oc-blue-grad); border-radius: 0 0 16px 16px; padding: 10px;
    box-shadow: 0 10px 24px rgba(37,99,235,.3);
  }
  .main-nav .nav-link { color: #fff !important; }
}
