:root {
  --bg: #f6ecdb;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5b5b5b;
  --primary: #2e6f7e;
  --accent: #ffd65a;
  --accent-dark: #b8860b;
  --accent-contrast: #1a1a1a;
  --border: #e2e0da;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --max-width: 76rem;
  --sidebar-width: 18rem;
}

/* Dark mode disabled 2026-07-12 (paused, not removed): layout.js now forces
   data-theme="light" and no longer loads js/theme.js or a toggle button, so
   neither block below is exercised. Left in place — not being kept in sync
   with light-mode changes while disabled — so re-enabling requires a full
   visual review of both blocks (and of every component styled since) before
   wiring the toggle back up. */
/*
@media (prefers-color-scheme: dark) {
  :root[data-theme='auto'] {
    --bg: #121212;
    --card: #1e1e1e;
    --text: #ececec;
    --text-muted: #a0a0a0;
    --primary: #7fbfcc;
    --accent: #ffd65a;
    --accent-contrast: #1a1a1a;
    --border: #2a2a2a;
  }
}

:root[data-theme='dark'] {
  --bg: #121212;
  --card: #1e1e1e;
  --text: #ececec;
  --text-muted: #a0a0a0;
  --primary: #7fbfcc;
  --accent: #ffd65a;
  --accent-contrast: #1a1a1a;
  --border: #2a2a2a;
}
*/

:root[data-theme='light'] {
  --bg: #f6ecdb;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5b5b5b;
  --primary: #2e6f7e;
  --accent: #ffd65a;
  --accent-dark: #b8860b;
  --accent-contrast: #1a1a1a;
  --border: #e2e0da;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header,
.site-footer,
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-right: auto;
}

.site-brand__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
}

.nav-link--active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent-dark);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-lang {
  font-size: 0.9rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}

.nav-lang--disabled {
  opacity: 0.4;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle__icon::before {
  content: '';
  display: block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: currentColor;
}

.site-main {
  min-height: 60vh;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--text-muted);
}

.about-avatar {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 0.85rem;
  color: var(--accent-contrast);
  background: var(--accent);
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

/* Desktop: content column + a persistent right sidebar (recent posts + tags). */
.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

@media (min-width: 900px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
    align-items: start;
  }

  .layout-sidebar {
    position: sticky;
    top: 1.5rem;
  }
}

.sidebar-widget {
  margin-bottom: 2.25rem;
}

.sidebar-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sidebar-widget__list a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: var(--text);
}

.sidebar-widget__meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.post-card {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.post-card__title {
  font-size: 1.3rem;
  margin: 0 0 0.35rem;
}

.post-card__title a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* The cat mark doubles as the post-list bullet. `--accent` (#ffd65a) is too
   pale to read at this size against the cream --bg, so the bullet rests at
   the darker gold (--accent-dark) and deepens further on hover/focus. */
.post-card__bullet {
  width: 0.85em;
  height: 0.85em;
  flex-shrink: 0;
  color: var(--accent-dark);
  transition: color 0.15s ease;
}

.post-card__title a:hover .post-card__bullet,
.post-card__title a:focus-visible .post-card__bullet,
.sidebar-widget__list a:hover .post-card__bullet,
.sidebar-widget__list a:focus-visible .post-card__bullet {
  color: var(--text);
}

.post-card__meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.post-card__excerpt {
  margin: 0 0 0.6rem;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 0.5rem 0;
}

.tag-pill {
  font-size: 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  color: var(--text-muted);
}

.tag-pill:hover {
  border-color: var(--accent-dark);
  color: var(--text);
}

.tag-pill__count {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.tag-list--index .tag-pill {
  font-size: 0.95rem;
  padding: 0.35rem 0.9rem;
}

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.post__meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post__content {
  margin-top: 1.5rem;
}

.post__content pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
}

.post__content code {
  font-family: var(--font-mono);
}

.post__content img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  height: auto;
  margin: 1.5rem auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.translation-notice {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-dark);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ironman-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
}

.ironman-block {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.15rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  color: var(--text);
}

.ironman-block:hover {
  border-color: var(--accent-dark);
  text-decoration: none;
}

.ironman-block__icon {
  grid-row: 1 / 3;
  width: 1.6rem;
  height: 1.6rem;
  color: var(--accent-dark);
}

.ironman-block__year {
  font-size: 1.4rem;
  font-weight: 700;
}

.ironman-block__group {
  grid-column: 2;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.ironman-block__title {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.ironman-block__count {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.external-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.external-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}

.external-links a:hover {
  border-color: var(--accent-dark);
  text-decoration: none;
}

.external-links__icon {
  width: 1rem;
  height: 1rem;
  border-radius: 2px;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

#search-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 1.5rem;
}

