/* Podium layout */
.podium-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.podium-card {
  flex: 0 0 30%;
  max-width: 30%;
  margin: 0 0.5rem;
  position: relative;
  text-align: center;
  padding-top: 3.1rem; /* mai mult spațiu pentru nume + icon sus */
}

/* „Capul” alergătorului deasupra podiumului */
.podium-avatar {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -30%); /* mai sus de podium */
  text-align: center;
  z-index: 2;
}

.podium-avatar .position-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.7rem;
  margin-bottom: 0.15rem;
}

.podium-avatar .podium-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.25rem;
  box-shadow: 0 0.15rem 0.35rem rgba(0,0,0,0.12);
  background: #fff;
}

/* NUMELE – mai mare, o singură linie, tăiat cu … dacă e prea lung */
.podium-avatar .runner-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  margin-left: auto;
  margin-right: auto;
}

.podium-avatar .runner-name a {
  display: inline-block;
  max-width: 100%;
}

/* Cubul / podiumul propriu-zis */
.podium-base {
  position: relative;
  border-radius: 0.75rem;
  padding: 1.8rem 0.5rem 0.8rem;
  box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.06);
  overflow: hidden;
}

/* Numărul mare, în fundal, blurat */
.podium-base .place-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 7.0rem;
  font-weight: 900;
  opacity: 0.10;
  color: #000;
  pointer-events: none;
  user-select: none;
  filter: blur(1px);
  line-height: 1;
}

/* TIMPUL – puțin mai mare */
.podium-base .time-label {
  font-weight: 700;
  font-size: 1.15rem;
}

/* Categoria de vârstă sub timp */
.podium-base .cat-label {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #6c757d;
}

/* Culori / înălțimi pentru locurile 1–3 */
.podium-base.podium-1 {
  height: 140px;
  background: linear-gradient(145deg, #fff7d6, #ffe082);
}

.podium-base.podium-2 {
  height: 120px;
  background: linear-gradient(145deg, #e0e0e0, #f5f5f5);
}

.podium-base.podium-3 {
  height: 115px;
  background: linear-gradient(145deg, #ffe0b2, #ffcc80);
}

@media (max-width: 767.98px) {
  .podium-row {
    flex-direction: row;
    align-items: flex-end;
  }
  .podium-card {
    flex: 0 0 32%;
    max-width: 32%;
    margin: 0 0.25rem;
    padding-top: 2.8rem;
  }
  .podium-base.podium-1 { height: 130px; }
  .podium-base.podium-2 { height: 115px; }
  .podium-base.podium-3 { height: 110px; }
  .podium-avatar .runner-name {
    font-size: 0.95rem;
  }
  .podium-base .time-label {
    font-size: 1.05rem;
  }
}

/* Small helper for runner links */
.runner-link {
  font-weight: 500;
}

.mini-podium-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.mini-podium-card {
  flex: 0 0 30%;
  max-width: 30%;
  min-width: 120px;
  background: #f8f9fa;
  border-radius: 0.75rem;
  padding: 0.5rem 0.4rem;
  text-align: center;
  box-shadow: 0 0.15rem 0.35rem rgba(0,0,0,0.06);
}

.mini-podium-card .mini-pos {
  font-size: 0.8rem;
  font-weight: 600;
  color: #6c757d;
  margin-bottom: 0.1rem;
}

.mini-podium-card .mini-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-podium-card .mini-time {
  font-size: 0.9rem;
  font-weight: 700;
}
@media (max-width: 767.98px) {
  .mini-podium-card {
    flex: 0 0 32%;
    max-width: 32%;
  }
}

/* ============================================================
   START: Run5 Event banner (fixed aspect ratio) + Hero overlay
   ============================================================ */

/* FIXED SIZE banner wrapper (standard look for all banners) */
.run5-event-banner {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #111;              /* fallback */
  aspect-ratio: 16 / 5;          /* desktop look */
  min-height: 200px;             /* safety */
}

/* Mobile: banner taller (hero feel) */
@media (max-width: 576px) {
  .run5-event-banner {
    aspect-ratio: 16 / 9;
    min-height: 180px;
  }
}

/* Background image fills the banner uniformly */
.run5-event-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;             /* key: uniform crop */
  object-position: center;
  display: block;
  opacity: 0.95;
}

/* Gradient overlay for readability (keep yours) */
.run5-event-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85),
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.0)
  );
}

/* Optional extra subtle overlay from your banner block (kept but lighter) */
.run5-event-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.35), rgba(0,0,0,0));
  pointer-events: none;
}

/* Content layer */
.run5-event-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.25rem 1.5rem;
  color: #fff;
  z-index: 2;
}

.run5-event-hero-content h1 {
  font-size: 1.5rem;
  margin-bottom: 0.3rem;
}

/* Desktop title */
@media (min-width: 768px) {
  .run5-event-hero-title {
    font-size: 2rem !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
  }
}

.run5-event-hero-meta {
  font-size: 0.9rem;
  opacity: 0.95;
}

.run5-event-hero-badges {
  font-size: 0.85rem;
}

/* Quick meta chips row under hero */
.event-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.event-meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background-color: #f8f9fa;
  font-size: 0.8rem;
  color: #495057;
}

.event-meta-chip i {
  margin-right: 0.35rem;
}

.run5-event-hero-fallback{
  position:absolute;
  inset:0;
  background:#111;
  z-index:0;
}

/* =========================================
   SUPER-COMPACT MOBILE LAYOUT (≤ 768px)
   HERO + QUICK META CHIPS
   ========================================= */
@media (max-width: 767.98px) {

  /* Banner becomes the hero container */
  .run5-event-banner {
    border-radius: 0.75rem;
  }

  .run5-event-hero-content {
    padding: 0.75rem 0.9rem 0.9rem;
  }

  .run5-event-hero-title {
    font-size: 1rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.25rem;
    font-weight: 700;
  }

  .run5-event-hero-meta {
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
  }

  /* stack title/meta/badges */
  .run5-event-hero-content > .d-flex {
    flex-direction: column;
    align-items: flex-start;
  }

  .run5-event-hero-content > .d-flex > .mb-2 {
    margin-bottom: 0.5rem !important;
  }

  .run5-event-hero-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.78rem;
    margin-bottom: 0.25rem !important;
  }

  .run5-event-hero-badges span {
    margin-right: 0 !important;
    margin-bottom: 0.15rem;
  }

  /* bottom meta line compact */
  .run5-event-hero-content .run5-event-hero-meta:last-child {
    margin-top: 0.15rem;
    font-size: 0.78rem !important;
  }

  .run5-event-hero-content .run5-event-hero-meta:last-child span {
    display: block;
    margin-bottom: 0.1rem;
  }

  .run5-event-hero-content .run5-event-hero-meta:last-child a {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
  }

  .run5-event-hero-content .run5-event-hero-meta:last-child i {
    margin-right: 0.25rem;
  }

  /* QUICK META CHIPS (2 per row) */
  .card .event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .event-meta-chip {
    flex: 0 0 calc(50% - 0.35rem);
    margin: 0;
    padding: 0.40rem 0.55rem;
    font-size: 0.88rem;
    border-radius: 999px;
  }

  .event-meta-chip i {
    margin-right: 0.4rem;
    font-size: 0.9rem;
  }

  .card .card-body.py-2 {
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
  }
}

/* ============================================================
   END: Run5 Event banner (fixed aspect ratio) + Hero overlay
   ============================================================ */

/* Mobile collapsed event description */
@media (max-width: 767.98px) {
  #eventDescText {
    max-height: 5.5rem;      /* ~ 2–3 linii, ~20–30% din text */
    overflow: hidden;
    position: relative;
  }

  #eventDescText::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2rem;
    background: linear-gradient(to top, #ffffff, rgba(255,255,255,0));
  }

  #eventDescText.expanded {
    max-height: none;
  }

  #eventDescText.expanded::after {
    display: none;
  }
}

/* clasament general - header + filtre */
/* Desktop width – filtre la dreapta */
.ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ranking-header-filters select {
    width: 120px;
}

/* =========================
   Mobile – toate 3 select-urile pe 1 singur rând
   ========================= */
@media (max-width: 767.98px) {

  .ranking-header {
      flex-direction: column;
      align-items: flex-start;
  }

  .ranking-header-filters {
      width: 100%;
      margin-top: 0.75rem;
  }

  .ranking-header-filters-row {
      display: flex;
      flex-wrap: nowrap;          /* IMPORTANT: toate pe un singur rând */
      justify-content: space-between;
  }

  .ranking-header-filters-row > div {
      flex: 0 0 32%;              /* Fix 3 coloane */
      max-width: 32%;
      margin-right: 0;            /* Eliminăm margin ca să încapă toate */
      margin-bottom: 0;
  }

  /* Dropdown-uri compacte */
  .ranking-header-filters select {
      width: 100% !important;
      min-width: 0;
      font-size: 0.78rem;          /* Mai mic */
      padding: 4px 16px 4px 6px;   /* Padding redus */
      height: 32px;                /* Le micșorăm vizibil */
      line-height: 32px;
  }

  .ranking-header-filters .small {
      font-size: 0.8rem;
      margin-bottom: 0.35rem;
  }
}
