/* ===== CSS VARIABLES ===== */
/* CSS variables inherited from base.css */

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--text-dark);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

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

.gn-nav-link {
  color: var(--gold);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 100px;
  transition: all 0.2s;
  white-space: nowrap;
}
.gn-nav-link:hover {
  background: rgba(212,175,55,0.12);
  border-color: var(--gold);
}

/* ===== HEADER ===== */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon { font-size: 24px; }

.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.back-link {
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s;
  margin-right: 4px;
}
.back-link:hover { color: var(--white); }

.header-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-date {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 300;
}

.header-badge {
  background: var(--gold);
  color: var(--navy);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 3px 10px;
  border-radius: 100px;
}

/* ===== RACE NAV ===== */
.race-nav {
  background: var(--navy-mid);
  border-bottom: 1px solid rgba(212,175,55,0.3);
  overflow-x: auto;
}

.race-nav::-webkit-scrollbar { height: 2px; }
.race-nav::-webkit-scrollbar-thumb { background: var(--gold); }

.race-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  min-width: max-content;
}

.race-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px 10px;
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
}

.race-tab:hover {
  color: var(--white);
  border-bottom-color: rgba(212,175,55,0.4);
}

.race-tab--featured {
  color: var(--gold-light);
}

.race-tab--featured:hover {
  border-bottom-color: var(--gold);
}

.tab-time {
  font-size: 16px;
  font-weight: 600;
  color: inherit;
  line-height: 1;
}

.tab-course {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}

.tab-star {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  color: var(--gold);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ===== FEATURED HERO ===== */
.featured-hero {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-bg-lines {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 60px,
      rgba(212,175,55,0.04) 60px,
      rgba(212,175,55,0.04) 61px
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(212,175,55,0.04) 60px,
      rgba(212,175,55,0.04) 61px
    );
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; }

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212,175,55,0.15);
  border: 1px solid rgba(212,175,55,0.4);
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.label-star { font-size: 10px; }

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 24px;
  max-width: 700px;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 32px;
  margin-bottom: 28px;
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.45);
  font-weight: 500;
}

.meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
}

.meta-value.prize { color: var(--gold); }

/* Verdict card */
.verdict-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(212,175,55,0.25);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.verdict-card--detail {
  background: rgba(13,31,60,0.04);
  border: 1px solid rgba(212,175,55,0.3);
  border-left: 4px solid var(--gold);
  margin-bottom: 0;
}

.verdict-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 10px;
}

.verdict-text {
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  line-height: 1.65;
}

.verdict-card--detail .verdict-text {
  color: var(--text-mid);
}

.view-racecard-btn {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  margin-bottom: 36px;
}

.view-racecard-btn:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,55,0.4);
}

/* Runners grid in hero */
.runners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.runner-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: all 0.2s;
}

.runner-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

.runner-card--fav {
  border-color: rgba(212,175,55,0.5);
  background: rgba(212,175,55,0.08);
}

.runner-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.silk {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.silk-num {
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.runner-info { flex: 1; min-width: 0; }

.runner-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.runner-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 1px;
}

.runner-odds {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

.runner-form {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  font-family: monospace;
}

.runner-ratings {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.rating-chip {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  padding: 2px 8px;
  border-radius: 100px;
}

.runner-comment {
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  line-height: 1.5;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
  margin-top: 4px;
}

/* Favourite tag */
.fav-tag {
  background: var(--gold);
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Forecast bar */
.forecast-bar {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
}

.forecast-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--gold);
  flex-shrink: 0;
}

.forecast-text {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}

/* ===== SECTION TITLE ===== */
.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ===== RACE CARDS (non-featured) ===== */
.other-races-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.race-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.race-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.race-card-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.race-card-time {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
  line-height: 1;
  padding-top: 2px;
  min-width: 64px;
}

.race-card-info { flex: 1; }

.race-card-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  line-height: 1.3;
}

.race-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: var(--text-mid);
}

.dot {
  margin: 0 8px;
  color: var(--border);
}

.race-prize { color: var(--gold-dark); font-weight: 500; }

.card-btn {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: background 0.2s;
  align-self: flex-start;
}
.card-btn:hover { background: var(--navy-light); }

.race-card-verdict {
  padding: 14px 24px;
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.6;
  background: rgba(212,175,55,0.04);
  border-bottom: 1px solid var(--border);
}

.race-card-verdict strong {
  color: var(--gold-dark);
  font-weight: 600;
  margin-right: 4px;
}

/* Mini runners */
.race-card-runners {
  padding: 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-runner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--off-white);
  transition: background 0.15s;
}

.mini-runner:hover { background: #ede9e0; }

.mini-runner--fav {
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.25);
}

.mini-silk {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  flex-shrink: 0;
}

.mini-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  flex: 1;
}

.mini-jockey {
  font-size: 12px;
  color: var(--text-light);
  min-width: 120px;
}

.mini-odds {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  min-width: 52px;
  text-align: right;
}

.mini-odds--fav { color: var(--gold-dark); }

.race-forecast {
  padding: 12px 24px;
  font-size: 13px;
  color: var(--text-mid);
  border-top: 1px solid var(--border);
  background: rgba(13,31,60,0.02);
}

.race-forecast strong {
  color: var(--navy);
  font-weight: 600;
  margin-right: 4px;
}

/* ===== RACE DETAIL PAGE ===== */
.detail-hero {
  background: var(--navy);
  border-radius: var(--radius);
  padding: 36px 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 28px;
}

.detail-time-block {
  text-align: center;
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  flex-shrink: 0;
}

.detail-time {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 900;
  color: var(--gold);
  line-height: 1;
}

.detail-course {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  margin-top: 4px;
  font-weight: 500;
}

.detail-title-block { flex: 1; }

.detail-race-name {
  font-family: 'Playfair Display', serif;
  font-size: clamp(20px, 2.5vw, 32px);
  font-weight: 900;
  color: var(--white);
  margin-bottom: 14px;
  line-height: 1.2;
}

.detail-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-badge {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.15);
}

.prize-badge {
  background: rgba(212,175,55,0.15);
  color: var(--gold-light);
  border-color: rgba(212,175,55,0.35);
}

/* Racecard table */
.racecard-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.racecard-table-wrap {
  overflow-x: auto;
}

.racecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.racecard-table thead {
  background: var(--navy);
}

.racecard-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
  white-space: nowrap;
}

.racecard-table th.col-odds { text-align: right; }

.runner-row {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.runner-row:hover { background: rgba(13,31,60,0.03); }

.runner-row--fav { background: rgba(212,175,55,0.05); }
.runner-row--fav:hover { background: rgba(212,175,55,0.09); }

.racecard-table td {
  padding: 14px 16px;
  vertical-align: top;
}

.silk-table {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.horse-name-cell strong {
  font-size: 15px;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.table-comment {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 5px;
  line-height: 1.5;
  max-width: 360px;
}

.trainer-name {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 3px;
}

.form-string {
  font-family: monospace;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--text-mid);
}

.odds-pill {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  float: right;
}

.odds-pill--fav {
  background: var(--gold);
  color: var(--navy);
}

.col-odds { text-align: right; }
.col-ts, .col-rpr, .col-age, .col-wgt, .col-no { white-space: nowrap; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy);
  margin-top: 60px;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-name-sm {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.12em;
}

.footer-note {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.featured-hero { animation: fadeUp 0.5s ease both; }
.race-card { animation: fadeUp 0.4s ease both; }
.race-card:nth-child(2) { animation-delay: 0.07s; }
.race-card:nth-child(3) { animation-delay: 0.14s; }
.race-card:nth-child(4) { animation-delay: 0.21s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .main-content { padding: 20px 16px 60px; }
  .featured-hero { padding: 24px 20px; }
  .runners-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 22px; }
  .race-card-header { flex-direction: column; gap: 12px; }
  .race-card-time { font-size: 22px; }
  .card-btn { align-self: stretch; text-align: center; }
  .detail-hero { padding: 24px 20px; }
  .detail-header { flex-direction: column; gap: 16px; }
  .mini-jockey { display: none; }
  .header-date { display: none; }
  .racecard-table th.col-ts,
  .racecard-table td.col-ts,
  .racecard-table th.col-rpr,
  .racecard-table td.col-rpr { display: none; }
}
