:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2e37;
  --text: #eceef2;
  --muted: #9aa1ac;
  --accent: #ffb703;
  --accent-dark: #e09400;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Georgia", "Times New Roman", serif;
  line-height: 1.6;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.site-header .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--text);
  text-decoration: none;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}

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

.hero {
  text-align: center;
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.hero p {
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

.btn {
  display: inline-block;
  margin-top: 20px;
  background: var(--accent);
  color: #1a1200;
  font-family: system-ui, sans-serif;
  font-weight: 600;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--accent-dark);
}

.articles {
  padding: 40px 0 80px;
}

.articles h2 {
  font-family: system-ui, sans-serif;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 20px;
}

.article-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.article-card h3 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.article-card .meta {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.article-card .tag {
  display: inline-block;
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent);
  font-family: system-ui, sans-serif;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  margin-right: 6px;
}

.article-card .excerpt {
  color: #c7ccd4;
  font-size: 0.98rem;
}

.empty-state {
  color: var(--muted);
  font-family: system-ui, sans-serif;
}

.form-page {
  padding: 48px 0 80px;
}

.form-page h1 {
  margin-bottom: 4px;
}

.form-page .sub {
  color: var(--muted);
  font-family: system-ui, sans-serif;
  margin-bottom: 32px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  font-family: system-ui, sans-serif;
}

.row {
  display: flex;
  gap: 18px;
}

.row .field {
  flex: 1;
}

label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-hint {
  opacity: 0.7;
  font-weight: 400;
}

input, textarea {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 1rem;
}

textarea {
  min-height: 320px;
  resize: vertical;
  font-family: "Georgia", serif;
  line-height: 1.6;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Searchable select (Sport field on the submit form) */
.combo {
  position: relative;
}

.combo-input[aria-expanded="true"] {
  border-color: var(--accent);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.combo-list {
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-top-color: var(--border);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.combo-option {
  padding: 8px 12px;
  font-size: 0.95rem;
  cursor: pointer;
}

.combo-option:hover,
.combo-option.active {
  background: rgba(255, 183, 3, 0.15);
  color: var(--accent);
}

.combo-option.selected::after {
  content: "✓";
  float: right;
  color: var(--accent);
}

.combo-empty {
  padding: 8px 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Rich text editor (Article field on the submit form) */
.editor {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.editor:focus-within {
  border-color: var(--accent);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.editor-btn {
  min-width: 34px;
  height: 30px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.editor-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* The button for whatever formatting the caret currently sits in. */
.editor-btn[aria-pressed="true"] {
  background: rgba(255, 183, 3, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.editor-sep {
  align-self: stretch;
  width: 1px;
  margin: 2px 6px;
  background: var(--border);
}

.editor-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.editor-btn:disabled:hover {
  background: transparent;
  color: var(--muted);
}

/* The URL bar under the toolbar, shown while a link or a video embed is being
   added. Hidden until then by the hidden attribute. */
.editor-prompt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.editor-prompt-label {
  color: var(--muted);
}

.editor-prompt-input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 7px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.editor-prompt-input:focus {
  outline: none;
  border-color: var(--accent);
}

.editor-prompt-btn {
  padding: 7px 12px;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  color: #1a1200;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.editor-prompt-btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
  font-weight: 400;
}

.editor-prompt-btn.ghost:hover {
  color: var(--text);
}

.editor-prompt-error {
  flex: 1 1 100%;
  color: #ff6b6b;
}

/* A video inside the editor: its still frame rather than a live player, so it
   behaves like one object the caret can step over and delete. */
.video-block {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.2em 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: default;
  user-select: none;
}

.video-block-thumb {
  width: 132px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
  background: var(--bg);
}

.video-block-label {
  flex: 1;
}

.video-block-remove {
  align-self: flex-start;
  width: 26px;
  height: 26px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.video-block-remove:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

/* How long the article is so far, against the minimum the submit form holds
   writers to. */
.word-count {
  margin: 8px 0 0;
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.word-count.short {
  color: var(--accent);
}

.word-count.met {
  color: #7bd88f;
}

.editor-input {
  position: relative;
  min-height: 320px;
  max-height: 65vh;
  overflow-y: auto;
  padding: 14px 12px;
  font-family: "Georgia", serif;
  font-size: 1rem;
  line-height: 1.6;
  outline: none;
}

/* An empty editor still holds a paragraph, so the placeholder can't rely on
   :empty and is positioned over the first line instead. */
.editor-input.is-empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 14px;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.submit-row button {
  background: var(--accent);
  color: #1a1200;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 28px;
  border-radius: 6px;
  cursor: pointer;
}

.submit-row button:hover {
  background: var(--accent-dark);
}

.submit-row button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-msg {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.status-msg.error {
  color: #ff6b6b;
}

.status-msg.success {
  color: #7bd88f;
}

.article-page {
  padding: 48px 0 80px;
}

.article-page .meta {
  font-family: system-ui, sans-serif;
  color: var(--muted);
  margin-bottom: 24px;
}

.article-page h1 {
  margin-bottom: 8px;
  font-size: 2.1rem;
}

.article-body {
  font-size: 1.08rem;
}

/* Articles written before the editor existed are plain text, and their line
   breaks only survive if CSS keeps them. */
.article-body.plain-text {
  white-space: pre-wrap;
}

/* Formatted article text, shared by the article page and the submit editor so a
   writer sees the headings and emphasis they are about to publish. */
.rich-text > *:first-child {
  margin-top: 0;
}

.rich-text > *:last-child {
  margin-bottom: 0;
}

.rich-text p {
  margin: 0 0 1.1em;
}

.rich-text h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 1.6em 0 0.5em;
}

.rich-text h3 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 1.5em 0 0.45em;
}

.rich-text h4 {
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 1.4em 0 0.4em;
}

.rich-text u {
  text-underline-offset: 2px;
}

/* Links an article points out to, in the editor and on the page alike. */
.rich-text a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rich-text a:hover {
  color: var(--accent-dark);
}

/* Embedded YouTube players. The iframe carries no size of its own, so the
   article's column width and a 16:9 ratio give it one. */
.rich-text iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.6em 0;
  border: 0;
  border-radius: 8px;
  background: #000;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--muted);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.back-link:hover {
  color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
}

/* Auth-aware nav */
.nav-user {
  color: var(--accent);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  margin-left: 20px;
}

/* Sport filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.filter-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1200;
  font-weight: 600;
}

/* Reaction summary on cards */
.card-reactions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.react-count {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Reaction buttons on the article page */
.reactions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 32px 0 8px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.reaction:hover {
  border-color: var(--accent);
}

.reaction.active {
  border-color: var(--accent);
  background: rgba(255, 183, 3, 0.15);
}

.reaction .count {
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  color: var(--muted);
}

.reaction.active .count {
  color: var(--accent);
}

/* Status badges */
.status-badge {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.status-badge.pending {
  background: rgba(255, 183, 3, 0.18);
  color: var(--accent);
}

.status-badge.approved {
  background: rgba(123, 216, 143, 0.18);
  color: #7bd88f;
}

.status-badge.rejected {
  background: rgba(255, 107, 107, 0.18);
  color: #ff6b6b;
}

/* Owner + admin tool rows */
.owner-tools,
.admin-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.tools-label {
  font-family: system-ui, sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
}

.btn-secondary,
.btn-danger {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  border-color: rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.12);
}

/* Auth tabs */
.form-page.narrow {
  max-width: 440px;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
}

.auth-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1200;
  font-weight: 600;
}

/* Quiet secondary links inside the auth forms (forgot password, back to sign in) */
.form-aside {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.form-aside a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}

.form-aside a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Static cards (My Articles / moderation queue) */
.article-card.static {
  cursor: default;
}

.article-card.static:hover {
  border-color: var(--border);
  transform: none;
}

.row-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.articles .sub {
  color: var(--muted);
  font-family: system-ui, sans-serif;
  margin: -8px 0 24px;
}

.articles h1 {
  margin-bottom: 8px;
}

.review-queue {
  margin-top: 42px;
}

.review-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.review-heading-row h2 {
  margin: 0 0 8px;
}

.review-heading-row .sub {
  margin: 0;
}

.review-card .excerpt {
  margin-bottom: 0;
}

.review-card button {
  width: auto;
}

/* The owner's way in, kept quiet at the bottom of the page */
.footer-owner {
  margin: 8px 0 0;
}

.footer-owner a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border);
}

.footer-owner a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
