/* ===== Rozvrh – základ ===== */
.schedule {
  margin-top: 1rem;
  width: 100%;
}

/* sloty sú len pre desktop layout; na mobile ich schováme */
.schedule__slots {
  display: none;
}

.schedule__days {
  display: grid;
  gap: 12px;
}

.schedule__day {
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 12px;
  min-width: 0;        /* kľúčové pre grid */
  overflow: hidden;    /* poistka proti "tlačeniu" stĺpcov */
}

.schedule__dayTitle {
  margin: 0 0 10px 0;
  font-weight: 700;
  font-size: 1.5rem;
  text-align: center;
  color: #7f7524;

  /* aby sa názvy dní nikdy netlačili / nepretekali */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule__cell {
  margin-top: 10px;
}

.schedule__event {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  background: #eee;
  color: #000;
}

.schedule__event--course {
  background: #b8a82a;
  color: #000;
}

.schedule__event--wt {
  background: #2a4a7f;
  color: #d0d8f0;
}

.schedule__event--kids {
  background: #2a7f4a;
  color: #d0f0da;
}

.schedule__eventTitle {
  font-weight: 700;
  line-height: 1.2;
}

.schedule__eventTime {
  margin-top: 4px;
  opacity: 0.85;
  font-size: 0.95rem;
}

/* "Súkromné tréningy" dni – jemné pozadie */
.schedule__day--private {
  background: rgba(0,0,0,0.02);
}

.schedule__privateNote {
  opacity: 0.9;
  font-style: italic;
  padding: 8px 0 2px 0;
  text-align: center;
}

/* malý footer pod rozvrhom */
.schedule__footnote {
  margin-top: 12px;
  opacity: 0.85;
  font-size: 0.95rem;
  text-align: center;
}

/* Short day names hidden by default (shown only on mobile) */
.schedule__dayFull  { display: inline; }
.schedule__dayShort { display: none; }

/* ===== MOBILE + TABLET (0–1199px): compact week view, Google-Calendar-style ===== */
@media (max-width: 1199px) {
  /* Two-column layout: narrow time axis + 7-day grid */
  .schedule {
    display: grid;
    grid-template-columns: 26px 1fr;
    gap: 4px;
    align-items: start;
  }

  /* Show time labels, one per row */
  .schedule__slots {
    display: grid;
    grid-auto-rows: 60px;
    gap: 4px;
    padding-top: 30px;
  }

  .schedule__slot {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 4px 3px 0 0;
    font-size: 0;          /* hide long text */
    font-weight: 700;
    opacity: 0.6;
    line-height: 1;
  }

  /* Show abbreviated label via data-short attribute */
  .schedule__slot::before {
    content: attr(data-short);
    font-size: 0.6rem;
  }

  /* 7 equal columns */
  .schedule__days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 3px;
  }

  .schedule__day {
    padding: 4px 2px;
    min-height: calc(60px * 7 + 30px);
    display: grid;
    grid-template-rows: 30px repeat(7, 60px);
    gap: 4px;
    border-radius: 6px;
    position: relative;
  }

  /* Swap to abbreviated day names */
  .schedule__dayFull  { display: none; }
  .schedule__dayShort { display: inline; }

  .schedule__dayTitle {
    font-size: 0.72rem;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Pin cells to their time rows */
  .schedule__cell { margin: 0; }
  .schedule__cell[data-slot="0700"] { grid-row: 2; }
  .schedule__cell[data-slot="0900"] { grid-row: 3; }
  .schedule__cell[data-slot="1100"] { grid-row: 4; }
  .schedule__cell[data-slot="1300"] { grid-row: 5; }
  .schedule__cell[data-slot="1500"] { grid-row: 6; }
  .schedule__cell[data-slot="1700"] { grid-row: 7; }
  .schedule__cell[data-slot="1900"] { grid-row: 8; }

  /* Compact event pills — sizing only; colours inherited from base */
  .schedule__event {
    height: 100%;
    box-sizing: border-box;
    border-radius: 5px;
    padding: 4px 3px;
    overflow: hidden;
  }

  .schedule__eventTitle {
    font-size: 0.55rem;
    line-height: 1.2;
    font-weight: 700;
  }

  .schedule__eventTime {
    font-size: 0.52rem;
    margin-top: 2px;
    opacity: 0.9;
  }

  /* Private-day overlay */
  .schedule__day--private .schedule__privateNote {
    position: absolute;
    left: 2px;
    right: 2px;
    top: 34px;
    bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.2;
    padding: 0;
    pointer-events: none;
  }

  .schedule__day--private .schedule__privateText {
    display: inline-block;
    transform: rotate(-90deg);
    transform-origin: center;
    white-space: nowrap;
    font-weight: 700;
    font-size: 0.5rem;
    letter-spacing: 0.04em;
  }

  /* Footnote spans full width */
  .schedule__footnote {
    grid-column: 1 / -1;
  }
}

/* ===== TABLET + DESKTOP (>=768px): sloty + 7 dní + časové riadky ===== */
@media (min-width: 1200px) {
  .schedule {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px;
    align-items: start;
  }

  .schedule__slots {
    display: grid;
    grid-auto-rows: 80px;
    gap: 12px;
    padding-top: 44px;
  }

  .schedule__slot {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 10px 8px 0 0;
    font-weight: 700;
    opacity: 0.75;
    font-size: 0.85rem;
  }

  .schedule__days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
  }

  .schedule__day {
    padding: 10px;
    min-height: calc(80px * 7 + 44px);
    display: grid;
    grid-template-rows: 44px repeat(7, 80px);
    gap: 8px;
    position: relative;
  }

  .schedule__dayTitle {
    margin-bottom: 8px;
  }

  /* Umiestnenie eventov podľa slotu */
  .schedule__cell { margin: 0; }

  .schedule__cell[data-slot="0700"] { grid-row: 2; }
  .schedule__cell[data-slot="0900"] { grid-row: 3; }
  .schedule__cell[data-slot="1100"] { grid-row: 4; }
  .schedule__cell[data-slot="1300"] { grid-row: 5; }
  .schedule__cell[data-slot="1500"] { grid-row: 6; }
  .schedule__cell[data-slot="1700"] { grid-row: 7; }
  .schedule__cell[data-slot="1900"] { grid-row: 8; }

  /* Private dni: overlay */
  .schedule__day--private .schedule__privateNote {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 44px;
    bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.35;
    font-style: normal;
    pointer-events: none;
    padding: 0;
  }

  .schedule__privateText {
    display: inline-block;
    transform: rotate(-90deg);
    transform-origin: center;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: center;
  }

  /* Footnote cez celú šírku */
  .schedule__footnote {
    grid-column: 1 / -1;
  }
}

/* Wider slot column and larger rows on big screens */
@media (min-width: 1200px) {
  .schedule {
    grid-template-columns: 110px 1fr;
  }

  .schedule__slots {
    grid-auto-rows: 92px;
  }

  .schedule__slot {
    font-size: 1rem;
  }

  .schedule__days {
    gap: 12px;
  }

  .schedule__day {
    min-height: calc(92px * 7 + 44px);
    grid-template-rows: 44px repeat(7, 92px);
    gap: 12px;
  }
}
