/* Drop the dataBASE — amber phosphor console */
:root {
  --bg: #16110a;
  --panel: #201811;
  --line: #3a2d1c;
  --amber: #ffb454;
  --amber-dim: #a97e3f;
  --text: #e9dcc6;
  --dim: #8f7f63;
  --danger: #ff5c47;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

* { box-sizing: border-box; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  line-height: 1.6;
  min-height: 100vh;
  /* faint scanline texture */
  background-image: repeating-linear-gradient(
    0deg, rgba(255, 180, 84, 0.025) 0px, rgba(255, 180, 84, 0.025) 1px,
    transparent 1px, transparent 3px);
}

.mono { font-family: var(--mono); font-size: 0.85rem; }
.dim { color: var(--dim); }
.accent { color: var(--amber); }
.error { color: var(--danger); white-space: pre-wrap; }
a { color: var(--amber); text-decoration-color: var(--amber-dim); }
a:hover { text-decoration-thickness: 2px; }

/* ---------- Console bar ---------- */
.console-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.console-bar .prompt {
  font-family: var(--mono); font-size: 0.85rem;
  color: var(--dim); text-decoration: none;
}
.console-bar .cmd { color: var(--amber); }
.cursor {
  display: inline-block; width: 0.55em; height: 1em;
  background: var(--amber); margin-left: 2px; vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }
@keyframes blink { 50% { opacity: 0; } }
.console-bar nav { display: flex; align-items: center; gap: 1rem; }
.console-bar nav a, .linkish {
  font-family: var(--mono); font-size: 0.85rem; color: var(--amber);
  background: none; border: none; cursor: pointer; padding: 0;
  text-decoration: underline; text-decoration-color: var(--amber-dim);
}
.linkish.danger { color: var(--danger); }

/* ---------- Layout ---------- */
.container { max-width: 780px; margin: 0 auto; padding: 2.5rem 1.2rem 5rem; }
.container.narrow { max-width: 640px; }

.site-title {
  font-family: var(--mono); font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: -0.02em; margin-bottom: 0.3rem;
}
.result-count { margin-bottom: 2.2rem; }

/* ---------- Post list ---------- */
.post-list { display: flex; flex-direction: column; gap: 1.4rem; }
.post-card {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--line);
  padding: 1.1rem 1.2rem; text-decoration: none; color: var(--text);
  transition: border-color 0.15s;
}
.post-card:hover { border-color: var(--amber-dim); }
.post-card img {
  width: 120px; height: 90px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line); filter: sepia(0.25);
}
.post-card h2 { font-size: 1.25rem; color: var(--amber); margin: 0.15rem 0 0.3rem; }
.post-card p { color: var(--text); font-size: 0.95rem; }
.post-card .slug { color: var(--dim); font-size: 0.75rem; }
.date { font-size: 0.75rem; letter-spacing: 0.05em; }

.empty { border: 1px dashed var(--line); padding: 2rem; text-align: center; }

/* ---------- Category badges ---------- */
.cat {
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; padding: 0.15rem 0.5rem; margin-left: 0.6rem;
  border: 1px solid; border-radius: 2px; vertical-align: middle;
}
.cat-fun  { color: #ffb454; border-color: #a97e3f; }
.cat-work { color: #7fd4a3; border-color: #3f6e52; }
.cat-info { color: #8ab8e8; border-color: #3f5a78; }

select {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 0.6rem 0.7rem; font-size: 0.9rem; width: 100%;
}
select:focus { outline: 2px solid var(--amber); outline-offset: 1px; }

/* ---------- Article ---------- */
.article h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.2; margin: 0.4rem 0 0.8rem; }
.article .deck { font-size: 1.15rem; color: var(--dim); font-style: italic; margin-bottom: 1.6rem; }
.article figure { margin: 1.8rem 0; }
.article img { max-width: 100%; border: 1px solid var(--line); }
.body-text p { margin-bottom: 1.2em; font-size: 1.05rem; }
.article-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* ---------- Admin table ---------- */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.6rem; flex-wrap: wrap; gap: 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 400; text-transform: lowercase; }
.row-actions { display: flex; gap: 0.8rem; align-items: center; }
.row-actions form { display: inline; }

/* ---------- Forms ---------- */
.page-form, .login-box form { display: flex; flex-direction: column; gap: 0.4rem; }
label { color: var(--dim); margin-top: 1rem; }
label .req { color: var(--amber-dim); font-size: 0.7rem; }
input[type="text"], input[type="password"], textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 0.6rem 0.7rem; font-family: var(--serif); font-size: 1rem; width: 100%;
}
input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 1px;
}
textarea { resize: vertical; line-height: 1.5; }
input[type="file"] { color: var(--dim); font-family: var(--mono); font-size: 0.8rem; }
.slug-row { display: flex; align-items: center; gap: 0.3rem; }
.slug-row input { font-family: var(--mono); font-size: 0.85rem; }
.current-img { margin-bottom: 0.3rem; }

.form-actions { display: flex; align-items: center; gap: 1.4rem; margin-top: 1.6rem; }
button[type="submit"], .btn {
  background: var(--amber); color: #1a1206; border: none;
  font-family: var(--mono); font-weight: 700; font-size: 0.9rem;
  padding: 0.65rem 1.3rem; cursor: pointer; text-decoration: none;
  display: inline-block;
}
button[type="submit"]:hover, .btn:hover { background: #ffc678; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-box { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); padding: 2rem; }
.ascii { color: var(--amber); font-family: var(--mono); font-size: 0.8rem; margin-bottom: 1rem; }
.login-box .error { margin: 0.8rem 0; }

@media (max-width: 560px) {
  .post-card { flex-direction: column; }
  .post-card img { width: 100%; height: 160px; }
  table { font-size: 0.72rem; }
  th, td { padding: 0.45rem 0.4rem; }
}
