/* =========================
   Nano Memo custom style
   ========================= */

/* ---- Base ---- */
body {
  font-family: "Noto Sans TC", "Noto Sans", "Microsoft JhengHei", "PingFang TC", sans-serif;
  line-height: 1.8;
  font-size: 1rem;
  color: #2f3440;
}

/* Main content width */
.quarto-container .content,
main.content,
main {
  max-width: 920px;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #273142;
}

h1 {
  font-size: 2.2rem;
  margin-top: 0.5rem;
  margin-bottom: 0.8rem;
}

h2 {
  font-size: 1.45rem;
  margin-top: 2.2rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid #e7ebf0;
}

h3 {
  font-size: 1.12rem;
  margin-top: 1.4rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.25rem;
}

/* ---- Links ---- */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ---- Navbar ---- */
.navbar {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ---- Sidebar ---- */
.sidebar {
  font-size: 0.95rem;
}

.sidebar .sidebar-title,
.sidebar-title {
  font-weight: 700;
}

.sidebar nav[role="doc-toc"] ul > li,
.sidebar .sidebar-item {
  line-height: 1.5;
}

/* ---- TOC ---- */
#TOC,
.toc-active {
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ---- Callouts ---- */
.callout {
  border-radius: 0.85rem;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  border: 1px solid #e7edf3;
}

.callout .callout-header {
  border-top-left-radius: 0.85rem;
  border-top-right-radius: 0.85rem;
}

.callout .callout-body {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

/* ---- Code ---- */
pre,
code {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

code {
  font-size: 0.92em;
  padding: 0.12em 0.32em;
  border-radius: 0.32rem;
}

pre {
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

div.sourceCode {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* ---- Tables ---- */
table {
  font-size: 0.96rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

table thead th {
  font-weight: 700;
}

/* ---- Images ---- */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

/* ---- Horizontal rule ---- */
hr {
  margin-top: 2rem;
  margin-bottom: 2rem;
  opacity: 0.2;
}

/* ---- Page title / subtitle ---- */
.page-title,
.quarto-title .title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle,
.quarto-title .subtitle {
  opacity: 0.82;
  font-size: 1.02rem;
}

/* ---- Optional badge styles for later ---- */
.badge-public {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #d8dee6;
}

.badge-private {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid #d8dee6;
}

/* ---- Mobile ---- */
@media (max-width: 991.98px) {
  body {
    font-size: 0.98rem;
  }

  h1 {
    font-size: 1.95rem;
  }

  h2 {
    font-size: 1.3rem;
  }
}

/* =========================
   Homepage card UI
   ========================= */

.memo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.memo-card {
  background: #ffffff;
  border: 1px solid #e7ebf0;
  border-radius: 1rem;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.memo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  border-color: #d7dee8;
}

.memo-card h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.memo-card p {
  margin-top: 0.7rem;
  margin-bottom: 0;
  color: #556070;
  font-size: 0.96rem;
  border-left: 4px solid #3b82f6;
  padding: 0.2rem 0 0.2rem 1rem;
}

.memo-card ul {
  margin-bottom: 0.6rem;
  padding-left: 1.2rem;
}

.memo-card li {
  margin-bottom: 0.35rem;
}

/* Mobile */
@media (max-width: 767.98px) {
  .memo-grid {
    grid-template-columns: 1fr;
  }

  .memo-card {
    padding: 1rem 1rem;
  }
}

/* =========================
   Public / private badges
   ========================= */

.badge-public,
.badge-private {
  display: inline-block;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.badge-public {
  background: #eef6ff;
  color: #175cd3;
  border: 1px solid #cfe0ff;
}

.badge-private {
  background: #fff4e5;
  color: #b54708;
  border: 1px solid #f5d7a1;
}