/* ============================================
   na's Security Blog - Custom Theme Styles
   Cybersecurity / CTF aesthetic
   ============================================ */

/* --- Dark mode color overrides --- */
[data-theme="dark"] {
  --global-bg: #0f172a;
  --second-bg: #1e293b;
  --card-bg: #1e293b;
  --font-color: #e2e8f0;
  --hr-border: #334155;
  --sidebar-bg: #1e293b;
}

/* --- Card styling --- */
#aside-content .card-widget,
.layout > div:first-child:not(.recent-posts) {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#aside-content .card-widget:hover {
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.12);
  transform: translateY(-2px);
}

[data-theme="dark"] #aside-content .card-widget,
[data-theme="dark"] .layout > div:first-child:not(.recent-posts) {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] #aside-content .card-widget:hover {
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
}

/* --- Post cards on homepage --- */
.recent-post-item {
  border-radius: 12px !important;
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.recent-post-item:hover {
  box-shadow: 0 8px 30px rgba(14, 165, 233, 0.15);
  transform: translateY(-3px);
}

[data-theme="dark"] .recent-post-item {
  border: 1px solid rgba(51, 65, 85, 0.5);
}

[data-theme="dark"] .recent-post-item:hover {
  border-color: rgba(14, 165, 233, 0.3);
}

/* --- Navigation bar --- */
#nav {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] #nav:not(.hide-menu) {
  background: rgba(15, 23, 42, 0.85) !important;
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0ea5e9, #06b6d4);
  border-radius: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0f172a;
}

/* --- Code blocks --- */
figure.highlight,
.code-area {
  border-radius: 10px !important;
  overflow: hidden;
}

[data-theme="dark"] figure.highlight {
  border: 1px solid rgba(51, 65, 85, 0.5);
}

/* Inline code */
code:not([class]) {
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

[data-theme="dark"] code:not([class]) {
  background: rgba(6, 182, 212, 0.1) !important;
  color: #22d3ee !important;
}

/* --- Blog title glow effect (dark mode) --- */
[data-theme="dark"] #site-info .site-title {
  text-shadow: 0 0 20px rgba(14, 165, 233, 0.5), 0 0 40px rgba(14, 165, 233, 0.2);
}

[data-theme="dark"] #site-info .site-subtitle {
  text-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

/* --- Selection color --- */
::selection {
  background: rgba(14, 165, 233, 0.3);
  color: inherit;
}

/* --- Tag pills styling --- */
.tag-cloud-list a {
  border-radius: 20px !important;
  padding: 4px 12px !important;
  transition: all 0.3s ease;
}

.tag-cloud-list a:hover {
  transform: scale(1.08);
}

/* --- Footer styling --- */
#footer {
  position: relative;
}

[data-theme="dark"] #footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #0ea5e9, transparent);
}

/* --- Article post content --- */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
  position: relative;
}

[data-theme="dark"] .post-content h1,
[data-theme="dark"] .post-content h2 {
  text-shadow: 0 0 8px rgba(14, 165, 233, 0.15);
}

/* --- Blockquote --- */
blockquote {
  border-radius: 0 8px 8px 0;
}

[data-theme="dark"] blockquote {
  background: rgba(14, 165, 233, 0.05);
  border-left: 4px solid #0ea5e9;
}

/* --- TOC styling --- */
.toc-content .toc-link.active {
  border-left-color: #0ea5e9 !important;
}

[data-theme="dark"] .toc-content .toc-link:hover {
  color: #22d3ee !important;
}

/* --- Pagination --- */
#pagination .page-number.current {
  background: linear-gradient(135deg, #0ea5e9, #06b6d4) !important;
  border: none !important;
}

/* --- Smooth animations --- */
a,
.card-widget,
.recent-post-item,
button {
  transition: all 0.3s ease;
}

/* --- Avatar hover glow --- */
[data-theme="dark"] #aside-content .card-widget .avatar-img:hover {
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.4);
}

/* --- Copyright info at bottom of posts --- */
.post-copyright {
  border-radius: 10px;
}

[data-theme="dark"] .post-copyright {
  border-left: 3px solid #0ea5e9;
  background: rgba(14, 165, 233, 0.05);
}

/* --- Related posts --- */
.relatedPosts > .relatedPosts-list > div:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(14, 165, 233, 0.12);
}

/* --- Loading progress bar color --- */
.pace .pace-progress {
  background: linear-gradient(90deg, #0ea5e9, #06b6d4, #22d3ee) !important;
}

/* ============================================
   Category Showcase - 首页分类展示区
   ============================================ */
.category-showcase {
  margin-bottom: 20px;
}

.category-showcase-title {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--font-color, #333);
}

.category-showcase-title i {
  margin-right: 8px;
  color: #0ea5e9;
}

.category-showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.category-showcase-card {
  display: flex;
  align-items: center;
  padding: 20px;
  border-radius: 12px;
  color: #fff !important;
  text-decoration: none !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.category-showcase-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease;
}

.category-showcase-card:hover::before {
  background: rgba(255, 255, 255, 0.1);
}

.category-showcase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.category-showcase-icon {
  font-size: 2em;
  margin-right: 16px;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.category-showcase-info {
  position: relative;
  z-index: 1;
}

.category-showcase-name {
  font-size: 1.15em;
  font-weight: 700;
  margin-bottom: 4px;
}

.category-showcase-desc {
  font-size: 0.8em;
  opacity: 0.85;
  line-height: 1.4;
}

/* 移动端响应式：两列 + 一列 */
@media screen and (max-width: 768px) {
  .category-showcase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 480px) {
  .category-showcase-grid {
    grid-template-columns: 1fr;
  }

  .category-showcase-card {
    padding: 16px;
  }
}

