/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bbc: #BB1919;
  --bbc-dark: #8a1010;
  --surface: #f5f5f0;
  --card-bg: #ffffff;
  --border: rgba(0,0,0,0.09);
  --border-strong: rgba(0,0,0,0.18);
  --text-primary: #1a1a1a;
  --text-secondary: #5a5a5a;
  --text-hint: #9a9a9a;
  --accent: #BB1919;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --font: 'Barlow', system-ui, sans-serif;
  --font-condensed: 'Barlow Condensed', system-ui, sans-serif;
  --header-h: 0px;
}

body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  font-size: 1.75rem;
  line-height: 1;
}

.header-title {
  font-family: var(--font-condensed);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--bbc);
  line-height: 1.1;
}

.header-sub {
  font-size: 0.75rem;
  color: var(--text-hint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}

.header-actions {
  /* display: flex; */
  gap: 0.5rem;
  flex-wrap: wrap;
}

.header-feed-meta {
  padding: 0.5rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

.feed-bbc-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--bbc);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.feed-bbc-link:hover { text-decoration: underline; }

.feed-card-time {
  color: var(--text-hint);
  font-weight: 400;
  font-size: 0.75rem;
  margin-left: 0.2rem;
}

.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
}
.btn-text:hover { color: var(--text-primary); }

.copyright-notice {
  font-size: 0.75rem;
  color: var(--text-hint);
  margin-left: auto;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--bbc);
  color: #fff;
  border-color: var(--bbc);
}
.btn-primary:hover { background: var(--bbc-dark); border-color: var(--bbc-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--surface); color: var(--text-primary); }

/* ── Loading (in header nav) ── */
.header-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--bbc);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ── */
.error-banner {
  margin: 1rem 1.25rem;
  padding: 0.75rem 1rem;
  background: #fff5f5;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-md);
  color: #991b1b;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Main content ── */
#mainContent {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── Date group ── */
.date-group {
  margin-bottom: 2rem;
}

.date-heading {
  font-family: var(--font-condensed);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-hint);
  padding: 0 0.25rem 0.6rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

/* ── Feed cards (choices) ── */
.feed-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  text-decoration: none;
  color: inherit;
}

.feed-card:hover {
  border-color: var(--bbc);
  box-shadow: 0 2px 12px rgba(187,25,25,0.08);
  transform: translateY(-1px);
}

.feed-card:active { transform: translateY(0); }

.sport-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: var(--bbc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.feed-card-body { flex: 1; min-width: 0; }

.feed-card-sport {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bbc);
  margin-bottom: 0.1rem;
}

.feed-card-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  line-height: 1.4;
}

.feed-card-title.no-title {
  color: var(--text-hint);
  font-style: italic;
  font-weight: 400;
}

.feed-card-arrow {
  color: var(--text-hint);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Feed updates ── */
.feed-container { display: block; }

.update_block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 0.625rem;
  overflow: hidden;
}

.update_block--new {
  border-color: var(--bbc);
}

/* ── NEW badge ── */
.update-new-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--bbc);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: auto;
  flex-shrink: 0;
}

.feed-new-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  background: var(--bbc);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── New items banner ── */
.new-items-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  background: var(--bbc);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-top: 1px solid rgba(255,255,255,0.2);
}


.new-items-banner--none {
  background: #2d7a2d;
}

.new-items-banner .banner-link {
  color: #fff;
  font-weight: 600;
  text-underline-offset: 2px;
}

.new-items-banner .banner-close {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
}
.new-items-banner .banner-close:hover { color: #fff; }

/* ── Cached feed card indicator ── */
.feed-card--cached {
  border-left: 3px solid var(--bbc);
}

.update_header {
  border-left: 3px solid var(--bbc);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  background: #fafafa;
}

.update_time {
  font-family: var(--font-condensed);
  font-size: 1rem;
  font-weight: 600;
  color: var(--bbc);
  white-space: nowrap;
}

.title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.update_text {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.commentator {
  padding: 0 1rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-hint);
}

.qa-contributor-name  { font-weight: 500; color: var(--text-secondary); }
.qa-contributor-role  { font-style: italic; }
.qa-visually-hidden-title { display: none; }


/* ── Scroll hint ── */
.scroll-hint {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  opacity: 0.85;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-hint);
}
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.95rem; }

/* ── Update text links & paragraphs (BBC content) ── */
.update_text p, .update_text a {
  margin-bottom: 0;
  margin-top: 10px;
}

/* ── lx-tag (BBC live ticker tag) ── */
.lx-tag {
  margin-right: 10px;
}
.lx-tag::after {
  content: ":";
}

/* ── No results block ── */
#id_no_results_found {
  border-left: solid 5px #af2525;
  border-bottom: solid 1px #af2525;
  border-top: solid 1px #af2525;
}
#id_no_results_found .update_header {
  background-color: #e76c6c;
}

/* ── Hidden utility elements ── */
#urlLink, #pageCount {
  display: none;
}

.qa-cta-accessibility-text {
  display: none;
}

/* ── Disabled state ── */
.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Responsive ── */
@media (max-width: 520px) {
  .header-inner { padding: 0.6rem 0.75rem; }
  .copyright-notice { display: none; }
  #mainContent { padding: 1rem 0.5rem 4rem; }
  .header-loading { min-width: 0; font-size: 0.75rem;}
  .header-title { font-size: 1.1rem; white-space: nowrap; }
  .header-sub { display: none; }
  .feed-card-arrow { display: none; }
  .feed-card { padding: 0.75rem; gap: 0.65rem; }
  .btn { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
  .update_header { flex-wrap: wrap; gap: 0.4rem; }
  html { font-size: 20px; }
  .header-brand { min-width: 0; flex-shrink: 1; min-height: 40px; }
  .header-inner { flex-wrap: nowrap; align-items: center; }
  .header-actions { display: flex; flex-wrap: nowrap; gap: 0.35rem; flex-shrink: 0; }
}