/*
 * Design source: the product spec given directly to the builder - there is
 * no pre-existing design asset anywhere in this repo or elsewhere on this
 * machine to match against (searched explicitly). Colors, font stack, and
 * the band-tag treatment below are built from that spec, not copied from
 * a reference. Flagging this plainly so it's easy to spot anything that
 * needs adjusting once a human looks at it on a real screen.
 */

:root {
  --ink: #0E2724;
  --moss: #2F5D52;
  --paper: #EDF0EC;
  --card: #FFFFFF;
  --gold: #E9A63C;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --gap: 1rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  font-size: 16px;
}

a { color: var(--moss); }
a:hover { color: var(--ink); }

img, video { max-width: 100%; height: auto; display: block; }

/* --- Layout shell --- */

.site-header {
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
}

.site-header nav a {
  color: var(--paper);
  text-decoration: none;
  opacity: 0.85;
}
.site-header nav a:hover { opacity: 1; text-decoration: underline; }

.logout-form { margin: 0; }
.logout-form button {
  background: none;
  border: none;
  color: var(--paper);
  opacity: 0.85;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0;
}
.logout-form button:hover { opacity: 1; text-decoration: underline; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0.5rem 0 1rem;
}

/* --- Cards (feed items, forms) --- */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: var(--gap);
  box-shadow: 0 1px 3px rgba(14, 39, 36, 0.08);
}

.feed-item .feed-item-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.author-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.feed-item-timestamp {
  color: var(--moss);
  font-size: 0.8rem;
  margin-left: auto;
}

.feed-item-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 0 0 0.75rem;
}

.feed-item-media img,
.feed-item-media video {
  width: 100%;
  border-radius: var(--radius-sm);
  background: var(--ink);
}

.feed-item-media + .feed-item-media { margin-top: 0.5rem; }

.feed-source-tag {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--moss);
  border: 1px solid var(--moss);
  border-radius: 999px;
  padding: 0.1em 0.6em;
  margin-bottom: 0.5rem;
}

.empty-state {
  text-align: center;
  color: var(--moss);
  padding: 2.5rem 1rem;
}

/* --- Band tag: THE signature visual element. A bird is always shown as
   this dark pill with a punched-hole detail - never a bare name. --- */

.band-tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.32em 0.85em 0.32em 1.7em;
  border-radius: 999px;
  line-height: 1.5;
  white-space: nowrap;
}

.band-tag::before {
  content: "";
  position: absolute;
  left: 0.6em;
  top: 50%;
  width: 0.5em;
  height: 0.5em;
  margin-top: -0.25em;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.band-tag--gold { background: var(--gold); color: var(--ink); }
.band-tag--gold::before { background: var(--paper); }

/* --- Forms --- */

.auth-shell {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

.auth-card .brand {
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 1.25rem;
}

.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
  border: 1px solid rgba(14, 39, 36, 0.25);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
}

.field input:focus {
  outline: 2px solid var(--moss);
  outline-offset: 1px;
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--gold);
  color: var(--ink);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { filter: brightness(0.95); }

.auth-links {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-message {
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.form-message--error {
  background: #fbeaea;
  color: #7a1f1f;
  border: 1px solid #e6b8b8;
}
.form-message--success {
  background: #eaf3ee;
  color: var(--moss);
  border: 1px solid #b9d6c6;
}

/* --- Admin merge-review table --- */

.review-table-wrap {
  overflow-x: auto;
  margin: 0.75rem 0;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.review-table th,
.review-table td {
  text-align: left;
  padding: 0.5em 0.6em;
  vertical-align: top;
  border-bottom: 1px solid rgba(14, 39, 36, 0.1);
}

.review-table th {
  border-bottom: 1px solid rgba(14, 39, 36, 0.25);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--moss);
}

.review-table tr.excluded-row { opacity: 0.5; }

.record-id {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--moss);
}

.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15em 0.55em;
  border-radius: 999px;
}
.status-pill--included { background: #eaf3ee; color: var(--moss); }
.status-pill--excluded { background: #fbeaea; color: #7a1f1f; }
.status-pill--overridden { background: #fdf3e2; color: #8a5a10; }

.band-tag + .band-tag { margin-left: 0.3em; }

/* --- Small screens are the default target; widen typography slightly on
   larger viewports rather than the other way around. --- */
@media (min-width: 640px) {
  body { font-size: 16px; }
  main { padding: 1.5rem 1rem; }
  .page-title { font-size: 1.5rem; }
}
