/* ==========================================================================
   pages.css — Page-specific styles: hero, stats, prose, editor, library,
   dropzone staging, blog toolbar, decorative glows
   ========================================================================== */

/* ---- Hero content --------------------------------------------------------- */
.hero-inner { text-align: center; max-width: 860px; margin-inline: auto; }
.hero-inner h1 { margin: 1rem 0 1.2rem; }
.hero-sub {
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  color: var(--text-muted);
  max-width: 60ch;
  margin: 0 auto 2rem;
}
.hero-cta { gap: 0.8rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  max-width: 900px;
  margin: 3.2rem auto 0;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 0.6rem;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.stat-label { font-size: 0.8rem; color: var(--text-dim); font-weight: 600; }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* thumb play badge on video cards */
.thumb-badge {
  position: absolute;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  animation: pulseRing 2.4s var(--ease) infinite;
}
.thumb-badge svg { width: 22px; height: 22px; color: #fff; margin-left: 3px; }

/* ---- CTA band ------------------------------------------------------------- */
.cta-band {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(2.5rem, 7vw, 4.5rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, var(--bg-elev), var(--bg-elev-2));
}
.cta-band h2 { margin-bottom: 0.7rem; }
.cta-band p { margin-bottom: 1.8rem; }
.cta-glow {
  position: absolute;
  width: 460px; height: 460px;
  top: -180px; left: 50%;
  transform: translateX(-50%);
  background: var(--gradient);
  filter: blur(90px);
  opacity: 0.35;
  animation: glowPulse 6s var(--ease) infinite;
  pointer-events: none;
}

/* ---- Decorative page glow ------------------------------------------------- */
.page-glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: 340px;
  background:
    radial-gradient(circle at 20% 0%, rgba(17, 100, 102, 0.24), transparent 45%),
    radial-gradient(circle at 80% 10%, rgba(255, 203, 154, 0.14), transparent 45%);
  z-index: -1;
  pointer-events: none;
}

/* ---- Blog toolbar --------------------------------------------------------- */
.blog-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.search { position: relative; flex: 1; min-width: 240px; max-width: 460px; }
.search svg {
  position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-dim); pointer-events: none;
}
.search .input { padding-left: 2.7rem; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- Upload grid ---------------------------------------------------------- */
.upload-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.6rem; align-items: start; }
.upload-side h3 { font-size: 1.15rem; }
@media (max-width: 860px) { .upload-grid { grid-template-columns: 1fr; } }

/* Staged files */
.staged-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.9rem 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.staged-item:hover { border-color: var(--border-strong); transform: translateX(4px); }
.up-progress {
  flex-basis: 100%;
  height: 5px;
  margin-top: 0.5rem;
  border-radius: 999px;
  background: var(--surface-strong);
  overflow: hidden;
  display: none;
}
.up-progress.active { display: block; }
.up-bar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gradient);
  transition: width 0.2s ease;
}
.staged-thumb, .lib-icon {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--gradient);
}
.staged-thumb svg, .lib-icon svg { width: 24px; height: 24px; }
.staged-info { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
.staged-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staged-info span { font-size: 0.82rem; }

/* type color accents shared by thumbs/icons */
.type-video { background: linear-gradient(135deg, #0ea5e9, #2563eb) !important; }
.type-ppt { background: linear-gradient(135deg, #f97316, #db2777) !important; }
.type-pdf { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; }
.type-article { background: var(--gradient) !important; }

/* ---- Markdown editor ------------------------------------------------------ */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.editor-pane {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pane-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.md-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.2s var(--ease);
}
.md-btn:hover { color: var(--text); border-color: var(--brand-2); transform: translateY(-1px); }
.editor-textarea {
  border: 0; border-radius: 0; background: transparent;
  min-height: 460px; flex: 1;
}
.editor-textarea:focus { box-shadow: none; }
.editor-preview {
  padding: 1.2rem 1.4rem;
  min-height: 460px;
  overflow: auto;
}
@media (max-width: 860px) { .editor-grid { grid-template-columns: 1fr; } }

/* ---- Library -------------------------------------------------------------- */
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.1rem; }
.lib-card { display: flex; gap: 1rem; align-items: flex-start; padding: 1.2rem; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.lib-main strong { font-size: 1.02rem; line-height: 1.3; }
.lib-meta { font-size: 0.8rem; }
.lib-actions { display: flex; flex-direction: column; gap: 0.4rem; flex: none; }
.lib-actions .icon-btn { width: 36px; height: 36px; }
.lib-actions .icon-btn svg { width: 17px; height: 17px; }
.lib-actions [data-act="delete"]:hover { color: #ffb4b4; border-color: color-mix(in srgb, var(--danger) 45%, transparent); }

/* ---- PPT notice ----------------------------------------------------------- */
.ppt-notice { text-align: center; padding: 2rem 1rem; }
.ppt-notice .feature-icon { margin-inline: auto; }

/* ==========================================================================
   Prose — rendered Markdown (article reader + live preview)
   ========================================================================== */
.prose { color: var(--text); line-height: 1.75; font-size: 1.02rem; }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.8rem 0 0.8rem; line-height: 1.25; }
.prose h1 { font-size: 1.9rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.22rem; }
.prose p { margin: 0.9rem 0; color: var(--text-muted); }
.prose strong { color: var(--text); }
.prose a { color: var(--brand-3); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { margin: 0.9rem 0 0.9rem 1.4rem; color: var(--text-muted); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0.4rem 0; }
.prose img { border-radius: var(--radius); margin: 1.2rem 0; border: 1px solid var(--border); }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2rem 0; }
.prose blockquote {
  margin: 1.2rem 0;
  padding: 0.6rem 1.2rem;
  border-left: 3px solid var(--brand-2);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}
.prose blockquote p { color: var(--text); margin: 0.3rem 0; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  padding: 0.12em 0.42em;
  border-radius: 6px;
  color: #ffcb9a;
}
.prose pre {
  margin: 1.2rem 0;
  padding: 1.1rem 1.3rem;
  background: #0d1117;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow-x: auto;
  position: relative;
}
[data-theme="light"] .prose pre { background: #0f1629; }
.prose pre code {
  background: none; border: 0; padding: 0; color: #c9d1e6; font-size: 0.86rem; line-height: 1.6;
}
.prose pre code[data-lang]:not([data-lang=""])::before {
  content: attr(data-lang);
  position: absolute; top: 0.5rem; right: 0.8rem;
  font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim);
}

/* ---- Footer social (LinkedIn) link --------------------------------------- */
.footer .social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.1rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease),
    transform 0.25s var(--ease), background 0.25s var(--ease);
}
.footer .social-link svg { width: 18px; height: 18px; }
.footer .social-link:hover {
  color: #0a66c2;
  border-color: color-mix(in srgb, #0a66c2 55%, transparent);
  background: var(--surface-strong);
  transform: translateY(-2px);
}
