/* The Pillory — public stylesheet. Warm, borderless, simple. */

:root {
  --paper:    #f4eee2;        /* warm cream, aged paper */
  --paper-2:  #ebe3d2;        /* slightly darker for soft separation */
  --ink:      #1f1c17;        /* near-black with warm undertone */
  --ink-2:    #3a342a;
  --muted:    #605845;          /* darker so 4.5:1 on both paper and paper_2 (WCAG AA text) */
  --amber:    #c08a2e;        /* cap-badge gold, used sparingly */
  --amber-2:  #8a601a;        /* amber on light bg */
  --grass:    #6b8f3c;        /* the green from the drawing */
  --tap:      44px;
  --max:      720px;
}

* { box-sizing: border-box; }

/* WCAG 2.4.7 — visible focus indicator. :focus-visible suppresses the ring
   on mouse clicks but always shows it for keyboard Tab navigation. */
:focus-visible {
  outline: 3px solid var(--amber-2);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Screen-reader-only utility (for labels that are visually obvious but
   would otherwise be missing from the accessibility tree). */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — visible only when focused */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  text-decoration: none;
  font-weight: 700;
  z-index: 100;
}
.skip-link:focus {
  left: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

html, body { margin: 0; padding: 0; }

body {
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1.1rem 3rem;
}

a {
  color: var(--amber-2);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover, a:focus { color: var(--ink); }

h1, h2, h3 {
  font-family: Georgia, "Iowan Old Style", Palatino, serif;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }

/* Header / brand */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  max-width: var(--max);
  margin: 0 auto;
  flex-wrap: wrap;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
}
.site-brand:hover { color: var(--ink); }

.site-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.site-title {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 1rem;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--amber-2);
}
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Form controls */

button, input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0.55rem 0.3rem;
  min-height: var(--tap);
}

input[type="text"], input[type="password"], input[type="date"], textarea, select {
  width: 100%;
  background: #fff;
  border: 1px solid rgba(31, 28, 23, 0.25);
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
}
input[type="text"]:hover, input[type="password"]:hover,
input[type="date"]:hover, textarea:hover, select:hover {
  border-color: rgba(31, 28, 23, 0.5);
}

textarea {
  min-height: calc(var(--tap) * 2);
  resize: vertical;
}

label {
  display: block;
  margin: 0.95rem 0 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

button {
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  border-radius: 4px;
}
button:hover { background: var(--amber-2); }

/* List controls — search bar group + view toggle */

.list-controls {
  margin-bottom: 1.1rem;
}

/* Search reads as one unified bar: pill with input + button + label above */
.search-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 0;
  background: #fff;
  border: 1px solid rgba(31, 28, 23, 0.25);
  border-radius: 999px;
  padding: 0.2rem 0.2rem 0.2rem 0.9rem;
  margin-bottom: 1rem;
}
.search-form input {
  border: none;
  background: transparent;
  padding: 0.55rem 0;
  min-height: var(--tap);
  font-size: 1rem;
  /* Input keeps the global :focus-visible ring so keyboard users get a
     clear indicator. The pill wrapper has no separate focus styling so
     they don't conflict. */
}
.search-form button {
  border-radius: 999px;
  padding: 0.5rem 1.2rem;
}
/* Visible label above the bar for sighted users */
.search-label {
  display: block;
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.view-toggle {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.view-toggle a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.view-toggle a.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.view-toggle a:hover { color: var(--ink); }

/* Entries / users */

.entries, .users {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Each row is a soft card on paper-2, no border. Hover lifts to white. */
.entry, .user-row {
  display: grid;
  gap: 0.2rem 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--paper-2);
  border-radius: 6px;
  transition: background 0.12s ease;
}
.entry:hover, .user-row:hover { background: #fff; }

.entry-user {
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}
.entry-user:hover { color: var(--amber-2); }
.entry-date { color: var(--muted); font-size: 0.95rem; }

.entry-status {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--amber-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  justify-self: start;
  padding: 0.1rem 0.55rem;
  background: rgba(192, 138, 46, 0.18);
  border-radius: 999px;
}

.entry-note {
  margin: 0.3rem 0 0;
  color: var(--ink-2);
  font-size: 0.97rem;
  grid-column: 1 / -1;
}

.user-row a {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.05rem;
}
.user-row a:hover { color: var(--amber-2); }
.user-row span { color: var(--muted); font-size: 0.95rem; }

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.pagination a { color: var(--amber-2); }

/* Sneak peek banner — borderless, just amber rule on left and gentle bg */

.sneak-peek {
  display: block;
  background: var(--paper-2);
  padding: 0.9rem 1rem 0.9rem 1rem;
  margin: 0 -0.2rem 1.25rem;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}
.sneak-peek::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.85rem;
  bottom: 0.85rem;
  width: 3px;
  background: var(--amber-2);
}
.sneak-peek:hover { background: #e2d8c2; }
.sneak-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-2);
  margin-bottom: 0.2rem;
}
.sneak-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}
.sneak-excerpt {
  display: block;
  color: var(--muted);
  font-size: 0.96rem;
  margin-top: 0.25rem;
}
.sneak-cta {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.9rem;
  color: var(--amber-2);
}

/* Forms general */

.tip-form { display: grid; gap: 0.3rem; }

.error {
  background: rgba(192, 138, 46, 0.15);
  color: var(--amber-2);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.85rem;
  border-left: 3px solid var(--amber);
}

.empty {
  color: var(--muted);
  padding: 1.5rem 0;
  text-align: center;
  font-style: italic;
}

/* User verdict — /u/<id> hero */

.verdict {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  margin: 0 0 2rem;
  padding: 0;
}
.verdict-img {
  width: 100%;
  max-width: 280px;
  height: auto;
  display: block;
  /* multiply blends the figure's internal whites with the paper bg */
  mix-blend-mode: multiply;
}
.verdict figcaption { margin: 0; }
.verdict h1 {
  margin: 0 0 0.35rem;
  font-size: 1.8rem;
}
.verdict-count {
  margin: 0;
  color: var(--amber-2);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 640px) {
  .verdict {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 1.5rem;
  }
  .verdict-img { max-width: 360px; }
  .verdict h1 { font-size: 2.2rem; }
  .verdict-count { font-size: 1.15rem; }
}

/* Error pages */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  margin: 1rem 0 2rem;
  padding: 0;
}
.error-page-img {
  width: 100%;
  max-width: 360px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}
.error-page figcaption { margin: 0; max-width: 480px; }
.error-page h1 { margin: 0 0 0.5rem; font-size: 1.6rem; }
.error-page p { color: var(--ink-2); margin: 0.5rem 0; }

@media (min-width: 640px) {
  .error-page-img { max-width: 460px; }
  .error-page h1 { font-size: 1.9rem; }
}

/* Footer */

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 1rem;
  font-size: 0.9rem;
}

/* Blog */

.post-list { list-style: none; padding: 0; margin: 0; }
.post-summary { padding: 1.1rem 0; border-bottom: 1px dashed rgba(31, 28, 23, 0.18); }
.post-summary:last-child { border-bottom: none; }
.post-summary time {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.post-summary h2 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.2rem;
}
.post-summary h2 a { color: var(--ink); text-decoration: none; }
.post-summary h2 a:hover { color: var(--amber-2); }
.post-summary .excerpt {
  color: var(--ink-2);
  margin: 0;
  font-size: 0.97rem;
}

.post header { margin-bottom: 1.2rem; }
.post header time {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.post header h1 { margin: 0.25rem 0 0; }

.prose { line-height: 1.65; }
.prose p { margin: 0.85rem 0; }
.prose ul, .prose ol { margin: 0.85rem 0 0.85rem 1.5rem; padding: 0; }
.prose li { margin: 0.3rem 0; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6rem; }
.prose h3 { font-size: 1.05rem; margin-top: 1.3rem; }
.prose blockquote {
  margin: 1rem 0;
  padding: 0.3rem 1rem;
  border-left: 3px solid var(--amber);
  color: var(--ink-2);
  font-style: italic;
}
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--paper-2);
  padding: 0 0.35em;
  font-size: 0.92em;
}
.prose a { color: var(--amber-2); }

/* Responsive */

@media (min-width: 640px) {
  body { font-size: 17px; }
  .entry { grid-template-columns: auto 1fr auto; align-items: baseline; }
  .user-row { grid-template-columns: auto 1fr auto; align-items: baseline; }
  .site-logo { width: 56px; height: 56px; }
  .site-title { font-size: 1.4rem; }
}
