/* ============================================================
   AURUMFIT — Мои тренировки
   Figma desktop: 11-585 (1728 × 2967)
   Figma mobile:  16-3469 (393 × 1974)
   ============================================================ */

.tr-page {
  position: relative;
  width: var(--page-width);
  min-height: 100vh;
  padding-top: 120px;
}

/* Footer flows in normal flow on trainings (dynamic content height) */
.tr-page .lk-footer {
  position: relative;
  top: auto;
  margin-top: 80px;
  width: 1728px;
}

/* ---------- Page title (Figma y:157, 64px, Graphik LCG Medium) ---------- */
.tr-title {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 64px;
  line-height: 68px;
  text-align: center;
  color: var(--color-white);
  margin-top: 37px;    /* 157 - 120 */
  margin-bottom: 42px; /* 267 - (157+68) = 42 */
}

/* ---------- Top rule (Figma y:267, w:1308, h:4, rgba(217,217,217,0.2)) ---------- */
.tr-rule {
  width: 1308px;
  height: 4px;
  background: rgba(217, 217, 217, 0.2);
  margin: 0 auto 48px; /* 319 - 271 = 48 */
  border-radius: 2px;
}

/* ---------- Month navigation (Figma y:319) ---------- */
.tr-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 23px; /* calendar at y:392, nav text bottom ~369 */
}

.tr-month-nav__item {
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-white);
  opacity: 0.5;
  min-width: 250px;
  text-align: center;
}

.tr-month-nav__item.is-current {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.52px;
  color: var(--color-white);
  opacity: 1;
  min-width: 200px;
}

.tr-month-nav__arrow {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.tr-month-nav__arrow:hover { opacity: 1; }

/* ---------- Calendar (Figma y:392, w:621, h:581, #352f2a, rounded-20) ---------- */
.tr-calendar {
  width: 621px;
  margin: 0 auto 45px;
  background: #352f2a;
  border-radius: 20px;
  padding: 47px 70px 126px;
}

.tr-cal-head {
  display: grid;
  grid-template-columns: repeat(7, 62px);
  gap: 8px;
  padding-bottom: 19px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.tr-cal-head__cell {
  width: 62px;
  text-align: center;
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
  color: var(--color-white);
  opacity: 0.5;
  letter-spacing: 0.36px;
}

.tr-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 62px);
  gap: 8px;
}

/* ---------- Calendar day cells ---------- */
.tr-cal-day {
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  color: #000;
  background: #fff;
  user-select: none;
}

.tr-cal-day.is-empty {
  background: none;
}

.tr-cal-day.has-past {
  background: #a7a7a7;
  color: #000;
}

.tr-cal-day.has-upcoming {
  background: #fec384;
  color: #000;
}

/* ---------- Mid rule (Figma y:1018, w:1308, h:4) ---------- */
.tr-mid-rule {
  width: 1308px;
  height: 4px;
  background: rgba(217, 217, 217, 0.2);
  margin: 0 auto 44px;
  border-radius: 2px;
}

/* ---------- Section (Figma card width: 1101px) ---------- */
.tr-section {
  width: 1101px;
  margin: 0 auto 44px;
}

.tr-section__title {
  font-family: var(--font-text);
  font-size: 28px;
  font-weight: 500;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 44px;
}

/* ---------- Training card (Figma h:192, rounded-12) ---------- */
.tr-card {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 192px;
  padding: 0 36px 0 40px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  position: relative;
}
.tr-card:last-child { margin-bottom: 0; }

/* Date block (day + month) */
.tr-card__date {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 185px;
  flex-shrink: 0;
}

.tr-card__day {
  font-family: var(--font-display);
  font-size: 39px;
  line-height: 1;
}

.tr-card__month {
  font-family: var(--font-text);
  font-size: 20px;
  line-height: 1;
}

.tr-card--upcoming .tr-card__day   { color: var(--color-accent-1); }
.tr-card--upcoming .tr-card__month { color: var(--color-accent-1); }
.tr-card--past .tr-card__day       { color: rgba(255, 255, 255, 0.4); }
.tr-card--past .tr-card__month     { color: rgba(255, 255, 255, 0.4); }

/* Time pill (Figma: 99×50, rounded-100) */
.tr-card__time {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 99px;
  height: 50px;
  border-radius: 50px;
  font-family: var(--font-display);
  font-size: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tr-card--upcoming .tr-card__time {
  background: var(--color-accent-1);
  color: #000;
}

.tr-card--past .tr-card__time {
  background: rgba(255, 255, 255, 0.4);
  color: #000;
}

/* Info block with vertical divider via ::before */
.tr-card__info {
  flex: 1;
  position: relative;
  padding-left: 36px;
}
.tr-card__info::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 120px;
  background: rgba(255, 255, 255, 0.14);
}

.tr-card__place {
  font-family: var(--font-text);
  font-size: 22px;
  font-weight: 500;
  color: var(--color-white);
  line-height: 24px;
  margin-bottom: 8px;
}

.tr-card--past .tr-card__place {
  color: rgba(255, 255, 255, 0.5);
}

.tr-card__addr {
  font-family: var(--font-text);
  font-size: 16px;
  color: #a4a4a4;
  line-height: 20px;
}

/* Price (Figma: 36px, Nimbus Sans L) */
.tr-card__price {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 34px;
  color: var(--color-white);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

.tr-card__price-per {
  font-family: var(--font-text);
  font-size: 16px;
  font-weight: 400;
  color: var(--color-white);
}

.tr-card--past .tr-card__price     { color: rgba(255, 255, 255, 0.4); }
.tr-card--past .tr-card__price-per { color: rgba(255, 255, 255, 0.4); }


/* ============================================================
   MOBILE ≤ 560px  (Figma frame 16-3469, 393px)
   ============================================================ */
@media (max-width: 560px) {

  /* ---------- Page wrapper ---------- */
  .tr-page {
    width: 100%;
    min-height: auto;
    padding-top: 0; /* LkMobMenu is outside tr-page in the layout */
  }

  .tr-page .lk-footer {
    width: 100%;
    margin-top: 32px;
  }

  /* LkHeader is hidden on mobile (handled in lk.css) */

  /* ---------- Title (Figma y:127, 28px, Graphik Medium) ---------- */
  .tr-title {
    font-size: 28px;
    line-height: 1.2;
    font-weight: 500;
    margin-top: 6px;    /* 127 - 121 (LkMobMenu bar height) */
    margin-bottom: 17px; /* to rule at y:200: 200-(127+28+...≈28) ≈ 45px margin but line-height gives natural height */
  }

  /* ---------- Top rule (Figma y:200, w:379, h:4) ---------- */
  .tr-rule {
    width: calc(100% - 14px);
    height: 4px;
    margin: 0 auto 29px; /* to month nav at y:233: 233-204=29 */
  }

  /* ---------- Month navigation (Figma y:233, 18px) ---------- */
  .tr-month-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 17px; /* to calendar at y:279: 279-(233+18+7≈258)≈21 */
  }

  /* Hide prev/next month labels */
  .tr-month-nav__item { display: none; }

  .tr-month-nav__item.is-current {
    display: block;
    font-size: 18px;
    line-height: 16.8px;
    font-weight: 500;
    letter-spacing: 0.36px;
    min-width: auto;
  }

  .tr-month-nav__arrow {
    width: 32px;
    height: 32px;
  }

  /* ---------- Calendar (Figma y:279, w:379, h:332, #352f2a, rounded-20) ---------- */
  .tr-calendar {
    width: calc(100% - 14px);
    margin: 0 7px 30px;
    background: #352f2a;
    border-radius: 20px;
    padding: 24px 21px 23px;
  }

  .tr-cal-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5.6px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .tr-cal-head__cell {
    width: auto;
    font-size: 12.6px;
    line-height: 16.8px;
    letter-spacing: 0.252px;
    opacity: 0.5;
  }

  .tr-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5.6px;
  }

  /* ---------- Calendar day cells (Figma: 43.4×43.4, rounded-8.4) ---------- */
  .tr-cal-day {
    width: auto;
    height: auto;
    aspect-ratio: 1;
    border-radius: 8.4px;
    font-size: 14px;
  }

  /* ---------- Mid rule (Figma y:641, w:379, h:4) ---------- */
  .tr-mid-rule {
    width: calc(100% - 14px);
    height: 4px;
    margin: 0 auto 29px; /* to "Предстоящие" at y:674 */
  }

  /* ---------- Section headings (Figma: 18px, Graphik Medium) ---------- */
  .tr-section {
    width: 100%;
    margin: 0 0 25px;
  }

  .tr-section__title {
    font-size: 18px;
    line-height: normal;
    margin-bottom: 25px;
  }

  /* ---------- Training card (Figma: 126×379, left:7, rounded-12) ---------- */
  .tr-card {
    display: block;            /* override flex */
    position: relative;
    height: 126px;
    width: calc(100% - 14px);
    margin: 0 7px 10px;
    padding: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
  }
  .tr-card:last-child { margin-bottom: 0; }

  /* Vertical divider (Figma: x:177 from card left, y:15, h:96) */
  .tr-card::before {
    content: '';
    position: absolute;
    left: 177px;
    top: 15px;
    width: 1px;
    height: 96px;
    background: rgba(255, 255, 255, 0.14);
  }

  /* Date block: day + month, left section, vertically centred */
  .tr-card__date {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    flex-direction: row;
    flex-shrink: 0;
  }

  .tr-card__day {
    font-size: 23px;
    line-height: 1;
  }

  .tr-card__month {
    font-size: 12px;
    line-height: 1;
  }

  /* Time pill (Figma: 60×30, x:105, vertically centred) */
  .tr-card__time {
    position: absolute;
    left: 105px;
    top: 48px;
    width: 60px;
    height: 30px;
    border-radius: 30px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
  }

  .tr-card--upcoming .tr-card__time {
    background: var(--color-accent-1);
    color: #000;
  }

  .tr-card--past .tr-card__time {
    background: rgba(255, 255, 255, 0.4);
    color: #000;
  }

  /* Info block: right section */
  .tr-card__info {
    position: absolute;
    left: 190px;
    top: 15px;
    right: 12px;
    bottom: 36px;
    padding-left: 0;
  }
  .tr-card__info::before { display: none; }

  .tr-card__place {
    font-size: 12px;
    line-height: 14.4px;
    margin-bottom: 4px;
  }

  .tr-card__addr {
    font-size: 9.6px;
    line-height: 12px;
  }

  /* Price: bottom-right of right section */
  .tr-card__price {
    position: absolute;
    right: 12px;
    bottom: 10px;
    font-size: 21.6px;
    line-height: 20.4px;
    text-align: right;
    color: var(--color-white);
  }

  .tr-card__price-per {
    font-size: 9.6px;
    color: var(--color-white);
  }

  .tr-card--past .tr-card__price     { color: rgba(255, 255, 255, 0.4); }
  .tr-card--past .tr-card__price-per { color: rgba(255, 255, 255, 0.4); }

}
