/* ══════════════════════════════════════════════════════════
   MATCH DETAIL PAGE
══════════════════════════════════════════════════════════ */

/* ─── Hero (nav overlays, like art-hero) ─────────────── */
.md-hero {
  background: var(--off-black);
  background-image: url('/images/grass_turf.jpg');
  background-size: cover;
  background-position: center center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  /* nav is fixed overlay — pad the top so content clears it */
  padding-top: var(--nav-h);
}

/* Dark overlay — same opacity as player detail */
.md-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(var(--rgb-black),.82);
  pointer-events: none;
  z-index: 1;
}

/* Red left CI bar */
.md-hero::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--red);
  z-index: 3;
}

/* Ghost matchday watermark */
.md-hero-bg-number {
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Teko', sans-serif;
  font-size: clamp(10rem, 28vw, 22rem);
  font-weight: 900;
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--rgb-red),.09);
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 2;
}

/* Status colour wash */
.md-hero-wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}
.md-hero--live     .md-hero-wash { background: rgba(var(--rgb-red),.06); }
.md-hero--halftime .md-hero-wash { background: rgba(var(--rgb-amber),.05); }
.md-hero--win      .md-hero-wash { background: rgba(var(--rgb-green-dm),.04); }
.md-hero--cancelled { opacity: .5; }

.md-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 60rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 5vw, 3rem) 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* ─── Competition header (top of hero-inner) ─────────── */
.md-hero-competition {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  text-align: center;
}
.md-hero-league {
  font-family: 'Teko', sans-serif;
  font-size: clamp(1.625rem, 4vw, 2.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
  line-height: 1;
  color: var(--white);
}
.md-hero-matchday {
  font-family: 'Teko', sans-serif;
  font-size: clamp(1rem, 3vw, 1.6rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--red);
}

/* ─── Matchup ─────────────────────────────────────────── */
.md-hero-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  width: 100%;
}

.md-hero-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .875rem;
  text-align: center;
  min-width: 0;
}

.md-hero-logo {
  width: 6rem; height: 6rem;
  display: flex; align-items: center; justify-content: center;
}
.md-hero-logo img {
  width: 6rem; height: 6rem;
  object-fit: contain;
  filter: drop-shadow(0 4px 18px rgba(var(--rgb-pure-black),.55));
}
.md-hero-logo-ph {
  width: 6rem; height: 6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  font-family: 'Teko', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  text-transform: uppercase;
}

.md-hero-team-name {
  font-family: 'Teko', sans-serif;
  font-size: clamp(1.125rem, 2.5vw, 1.625rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.1;
  color: var(--white);
  word-break: break-word;
}

/* ─── Score center ────────────────────────────────────── */
.md-hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  flex-shrink: 0;
  min-width: 7rem;
}

.md-score {
  font-family: 'Teko', sans-serif;
  font-size: clamp(3rem, 9vw, 5.5rem);
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: .15em;
}
.md-score-sep {
  color: var(--white);
  font-weight: 300;
  font-size: .65em;
}
.md-score--win          { color: var(--green); }
.md-score--loss         { color: var(--danger); }
.md-score--draw         { color: var(--muted); }
.md-score--live         { color: var(--red); }
.md-score--halftime     { color: var(--amber); }
.md-score--win      .md-score-sep,
.md-score--loss     .md-score-sep,
.md-score--live     .md-score-sep,
.md-score--halftime .md-score-sep { color: currentColor; opacity: .35; }

.md-score-dash {
  font-family: 'Teko', sans-serif;
  font-size: clamp(2.25rem, 7vw, 4.5rem);
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--muted);
}

.md-status-badge {
  font-family: 'Teko', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3rem .75rem;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.md-status--scheduled {
  color:      var(--status-scheduled-color);
  background: var(--status-scheduled-bg);
  border:     1px solid var(--status-scheduled-border);
}
.md-status--live {
  color:      var(--status-live-color);
  background: var(--status-live-bg);
  border:     1px solid var(--status-live-border);
}
.md-status--halftime {
  color:      var(--status-halftime-color);
  background: var(--status-halftime-bg);
  border:     1px solid var(--status-halftime-border);
}
.md-status--finished {
  color:      var(--status-finished-color);
  background: var(--status-finished-bg);
  border:     1px solid var(--status-finished-border);
}
.md-status--cancelled {
  color:      var(--status-cancelled-color);
  background: var(--status-cancelled-bg);
  border:     1px solid var(--status-cancelled-border);
}

.md-live-dot {
  width: .45rem; height: .45rem;
  border-radius: 50%;
  background: var(--status-live-color);
  flex-shrink: 0;
  animation: pulse 1.4s ease-in-out infinite;
}

/* ─── Match facts — surface card (kader bio style) ───── */
.md-facts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  margin: 0;
}

.md-fact {
  display: grid;
  grid-template-columns: 9rem 1fr;
  align-items: center;
  gap: 1.2rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid rgba(var(--rgb-white),.04);
}
.md-fact:last-child { border-bottom: none; }

.md-fact-label {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
  flex-shrink: 0;
}
.md-fact-value {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--white);
  margin: 0;
}

.md-fact-link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  text-decoration: none;
  color: var(--white);
  transition: color .15s;
}
.md-fact-link:hover { color: var(--red); }
.md-fact-link svg {
  width: .625rem; height: .625rem;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round;
  flex-shrink: 0;
  opacity: .4;
  transition: opacity .15s;
}
.md-fact-link:hover svg { opacity: 1; }

/* ─── Main ────────────────────────────────────────────── */
.md-main {
  background: var(--black);
  padding: 2.5rem 0 6rem;
}
.md-wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ─── Section title ───────────────────────────────────── */
.md-section-title {
  font-family: 'Teko', sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.375rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .625rem;
}
.md-section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1.2rem;
  background: var(--red);
  flex-shrink: 0;
}

/* ─── Timeline — not-yet-played message ─────────────────── */
.md-tl-pending-msg {
  color: var(--muted);
  font-family: 'Teko', sans-serif;
  font-size: 1.2rem;
  letter-spacing: .02em;
  padding: 1.25rem 0 .5rem;
}

/* ─── Timeline — centered column, label above, value below ── */
.md-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Each milestone: centered column stack */
.md-tl-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .625rem;
}

/* Connecting line between items */
.md-tl-line {
  width: 1px;
  height: 3.75rem; /* 1.5× the previous ~2.5rem */
  background: var(--border);
  flex-shrink: 0;
}
.md-tl-item--last .md-tl-line { display: none; }

/* Milestone label — above the dot */
.md-tl-label {
  font-family: 'Teko', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

/* Dot */
.md-tl-dot {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: background .25s, border-color .25s;
}
.md-tl-dot--ft { border-radius: 3px; }

.md-tl-dot--done   { background: var(--white);  border-color: var(--white); }
.md-tl-dot--active { background: var(--amber);  border-color: var(--amber); }
.md-tl-dot--live   { background: var(--red);    border-color: var(--red); animation: pulse 1.4s ease-in-out infinite; }
.md-tl-dot--win    { background: var(--green);  border-color: var(--green); }
.md-tl-dot--loss   { background: var(--danger); border-color: var(--danger); }
.md-tl-dot--draw   { background: var(--muted);  border-color: var(--muted); }

/* Value — below the dot, uniform size across all items */
.md-tl-value {
  font-family: 'Teko', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: .06em;
  text-align: center;
  line-height: 1.1;
}
.md-tl-score { font-weight: 700; letter-spacing: .1em; }
.md-tl-score--final { font-weight: 900; }
.md-tl-value--pending { color: var(--border); font-weight: 400; }

.md-tl-score--final.md-score--win  { color: var(--green); }
.md-tl-score--final.md-score--loss { color: var(--danger); }
.md-tl-score--final.md-score--draw { color: var(--muted); }
.md-tl-score--final.md-score--live { color: var(--red); }
.md-tl-score--final.md-score--halftime { color: var(--amber); }

/* ─── Formkurve ───────────────────────────────────────── */
.md-form-grid {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}
.md-form-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.md-form-team {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--muted);
  min-width: 11.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.md-form-dots { display: flex; gap: .5rem; }

.md-form-dot {
  width: 2.25rem;
  height: 2.25rem;
  font-family: 'Teko', sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  border: 1.5px solid;
}
/* Outlined style — colored border + text, dark bg */
.md-form-dot--w { color: var(--green);  border-color: var(--green);  background: rgba(var(--rgb-green-dm),.1); }
.md-form-dot--d { color: var(--muted);  border-color: var(--border); background: transparent; }
.md-form-dot--l { color: var(--danger); border-color: var(--danger); background: rgba(var(--rgb-danger),.08); }

/* ─── Venue ───────────────────────────────────────────── */
.md-venue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  background: var(--surface);
  padding: 1.125rem 1.25rem;
  text-decoration: none;
  border-left: 3px solid var(--border);
  transition: background .15s, border-color .15s;
}
.md-venue:hover { background: var(--surface2); border-left-color: var(--red); }
.md-venue-info { flex: 1; min-width: 0; }
.md-venue-name { font-size: 1.2rem; font-weight: 600; color: var(--white); margin: 0 0 .25rem; }
.md-venue-address { font-size: 1.2rem; color: var(--muted); margin: 0; }
.md-venue-arrow {
  width: 1.2rem; height: 1.2rem;
  stroke: var(--muted); fill: none;
  stroke-width: 2; stroke-linecap: round;
  flex-shrink: 0;
  transition: stroke .15s;
}
.md-venue:hover .md-venue-arrow { stroke: var(--red); }

/* ─── Articles list wrapper ───────────────────────────── */
.md-articles {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

/* ─── Article card ────────────────────────────────────── */
.md-article-card {
  display: block;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  transition: background .2s;
}
.md-article-card:hover { background: var(--surface2); }

.md-article-card-inner {
  display: grid;
  grid-template-columns: 14rem 1fr;
  min-height: 9rem;
}

.md-article-img {
  position: relative;
  overflow: hidden;
  background: var(--surface2);
}
.md-article-img-blur {
  position: absolute;
  inset: -8%;
  background-size: cover;
  background-position: center;
  filter: blur(16px);
  opacity: .6;
}
.md-article-img img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform .45s ease;
}
.md-article-card:hover .md-article-img img { transform: scale(1.06); }

.md-article-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem 1.75rem 1.5rem 1.5rem;
  border-left: 3px solid var(--red);
  gap: .5rem;
}

.md-article-type {
  font-family: 'Teko', sans-serif;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--red);
}

.md-article-title {
  font-family: 'Teko', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .03em;
  line-height: 1.1;
  color: var(--white);
  margin: 0;
  transition: color .15s;
}
.md-article-card:hover .md-article-title { color: var(--red); }

.md-article-summary {
  font-size: 1.2rem;
  color: var(--muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.55;
}

/* md-article-cta extends btn-tertiary-small — red always, inside card links */
.md-article-cta { color: var(--red); margin-top: .25rem; }
.md-article-cta svg { stroke: var(--red); }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 48rem) {
  .md-hero-logo,
  .md-hero-logo img { width: 4.5rem; height: 4.5rem; }
  .md-hero-logo-ph  { width: 4.5rem; height: 4.5rem; font-size: 1.125rem; }
  .md-form-team { min-width: 8rem; }
}

@media (max-width: 40rem) {
  .md-article-card-inner { grid-template-columns: 8rem 1fr; }
  .md-article-body { padding: 1rem 1.25rem 1rem 1.2rem; }
}

@media (max-width: 36rem) {
  .md-hero-matchup { gap: 1.2rem; }
  .md-hero-logo,
  .md-hero-logo img { width: 3.25rem; height: 3.25rem; }
  .md-hero-logo-ph  { width: 3.25rem; height: 3.25rem; font-size: 1.2rem; }
  .md-hero-team-name { font-size: 1.2rem; }
  .md-hero-center { min-width: 5rem; }
  .md-article-card-inner { grid-template-columns: 1fr; }
  .md-article-img { height: 10rem; }
  .md-form-row { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .md-form-team { min-width: auto; }
  .md-fact { grid-template-columns: 7rem 1fr; }
  .md-tl-line { height: 2.5rem; }
}
