/* Title font: use the Regular (R) weight for headings */
@font-face {
  font-family: 'Chiron Sung HK Title';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Chiron Sung HK'), url('../fonts/chiron-sung-hk/TTF/ChironSungHK-R.ttf') format('truetype');
}

/* Body font: use the Text-R variant tuned for body text */
@font-face {
  font-family: 'Chiron Sung HK Text';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Chiron Sung HK Text'), url('../fonts/chiron-sung-hk/TTF/ChironSungHK-Text-R.ttf') format('truetype');
}

html,
body,
button,
input,
select,
textarea {
  font-family: 'Chiron Sung HK Text', 'Noto Serif TC', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
}

html,
body {
  background-color: var(--dd-surface, #ffffff);
  color: var(--dd-text-primary, #0f172a);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme tokens */
:root[data-theme='light'] {
  color-scheme: light;
  --gray-100: #f8fafc;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --color-link: #2563eb;
  --color-visited-link: #7c3aed;
  --body-background: #ffffff;
  --body-font-color: #0f172a;
  --icon-filter: none;
  --dd-surface: #ffffff;
  --dd-surface-alt: #ffffff;
  --dd-surface-muted: #f1f5f9;
  --dd-text-primary: #0f172a;
  --dd-text-muted: #475569;
  --dd-border: rgba(148, 163, 184, 0.35);
  --dd-border-strong: rgba(100, 116, 139, 0.45);
  --dd-accent: #2563eb;
  --dd-accent-soft: rgba(37, 99, 235, 0.12);
  --dd-code-bg: #f1f5f9;
  --dd-code-border: #bfdbfe;
  --dd-inline-code-bg: rgba(37, 99, 235, 0.12);
  --dd-blockquote-bg: rgba(37, 99, 235, 0.1);
  --dd-shadow: 0 20px 35px rgba(15, 23, 42, 0.12);
  --dd-menu-hover: rgba(37, 99, 235, 0.12);
  --dd-menu-active: #2563eb;
  --dd-control-surface: rgba(15, 23, 42, 0.06);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --gray-100: #1e293b;
  --gray-200: #293548;
  --gray-500: #94a3b8;
  --color-link: #93c5fd;
  --color-visited-link: #c4b5fd;
  --body-background: #0f172a;
  --body-font-color: #e2e8f0;
  --icon-filter: brightness(0) invert(1);
  --dd-surface: #0f172a;
  --dd-surface-alt: #111c2f;
  --dd-surface-muted: #1e293b;
  --dd-text-primary: #e2e8f0;
  --dd-text-muted: #94a3b8;
  --dd-border: rgba(71, 85, 105, 0.45);
  --dd-border-strong: rgba(148, 163, 184, 0.5);
  --dd-accent: #60a5fa;
  --dd-accent-soft: rgba(96, 165, 250, 0.2);
  --dd-code-bg: #1e293b;
  --dd-code-border: #334155;
  --dd-inline-code-bg: rgba(148, 163, 184, 0.2);
  --dd-blockquote-bg: rgba(96, 165, 250, 0.16);
  --dd-shadow: 0 24px 40px rgba(2, 6, 23, 0.65);
  --dd-menu-hover: rgba(96, 165, 250, 0.16);
  --dd-menu-active: #93c5fd;
  --dd-control-surface: rgba(148, 163, 184, 0.12);
}

/* Use the Title font for headings and the site title */
h1, h2, h3, h4, h5, h6, .site-title, .post-title {
  font-family: 'Chiron Sung HK Title', 'Chiron Sung HK Text', 'Noto Serif TC', serif;
}

.latest-post-card {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem;
  border-left: 4px solid var(--color-link, #2563eb);
  border: 1px solid var(--dd-border, rgba(148, 163, 184, 0.35));
  border-radius: 0.75rem;
  background-color: var(--dd-surface-muted, #f1f5f9);
  box-shadow: var(--dd-shadow, 0 20px 35px rgba(15, 23, 42, 0.1));
}

:is(html[data-theme='dark'], body[data-theme='dark']) .latest-post-card {
  border: 1px solid var(--dd-border-strong, rgba(148, 163, 184, 0.5));
  background-color: var(--dd-surface-alt, #111c2f);
  box-shadow: none;
}

.latest-post-heading {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.latest-post-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--color-link, #2563eb);
  text-decoration: none;
}

.latest-post-link:hover,
.latest-post-link:focus {
  text-decoration: underline;
}

.latest-post-meta {
  margin: 0.4rem 0 0.75rem;
  font-size: 0.85rem;
  color: var(--dd-text-muted, #64748b);
}

.latest-post-summary {
  margin: 0;
  line-height: 1.6;
}
