/* PFS Content Portal - one small clean stylesheet, mobile-first. */

:root {
  --bg: #f7f7f8;
  --card: #ffffff;
  --ink: #1b1f24;
  --muted: #6a7280;
  --border: #e1e4e8;
  --accent: #2454ff;
  --accent-ink: #ffffff;

  --draft: #9aa0a6;
  --approved: #1f7ae0;
  --scheduled: #b8860b;
  --posted: #1a8a4a;
  --measured: #6a3fd6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}

.nav-links { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--accent); }
.nav-user { margin-left: auto; color: var(--muted); font-size: 0.9rem; }
.nav-logout { text-decoration: none; color: var(--muted); font-size: 0.9rem; }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; }
h3 { font-size: 1rem; }

section { margin-top: 1.25rem; }

.meta, .directives { color: var(--muted); font-size: 0.9rem; }
.empty { color: var(--muted); font-style: italic; }

.flashes {
  list-style: none;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  background: #fff4e5;
  border: 1px solid #f0c36d;
  border-radius: 6px;
}

table.posts-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.92rem;
}

table.posts-table th, table.posts-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

table.posts-table thead { background: #fafbfc; }
table.posts-table tbody tr:last-child td { border-bottom: none; }

.chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
}

.status-draft { background: var(--draft); }
.status-approved { background: var(--approved); }
.status-scheduled { background: var(--scheduled); }
.status-posted { background: var(--posted); }
.status-measured { background: var(--measured); }

pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 0.95rem;
}

button, .button-link, input[type="submit"] {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 6px;
  padding: 0.55rem 1.1rem;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
}

button:hover, .button-link:hover { opacity: 0.9; }

#copy-button, #copy-comment-button {
  font-size: 1.05rem;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
}

.inline-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

form input, form select, form textarea {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
}

.metrics-form label { display: inline-block; width: auto; margin-right: 1rem; }
.metrics-form input { width: 8rem; display: inline-block; }

.post-image {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.login-box {
  max-width: 360px;
  margin: 4rem auto;
  text-align: center;
}

.audit-table { font-size: 0.8rem; }

@media (max-width: 640px) {
  .nav-user { display: none; }
  table.posts-table { font-size: 0.85rem; }
}
