/* ============================================================
   Custom styles — layered on top of hugo-clarity
   ============================================================ */

:root {
  --brand: #0a7ea4;
  --brand-dark: #056b8a;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.1), 0 8px 28px rgba(15, 23, 42, 0.08);
}

/* ---------- Chinese-friendly typography ---------- */
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: 0.01em;
}

/* ---------- Home hero ---------- */
.home-hero {
  margin: 2.2rem 0 1.6rem;
  padding: 2.4rem 2rem;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(10, 126, 164, 0.1) 0%, rgba(10, 126, 164, 0.02) 60%),
    var(--post-bg, #fff);
  border: 1px solid var(--table-border, rgba(0, 0, 0, 0.06));
}

.home-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.9rem;
  line-height: 1.3;
}

.home-hero p {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  max-width: 46rem;
}

.home-hero .hero-links {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.home-hero .hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--table-border, rgba(0, 0, 0, 0.12));
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s var(--ease, ease);
}

.home-hero .hero-links a:hover {
  color: var(--brand);
  border-color: var(--brand);
}

html[data-mode="dim"] .home-hero {
  background:
    linear-gradient(135deg, rgba(10, 126, 164, 0.16) 0%, rgba(10, 126, 164, 0.04) 60%),
    var(--post-bg, #1c2733);
}

/* ---------- Post cards ---------- */
.post_item {
  border: 1px solid var(--table-border, rgba(0, 0, 0, 0.06));
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s var(--ease, ease), transform 0.25s var(--ease, ease);
}

.post_item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

html[data-mode="dim"] .post_item:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

.post_item .post_title a {
  transition: color 0.2s var(--ease, ease);
}

.post_item .post_title a:hover {
  color: var(--brand);
}

/* ---------- Buttons / tags ---------- */
.button, .post_tag {
  transition: all 0.2s var(--ease, ease);
}

.button:hover {
  background-color: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* ---------- Sidebar: recent comments ---------- */
.sidebar_comments {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--table-border, rgba(0, 0, 0, 0.08));
}

.sidebar_comments h2 {
  font-size: 1rem;
}

.recent-comments-list {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}

.recent-comment-item {
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--table-border, rgba(0, 0, 0, 0.08));
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.recent-comment-item:last-child {
  border-bottom: none;
}

.recent-comment-title {
  color: var(--text-hover);
  font-size: 0.88rem;
  line-height: 1.45;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-comment-title:hover {
  color: var(--brand);
}

.recent-comment-meta {
  font-size: 0.75rem;
  color: var(--text);
  opacity: 0.8;
}

.recent-comments-hint {
  margin-top: 0.7rem;
  font-size: 0.75rem;
  color: var(--text);
  opacity: 0.75;
  line-height: 1.6;
}

html[data-mode="dim"] .recent-comment-title {
  color: #c9d4df;
}

/* ---------- Code blocks ---------- */
pre, code {
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* selection */
::selection {
  background: rgba(10, 126, 164, 0.25);
}

/* links */
.content a:not(.button):hover {
  text-decoration: underline;
}

/* ---------- Small screens ---------- */
@media screen and (max-width: 667px) {
  .home-hero {
    padding: 1.6rem 1.2rem;
    margin-top: 1.4rem;
  }
  .home-hero h1 {
    font-size: 1.45rem;
  }
}
