/* ============================
   Microsoft Copilot Agentic Blog
   Multi-Section Style
   ============================ */

:root {
  --header-bg: #1B1F2B;
  --header-text: #FFFFFF;
  --sidebar-bg: #F8F9FA;
  --sidebar-width: 272px;
  --sidebar-border: #E5E7EB;
  --sidebar-hover: #EEF0F4;
  --sidebar-active-bg: #E8E0F0;
  --sidebar-active-text: #6B21A8;
  --sidebar-active-border: #7C3AED;
  --content-bg: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --accent: #7C3AED;
  --accent-light: #EDE9FE;
  --accent-dark: #5B21B6;
  --link: #7C3AED;
  --link-hover: #5B21B6;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 6px rgba(0,0,0,0.07), 0 10px 15px rgba(0,0,0,0.1);
  --max-content: 1120px;
  --font-sans: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--content-bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  /* 전체 화면 크기 확대 (브라우저 확대와 동일한 효과) */
  zoom: 1.2;
}

a { color: var(--link); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--link-hover); }

/* ===== Header ===== */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  height: 56px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
  max-width: 100%;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--header-text);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.header-logo:hover { color: var(--header-text); opacity: 0.9; }

.logo-svg { color: var(--accent); opacity: 0.9; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}

.header-nav a:hover { color: #FFFFFF; }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--header-text);
  cursor: pointer;
  padding: 4px;
}

/* ===== Layout ===== */
.site-wrapper {
  display: flex;
  max-width: 1680px;
  margin: 0 auto;
  min-height: 100vh;
  padding-top: 56px;
}

/* ===== Sidebar ===== */
.site-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  padding: 20px 0;
}

.site-sidebar::-webkit-scrollbar { width: 4px; }
.site-sidebar::-webkit-scrollbar-track { background: transparent; }
.site-sidebar::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }

.sidebar-header {
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 10px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 450;
  line-height: 1.4;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.sidebar-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
  border-left-color: var(--sidebar-active-border);
}

.sidebar-icon { font-size: 16px; flex-shrink: 0; }
.sidebar-label { flex: 1; }

/* ===== Sidebar Sections (Hierarchical Nav) ===== */
.sidebar-section {
  margin-top: 4px;
}

.sidebar-section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius);
  background: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.sidebar-section-toggle:hover {
  background: var(--sidebar-hover);
}

.sidebar-section-toggle.active {
  color: var(--sidebar-active-text);
}

.sidebar-section-link {
  text-decoration: none;
}

.sidebar-chevron {
  margin-left: auto;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.sidebar-section.open .sidebar-chevron {
  transform: rotate(90deg);
}

.sidebar-section-items {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding-left: 8px;
  margin-top: 2px;
}

.sidebar-section.open .sidebar-section-items {
  display: flex;
}

.sidebar-link.sub {
  padding: 6px 10px 6px 12px;
  font-size: 13.5px;
  font-weight: 400;
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-left: 8px;
}

.sidebar-link.sub:hover {
  border-left-color: var(--accent);
  background: var(--sidebar-hover);
}

.sidebar-link.sub.active {
  border-left-color: var(--sidebar-active-border);
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

/* ===== Main Content ===== */
.site-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.main-content {
  max-width: var(--max-content);
  width: 100%;
  margin: 0 auto;
  padding: 40px 48px;
  flex: 1;
}

/* ===== Home Page ===== */
.home-hero {
  margin-bottom: 22px;
}

.home-hero h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.home-hero .hero-sub {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 680px;
}

.home-section {
  margin-bottom: 32px;
}

.home-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.chapter-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateX(2px);
  color: var(--text);
}

.chapter-item .item-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: var(--radius);
}

.chapter-item .item-body { flex: 1; min-width: 0; }

.chapter-item .item-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.chapter-item .item-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.chapter-item .item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.chapter-item .item-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: 10px;
  font-weight: 500;
}

/* Workshop item tags */
.chapter-item .item-tag.ws {
  background: #D1FAE5;
  color: #065F46;
}

/* Updates item tags */
.chapter-item .item-tag.up {
  background: #FEF3C7;
  color: #92400E;
}

/* Workshop chapter items */
.chapter-item.workshop:hover {
  border-color: #059669;
}

.chapter-item.workshop .item-icon {
  background: #D1FAE5;
}

/* Updates chapter items */
.chapter-item.updates:hover {
  border-color: #D97706;
}

.chapter-item.updates .item-icon {
  background: #FEF3C7;
}

/* Section description on homepage */
.section-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Home info box */
.home-info {
  padding: 20px 24px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: 1.7;
  color: #92400E;
}

.home-info strong { color: #78350F; }

/* ===== Chapter Article ===== */
.chapter-article {}

.chapter-header {
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.chapter-meta { margin-bottom: 12px; }

.chapter-badge {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: white;
  padding: 3px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.chapter-badge.workshop {
  background: #059669;
}

.chapter-badge.updates {
  background: #D97706;
}

.chapter-badge.newcs {
  background: linear-gradient(135deg, #7C3AED, #DB2777);
}

.chapter-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.chapter-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Chapter Body Typography ===== */
.chapter-body h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 48px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  letter-spacing: -0.01em;
}

.chapter-body h2:first-child { margin-top: 0; }

.chapter-body h3 {
  font-size: 20px;
  font-weight: 650;
  margin: 32px 0 12px;
  color: var(--text);
}

.chapter-body h4 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text);
}

.chapter-body p {
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.8;
  font-size: 16px;
}

.chapter-body ul, .chapter-body ol {
  margin: 8px 0 20px 24px;
}

.chapter-body li {
  margin-bottom: 6px;
  line-height: 1.7;
  font-size: 16px;
}

.chapter-body strong { font-weight: 650; }

.chapter-body a { text-decoration: underline; text-underline-offset: 2px; }
.chapter-body a:hover { text-decoration-color: var(--accent); }

/* Code */
.chapter-body code {
  background: #F3F4F6;
  padding: 1.5px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: #BE185D;
}

.chapter-body pre {
  background: #0D1117;
  color: #C9D1D9;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 16px 0 24px;
  font-size: 14px;
  line-height: 1.65;
  border: 1px solid #21262D;
  position: relative;
}

.chapter-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Blockquote */
.chapter-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-light);
  padding: 14px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  color: var(--accent-dark);
}

/* Tables */
.chapter-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chapter-body thead { background: var(--sidebar-bg); }

.chapter-body th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 650;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  font-size: 13px;
}

.chapter-body td {
  padding: 10px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.chapter-body tbody tr:last-child td { border-bottom: none; }
.chapter-body tbody tr:hover { background: #FAFBFC; }

/* Info boxes */
.info-box {
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.7;
  border: 1px solid;
}

.info-box strong {
  font-weight: 700;
}

.info-box.tip {
  background: #F0FDF4;
  border-color: #BBF7D0;
  color: #166534;
}

.info-box.tip strong { color: #15803D; }

.info-box.warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #92400E;
}

.info-box.warning strong { color: #B45309; }

.info-box.note {
  background: #EFF6FF;
  border-color: #BFDBFE;
  color: #1E40AF;
}

.info-box.note strong { color: #1D4ED8; }

/* Figures / screenshots */
.chapter-body figure.screenshot {
  margin: 20px 0 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sidebar-bg);
}

.chapter-body figure.screenshot img {
  display: block;
  max-width: 100%;
  max-height: 75vh;   /* 세로로 긴 이미지 자동 축소 */
  width: auto;
  height: auto;
  margin: 0 auto;
}

.chapter-body figure.screenshot figcaption {
  padding: 10px 16px;
  font-size: 12.5px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-light);
  background: #FFFFFF;
}

/* Screenshot not yet added (img failed to load) */
.chapter-body figure.screenshot.pending {
  border-style: dashed;
  border-color: var(--sidebar-active-border);
  background: var(--accent-light);
}

.chapter-body figure.screenshot.pending figcaption {
  border-top: none;
  background: transparent;
  color: var(--accent-dark);
}

.chapter-body figure.screenshot.pending figcaption::before {
  content: "📷 스크린샷 준비 중 — ";
  font-weight: 700;
}

/* Clickable screenshots → lightbox */
.chapter-body figure.screenshot:not(.pending) img {
  cursor: zoom-in;
  transition: filter 0.15s ease;
}
.chapter-body figure.screenshot:not(.pending) img:hover {
  filter: brightness(1.04);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(15, 18, 25, 0.9);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
  cursor: zoom-out;
}
.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
}
.lightbox-overlay img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  transform: scale(0.97);
  transition: transform 0.18s ease;
  cursor: default;
}
.lightbox-overlay.open img {
  transform: scale(1);
}
.lightbox-caption {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 1.5;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Featured home section (New Copilot Studio) */
.home-section.featured {
  padding: 24px;
  margin-bottom: 56px;
  border: 1px solid var(--sidebar-active-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--accent-light) 0%, #FFFFFF 60%);
}

.home-section.featured h2 { font-size: 22px; }

.home-section .section-badge {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: linear-gradient(135deg, #7C3AED, #DB2777);
}

/* ===== Pagination ===== */
.chapter-pagination {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.pagination-link {
  display: flex;
  flex-direction: column;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none !important;
  transition: all 0.2s;
  max-width: 48%;
}

.pagination-link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.pagination-link.next { text-align: right; margin-left: auto; }

.pagination-direction {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.pagination-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* ===== Footer ===== */
.site-footer {
  padding: 24px 48px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
}

.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--accent); }

/* ===== Mobile Overlay ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}

.mobile-overlay.open { display: block; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .main-content { padding: 32px 32px; }
}

@media (max-width: 960px) {
  .header-nav { display: none; }
  .mobile-menu-btn { display: block; }

  .site-sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    height: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 150;
    background: #FFFFFF;
    box-shadow: var(--shadow-lg);
  }

  .site-sidebar.open { transform: translateX(0); }

  .main-content { padding: 24px 20px; }

  .home-hero h1 { font-size: 26px; }

  .chapter-title { font-size: 24px; }

  .chapter-pagination { flex-direction: column; }
  .pagination-link { max-width: 100%; }
  .pagination-link.next { text-align: left; }
}

/* ===== Workshop Image Sizing ===== */
.chapter-body img {
  max-width: 100%;
  height: auto !important;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 16px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.chapter-body img[width] {
  width: auto;
  max-width: 100%;
  height: auto !important;
}

/* ===== Sidebar Hierarchical (Workshop) ===== */
.sidebar-group {
  margin: 0;
}

.sidebar-parent {
  display: flex;
  align-items: center;
  font-weight: 600;
  flex: 1;
  min-width: 0;
}

.sidebar-parent .sidebar-label {
  flex: 1;
}

.sidebar-chevron-sm {
  flex-shrink: 0;
  margin-left: 4px;
  transition: transform 0.2s;
  opacity: 0.5;
}

.sidebar-group.open > .sidebar-parent .sidebar-chevron-sm {
  transform: rotate(90deg);
}

.sidebar-children {
  display: none;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-left: 16px;
}

.sidebar-group.open > .sidebar-children {
  display: block;
}

.sidebar-link.child {
  padding: 5px 8px 5px 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.sidebar-link.child:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.sidebar-link.child.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 500;
}

.sidebar-link.child .sidebar-icon {
  font-size: 12px;
  width: 18px;
  text-align: center;
}

/* ===== Code Copy Button ===== */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(110, 118, 129, 0.4);
  border: none;
  border-radius: 6px;
  color: #C9D1D9;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 1;
}

.chapter-body pre:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  background: rgba(110, 118, 129, 0.7);
}

.code-copy-btn.copied {
  background: #238636;
  opacity: 1;
}

.code-copy-btn svg {
  width: 14px;
  height: 14px;
}

/* ===================================================================
   v2 Redesign — 3-column aside, home card feed, widgets, TOC, nav group
   =================================================================== */

/* Right rail */
.site-aside {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 28px 20px 40px;
  border-left: 1px solid var(--border);
}
.site-aside::-webkit-scrollbar { width: 4px; }
.site-aside::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 4px; }

.widget { margin-bottom: 28px; }
.widget-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-secondary);
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--border);
}
.widget-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.widget-list li { display: flex; flex-direction: column; gap: 2px; }
.widget-list a { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; }
.widget-list a:hover { color: var(--accent); }
.widget-date { font-size: 12px; color: var(--text-light); }

/* In-page TOC */
.toc-nav { display: flex; flex-direction: column; gap: 2px; }
.toc-link {
  font-size: 13px; color: var(--text-secondary); line-height: 1.4;
  padding: 4px 8px; border-left: 2px solid transparent; border-radius: 0 4px 4px 0;
  white-space: normal;
}
.toc-link:hover { color: var(--text); background: var(--sidebar-hover); }
.toc-link.toc-h3 { padding-left: 20px; font-size: 12.5px; }
.toc-link.active {
  color: var(--accent); border-left-color: var(--accent);
  font-weight: 600; background: var(--accent-light);
}

/* Home card feed */
.card-feed { display: flex; flex-direction: column; gap: 11px; width: 100%; }
.post-card {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: #fff; overflow: hidden; transition: box-shadow .18s, transform .18s;
}
.post-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.post-card-link { display: flex; color: inherit; }
.post-card-thumb {
  flex-shrink: 0; width: 132px; min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6B21A8, #7C3AED);
}
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-label {
  color: #fff; font-weight: 700; font-size: 13px; text-align: center;
  padding: 0 12px; opacity: .95; letter-spacing: -.01em;
}
.thumb-newcs { background: linear-gradient(135deg,#5B21B6,#7C3AED); }

/* ===== Lab 태그 칩 ===== */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.chapter-header .tag-row { margin: 12px 0 0; }
.post-card-tags { margin: 8px 0 0; }
.tag-chip {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
  letter-spacing: -.01em;
}
/* 팔레트별 색상 (slug = 소문자·공백을 -로) */
.tag-new-copilot-studio   { background: #EDE9FE; color: #6D28D9; border-color: #DDD6FE; }
.tag-classic-copilot-studio { background: #E0F2FE; color: #0369A1; border-color: #BAE6FD; }
.tag-new-work-flow        { background: #DCFCE7; color: #15803D; border-color: #BBF7D0; }
.tag-power-platform-admin { background: #FFEDD5; color: #C2410C; border-color: #FED7AA; }
.tag-power-platform       { background: #FFEDD5; color: #C2410C; border-color: #FED7AA; }
.tag-administrator        { background: #FEF9C3; color: #A16207; border-color: #FDE68A; }
.tag-cowork               { background: #FCE7F3; color: #BE185D; border-color: #FBCFE8; }
.tag-scout                { background: #E0E7FF; color: #4338CA; border-color: #C7D2FE; }
.thumb-newcslab { background: linear-gradient(135deg,#0E7490,#06B6D4); }
.thumb-updates { background: linear-gradient(135deg,#B45309,#F59E0B); }
.thumb-catblog { background: linear-gradient(135deg,#9D174D,#EC4899); }
.thumb-academy-courses { background: linear-gradient(135deg,#1E3A8A,#3B82F6); }
.thumb-academy-labs { background: linear-gradient(135deg,#065F46,#10B981); }
.thumb-cowork { background: linear-gradient(135deg,#374151,#6B7280); }
.thumb-scout { background: linear-gradient(135deg,#7C2D12,#EA580C); }
.thumb-m365 { background: linear-gradient(135deg,#1E3A8A,#2563EB); }
.thumb-guide, .thumb-workshop, .thumb-special { background: linear-gradient(135deg,#334155,#64748B); }

/* ===== 홈 섹션 제목 + 가로 스크롤 카드 ===== */
.home-section { margin: 6px 0 28px; }
.home-section + .home-section { margin-top: 10px; }
.home-section-head { margin: 0 0 12px; }
.home-section-title {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -.02em; margin: 0;
}
.home-section-sub { font-size: 13.5px; color: var(--text-light); margin: 4px 0 0; }

.hscroll-block { margin: 0 0 24px; }
.hscroll-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 10px; }
.hscroll-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em; margin: 0;
  padding-left: 10px; border-left: 3px solid var(--accent);
}
.hscroll-row {
  display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 12px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.hscroll-row::-webkit-scrollbar { height: 8px; }
.hscroll-row::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 999px; }
.hscroll-row::-webkit-scrollbar-track { background: transparent; }
.hscroll-empty { color: var(--text-light); font-size: 13px; padding: 16px 2px; }

.hcard {
  flex: 0 0 232px; scroll-snap-align: start;
  display: flex; flex-direction: column; color: inherit;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: #fff; overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}
.hcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.hcard-thumb {
  height: 116px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg,#6B21A8,#7C3AED);
}
.hcard-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hcard-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; }
.hcard-cat { font-size: 10.5px; font-weight: 600; color: var(--accent); }
.hcard-title {
  font-size: 14px; font-weight: 700; color: var(--text); margin: 0;
  line-height: 1.35; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hcard-date { font-size: 11.5px; color: var(--text-light); }

.post-card-body { padding: 11px 13px; min-width: 0; }
.post-card-cat { font-size: 10.5px; font-weight: 600; color: var(--accent); margin-bottom: 3px; }
.post-card-title {
  font-size: 14px; font-weight: 700; color: var(--text);
  line-height: 1.3; margin-bottom: 4px; letter-spacing: -.01em;
}
.post-card:hover .post-card-title { color: var(--accent); }
.post-card-desc {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta { font-size: 11px; color: var(--text-light); display: flex; gap: 6px; }

/* ===== 추천 사이트 카드 ===== */
.resource-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.resource-card {
  display: block; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: #fff; color: inherit; text-decoration: none;
  transition: box-shadow .18s, transform .18s;
}
.resource-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.resource-card-head { display: flex; align-items: flex-start; gap: 8px; }
.resource-card-title {
  flex: 1; margin: 0; font-size: 15.5px; font-weight: 700;
  color: var(--text); line-height: 1.35; letter-spacing: -.01em;
}
.resource-card:hover .resource-card-title { color: var(--accent); }
.resource-card-ext { flex-shrink: 0; margin-top: 2px; color: var(--text-light); opacity: .7; }
.resource-card-url { margin: 6px 0 0; font-size: 12px; color: var(--accent); word-break: break-all; }
.resource-card-desc { margin: 9px 0 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
@media (max-width: 768px) { .resource-grid { grid-template-columns: 1fr; } }

/* 홈 '최근 포스팅' 카드: 고정 높이 90px (컴팩트) — 데스크톱만 적용, 모바일 세로 스택 제외 */
@media (min-width: 769px) {
  .home-section .post-card,
  .home-section .post-card-link { height: 90px; }
  .home-section .post-card { overflow: hidden; }
  .home-section .post-card-thumb { height: 90px; min-height: 90px; }
  .home-section .post-card-body { padding: 9px 13px; align-self: center; }
  .home-section .post-card-title {
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; margin-bottom: 2px;
  }
  .home-section .post-card-desc { -webkit-line-clamp: 1; margin-bottom: 4px; }
  .home-section .post-card-tags { display: none; }
}

/* Sidebar supergroup (Classic archive) */
.sidebar-supergroup { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; }
.sidebar-supergroup-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: none; background: none; cursor: pointer; text-align: left;
  color: var(--text-secondary); font-family: var(--font-sans);
  font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  border-radius: var(--radius);
}
.sidebar-supergroup-toggle:hover { background: var(--sidebar-hover); }
.sidebar-supergroup .sidebar-chevron { margin-left: auto; opacity: .5; transition: transform .2s; }
.sidebar-supergroup.open > .sidebar-supergroup-toggle .sidebar-chevron { transform: rotate(90deg); }
.sidebar-supergroup-items { display: none; padding-left: 6px; }
.sidebar-supergroup.open > .sidebar-supergroup-items { display: block; }

.sidebar-empty { display: block; padding: 8px 16px; font-size: 13px; color: var(--text-light); font-style: italic; }

/* Chapter post date */
.chapter-postmeta { margin-top: 12px; font-size: 13px; color: var(--text-light); }

/* Header search (top-right, next to Home) */
.header-search { position: relative; display: flex; align-items: center; }
.search-input {
  width: 190px; padding: 6px 12px; font-size: 13.5px;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 999px;
  background: rgba(255,255,255,0.12); color: #fff; font-family: var(--font-sans);
  transition: width .2s, background .2s, border-color .2s;
}
.search-input::placeholder { color: rgba(255,255,255,0.6); }
.search-input:focus {
  outline: none; width: 260px;
  background: rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5);
}
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 360px; max-width: 82vw; max-height: 70vh; overflow-y: auto; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 300; padding: 4px;
}
.search-hit { display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: 6px; }
.search-hit:hover { background: var(--sidebar-hover); }
.search-hit-cat { font-size: 11px; color: var(--accent); font-weight: 600; }
.search-hit-title { font-size: 13.5px; color: var(--text); line-height: 1.3; }
.search-empty { padding: 12px; font-size: 13px; color: var(--text-light); text-align: center; }

/* Responsive */
@media (max-width: 1200px) {
  .site-aside { display: none; }
}
@media (max-width: 720px) {
  .post-card-link { flex-direction: column; }
  .post-card-thumb { width: 100%; min-height: 120px; }
}
