/* What's in John's Head: dark theme for Dotclear "customCSS" (glaz template set).
   Source of truth: notes/claude/site/customCSS.css on the NUC; deployed to public/customCSS.css. */

:root {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1e232b;
  --border: #2a313b;
  --text: #e3e7ec;
  --muted: #9aa5b3;
  --accent: #7cb7ff;
  --accent-hover: #a9d0ff;
  --warn-bg: rgba(229, 83, 75, 0.10);
  --warn-border: #e5534b;
  --radius: 10px;
  --measure: 46rem;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  line-height: 1.65;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover, a:focus { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#page { max-width: var(--measure); margin: 0 auto; padding: 0 16px 2rem; }

/* Skip links: hidden until focused */
.skip-links { position: absolute; left: -9999px; }
.skip-links:focus-within { position: static; padding: 0.5rem 0; }

/* Header */
.header { padding: 1.75rem 0 0.5rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.banner { margin-bottom: 1rem; }
.site-title { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.2rem); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.site-title a { color: var(--text); text-decoration: none; }
.site-baseline { margin: 0.35rem 0 0; color: var(--muted); }
.site-baseline-home-first { display: none; }

/* Navigation */
.simple-menu { list-style: none; margin: 0; padding: 0 0 0.75rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.simple-menu li { margin: 0; }
.simple-menu a {
  display: inline-block; padding: 0.4rem 0.8rem; border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 0.92rem; background: var(--surface);
}
.simple-menu a:hover, .simple-menu a:focus { border-color: var(--accent); color: var(--accent-hover); }
.simple-menu .active a { background: var(--accent); border-color: var(--accent); color: #0b1220; }

/* Posts */
.post {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.75rem; margin: 0 0 1.25rem;
}
.post-day-date, .date-title { color: var(--muted); font-size: 0.85rem; margin: 0 0 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.post-title { margin: 0 0 0.75rem; font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem); line-height: 1.3; }
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--accent-hover); }
.post-content { overflow-wrap: anywhere; }
.post-content h2 { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.3rem); margin: 2rem 0 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.post-content h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.post-content p, .post-content ul, .post-content ol { margin: 0 0 1rem; }
.post-content li { margin: 0.25rem 0; }
.post-content img { max-width: 100% !important; height: auto !important; border-radius: 6px; display: block; margin: 0.5rem auto; }
.post-content em { color: #cfd6de; }
.post-read-it a { font-weight: 600; white-space: nowrap; }
.ellipsis { color: var(--muted); }

/* The "Time-sensitive" box and other quotes (override any inline light styles) */
.post-content blockquote {
  margin: 1rem 0 !important; padding: 0.75rem 1rem !important; border-radius: 6px;
  background: var(--warn-bg) !important; border-left: 4px solid var(--warn-border) !important; color: var(--text) !important;
}

/* Tables: scroll sideways on phones instead of squashing */
.post-content table {
  display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-collapse: collapse; margin: 0 0 1.25rem; font-size: 0.9rem;
}
.post-content th, .post-content td {
  border: 1px solid var(--border) !important; padding: 0.4rem 0.6rem !important; vertical-align: top;
  background: transparent !important; color: var(--text) !important; min-width: 7rem;
}
.post-content th { background: var(--surface-2) !important; text-align: left; }

/* Post footer */
.post-meta { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 0.6rem; color: var(--muted); font-size: 0.85rem; }
.post-meta p { margin: 0.2rem 0; }
.post-tags, .post-info a { color: var(--muted); }
.post-tags a, .post-meta a[rel="tag"] {
  display: inline-block; margin: 0 0.25rem 0.25rem 0; padding: 0.1rem 0.55rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); text-decoration: none;
}

/* Comments and trackbacks are off on this site */
#comments, #pings, #comment-form, #pr, .comment-form, .post-feed, .post-attr, .send-ping { display: none !important; }

/* Archive, tag and search pages */
.content-info, .content-intro { color: var(--muted); }
.content-info h2, .content-title, h2.content-title { color: var(--text); font-size: 1.4rem; }
.arch-block, .archives-list, .content ul.arch { list-style: none; padding: 0; }
.arch-block li, .archives-list li { padding: 0.35rem 0; border-bottom: 1px solid var(--border); }

/* Tag pills under each post, and tag/month lists on the archive page */
.post-taxonomy { margin: 0.4rem 0 0.2rem; }
.post-tags-list, .arch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.post-tags-list a, .arch-tag-list a {
  display: inline-block; padding: 0.15rem 0.65rem; border-radius: 999px; font-size: 0.85rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent); text-decoration: none;
}
.post-tags-list a:hover, .arch-tag-list a:hover { border-color: var(--accent); }
.content-inner article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0 0 1rem; }
.content-inner h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.content-inner h4 { margin: 0.75rem 0 0.4rem; color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.fromto { color: var(--muted); }

/* Pagination */
.pagination { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; }

/* Sidebar is unused */
.sidebar:empty, #sidebar:empty { display: none; }
.sidebar { margin-top: 1rem; }

/* Footer */
.gotop { text-align: right; margin: 1rem 0 0; font-size: 0.85rem; }
.footer { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: 1rem; color: var(--muted); font-size: 0.85rem; }
.footer a { color: var(--muted); }

@media (max-width: 600px) {
  .post { padding: 1rem 0.9rem 0.6rem; border-radius: 8px; }
  .simple-menu a { padding: 0.45rem 0.75rem; }
  .post-content table { font-size: 0.85rem; }
}

@media print {
  body { background: #fff; color: #000; }
  .post { border: 0; background: none; }
  .simple-menu, .gotop { display: none; }
}
