:root {
  --bg: #14120e;        /* warm near-black (ink) */
  --bg-soft: #1d1a14;   /* slightly lifted, for fields & panels */
  --ink: #ece6d8;       /* warm off-white text */
  --muted: #9b9281;     /* muted warm grey */
  --line: #322d23;      /* subtle warm divider */
  --link: #e0a96d;      /* warm amber/gold accent */
  --on-accent: #17140f; /* dark text on amber buttons */
  --danger: #e38179;    /* soft red for dark bg */
  --max: 42rem;
}

/* Self-hosted display font for the masthead title only. */
@font-face {
  font-family: 'Title';
  src: url('/font/LunchtimeDoublySo.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Georgia, serif;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.1rem 4rem;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header / footer */
.site-header { margin-bottom: 2.5rem; text-align: center; }
.site-title {
  margin: 0;
  font-family: 'Title', serif;
  font-weight: 400; font-size: 3.3rem; line-height: 1.08; letter-spacing: .01em;
}
.site-title a { color: var(--ink); }
.site-tagline { margin: .35rem 0 0; color: var(--muted); font-size: 1.05rem; }

/* Round avatar with a soft amber glow behind it */
.avatar { margin-top: 1.5rem; }
.avatar img {
  width: 116px; height: 116px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(255,255,255,.55), 0 0 28px 4px rgba(255,255,255,.22);
}
.site-footer {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem; text-align: center;
}
.site-footer p { margin: .5rem 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer .pledge { margin-top: 1.1rem; }
.site-footer .pledge img { width: 116px; height: auto; border-radius: 10px; }

/* Timeline */
.day-sep {
  font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted);
  margin: 2rem 0 .5rem;
}

.post {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.post .dt-published {
  display: inline-block;
  font-size: .8rem; color: var(--muted);
}
.post .u-url { text-decoration: none; }
.post .u-url:hover .dt-published { color: var(--link); }

.e-content { margin-top: .35rem; }
.e-content > :first-child { margin-top: 0; }
.e-content > :last-child { margin-bottom: 0; }
.e-content p { margin: .6rem 0; }
.e-content pre {
  background: var(--bg-soft); padding: .8rem 1rem;
  overflow-x: auto; border-radius: 6px; font-size: .9rem;
}
.e-content code {
  background: var(--bg-soft); padding: .1rem .3rem; border-radius: 4px; font-size: .9em;
}
.e-content pre code { background: none; padding: 0; }
.e-content blockquote {
  margin: .6rem 0; padding-left: 1rem;
  border-left: 3px solid var(--line); color: var(--muted);
}
.e-content img { max-width: 100%; height: auto; }

.syndication-links {
  margin-top: .5rem; font-size: .82rem; color: var(--muted);
}
.syndication-links span { margin-right: .25rem; }
.syndication-links a { margin-right: .5rem; }

/* Pager */
.pager { margin-top: 2rem; display: flex; justify-content: space-between; font-size: .9rem; }
.empty { color: var(--muted); }
.single .back { margin-top: 2rem; font-size: .9rem; }

/* ---------- Admin (cozy) ---------- */
body.admin {
  background:
    radial-gradient(1100px 460px at 50% -220px, rgba(224,169,109,.07) 0%, rgba(224,169,109,0) 70%),
    var(--bg);
}
.admin-header {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  padding: .2rem 0 1.1rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--line);
}
.admin-header strong, .admin-header strong a { color: var(--ink); font-size: 1.02rem; }
.admin-header nav { margin-left: auto; display: flex; gap: 1.15rem; align-items: center; }
.admin-header nav a, .admin-header nav .linkish { color: var(--link); font-size: .92rem; }

/* Admin content sits flat on the background — no card. */
body.admin main { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
body.admin main h2 { margin-top: 0; }

.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td {
  text-align: left; padding: .6rem .45rem; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .03em; }
.excerpt { color: var(--muted); }
.row-actions { white-space: nowrap; }
.row-actions a, .row-actions .linkish { margin-right: .6rem; }

/* Forms */
form { margin: 1rem 0 0; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; }
input, textarea, select {
  width: 100%; padding: .7rem .85rem; margin-bottom: 1.1rem;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg-soft); color: var(--ink); font: inherit; font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(224,169,109,.18);
}
textarea { resize: vertical; min-height: 9.5rem; line-height: 1.65; font-family: inherit; }

button {
  padding: .62rem 1.35rem; border: 0; border-radius: 999px;
  background: var(--link); color: var(--on-accent); font: inherit; font-weight: 600;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35);
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
button:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 5px 14px rgba(154,91,47,.28); }
button:active { transform: translateY(0); }

.linkish {
  background: none; border: 0; color: var(--link); padding: 0;
  font: inherit; cursor: pointer; text-decoration: none; box-shadow: none;
}
.linkish:hover { text-decoration: underline; filter: none; transform: none; box-shadow: none; }
.danger { color: var(--danger); }

/* A soft, outlined delete button */
button.danger-btn {
  background: transparent; color: var(--danger); font-weight: 500;
  box-shadow: none; border: 1px solid rgba(227,129,121,.4);
}
button.danger-btn:hover { background: rgba(227,129,121,.12); filter: none; transform: none; box-shadow: none; }

.form-actions { display: flex; align-items: center; gap: 1.1rem; margin-top: .25rem; }
.form-divider { margin: 2rem 0; border: 0; border-top: 1px solid var(--line); }

.auth-box { max-width: 22rem; margin: 1.5rem auto; }
.auth-box h2 { text-align: center; }
.syndications { margin-top: 1.5rem; }
.syn-list { list-style: none; padding: 0; }
.syn-list li { padding: .45rem 0; font-size: .92rem; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.syn-form { display: flex; gap: .5rem; align-items: start; flex-wrap: wrap; margin-top: .6rem; }
.syn-form input { width: auto; flex: 1 1 12rem; margin-bottom: 0; }
.hint { color: var(--muted); font-size: .88rem; }

/* Editor toolbar (emoji + image) */
.editor-toolbar { position: relative; margin-bottom: .6rem; display: flex; gap: .5rem; }
.tool-btn {
  background: var(--bg-soft); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: .35rem .85rem; font-size: .9rem; font-weight: 500;
  box-shadow: none;
}
.tool-btn:hover { background: rgba(255,255,255,.07); filter: none; transform: none; box-shadow: none; }
.tool-btn:disabled { opacity: .6; cursor: default; }
.emoji-panel {
  position: absolute; z-index: 20; top: 100%; left: 0; margin-top: .4rem;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 34px rgba(0,0,0,.5); padding: .5rem;
  display: none; grid-template-columns: repeat(8, 1fr); gap: .1rem;
  width: min(20rem, calc(100vw - 2.5rem)); max-height: 14rem; overflow-y: auto;
}
.emoji-panel.open { display: grid; }
.emoji-panel button {
  background: none; border: 0; box-shadow: none; cursor: pointer;
  font-size: 1.3rem; line-height: 1; padding: .3rem; border-radius: 8px;
}
.emoji-panel button:hover { background: rgba(255,255,255,.07); filter: none; transform: none; box-shadow: none; }

/* Flash messages (dark-tinted, light text) */
.message {
  padding: .6rem .85rem; border-radius: 8px; margin: .5rem 0; font-size: .9rem;
  color: var(--ink); border: 1px solid transparent;
}
.message.success { background: rgba(120,180,120,.14); border-color: rgba(120,180,120,.4); }
.message.error { background: rgba(226,121,111,.14); border-color: rgba(226,121,111,.45); }
.message.warning { background: rgba(220,180,110,.14); border-color: rgba(220,180,110,.4); }

/* Feeds */
.feed-banner {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: .7rem .9rem; margin-bottom: 1.5rem;
  font-size: .85rem; color: var(--muted);
}
.feed-list { list-style: none; padding: 0; }
.feed-list li {
  padding: .6rem 0; border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem;
}
.feed-list a { font-weight: 600; }
.feed-list code {
  background: var(--bg-soft); padding: .05rem .35rem; border-radius: 4px; font-size: .82rem;
}
.feed-desc { color: var(--muted); font-size: .85rem; flex-basis: 100%; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 1.25rem 1rem 3rem; }
  .site-title { font-size: 2.3rem; line-height: 1.12; }
  .site-tagline { font-size: .95rem; }
  .avatar img { width: 104px; height: 104px; }

  /* Admin table fits narrow screens */
  .admin-table .excerpt { display: none; }
  .admin-table { font-size: .85rem; }
  .admin-table th, .admin-table td { padding: .5rem .3rem; }
  .row-actions { white-space: normal; }
  .row-actions a, .row-actions .linkish { display: inline-block; margin: .15rem .55rem .15rem 0; }

  .admin-header { gap: .5rem 1rem; }
  .form-actions { flex-wrap: wrap; }
}
