/* =========================================================
   Blueshirts Archive — Design System
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  /* Palette — brighter, livelier "stadium navy" base with Rangers blue/red accents */
  --bg: #1c2c52;
  --bg-elevated: #24365f;
  --panel: #2b3f70;
  --panel-alt: #354c84;
  --border: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.30);

  --text: #f8f9fd;
  --text-muted: #c5cee9;
  --text-faint: #9ca6c9;

  --blue: #5286ff;
  --blue-deep: #1245c7;
  --red: #ff4d68;
  --red-deep: #e21631;
  --gold: #e8c268;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.5);

  --font-display: 'Rajdhani', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --container: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html { background: var(--bg); }

body {
  margin: 0;
  background: radial-gradient(ellipse 1200px 600px at 50% -10%, #3d5aa0 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* subtle site-wide pinstripes, echoing the hero pattern */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 60px);
}

a { color: inherit; }

img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  margin: 0;
}

/* ---------- Brand + pill nav ---------- */
.top-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 20px 28px;
  position: relative;
}

.top-header::after {
  content: "";
  display: block;
  width: 320px;
  max-width: 70%;
  height: 2px;
  margin-top: 28px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5) 20%, rgba(255, 255, 255, 0.5) 80%, transparent);
}

.pill-nav {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 32px;
}

.pill-nav-track {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 6px;
  background: rgba(15, 21, 38, 0.7);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow-elevated);
}

.pill-highlight {
  position: absolute;
  top: 6px;
  left: 6px;
  height: calc(100% - 12px);
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  box-shadow: 0 4px 16px rgba(82, 134, 255, 0.55);
  transform: translateX(0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.pill-link {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.25s ease;
}

.pill-link svg {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  flex-shrink: 0;
}

.pill-link:hover,
.pill-link[aria-current="page"] {
  color: #fff;
}

.pill-link:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 999px;
}

@media (max-width: 480px) {
  .pill-link span.pill-label { display: none; }
  .pill-link { padding: 12px; }
  .pill-link svg { width: 19px; height: 19px; opacity: 1; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 20px 56px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20px;
  background-image:
    repeating-linear-gradient(115deg, rgba(140, 175, 255, 0.13) 0 2px, transparent 2px 60px);
  pointer-events: none;
  transform: translate(calc(var(--px, 0) * 1px), calc(var(--py, 0) * 1px));
  transition: transform 0.2s ease-out;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease;
}
.brand-lockup:hover { transform: scale(1.03); }

.brand-lockup img {
  height: 46px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.brand-lockup .accent { color: var(--red); }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.05;
}

.hero h1 .accent { color: var(--red); }

.hero p.lede {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: #fff;
  box-shadow: 0 6px 22px rgba(82, 134, 255, 0.45);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(82, 134, 255, 0.6);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--text-muted); }

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  max-width: 760px;
  margin: 44px auto 0;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.stat {
  background: var(--panel);
  padding: 18px 10px;
  text-align: center;
}

.stat .num {
  font-family: var(--font-display);
  font-size: 2.9rem;
  font-weight: 700;
  color: var(--text);
}

.stat .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ---------- Section shell ---------- */
.section {
  max-width: var(--container);
  margin: 48px auto;
  padding: 0 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.section-title {
  font-size: 1.5rem;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 20px;
}

.section-title .accent { color: var(--red); }

/* ---------- Widget dashboard ---------- */
.dashboard {
  display: grid;
  grid-template-columns: 1.9fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.dashboard > .panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard .dash-brands {
  grid-column: 1 / -1;
  padding: 22px 24px;
}

@media (max-width: 860px) {
  .dashboard { grid-template-columns: 1fr; }
  /* mobile order: Random Card, Shoutout, News, About, Brands */
  .dash-random { order: 1; }
  .dash-shout { order: 2; }
  .dash-news { order: 3; }
  .dash-about { order: 4; }
  .dash-brands { order: 5; }
}

/* ---------- News widget ---------- */
.news-widget { padding: 24px; }

.news-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
}

.news-slide {
  flex: 1;
  padding: 6px 34px;
  font-size: 0.92em;
  color: var(--text-muted);
}

.news-slide h3 {
  color: var(--text);
  font-size: 1.15rem;
  text-transform: none;
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 6px;
}

.news-slide a.read-more {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}
.news-slide a.read-more:hover { text-decoration: underline; }

.news-arrow {
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 10px;
  user-select: none;
  border-radius: 50%;
  transition: background 0.15s ease, color 0.15s ease;
}
.news-arrow:hover { background: var(--panel-alt); color: var(--text); }
.news-arrow.left { position: absolute; left: -6px; }
.news-arrow.right { position: absolute; right: -6px; }

/* ---------- Content panel (about text) ---------- */
.about { padding: 28px 32px; }
.about p { color: var(--text-muted); }
.about strong { color: var(--text); }

/* ---------- Random card widget ---------- */
.widget-random-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.random-card-slot-wrap {
  max-width: 320px;
  width: 100%;
  margin: 0 auto 18px;
  min-height: 100px;
}

#random-card-slot {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.random-card-slot-wrap .card-inner { cursor: default; }
.random-card-slot-wrap .card-face { cursor: pointer; }

.widget-random-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 18px;
}

/* ---------- Shoutbox widget ---------- */
.widget-shoutbox { padding: 24px; display: flex; flex-direction: column; }

.shout-form {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.shout-form input,
.shout-form textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  resize: vertical;
}

.shout-form .btn { justify-self: start; }

.shout-entries {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.shout-entry {
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.shout-entry .meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.shout-entry .name { color: var(--text); font-weight: 700; }
.shout-entry p { margin: 0; font-size: 0.85rem; color: var(--text-muted); word-break: break-word; }

/* ---------- Brand row (static) ---------- */
.brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 20px 0;
}

.brand-row img {
  height: 34px;
  filter: grayscale(100%) brightness(1.6) opacity(0.65);
  transition: filter 0.2s ease;
}
.brand-row img:hover { filter: grayscale(0%) opacity(1); }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-faint);
  padding: 40px 12px 32px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}

.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }

.footer-links { margin: 6px 0 14px; font-size: 13px; }
.footer-links span.dot { margin: 0 8px; color: var(--text-faint); }

.footer-disclaimer {
  max-width: 760px;
  margin: 14px auto 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-faint);
}

.custom-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- Consent banner ---------- */
.consent-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  max-width: 560px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 18px;
}

.consent-text { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.consent-text a { color: var(--blue); }

.consent-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.consent-btn {
  border: 2px solid var(--blue);
  background: var(--blue);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.consent-btn.secondary { background: transparent; color: var(--text-muted); border-color: var(--border-strong); }
.consent-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ---------- Filter bar (collection page) ---------- */
.filter-bar {
  position: sticky;
  top: 76px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-controls,
.filter-meta {
  padding: 12px 18px;
  background: rgba(20, 27, 48, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.filter-bar select,
.filter-bar input[type="search"] {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
}

.filter-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
  min-height: 24px;
}

.filter-count-divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.filter-bar label.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}

.filter-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.filter-count-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
  line-height: 1;
}

.filter-count-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

@media (max-width: 640px) {
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar select,
  .filter-bar input[type="search"] {
    width: 100%;
  }
  .filter-meta {
    flex-direction: column;
    gap: 10px;
  }
  .filter-count {
    justify-content: center;
  }
  .filter-count-divider {
    display: none;
  }
}

/* ---------- Card gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
}

@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

.card-tile {
  cursor: pointer;
  min-width: 0;
}

.card-inner {
  border-radius: var(--radius-md);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card-tile:hover .card-inner {
  transform: translateY(-6px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--blue);
}

.card-inner.rare { border-color: var(--gold); }
.card-inner.rare:hover { box-shadow: 0 16px 40px rgba(217, 178, 76, 0.25); }

.card-face {
  position: relative;
  aspect-ratio: 5 / 7;
  background: linear-gradient(160deg, var(--panel-alt) 0%, var(--bg-elevated) 100%);
}

.card-face::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(82, 134, 255, 0.22), transparent 55%);
}

.card-face.has-photo {
  background-size: cover;
  background-position: center;
}
.card-face.has-photo::before { display: none; }

.card-badges {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.card-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  white-space: nowrap;
}

.card-badge.jersey { background: var(--blue); }
.card-badge.auto { background: var(--gold); color: #1a1200; }

.card-number {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.14);
}

.card-caption {
  padding: 10px 12px 12px;
}

.card-caption h3 {
  font-size: 0.9rem;
  text-transform: none;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-caption .set-name {
  font-size: 0.74rem;
  color: var(--text-faint);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-results {
  text-align: center;
  color: var(--text-faint);
  padding: 60px 20px;
  display: none;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6, 8, 16, 0.86);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lightbox.open { display: flex; }

.lightbox-content {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 28px;
  position: relative;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.lightbox-close:hover { color: var(--text); }

.lightbox .card-inner {
  margin-bottom: 18px;
  cursor: default;
}

.lightbox dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 0.88rem;
}
.lightbox dt { color: var(--text-faint); }
.lightbox dd { margin: 0; color: var(--text); }

.gb-honeypot { position: absolute; left: -9999px; opacity: 0; }

.gb-hint {
  font-size: 0.78rem;
  color: var(--text-faint);
}

.badge-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--gold);
  background: rgba(217, 178, 76, 0.12);
  border: 1px solid rgba(217, 178, 76, 0.35);
  padding: 6px 12px;
  border-radius: 999px;
  margin: 0 auto 20px;
  width: fit-content;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Interactive polish ---------- */
.news-slide { transition: opacity 0.2s ease; }
.news-slide.fading { opacity: 0; }

.news-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--panel-alt);
  display: block;
}

.news-img-wrap {
  position: relative;
  margin-bottom: 12px;
}
.news-img-wrap .news-img { margin-bottom: 0; }

.news-credit {
  position: absolute;
  right: 6px;
  bottom: 6px;
  font-size: 0.6rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(10, 14, 26, 0.65);
  backdrop-filter: blur(3px);
  padding: 2px 6px;
  border-radius: 999px;
  text-decoration: none;
  max-width: calc(100% - 12px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-credit:hover { color: #fff; background: rgba(10, 14, 26, 0.85); }

.stat { transition: transform 0.2s ease, background 0.2s ease; }
.stat:hover { transform: translateY(-3px); background: var(--panel-alt); }

.about, .news-widget { transition: box-shadow 0.25s ease, transform 0.25s ease; }
.about:hover, .news-widget:hover { box-shadow: var(--shadow-elevated); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 21, 38, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-elevated);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--blue);
  background: var(--panel-alt);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 480px) {
  .back-to-top { right: 16px; bottom: 16px; width: 42px; height: 42px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}
