/* The Aggregate — dark, sports-broadcast brand theme. Black background
   throughout, red accent sampled directly from the official logo artwork
   (#e20915) used only for emphasis — no blue anywhere. */
:root {
  --bg: #000000; /* page background */
  --surface: #0b0b0b; /* story cards, primary surfaces */
  --surface-alt: #171717; /* secondary surfaces: nav bar, inputs, footer */
  --border: #2a2a2a;
  --text: #ffffff; /* headlines/primary text */
  --text-secondary: #b5b5b5; /* body copy, descriptions */
  --text-muted: #888888; /* metadata */
  --red: #e20915; /* brand accent */
  --red-tint: rgba(226, 9, 21, 0.14);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Arial, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

a {
  color: var(--red);
}

/* ---------------------------------------------------------------------
   Header / brand — sports-network masthead: black, tall, logo-dominant.
   --------------------------------------------------------------------- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 20px 20px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
}

.brand-logo-full {
  display: block;
  width: 430px;
  max-width: 100%;
  height: auto;
}

.brand-logo-mark {
  display: none;
  width: auto;
  height: 68px;
}

/* Story pages reuse the same masthead but at a slightly smaller scale so
   the homepage remains the most visually dominant use of the logo. */
.brand--compact .brand-logo-full {
  width: 360px;
}

.header-subrow {
  border-top: 2px solid var(--red);
}

.header-subrow .wrap {
  display: flex;
  align-items: center;
  padding-top: 14px;
  padding-bottom: 14px;
}

.section-label {
  border-left: 3px solid var(--red);
  padding-left: 10px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}

.freshness {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
}

.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px rgba(226, 9, 21, 0.8);
  margin-right: 6px;
  vertical-align: middle;
}

.freshness.delayed {
  color: #ffb3b8;
  background: rgba(226, 9, 21, 0.16);
  border: 1px solid rgba(226, 9, 21, 0.4);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
}

.freshness.stale {
  color: #fff;
  background: var(--red);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 700;
}

.feed-links {
  margin: 0;
  padding: 6px 20px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.feed-links a {
  text-decoration: none;
  color: var(--text-muted);
}

.feed-links a:hover {
  color: var(--red);
}

/* ---------------------------------------------------------------------
   Category navigation
   --------------------------------------------------------------------- */

main.wrap {
  padding-top: 20px;
  padding-bottom: 40px;
}

.filters {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -20px 20px;
}

.chips {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
}

.chip {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: #d8d8da;
  border-radius: 0;
  padding: 12px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.chip.active {
  background: transparent;
  color: #fff;
  border-bottom: 3px solid var(--red);
}

.controls {
  display: flex;
  gap: 8px;
  margin: 14px 20px 0;
  flex-wrap: wrap;
}

.controls select,
.controls input {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-size: 0.9rem;
}

.controls select option {
  background: var(--surface-alt);
  color: var(--text);
}

.controls select::placeholder,
.controls input::placeholder {
  color: var(--text-muted);
}

.controls select:focus,
.controls input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

.controls input[type="search"] {
  flex: 1;
  min-width: 200px;
}

/* ---------------------------------------------------------------------
   Story cards
   --------------------------------------------------------------------- */

.story-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: background-color 0.15s ease;
}

.card:hover {
  background: #131313;
}

.card[hidden] {
  display: none;
}

.card.card-breaking {
  border-left: 3px solid var(--red);
}

/* Story cards with a confidently subject-matching image (see imageMatch.js)
   get a media panel — left of the content on desktop, above it on mobile.
   Cards without one keep the plain padded layout; .card-body is present
   either way so both cases share one set of inner spacing rules. */
.card.card-has-media {
  padding: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* .card[hidden] and .card.card-has-media are the same specificity (0,2,0);
   card-has-media appears later in the cascade, so on a hidden card that
   also has media it was winning with display:flex — the filter tabs would
   set every card's [hidden] attribute correctly (confirmed via
   card.hidden in app.js) but ~63% of cards stayed visually shown anyway.
   This rule's three-part selector outranks both, independent of source
   order, so a hidden media card always actually hides. */
.card.card-has-media[hidden] {
  display: none;
}

.card-media {
  flex: 0 0 260px;
  align-self: stretch;
  background: var(--surface-alt);
}

.card-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
}

.card-has-media .card-body {
  flex: 1;
  min-width: 0;
  padding: 18px 20px;
}

.card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.72rem;
}

.badge {
  border-radius: 3px;
  padding: 3px 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-category {
  background: var(--surface-alt);
  color: #fff;
  border: 1px solid var(--border);
}

.badge-importance-breaking {
  background: var(--red);
  color: #fff;
}

.badge-importance-major {
  background: #3a3a3c;
  color: #fff;
}

.badge-importance-normal,
.badge-importance-minor {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge-rumor {
  background: #f2c744;
  color: #4a3b00;
}

.badge-updated {
  background: var(--red-tint);
  color: #ff5a63;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.time {
  margin-left: auto;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.headline {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

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

.headline a:hover {
  color: var(--red);
}

.meta {
  margin: 0 0 2px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.meta.teams,
.meta.players {
  font-weight: 600;
  color: var(--text-secondary);
}

.summary {
  margin: 10px 0 0;
  font-size: 0.94rem;
  color: var(--text-secondary);
}

.card-actions {
  margin: 12px 0 0;
}

.open-story-btn {
  display: inline-block;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.open-story-btn:hover {
  background: var(--surface-alt);
  border-color: #4a4a4a;
}

/* ---------------------------------------------------------------------
   Individual story page (/stories/*.html) — reuses .card and friends from
   the homepage feed, just given a bit more breathing room as the only
   thing on the page.
   --------------------------------------------------------------------- */

.story-page {
  padding-top: 24px;
  padding-bottom: 40px;
}

.story-page .card {
  padding: 24px 28px;
}

.back-link {
  display: inline-block;
  padding: 14px 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}

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

.story-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.story-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--red);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.story-details section {
  margin-top: 16px;
}

.story-details h2,
.story-details h3 {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.story-details p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.source-report {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 0.85rem;
  background: var(--surface-alt);
}

.source-report h4 {
  margin: 0 0 4px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--red);
}

.source-report p {
  margin: 2px 0;
  color: var(--text-secondary);
}

.source-report a {
  word-break: break-all;
  color: var(--red);
}

.callout {
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 0.85rem;
  margin: 0 0 12px;
  font-weight: 600;
}

.callout-rumor {
  background: rgba(242, 199, 68, 0.16);
  color: #f2c744;
  border: 1px solid rgba(242, 199, 68, 0.35);
}

.callout-updated {
  background: var(--red-tint);
  color: #ff5a63;
  border: 1px solid rgba(226, 9, 21, 0.35);
}

/* Story-page hero image — full width beneath the headline/meta block. Same
   "no image field, no image area" rule as the homepage cards. */
.story-media {
  margin: 14px 0;
}

.story-media img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.media-attribution {
  margin: 6px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Munch Content Brief
   --------------------------------------------------------------------- */

.munch-block {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.munch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.munch-header h2,
.munch-header h3 {
  margin: 0;
  color: var(--text);
}

.munch-header h2::before,
.munch-header h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.9em;
  background: var(--red);
  margin-right: 8px;
  vertical-align: middle;
}

.copy-btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.copy-btn:hover {
  background: #ff1f2c;
}

.copy-btn.copied {
  background: #1a7d34;
}

.munch-textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--bg);
  color: var(--text);
}

/* ---------------------------------------------------------------------
   Social Post — compact headline/image/source block for handing a post
   straight to Munch (or another downstream creative system). Replaces
   the old Munch Content Brief in the UI; .copy-btn/.open-story-btn are
   shared with the rest of the site, not new here.
   --------------------------------------------------------------------- */

.social-post {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.social-post h2,
.social-post h3 {
  margin: 0 0 12px;
  color: var(--text);
}

.social-post h2::before,
.social-post h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.9em;
  background: var(--red);
  margin-right: 8px;
  vertical-align: middle;
}

.social-post-field {
  margin-bottom: 14px;
}

.social-post-field:last-child {
  margin-bottom: 0;
}

.social-post-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.social-post-value {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.social-post-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.social-post-image {
  display: block;
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}

.social-post-image-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px 16px;
  font-size: 0.9rem;
  margin: 0 20px;
}

/* ---------------------------------------------------------------------
   Posts For Approval — admin/social-workflow view, not an NFL category.
   Reuses .card/.badge/.empty-state/.story-page rather than inventing a
   parallel visual language; the handful of classes below are only for the
   things genuinely unique to this page (side-by-side artwork/base-image
   media, the "no actions yet" note).
   --------------------------------------------------------------------- */

.approval-page-title {
  color: var(--text);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  margin: 20px 20px 16px;
}

.approval-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.approval-item {
  padding: 18px 20px;
}

.approval-headline {
  font-size: 1.1rem;
}

.approval-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}

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

.approval-media-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-alt);
}

.approval-media-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.approval-media-image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
}

.approval-story-block {
  max-width: 200px;
}

.approval-story-image {
  max-height: 260px;
  object-fit: contain;
  background: #111;
}

.approval-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

.approval-caption-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-alt);
  margin-top: 12px;
}

.approval-caption-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.approval-caption-hashtags {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.approval-actions-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-secondary);
  padding: 24px 0 30px;
  font-size: 0.8rem;
  margin-top: 20px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-logo {
  display: block;
  height: 22px;
  width: auto;
}

.site-footer .footer-brand {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.site-footer p {
  margin: 0 0 4px;
}

/* ---------------------------------------------------------------------
   Responsive — desktop logo scales down through tablet, then swaps to
   the standalone mark on mobile so it stays legible instead of shrinking
   to nothing. Tested at 1440/1280/768/430/390/375.
   --------------------------------------------------------------------- */

@media (max-width: 1439px) {
  .brand-logo-full {
    width: 380px;
  }

  .brand--compact .brand-logo-full {
    width: 320px;
  }
}

@media (max-width: 1024px) {
  .brand-logo-full {
    width: 300px;
  }

  .brand--compact .brand-logo-full {
    width: 260px;
  }
}

@media (max-width: 640px) {
  .brand-logo-full {
    display: none;
  }

  .brand-logo-mark {
    display: block;
  }

  .header-row {
    padding: 20px 16px 16px;
  }

  .section-label {
    font-size: 0.85rem;
  }

  .feed-links {
    padding: 6px 16px 12px;
  }

  .card.card-has-media {
    flex-direction: column;
  }

  .card-media {
    flex: 0 0 auto;
    width: 100%;
  }

  .card-media img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .story-media img {
    max-height: 260px;
  }

  .filters {
    margin: 0 0 20px;
  }

  .chips {
    padding: 0 16px;
  }

  .controls {
    margin: 14px 16px 0;
  }

  .story-list {
    padding: 0 16px;
  }

  .empty-state {
    margin: 0 16px;
  }

  .headline {
    font-size: 1.08rem;
  }

  .story-page .card {
    padding: 18px;
  }
}
