/* ==========================================================================
   Half Cash Half Stock — vanilla CSS. Web 1.0 brutalism, on purpose.
   ========================================================================== */

/* ---------- reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- design tokens ---------- */
:root {
  --bg:           #fffde7;
  --bg-grid:      #c0c0c0;
  --ink:          #000000;
  --link:         #0000ff;
  --link-visited: #800080;
  --accent:       #ff0000;
  --card:         #ffffff;
  --beige:        #f5f5dc;
  --shadow:       4px 4px 0 #000000;
  --shadow-lg:    6px 6px 0 #000000;
  --border:       3px solid #000000;
  --bevel-light:  #ffffff;
  --bevel-dark:   #808080;
  --bevel-darker: #404040;
}

/* ---------- base ---------- */
body {
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Marker Felt", cursive, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  /* Subtle SVG noise texture, tiled */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
  min-height: 100vh;
}

a:link        { color: var(--link); }
a:visited     { color: var(--link-visited); }
a:hover       { background: yellow; color: black; text-decoration: underline wavy var(--accent); }
a:active      { color: var(--accent); }

h1, h2, h3, h4 {
  font-family: "Comic Sans MS", "Chalkboard SE", cursive, sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 0.4em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

code { font-family: "Courier New", monospace; background: #fff; border: 1px dashed #000; padding: 0 4px; }
pre  { font-family: "Courier New", monospace; background: #fff; border: var(--border); padding: 8px; overflow: auto; }

/* ---------- divider with the classic <hr> double-line look ---------- */
hr.hr-double {
  border: 0;
  height: 6px;
  background: transparent;
  border-top:    2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  margin: 16px 0;
}

/* ---------- header / marquee ---------- */
.site-header {
  border-bottom: var(--border);
  background: var(--bg-grid);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0,0,0,0.04) 0 4px,
    transparent 4px 8px
  );
}
.site-marquee {
  display: block;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent);
  background: #000;
  padding: 6px 0;
  border-bottom: var(--border);
  letter-spacing: 1px;
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.site-title { margin: 0; font-size: 2rem; }

/* ---------- GME stock ticker (next to the logo) ---------- */
.ticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: #0a0a0a;
  color: #00ff66;
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.5px;
  border: 2px solid #000;
  box-shadow: var(--shadow);
  text-decoration: none !important;
  text-shadow: 0 0 4px rgba(0, 255, 102, 0.55);
  white-space: nowrap;
}
.ticker:hover { background: #111; color: #aaffcc; text-decoration: none !important; }
.ticker:visited { color: #00ff66; }
.ticker .ticker-sym {
  background: #ff0000;
  color: #fff;
  padding: 0 6px;
  border: 1px solid #fff;
  text-shadow: none;
  font-size: 0.85rem;
}
.ticker .ticker-price { color: #ffffff; text-shadow: 0 0 4px rgba(255,255,255,0.4); }
.ticker.ticker-up   .ticker-change { color: #00ff66; }
.ticker.ticker-down .ticker-change { color: #ff4040; text-shadow: 0 0 4px rgba(255, 64, 64, 0.55); }

@media (max-width: 480px) {
  .ticker { font-size: 0.8rem; padding: 3px 6px; gap: 6px; }
  .ticker .ticker-sym { font-size: 0.7rem; }
}
.site-title a {
  color: var(--ink);
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border: var(--border);
  box-shadow: var(--shadow);
  display: inline-block;
}
.site-title a:hover { background: yellow; color: var(--ink); text-decoration: none; }
.site-nav { font-size: 1rem; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-nav > a { margin: 0 4px; }
.site-nav .sep { color: #555; }

/* ---------- "POST YOUR MEME" navbar CTA — animated rainbow gradient ---------- */
.submit-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  margin: 0 6px 0 0 !important;
  font-family: "Comic Sans MS", "Chalkboard SE", cursive, sans-serif;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: #fff !important;
  text-decoration: none !important;
  background: linear-gradient(90deg, #ff007f, #ff8a00, #ffe600, #00d26a, #00b4ff, #8a2be2, #ff007f);
  background-size: 300% 100%;
  animation: cta-rainbow 3.5s linear infinite;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000, inset 0 0 0 1px rgba(255,255,255,0.6);
  text-shadow: 1px 1px 0 #000, 0 0 6px rgba(255,255,255,0.6);
  transform: rotate(-1.5deg);
  transition: transform 0.15s ease;
  white-space: nowrap;
}
.submit-cta:hover {
  transform: rotate(0deg) scale(1.06);
  background: linear-gradient(90deg, #ff007f, #ff8a00, #ffe600, #00d26a, #00b4ff, #8a2be2, #ff007f) !important;
  color: #fff !important;
  text-decoration: none !important;
  box-shadow: 5px 5px 0 #000, inset 0 0 0 1px rgba(255,255,255,0.85);
}
.submit-cta:active { transform: translate(2px, 2px) rotate(-1deg); box-shadow: 1px 1px 0 #000; }
.submit-cta-spark { animation: cta-spark 1.2s ease-in-out infinite; display: inline-block; color: #fff700; text-shadow: 0 0 6px #ff0; }
.submit-cta-spark:last-child { animation-delay: 0.6s; }
.submit-cta-text { display: inline-block; }

@keyframes cta-rainbow {
  0%   { background-position:   0% 50%; }
  100% { background-position: 300% 50%; }
}
@keyframes cta-spark {
  0%, 100% { transform: scale(1)   rotate(0deg); opacity: 1; }
  50%      { transform: scale(1.4) rotate(20deg); opacity: 0.8; }
}
@media (prefers-reduced-motion: reduce) {
  .submit-cta { animation: none; }
  .submit-cta-spark { animation: none; }
}
@media (max-width: 480px) {
  .submit-cta { font-size: 0.8rem; padding: 4px 8px; letter-spacing: 0.5px; }
}
.site-nav .inline-form { display: inline; }
.site-nav .link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--link);
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- main / layout ---------- */
.site-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ==========================================================================
   Post wall — corkboard meme board with pinned polaroid cards.
   CSS multi-column gives us native masonry packing (no JS, no gaps).
   Rotations cycle 4n+x for stable but never-symmetric chaos.
   ========================================================================== */

.post-splash {
  margin: 0 auto 32px;
  max-width: 760px;
  position: relative;
  perspective: 1200px;
}
.post-splash .card {
  transform: rotate(-0.6deg);
  border-width: 4px;
  box-shadow: 8px 8px 0 #000, var(--shadow);
  position: relative;
}
.post-splash .card-title { font-size: 1.7rem; }
.post-splash .card-image-link { box-shadow: 4px 4px 0 #000; }

/* Cork bulletin board — frames the wall, pulls focus inward. */
.post-wall-frame {
  /* We render this on the same .post-wall via padding/background; no extra wrapper element needed. */
}
.post-wall {
  columns: 1;
  column-gap: 28px;
  padding: 28px 18px 32px;
  background-color: #b08652;
  background-image:
    /* layered cork-fiber noise: two slightly-offset noise tiles to feel organic */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.34  0 0 0 0 0.20  0 0 0 0 0.07  0 0 0 0.55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23c)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='c2'><feTurbulence type='fractalNoise' baseFrequency='0.45' numOctaves='2' seed='12'/><feColorMatrix values='0 0 0 0 0.78  0 0 0 0 0.55  0 0 0 0 0.28  0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23c2)'/></svg>");
  background-size: 220px 220px, 160px 160px;
  border: var(--border);
  box-shadow: var(--shadow), inset 0 0 0 4px #6b4a22, inset 0 0 30px rgba(0,0,0,0.35);
  position: relative;
}

@media (min-width: 768px)  { .post-wall { columns: 2; } }
@media (min-width: 1024px) { .post-wall { columns: 3; } }

.post-wall .card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin: 0 0 28px;
  position: relative;
  display: block;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

/* Stable, deterministic tilt cycle — feels random but is identical between renders. */
.post-wall .card:nth-child(4n+1) { transform: rotate(-2.5deg); }
.post-wall .card:nth-child(4n+2) { transform: rotate( 1.5deg); }
.post-wall .card:nth-child(4n+3) { transform: rotate( 2.0deg); }
.post-wall .card:nth-child(4n+4) { transform: rotate(-1.0deg); }

.post-wall .card:hover,
.post-wall .card:focus-within {
  transform: rotate(0deg) scale(1.025);
  box-shadow: 8px 8px 0 #000;
  z-index: 2;
}

/* Thumbtack — only visible on the wall and splash; hidden by default so the
   single-post page (which reuses post-card.ejs) doesn't get one. */
.thumbtack { display: none; }
.post-wall .thumbtack,
.post-splash .thumbtack {
  display: block;
  position: absolute;
  top: -10px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.55),
    1px 2px 0 rgba(0,0,0,0.45),
    inset 1px 1px 0 rgba(255,255,255,0.45);
  z-index: 3;
  pointer-events: none;
}
/* Wall thumbtack color rotation: red / yellow / green / blue */
.post-wall .card:nth-child(4n+1) .thumbtack { background: radial-gradient(circle at 35% 30%, #ff8a8a 0%, #c80000 55%, #800000 100%); }
.post-wall .card:nth-child(4n+2) .thumbtack { background: radial-gradient(circle at 35% 30%, #fff19a 0%, #e0b400 55%, #8a6a00 100%); }
.post-wall .card:nth-child(4n+3) .thumbtack { background: radial-gradient(circle at 35% 30%, #b3ffb3 0%, #1ea84a 55%, #0e5a26 100%); }
.post-wall .card:nth-child(4n+4) .thumbtack { background: radial-gradient(circle at 35% 30%, #b9e6ff 0%, #0a78d6 55%, #074180 100%); }
/* Splash gets a single oversized red tack, dead-centered above the headline. */
.post-splash .card { overflow: visible; }
.post-splash .card > .thumbtack {
  display: block;
  width: 22px; height: 22px; margin-left: -11px; top: -14px;
  background: radial-gradient(circle at 35% 30%, #ff8a8a 0%, #c80000 55%, #800000 100%);
  box-shadow: 0 0 0 1.5px rgba(0,0,0,0.55), 2px 3px 0 rgba(0,0,0,0.45), inset 1px 1px 0 rgba(255,255,255,0.45);
}

/* "★ TOP ★" rubber-stamp on the splash card — rotated, blood-red, slightly distressed. */
.top-stamp {
  position: absolute;
  top: 12px;
  right: -14px;
  z-index: 4;
  font-family: "Impact", "Haettenschweiler", "Arial Black", sans-serif;
  font-size: 1.05rem;
  letter-spacing: 3px;
  color: #c20000;
  background: rgba(255,255,255,0.0);
  border: 3px solid #c20000;
  padding: 3px 10px;
  transform: rotate(8deg);
  text-shadow: 0 0 1px rgba(194,0,0,0.4);
  box-shadow: inset 0 0 0 1px #c20000;
  pointer-events: none;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .post-wall .card,
  .post-splash .card { transition: none; }
}

@media (max-width: 480px) {
  .post-wall { columns: 1; padding: 18px 12px 22px; }
  .post-wall .card { margin-bottom: 22px; }
  .post-wall .card:nth-child(4n+1),
  .post-wall .card:nth-child(4n+2),
  .post-wall .card:nth-child(4n+3),
  .post-wall .card:nth-child(4n+4) { transform: rotate(-1deg); } /* gentler on small screens */
  .post-splash { margin-bottom: 22px; }
  .post-splash .card { transform: rotate(-0.3deg); }
  .post-splash .card-title { font-size: 1.3rem; }
  .top-stamp { font-size: 0.85rem; right: -8px; padding: 2px 8px; }
}

/* ---------- card ---------- */
.card {
  background: var(--card);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-radius: 0;        /* Sharp rectangles only. */
}
.card + .card { margin-top: 24px; }

/* Post-card layout: vote column on the left, content on the right. */
.post-card { display: flex; gap: 12px; align-items: stretch; }
.post-card .card-content { flex: 1 1 auto; min-width: 0; }

/* ---------- vote column (Reddit-style ▲ score ▼) ---------- */
.vote-col {
  flex: 0 0 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
  user-select: none;
}
.vote-btn {
  display: block;
  width: 36px;
  height: 26px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 900;
  color: #444;
  background: #d8d8d8;
  border-top:    2px solid var(--bevel-light);
  border-left:   2px solid var(--bevel-light);
  border-right:  2px solid var(--bevel-darker);
  border-bottom: 2px solid var(--bevel-darker);
  outline: 1px solid #000;
  cursor: crosshair;
  border-radius: 0;
  padding: 0;
  line-height: 1;
  transition: background 100ms ease, color 100ms ease, transform 100ms ease;
}
.vote-btn:hover { background: #fff; color: #000; }
.vote-btn:focus-visible { outline: 2px solid #ffeb3b; outline-offset: 1px; }
.vote-btn:active {
  border-top:    2px solid var(--bevel-darker);
  border-left:   2px solid var(--bevel-darker);
  border-right:  2px solid var(--bevel-light);
  border-bottom: 2px solid var(--bevel-light);
}
.vote-up.active   { background: var(--accent); color: #fff; text-shadow: 1px 1px 0 #000; }
.vote-up.active:hover { background: #ff3030; color: #fff; }
.vote-down.active { background: #1e6bd6; color: #fff; text-shadow: 1px 1px 0 #000; }
.vote-down.active:hover { background: #4a92ff; color: #fff; }

.vote-score {
  font-family: "Courier New", monospace;
  font-size: 0.95rem;
  font-weight: bold;
  color: #000;
  background: #fff;
  border: 2px solid #000;
  padding: 2px 4px;
  min-width: 36px;
  text-align: center;
  letter-spacing: 1px;
  display: inline-block;
}
.vote-score.pos { color: #008f3a; }
.vote-score.neg { color: #c00000; }
.vote-score.pop { animation: vote-pop 360ms cubic-bezier(.2, .9, .3, 1.4); }
@keyframes vote-pop {
  0%   { transform: scale(1);   }
  35%  { transform: scale(1.55); }
  70%  { transform: scale(0.92); }
  100% { transform: scale(1);   }
}

/* While FLIP-animating between positions, force the card to render above
   neighbours and disable the corkboard tilt so movement reads cleanly. */
.post-wall .card.flipping {
  z-index: 5;
  box-shadow: 8px 8px 0 #000 !important;
}

@media (max-width: 480px) {
  .vote-col { flex: 0 0 38px; gap: 3px; }
  .vote-btn { width: 30px; height: 22px; font-size: 0.85rem; }
  .vote-score { min-width: 30px; font-size: 0.85rem; padding: 1px 3px; }
}

.card-head { margin-bottom: 8px; }
.card-title { margin: 0; font-size: 1.35rem; word-break: break-word; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }

.card-meta {
  margin: 4px 0 10px;
  font-size: 0.9rem;
  color: #333;
}
.card-meta .sep { margin: 0 6px; color: #888; }
.card-type-pill {
  display: inline-block;
  padding: 1px 8px;
  border: 2px solid var(--ink);
  background: #fff;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.card-type-image { background: #fff8a8; }
.card-type-embed { background: #cfe9ff; }

.card-image-link { display: block; border: var(--border); box-shadow: 2px 2px 0 #000; margin-bottom: 8px; }
.card-image      { width: 100%; height: auto; display: block; }

.card-caption {
  margin: 8px 0 0;
  font-style: italic;
  font-size: 1.05rem;
}
.embed-wrap { margin: 4px 0; }
.embed-wrap blockquote.twitter-tweet { margin: 0 auto !important; }
.embed-fallback { padding: 12px; border: 2px dashed #000; background: #fffacd; }

.card-foot { margin-top: 12px; }
.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  background: var(--accent);
  color: #fff !important;
  border: 2px solid var(--ink);
  padding: 1px 8px;
  font-size: 0.85rem;
  text-decoration: none;
  box-shadow: 2px 2px 0 #000;
  cursor: crosshair;
}
.tag:hover { background: yellow; color: var(--ink) !important; }

.missing-image {
  border: 2px dashed #000;
  padding: 16px;
  text-align: center;
  color: #555;
  background: #f8f8f8;
}

/* ---------- "NEW!" badge ---------- */
.new-badge {
  display: inline-block;
  margin-left: 6px;
  background: var(--accent);
  color: #fff;
  border: 2px solid #000;
  padding: 1px 6px;
  font-size: 0.75rem;
  letter-spacing: 1px;
  vertical-align: middle;
  box-shadow: 2px 2px 0 #000;
}
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink {
  to { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
  .site-marquee { /* let the OS pause it; if not supported, oh well, you asked for marquee */ }
}

/* ---------- buttons (Windows-95 beveled) ---------- */
.btn, button.btn, button[type="submit"], input[type="submit"] {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  padding: 6px 14px;
  background: #c0c0c0;
  color: var(--ink);
  text-decoration: none;
  border-top:    2px solid var(--bevel-light);
  border-left:   2px solid var(--bevel-light);
  border-right:  2px solid var(--bevel-darker);
  border-bottom: 2px solid var(--bevel-darker);
  outline: 1px solid #000;
  cursor: crosshair;
  user-select: none;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
}
.btn:hover { background: #d4d4d4; }
.btn:active,
button.btn:active,
button[type="submit"]:active {
  border-top:    2px solid var(--bevel-darker);
  border-left:   2px solid var(--bevel-darker);
  border-right:  2px solid var(--bevel-light);
  border-bottom: 2px solid var(--bevel-light);
  transform: translate(2px, 2px);
  box-shadow: none;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: #ffaaaa #800000 #800000 #ffaaaa;
}
.btn.primary:hover { background: #ff3030; }
.btn.danger { background: #000; color: #fff; }
.btn.small  { padding: 2px 8px; font-size: 0.85rem; }

/* ---------- forms ---------- */
.stack-form {
  display: grid;
  gap: 14px;
  max-width: 720px;
}
.stack-form label {
  display: block;
  font-weight: bold;
}
.stack-form small { font-weight: normal; color: #555; }
.stack-form input[type="text"],
.stack-form input[type="url"],
.stack-form input[type="password"],
.stack-form input[type="datetime-local"],
.stack-form textarea {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  padding: 8px 10px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 0;
  margin-top: 4px;
  box-shadow: inset 2px 2px 0 rgba(0,0,0,0.06);
}
.stack-form input[type="file"] { display: block; margin-top: 4px; }
.stack-form fieldset {
  border: 2px solid var(--ink);
  background: #fff;
  padding: 8px 12px;
}
.stack-form fieldset legend { padding: 0 6px; font-weight: bold; }
.form-actions { display: flex; gap: 12px; }

/* The form toggles which fields are visible based on chosen post type. */
body[data-posttype="embed"] .field-image { display: none; }
body[data-posttype="image"] .field-embed { display: none; }

/* ---------- admin ---------- */
.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-bar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-bar-actions .inline-form { display: inline; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: var(--border);
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  border-bottom: 1px solid #000;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.admin-table thead th {
  background: var(--accent);
  color: #fff;
  border-bottom: 2px solid #000;
}
.admin-table tr:nth-child(even) td { background: #fff7d8; }
.admin-table .slug { color: #555; }
.admin-table .actions { white-space: nowrap; }
.admin-table .actions .inline-form { display: inline; }
.admin-table .empty { text-align: center; color: #555; padding: 24px; }

/* ---------- flash + login ---------- */
.flash {
  padding: 10px 14px;
  border: var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  background: #d4ffd4;
}
.flash-err { background: #ffd4d4; }
.login-card { max-width: 420px; margin: 40px auto; }
.login-card .tip { font-size: 0.85rem; color: #444; }

/* ---------- pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}
.page-indicator { font-weight: bold; }

/* ---------- footer ---------- */
.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  text-align: center;
}
.hit-counter { margin: 8px 0 4px; }
.lcd-label { display: inline-block; margin-right: 8px; font-weight: bold; }
.lcd-digits {
  display: inline-flex;
  gap: 2px;
  background: #000;
  border: 2px solid #000;
  padding: 2px 4px;
  vertical-align: middle;
  box-shadow: var(--shadow);
}
.lcd-digit {
  font-family: "Courier New", monospace;
  background: #1a1a1a;
  color: #00ff00;
  padding: 2px 6px;
  font-size: 1.2rem;
  font-weight: bold;
  border: 1px solid #333;
  text-shadow: 0 0 4px #00ff00;
  min-width: 1ch;
  text-align: center;
}
.visitor-line { font-style: italic; }
.footer-credit, .footer-tag { font-size: 0.85rem; color: #333; }
.footer-tag { margin-top: 4px; }

/* ---------- breadcrumbs / aside ---------- */
.breadcrumbs { margin: 0 0 12px; }
.post-share { margin-top: 24px; }

/* ---------- error pages ---------- */
.error-card { text-align: center; }
.error-pre  { text-align: left; max-height: 40vh; }

/* ---------- empty state ---------- */
.empty-state { text-align: center; padding: 32px; }

/* ---------- public submission form ---------- */
.submit-card { max-width: 720px; margin: 0 auto; }
.submit-title { text-align: center; color: var(--accent); text-shadow: 2px 2px 0 #000; }
.submit-lede { font-style: italic; color: #333; margin-bottom: 16px; }
.submit-rules { font-size: 0.85rem; color: #555; margin-top: 12px; border-top: 1px dashed #888; padding-top: 8px; }

/* ---------- admin pending queue ---------- */
.pending-badge {
  display: inline-block;
  margin-left: 8px;
  background: #ff8800;
  color: #000;
  border: 2px solid #000;
  padding: 1px 8px;
  font-size: 0.85rem;
  letter-spacing: 1px;
  box-shadow: 2px 2px 0 #000;
  vertical-align: middle;
}
.pending-queue {
  background: #fff8d6;
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin: 0 0 24px;
}
.pending-queue h3 { margin: 0 0 12px; color: #b85f00; }
.pending-count   { color: #555; font-weight: normal; font-size: 0.9rem; }

.pending-item {
  background: #fff;
  border: 2px solid #000;
  padding: 10px 12px;
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.pending-item:last-child { margin-bottom: 0; }
.pending-meta { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; font-size: 0.9rem; }
.pending-meta strong { color: #000; }
.pending-title { font-weight: bold; color: #000; }
.pending-time  { color: #555; font-size: 0.8rem; margin-left: auto; }
.pill {
  display: inline-block;
  padding: 0 6px;
  border: 2px solid #000;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: #fff;
}
.pill-image { background: #fff8a8; }
.pill-embed { background: #cfe9ff; }
.pending-img {
  max-width: 100%;
  max-height: 240px;
  border: 2px solid #000;
  display: block;
}
.pending-caption { margin: 6px 0 0; font-style: italic; }
.pending-tags    { margin: 6px 0 0; }
.pending-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px dashed #aaa; }
.pending-actions .inline-form { display: inline; }

.published-heading { margin: 8px 0 12px; }

/* ==========================================================================
   Comments — 4chan / Yotsuba B aesthetic, tuned for readability.
   Each comment is a distinct card with clear separation, vivid greentext,
   and prominent >>NN backlinks.
   ========================================================================== */
.comments {
  margin-top: 32px;
  padding: 16px 18px 20px;
  background: #d6daf0;            /* Yotsuba B page bg */
  border: var(--border);
  box-shadow: var(--shadow);
  font-family: arial, helvetica, sans-serif;
  font-size: 14px;
  color: #000;
}
.comments h3.comments-heading {
  font-family: arial, helvetica, sans-serif;
  font-size: 1.15rem;
  margin: 0 0 14px;
  border-bottom: 2px solid #34345c;
  padding-bottom: 8px;
  color: #34345c;
}
.comments .comments-count { color: #34345c; font-weight: normal; }
.comments .flash {
  background: #ffd1d1;
  border: 2px solid #800000;
  box-shadow: 2px 2px 0 #800000;
  color: #800000;
  margin-bottom: 14px;
}
.comments-empty { color: #34345c; font-style: italic; margin: 8px 0 16px; }
.comments hr.hr-double {
  border-top:    1px solid #b7c5d9;
  border-bottom: 1px solid #b7c5d9;
  height: 4px;
  margin: 16px 0;
}

/* Each comment is a distinct card with its own bg + left rule. */
.comment {
  margin: 0 0 10px;
  padding: 8px 12px 10px;
  background: #eef2ff;
  border: 1px solid #b7c5d9;
  border-left: 4px solid #34345c;
  box-shadow: 1px 1px 0 rgba(0,0,0,0.08);
  display: block;
}
.comment:last-of-type { margin-bottom: 0; }

.comment-head {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  padding-bottom: 4px;
  border-bottom: 1px dotted #b7c5d9;
  margin-bottom: 6px;
}
.comment-name {
  color: #117743;                 /* classic anon green */
  font-weight: bold;
  font-size: 14px;
}
.comment-date {
  margin-left: 8px;
  color: #555;
  font-size: 12px;
  font-family: "Courier New", monospace;
}
.comment-no {
  margin-left: 8px;
  color: #34345c !important;
  text-decoration: none;
  font-weight: bold;
}
.comment-no:hover {
  color: #d00 !important;
  background: transparent;
  text-decoration: underline;
}

.comment-body {
  margin: 0;
  padding: 2px 0 2px 8px;
  font-size: 15px;
  line-height: 1.55;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  color: #000;
}

/* Greentext — the punchier 4chan green, bold for visibility. */
.comment-body .quote {
  color: #4a7d2f;
  font-weight: bold;
  display: inline;
}

/* >>NN backlinks — vivid red, always underlined. */
.comment-body a.post-link {
  color: #d00033 !important;
  text-decoration: underline;
  font-weight: bold;
}
.comment-body a.post-link:hover {
  background: #ffebeb;
  color: #800000 !important;
}

/* ---------- comment form ---------- */
.comment-form {
  background: #eef2ff;
  border: 1px solid #34345c;
  padding: 10px 12px;
  margin-top: 8px;
}
.comment-form-row { display: flex; gap: 12px; align-items: flex-end; }
.comment-form label {
  display: block;
  font-weight: bold;
  font-size: 12px;
  color: #34345c;
  margin: 0 0 6px;
}
.comment-form .cf-name { flex: 0 0 240px; }
.comment-form .cf-body { display: block; margin-top: 8px; }
.comment-form input[type="text"],
.comment-form textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 4px 6px;
  font-family: arial, helvetica, sans-serif;
  font-size: 13px;
  background: #fff;
  border: 1px solid #888a8c;
  border-radius: 0;
  box-shadow: inset 1px 1px 0 rgba(0,0,0,0.08);
  color: #000;
  font-weight: normal;
}
.comment-form textarea { resize: vertical; min-height: 80px; }
.comment-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.comment-form .cf-rules {
  font-size: 11px;
  color: #34345c;
}

/* The shared .btn would override too much; keep our beveled style but adapt color */
.comments .btn.primary {
  font-family: arial, helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
}

.comment-cooldown {
  margin-top: 12px;
  padding: 10px 12px;
  background: #ffefef;
  border: 1px dashed #800000;
  color: #800000;
  font-size: 13px;
}
.comment-cooldown p { margin: 0 0 4px; }

@media (max-width: 480px) {
  .comment-form-row { flex-direction: column; align-items: stretch; }
  .comment-form .cf-name { flex: 1 1 auto; }
  .comment-body { margin-left: 16px; }
}

/* ---------- mobile tightening ---------- */
@media (max-width: 480px) {
  .site-title { font-size: 1.4rem; }
  .site-marquee { font-size: 0.95rem; }
  .card { padding: 12px; }
  .admin-table th, .admin-table td { padding: 6px; font-size: 0.9rem; }
}
