/* Enjoy Blog — warm palette ported from blog-mockup-v2.html + DESIGN.md tokens */
:root {
  --bg1: #FFE5E5;
  --bg2: #FFD4C4;
  --bg3: #FFC4B4;
  --brown: #4B1F0F;
  --brown2: #512E11;
  --muted: #7a6a62;
  --coral1: #FFC09E;
  --coral2: #FA5C42;
  --surf: #fff;
  --shadow-sm: 0 2px 8px rgba(75,31,15,0.08);
  --shadow-md: 0 4px 16px rgba(75,31,15,0.12);
  --shadow-lg: 0 8px 30px rgba(75,31,15,0.14);
  --radius-card: 14px;
  --radius-pill: 20px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--brown);
  background: linear-gradient(160deg, var(--bg1), var(--bg2), var(--bg3));
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ── Nav ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(75,31,15,0.07);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 20px;
  color: var(--brown);
  text-decoration: none;
}

.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--coral1), var(--coral2));
  display: inline-block;
  flex-shrink: 0;
}

.brand .sub {
  font-weight: 600;
  color: var(--muted);
  font-size: 13px;
}

.nav nav {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--brown2);
  font-weight: 600;
}

.nav nav a {
  color: var(--brown2);
  text-decoration: none;
  transition: color 0.15s;
}

.nav nav a:hover { color: var(--coral2); }

/* ── Main layout ── */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 22px 48px;
}

/* ── Section title (category pages) ── */
.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--brown);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--coral2);
  display: inline-block;
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 700px) {
  .grid { grid-template-columns: 1fr; }
}

@media (min-width: 701px) and (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Card ── */
.card {
  background: var(--surf);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--brown);
  transition: box-shadow 0.18s, transform 0.18s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Thumbnail — only rendered when cover_image_url exists (IMAGE-OPTIONAL) */
.card .thumb {
  height: 90px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--coral1), var(--bg3));
  flex-shrink: 0;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card .body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card h4 {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--brown);
}

.card p.ex {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.card .meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

/* ── Category / section label ── */
.klabel {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--coral2);
  font-weight: 700;
}

/* ── Avatar dot (placeholder circle) ── */
.av {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral1), var(--coral2));
  display: inline-block;
  flex-shrink: 0;
}

/* ── Empty state ── */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  padding: 40px 0;
}

/* ── Article page ── */
.article {
  max-width: 640px;
  margin: 0 auto;
  padding-top: 10px;
}

.back {
  display: inline-block;
  font-size: 13px;
  color: var(--coral2);
  font-weight: 600;
  margin-bottom: 16px;
  text-decoration: none;
}

.back:hover { text-decoration: underline; }

.article h1 {
  font-size: 30px;
  line-height: 1.18;
  margin: 8px 0 16px;
  color: var(--brown);
}

/* Cover image — only rendered when cover_image_url exists (IMAGE-OPTIONAL) */
.cover-image {
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.cover-image img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 400px;
  object-fit: cover;
}

/* ── Byline ── */
.byline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.byline .av {
  width: 38px;
  height: 38px;
}

.byline b {
  font-size: 14px;
  color: var(--brown);
}

.byline span {
  font-size: 12px;
  color: var(--muted);
}

/* ── Prose ── */
.prose {
  color: var(--brown2);
}

.prose p {
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 15px;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--brown);
  margin: 28px 0 10px;
  line-height: 1.2;
}

.prose h2 { font-size: 22px; }
.prose h3 { font-size: 18px; }

.prose blockquote {
  border-left: 4px solid var(--coral1);
  margin: 20px 0;
  padding: 10px 20px;
  background: rgba(255,192,158,0.15);
  border-radius: 0 8px 8px 0;
  color: var(--brown2);
}

.prose code {
  background: rgba(75,31,15,0.07);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.prose pre {
  background: rgba(75,31,15,0.06);
  border-radius: 10px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 20px 0;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: 13px;
}

.prose a {
  color: var(--coral2);
  text-decoration: underline;
}

.prose ul, .prose ol {
  padding-left: 24px;
  margin: 0 0 15px;
}

.prose li {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 4px;
}

.prose img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 18px auto;
}

/* ── Tags ── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag {
  background: var(--surf);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brown2);
  box-shadow: var(--shadow-sm);
}

/* ── Author page header row ── */
.author-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.author-header h1 {
  margin: 0;
}

.btn-logout {
  background: none;
  border: 1px solid var(--muted);
  border-radius: var(--radius-pill);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-logout:hover {
  border-color: var(--coral2);
  color: var(--coral2);
}

/* ── Author + login form pages ── */
.editor-wrap, .my-posts, .verdict-page { max-width: 680px; margin: 0 auto; }
.auth-box { max-width: 420px; margin: 36px auto 0; }

#editor-form, #login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surf);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-top: 12px;
}

#editor-form label, #login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brown2);
}

#editor-form input, #editor-form textarea, #editor-form select, #login-form input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  color: var(--brown);
  background: #fff;
  border: 1px solid rgba(75,31,15,0.18);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: inset 0 1px 2px rgba(75,31,15,0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

#editor-form input:focus, #editor-form textarea:focus,
#editor-form select:focus, #login-form input:focus {
  outline: none;
  border-color: var(--coral2);
  box-shadow: 0 0 0 3px rgba(250,92,66,0.18);
}

#editor-form textarea {
  min-height: 340px;
  resize: vertical;
  line-height: 1.6;
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 14px;
}

#editor-form input[type="file"] {
  border: none;
  padding: 0;
  box-shadow: none;
  font-size: 13px;
  color: var(--muted);
}

.editor-actions { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }

#editor-form button, #login-form button {
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  border: 1px solid rgba(75,31,15,0.2);
  background: #fff;
  color: var(--brown);
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s, color 0.15s;
}

#editor-form button:hover, #login-form button:hover {
  border-color: var(--coral2);
  color: var(--coral2);
}

#editor-form button.btn-primary, #login-form button[type="submit"], a.btn-primary {
  background: linear-gradient(90deg, var(--coral1), var(--coral2));
  color: #fff;
  border: none;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: inline-block;
}

#editor-form button.btn-primary:hover,
#login-form button[type="submit"]:hover, a.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

a.btn-primary {
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
}

#editor-msg, #upload-status { font-size: 13px; margin: 4px 0 0; min-height: 1.2em; }
.error { color: var(--coral2); font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ── My posts list ── */
.my-posts > p { color: var(--brown2); }
.pw-heading { margin: 32px 0 0; font-size: 18px; color: var(--brown); }
#pw-msg { font-size: 13px; margin: 4px 0 0; min-height: 1.2em; }
.post-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surf);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;
}
.post-item > a {
  font-weight: 600;
  color: var(--brown);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(75,31,15,0.25);
}
.post-item > a:hover { text-decoration-color: var(--coral2); }
.post-date { font-size: 12px; color: var(--muted); margin-left: auto; }
.status-chip {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.status-published { background: rgba(45,139,78,0.14); color: #2D8B4E; }
.status-draft { background: rgba(75,31,15,0.08); color: var(--muted); }
.status-screening { background: rgba(255,150,40,0.18); color: #C56A12; }
.status-needs_revision { background: rgba(195,37,37,0.12); color: #C32525; }
.status-unpublished { background: rgba(75,31,15,0.12); color: var(--brown2); }

/* ── Verdict page ── */
.verdict-pass, .verdict-fail {
  background: var(--surf);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin: 16px 0;
}
.verdict-pass { border-left: 4px solid #2D8B4E; }
.verdict-fail { border-left: 4px solid var(--coral2); }
.verdict-pass p { font-size: 18px; font-weight: 700; color: #2D8B4E; margin: 0 0 14px; }
.verdict-fail h2 { margin: 0 0 12px; font-size: 18px; color: var(--brown); }
.feedback-checklist { margin: 0 0 18px; padding-left: 20px; }
.feedback-checklist li { font-size: 14px; line-height: 1.6; color: var(--brown2); margin-bottom: 8px; }
.verdict-page > p a { color: var(--coral2); text-decoration: underline; }

/* ── Link affordance: underline clickable text links ── */
.nav nav a {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(75,31,15,0.25);
}
.nav nav a:hover { text-decoration-color: var(--coral2); }
.card h4 {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(75,31,15,0.2);
}
.card:hover h4 { text-decoration-color: var(--coral2); }
.back { text-decoration: underline; text-underline-offset: 3px; }

/* ── Author draft preview banner ── */
.preview-banner {
  background: rgba(255,150,40,0.18);
  color: #C56A12;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
}

/* ── Editing a live post: re-screen notice ── */
.editing-notice {
  background: rgba(255,192,158,0.30);
  border-left: 4px solid var(--coral2);
  color: var(--brown2);
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 16px;
  border-radius: 10px;
  margin: 0 0 4px;
}

/* ── My posts: pending-edit + edited-at affordances ── */
.post-edited { font-size: 12px; color: var(--muted); }
.post-edit-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--coral2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.post-edit-link:hover { color: var(--brown); }

/* ── Public article: updated date ── */
.byline .updated { color: var(--muted); }

/* ════════════════════════════════════════════════════════════════
   Visual polish pass — masthead, typography, card & footer refinement.
   Same Enjoy warm palette (vars at top); these later rules win.
   ════════════════════════════════════════════════════════════════ */

/* Warm depth + footer pinned to the bottom on short pages */
body {
  background:
    radial-gradient(1100px 480px at 78% -10%, rgba(255,255,255,0.55), transparent 62%),
    linear-gradient(162deg, var(--bg1) 0%, var(--bg2) 48%, var(--bg3) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; }

/* ── Hero / masthead (home + category) ── */
.hero { padding: 6px 0 26px; }
.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--coral2);
  margin: 0 0 8px;
}
.hero-title {
  font-size: 42px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--brown);
  margin: 0;
}
.hero-sub {
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  margin: 12px 0 0;
  max-width: 560px;
}
.hero::after {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  border-radius: 3px;
  margin-top: 20px;
  background: linear-gradient(90deg, var(--coral1), var(--coral2));
}
@media (max-width: 700px) {
  .hero { padding: 2px 0 20px; }
  .hero-title { font-size: 31px; }
  .hero-sub { font-size: 15px; }
}

/* ── Grid: a touch more air ── */
.grid { gap: 20px; }

/* ── Cards: larger type, calmer chrome, clearer hover ── */
.card {
  border-radius: 16px;
  border: 1px solid rgba(75,31,15,0.06);
  box-shadow: 0 1px 2px rgba(75,31,15,0.04), 0 6px 18px rgba(75,31,15,0.06);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(75,31,15,0.06), 0 16px 34px rgba(75,31,15,0.15);
}
.card .thumb { height: 130px; }
.card .body { padding: 18px 18px 16px; gap: 10px; }
.card h4 {
  font-size: 17px;
  line-height: 1.32;
  letter-spacing: -0.01em;
  margin: 0;
  text-decoration: none;          /* drop the static underline — affordance moves to hover */
}
.card:hover h4 {
  color: var(--coral2);
  text-decoration: underline;
  text-decoration-color: var(--coral2);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 2px;
}
.card p.ex {
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta { font-size: 12px; gap: 8px; padding-top: 4px; }
.card .meta .av { width: 22px; height: 22px; }

/* Category label → soft coral pill */
.klabel {
  align-self: flex-start;
  background: rgba(250,92,66,0.10);
  color: var(--coral2);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
}

/* ── Article: stronger title, back link on its own line ── */
.article .back { display: block; margin-bottom: 14px; }
.article h1 { font-size: 34px; letter-spacing: -0.02em; margin-top: 14px; }
.article .klabel { display: inline-block; }

/* ── Site footer ── */
.site-footer {
  margin-top: 56px;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(75,31,15,0.08);
}
.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 22px 32px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.footer-inner .brand { font-size: 17px; }
.footer-nav { display: flex; gap: 18px; margin-left: auto; font-size: 13px; font-weight: 600; }
.footer-nav a { color: var(--brown2); text-decoration: none; transition: color 0.15s; }
.footer-nav a:hover { color: var(--coral2); text-decoration: underline; text-underline-offset: 4px; }
.footer-tag { flex-basis: 100%; font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }
.footer-copy { flex-basis: 100%; font-size: 12px; color: var(--muted); margin: 6px 0 0; opacity: 0.9; }
@media (max-width: 700px) { .footer-nav { margin-left: 0; } }
