:root {
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Default fallbacks if appearance.html is missing */
  --user-font: var(--serif);
  --heading-font: var(--user-font);
  --bg: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --accent: #111111;
  --rule: #eeeeee;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--user-font);
  font-size: 18px;
  line-height: 1.6;
}

.site-header {
  border-bottom: 1px solid var(--rule);
}
.bar {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem 1.1rem;
}
.site-name { font-weight: 700; font-size: 1.15rem; line-height: 1.2; text-decoration: none; color: var(--ink); margin-right: auto; }
.nav-links { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem .95rem; }
.nav-links > a { font-family: var(--mono); font-size: .8rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav-links > a:hover { color: var(--ink); }

/* social icons */
.nav-social { display: inline-flex; align-items: center; gap: .55rem; }
.nav-social .social-link { color: var(--muted); display: inline-flex; line-height: 0; }
.nav-social .social-link:hover { color: var(--accent); }

/* public fuzzy search */
.nav-search { position: relative; }
.nav-search-input {
  font-family: var(--mono); font-size: .8rem; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 6px;
  padding: .25rem .5rem; width: 7rem; transition: width .15s, border-color .15s;
}
.nav-search-input:focus { outline: none; border-color: var(--accent); width: 11rem; }
.nav-search-results {
  position: absolute; top: 130%; right: 0; z-index: 50; width: 18rem; max-width: 70vw;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18); overflow: hidden;
}
.nav-search-item { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  padding: .5rem .7rem; text-decoration: none; color: var(--ink); font-size: .85rem; }
.nav-search-item:hover { background: var(--rule); }
.nav-search-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-search-date { font-family: var(--mono); font-size: .7rem; color: var(--muted); flex: 0 0 auto; }
.nav-search-empty { padding: .6rem .7rem; color: var(--muted); font-size: .8rem; }

.content { max-width: 640px; margin: 0 auto; padding: 2rem 1rem; }

a { color: var(--accent); }

.profile { text-align: center; margin-bottom: 2.5rem; }
.profile .avatar { border-radius: 50%; object-fit: cover; }
.profile .p-name { margin: .5rem 0 .25rem; }
.profile .bio { color: var(--muted); }

.post-summary, .post { border-bottom: 1px solid var(--rule); padding: 1.25rem 0; }
.post-summary:last-child { border-bottom: none; }
.post-title { font-size: 1.6rem; }

.e-content img, .photos img { max-width: 100%; height: auto; border-radius: 6px; }
.photos { display: grid; gap: .5rem; margin-bottom: .75rem; }

.post-meta, .permalink time, .dt-published {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
}
.post-meta { display: block; margin-top: 1.5rem; }
/* The date is a permalink, but a default underline sits cramped under the
   monospace text — drop it and let the meta rows breathe instead. */
.post-meta .u-url { text-decoration: none; color: var(--muted); }
.post-meta .u-url:hover { color: var(--ink); }
.post-meta .dt-published { display: inline-block; }
.post-meta .categories { display: block; margin-top: .4rem; }
.post-meta .p-author.author { margin-top: .9rem; }
.post-meta .syndication { margin-top: .9rem; }
.permalink { text-decoration: none; }
.p-category { margin-right: .4rem; text-decoration: none; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.photo-cell img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 4px; }

.archive-month ul { list-style: none; padding: 0; }
.archive-month li { display: flex; gap: .75rem; padding: .15rem 0; }
.archive-month time { font-family: var(--mono); font-size: .8rem; color: var(--muted); min-width: 3.5rem; }

.author { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; }
.author img { border-radius: 50%; }

.webmentions { margin-top: 2rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.webmention { padding: .5rem 0; }

.site-footer { max-width: 640px; margin: 0 auto; padding: 2rem 1rem; color: var(--muted); font-family: var(--mono); font-size: .8rem; border-top: 1px solid var(--rule); }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  body { font-size: 17px; }
  .bar {
    padding: .85rem 1rem;
    gap: .55rem .9rem;
    /* Keep the brand on its own row so the links never crowd it. */
    row-gap: .7rem;
  }
  .site-name { font-size: 1.1rem; width: 100%; margin-right: 0; }
  .nav-links { width: 100%; gap: .5rem .9rem; }
  /* Let search take the remaining width on its row instead of a fixed 7rem. */
  .nav-search { flex: 1 1 8rem; min-width: 6rem; }
  .nav-search-input { width: 100%; }
  .nav-search-input:focus { width: 100%; }
  .nav-search-results { width: min(20rem, 92vw); max-width: 92vw; }
  .content { padding: 1.5rem 1rem 2.5rem; }
  .post-title { font-size: 1.35rem; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  /* Comfortable tap targets for the nav links + toggle. */
  .nav-links > a, .theme-toggle { padding-block: .2rem; }
}
