/* Leroy Blog */
/* Self-hosted IBM Plex Mono */
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-Italic.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-Medium.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: italic;
    font-weight: 500;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-MediumItalic.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: italic;
    font-weight: 600;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-SemiBoldItalic.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-Bold.woff2") format("woff2");
}
@font-face {
    font-family: "IBM Plex Mono";
    font-style: italic;
    font-weight: 700;
    font-display: swap;
    src: url("/static/fonts/IBMPlexMono-BoldItalic.woff2") format("woff2");
}
:root {
  --bg: #fdfdfb;
  --fg: #111111;
  --muted-fg: #6b6b6b;
  --line: #d9d7d0;
  --accent: #0a6c73;
  --brand: #6b46e0;
  --brand-royal: #6b46e0;
  --brand-gold: #9c7c00;
  --brand-gold-hover: #7a5c00;
  --font: "IBM Plex Mono", "JetBrains Mono", "SF Mono", "Fira Code", "Liberation Mono", Consolas, monospace;
}

.dark {
  --bg: #18181a;
  --fg: #e8e6e0;
  --muted-fg: #8a8a8a;
  --line: #2a2a2e;
  --accent: #66d9d0;
  --brand: #8b7cf8;
  --brand-royal: #8b7cf8;
  --brand-gold: #d9a621;
  --brand-gold-hover: #e6c15c;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding: 0 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.2s, color 0.2s;
}

.container {
  max-width: 660px;
  margin: 0 auto;
  padding: 48px 0 80px;
  width: 100%;
  flex: 1;
}

/* ===== NAV ===== */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 64px;
  font-size: 13px;
}

.site-name { font-weight: 600; color: var(--fg); text-decoration: none; }
.site-name .logo-royal { color: var(--brand-royal); }
.site-name .logo-gold { color: var(--brand-gold); }
.site-name:hover .logo-royal { color: var(--brand-royal); }
.site-name:hover .logo-gold { color: var(--brand-gold-hover); }

.nav-links { display: flex; align-items: center; }
.nav-links a {
  color: var(--muted-fg);
  text-decoration: none;
  padding: 0 8px;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:first-child { padding-left: 0; }
.nav-links a:last-child { padding-right: 0; }
.nav-sep { color: var(--line); }

.nav-right { display: flex; align-items: center; }

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  padding: 6px 8px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  margin-left: 12px;
  transition: border-color 0.15s;
}
.nav-toggle:hover { border-color: var(--fg); }
.nav-toggle-bar {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--fg);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.open .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.theme-btn {
  background: none;
  border: 1px solid var(--line);
  padding: 4px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-fg);
  transition: color 0.15s, border-color 0.15s;
  margin-left: 12px;
}
.theme-btn:hover { color: var(--fg); border-color: var(--fg); }
.theme-btn svg { width: 14px; height: 14px; display: block; }
.dark .theme-btn .light-icon { display: none; }
.theme-btn .dark-icon { display: none; }
.dark .theme-btn .dark-icon { display: block; }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: 20px; font-weight: 700; line-height: 1.4; margin-bottom: 20px; }
h2 { font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; margin-top: 32px; }
h3 { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 8px; margin-top: 24px; }
p { margin-bottom: 16px; }

/* Links: clear underline, visible as clickable */
a {
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  transition: color 0.15s;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ===== SECTION HEADER ===== */
.section-header {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-fg);
  text-transform: lowercase;
  letter-spacing: 0.02em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
}

/* ===== PROSE ===== */
.prose { margin-bottom: 48px; }
.prose p:last-child { margin-bottom: 0; }

.prose blockquote {
  border-left: 2px solid var(--line);
  padding-left: 16px;
  margin: 20px 0;
}
.prose blockquote p { color: var(--muted-fg); font-size: 13px; margin-bottom: 0; }

.prose ul, .prose ol { margin: 12px 0 16px 24px; }
.prose li { margin-bottom: 4px; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }

.prose code {
  font-family: var(--font);
  font-size: 13px;
  background: var(--line);
  padding: 1px 5px;
}

.prose pre {
  font-family: var(--font);
  font-size: 13px;
  background: var(--line);
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; }

.prose img { margin: 20px 0; max-width: 100%; height: auto; }

.prose hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; }
.prose th { font-weight: 600; }

/* ===== LIST ROWS ===== */
.list-section { margin-bottom: 48px; }

.list-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
}

/* Row hover so you can see you're on an item */
.list-row:hover { background: #f5f4f0; }
.dark .list-row:hover { background: #202022; }

.list-row:first-of-type { padding-top: 16px; }

/* Date/label column: muted, narrow */
.list-row .label {
  flex-shrink: 0;
  width: 75px;
  font-size: 13px;
  color: var(--muted-fg);
}

/* Title: underlined link, clearly clickable */
.list-row .title {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
}
.list-row .title:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* Description: muted, smaller */
.list-row .desc {
  font-size: 13px;
  color: var(--muted-fg);
  margin-top: 3px;
  line-height: 1.5;
}

.tag { font-size: 11px; color: var(--muted-fg); display: inline-block; margin-right: 4px; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 40px;
  font-size: 13px;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  text-decoration: none;
  color: var(--muted-fg);
  border: 1px solid var(--line);
  transition: color 0.15s, border-color 0.15s;
}
.pagination a:hover { color: var(--fg); border-color: var(--fg); }
.pagination .current { border-color: var(--fg); color: var(--fg); font-weight: 600; }
.pagination .disabled { opacity: 0.35; }

/* ===== CONTACT FORM ===== */
.contact-form { margin-bottom: 48px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--muted-fg); margin-bottom: 4px; }
.form-group input,
.form-group textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.form-group input:focus,
.form-group textarea:focus { border-color: var(--fg); }
.form-group textarea { resize: vertical; min-height: 100px; }

.form-error {
  font-size: 13px; color: #b33; margin-bottom: 16px;
  padding: 8px 10px; border: 1px solid #b33;
}
.form-success {
  font-size: 13px; color: #2a7; margin-bottom: 16px;
  padding: 8px 10px; border: 1px solid #2a7;
}
.form-terms { font-size: 12px; color: var(--muted-fg); margin-top: 4px; }

.form-submit {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.form-submit:hover { background: var(--accent); border-color: var(--accent); }

/* ===== SIGNUP ===== */
.signup { padding-top: 16px; }
.signup p { font-size: 13px; color: var(--muted-fg); margin-bottom: 12px; }
.signup-form { display: flex; gap: 0; }
.signup-form input {
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 12px;
  outline: none;
  flex: 1;
}
.signup-form input:focus { border-color: var(--fg); }
.signup-form button {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--bg);
  background: var(--fg);
  border: 1px solid var(--fg);
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.signup-form button:hover { background: var(--accent); border-color: var(--accent); }

/* ===== POST TAGS ===== */
.post-tags { margin-top: 4px; }
.post-tag {
  font-size: 11px;
  color: var(--muted-fg);
  margin-right: 6px;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line);
  transition: color 0.15s, text-decoration-color 0.15s;
}
.post-tag:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ===== BREADCRUMB ===== */
.breadcrumb { font-size: 13px; color: var(--muted-fg); margin-bottom: 32px; }
.breadcrumb a {
  color: var(--muted-fg); font-size: 13px;
  text-decoration: underline; text-underline-offset: 2px;
  text-decoration-thickness: 1px; text-decoration-color: var(--line);
}
.breadcrumb a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ===== FOOTER ===== */
footer { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); }
footer p { font-size: 13px; color: var(--muted-fg); margin-bottom: 0; }
footer a {
  font-size: 13px; color: var(--muted-fg);
  text-decoration: underline; text-underline-offset: 2px;
  text-decoration-thickness: 1px; text-decoration-color: transparent;
}
footer a:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ===== ERROR PAGES ===== */
.error-page { max-width: 480px; margin: 80px auto; text-align: center; }
.error-page p { color: var(--muted-fg); font-size: 13px; margin-bottom: 24px; }

/* ===== SEARCH ===== */
.search-form {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 32px;
}
.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 8px 10px;
  outline: none;
  transition: border-color 0.15s;
}
.search-form input[type="search"]:focus { border-color: var(--fg); }
.search-form input[type="search"]::placeholder { color: var(--muted-fg); }
.search-form button.search-btn {
  font-family: var(--font);
  font-size: 13px;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  padding: 8px 14px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.search-form button.search-btn:hover { color: var(--accent); border-color: var(--accent); }

.home-search { margin-bottom: 48px; }

.search-summary {
  font-size: 13px;
  color: var(--muted-fg);
  margin-bottom: 16px;
}
.search-summary strong { color: var(--fg); font-weight: 600; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  body { padding: 0 16px; }
  .container { padding: 32px 0 64px; }
  .site-nav { margin-bottom: 40px; }
  .list-row { flex-direction: column; gap: 2px; }
  .list-row .label { width: auto; }
  .signup-form { flex-direction: column; }
  .signup-form button { border-top: none; }
  .pagination { flex-wrap: wrap; }

  /* Mobile nav: logo + hamburger on the first row, links collapse below */
  .site-nav {
    flex-direction: row;
    align-items: center;
  }
  .nav-right { align-items: center; }
  .nav-toggle { display: flex; }

  /* Collapsible panel — full-width, below the top row */
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 6px 0;
    font-size: 14px;
  }
  .nav-links a:first-child { padding-left: 0; }
  .nav-links a:last-child { padding-right: 0; }
  .nav-sep { display: none; }

  /* Theme button stays beside the hamburger */
  .theme-btn { margin-left: 8px; }
}
