/*
 * CsBe Stundenplan
 * Schritt 342 v7
 *
 * Responsive Wochenansichten und kompakte INF25 Zeitblöcke.
 * V2 überschreibt zusätzlich alte feste Wochenbreiten aus Schritt 307,
 * Schritt 308 und Schritt 311.
 * V3 entfernt redundante Angaben und zeigt die tatsächliche ÜK Zeit.
 * V5 gestaltet ganztägige ÜK Karten grosszügiger und kennzeichnet
 * Unterricht während Ferien oder Schliesszeiten.
 * V6 gibt allen Wochenkarten mehr Raum und zeigt Hoverinformationen
 * ausserhalb des Stundenplanrasters vollständig lesbar an.
 * V7 entkoppelt das Hoverfenster technisch von der Unterrichtskarte.
 */

.tt-card,
.tt-week-single,
.tt-week-pair,
.tt-week,
.tt-grid,
.tt-cell {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

.tt-card {
  overflow: visible !important;
}

.tt-card.tt-mode-double .tt-week-pair,
.tt-card.tt-mode-semester .tt-week-pair {
  display: grid !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
  overflow: visible !important;
  padding: 8px !important;
  scroll-snap-type: none !important;
}

/*
 * Die alten Dateien vergeben pro Woche 1080 bis 1260 Pixel.
 * Diese Selektoren sind bewusst spezifischer und entfernen die feste Breite.
 */
.tt-card.tt-mode-double .tt-week-pair > .tt-week,
.tt-card.tt-mode-semester .tt-week-pair > .tt-week,
.tt-card.tt-mode-double .tt-week-pair > .tt-week.tt-days-6,
.tt-card.tt-mode-semester .tt-week-pair > .tt-week.tt-days-6 {
  flex: 1 1 0 !important;
  flex-basis: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: visible !important;
}

.tt-grid {
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns:
    58px
    repeat(var(--tt-days), minmax(0, 1fr))
    58px !important;
  gap: 7px !important;
  padding: 12px !important;
}

.tt-break {
  grid-column: 2 / -2 !important;
}

.tt-card.tt-mode-double .tt-week-pair > .tt-week .tt-grid,
.tt-card.tt-mode-semester .tt-week-pair > .tt-week .tt-grid,
.tt-card.tt-mode-double .tt-week-pair > .tt-week.tt-days-6 .tt-grid,
.tt-card.tt-mode-semester .tt-week-pair > .tt-week.tt-days-6 .tt-grid {
  width: 100% !important;
  min-width: 0 !important;
  grid-template-columns:
    32px
    repeat(var(--tt-days), minmax(0, 1fr))
    32px !important;
  column-gap: 3px !important;
  row-gap: 4px !important;
  padding: 6px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-day,
.tt-card.tt-mode-semester .tt-week-pair .tt-day {
  min-width: 0 !important;
  min-height: 38px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-day strong,
.tt-card.tt-mode-semester .tt-week-pair .tt-day strong {
  font-size: 8.5px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-day span,
.tt-card.tt-mode-semester .tt-week-pair .tt-day span {
  font-size: 7.5px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-time,
.tt-card.tt-mode-semester .tt-week-pair .tt-time {
  min-width: 0 !important;
  min-height: 62px !important;
  font-size: 7.5px !important;
  line-height: 1.1 !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-cell,
.tt-card.tt-mode-semester .tt-week-pair .tt-cell,
.tt-card.tt-mode-double .tt-week-pair .tt-lesson,
.tt-card.tt-mode-semester .tt-week-pair .tt-lesson,
.tt-card.tt-mode-double .tt-week-pair .tt-closed-box,
.tt-card.tt-mode-semester .tt-week-pair .tt-closed-box {
  min-width: 0 !important;
  min-height: 62px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-lesson,
.tt-card.tt-mode-semester .tt-week-pair .tt-lesson {
  height: 62px !important;
  padding: 5px 3px !important;
  border-radius: 9px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-subject,
.tt-card.tt-mode-semester .tt-week-pair .tt-subject,
.tt-card.tt-mode-double .tt-week-pair .tt-week.tt-days-6 .tt-subject,
.tt-card.tt-mode-semester .tt-week-pair .tt-week.tt-days-6 .tt-subject {
  font-size: 8px !important;
  line-height: 1.08 !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-teacher,
.tt-card.tt-mode-double .tt-week-pair .tt-room,
.tt-card.tt-mode-double .tt-week-pair .tt-type,
.tt-card.tt-mode-double .tt-week-pair .tt-lesson-time,
.tt-card.tt-mode-semester .tt-week-pair .tt-teacher,
.tt-card.tt-mode-semester .tt-week-pair .tt-room,
.tt-card.tt-mode-semester .tt-week-pair .tt-type,
.tt-card.tt-mode-semester .tt-week-pair .tt-lesson-time,
.tt-card.tt-mode-double .tt-week-pair .tt-week.tt-days-6 .tt-teacher,
.tt-card.tt-mode-double .tt-week-pair .tt-week.tt-days-6 .tt-room,
.tt-card.tt-mode-double .tt-week-pair .tt-week.tt-days-6 .tt-type,
.tt-card.tt-mode-double .tt-week-pair .tt-week.tt-days-6 .tt-lesson-time,
.tt-card.tt-mode-semester .tt-week-pair .tt-week.tt-days-6 .tt-teacher,
.tt-card.tt-mode-semester .tt-week-pair .tt-week.tt-days-6 .tt-room,
.tt-card.tt-mode-semester .tt-week-pair .tt-week.tt-days-6 .tt-type,
.tt-card.tt-mode-semester .tt-week-pair .tt-week.tt-days-6 .tt-lesson-time {
  font-size: 7px !important;
  line-height: 1.08 !important;
}

.tt-lesson-time {
  margin-top: 3px !important;
  font-size: 10px !important;
  line-height: 1.1 !important;
  font-weight: 850 !important;
  opacity: .96 !important;
}

.tt-card.tt-mode-week .tt-grid {
  gap: 10px !important;
  padding: 18px !important;
}

.tt-card.tt-mode-week .tt-day,
.tt-card.tt-mode-week .tt-corner {
  min-height: 56px !important;
}

.tt-card.tt-mode-week .tt-time,
.tt-card.tt-mode-week .tt-cell,
.tt-card.tt-mode-week .tt-empty,
.tt-card.tt-mode-week .tt-closed-box {
  min-height: 108px !important;
}

.tt-card.tt-mode-week .tt-lesson {
  min-height: 108px !important;
  height: auto !important;
  padding: 16px 12px !important;
  border-radius: 14px !important;
}

.tt-card.tt-mode-week .tt-subject {
  font-size: 15px !important;
  line-height: 1.18 !important;
}

.tt-card.tt-mode-week .tt-teacher,
.tt-card.tt-mode-week .tt-room {
  margin-top: 4px !important;
  font-size: 12px !important;
  line-height: 1.18 !important;
}

.tt-card.tt-mode-week .tt-type,
.tt-card.tt-mode-week .tt-lesson-time {
  margin-top: 5px !important;
  font-size: 11px !important;
  line-height: 1.18 !important;
}

.tt-card.tt-mode-week .tt-cell.is-long-slot {
  min-height: 152px !important;
}

.tt-card.tt-mode-week .tt-cell.is-long-slot .tt-lesson {
  min-height: 152px !important;
  height: auto !important;
  padding: 20px 14px !important;
  border-radius: 16px !important;
}

.tt-card.tt-mode-week .tt-cell.is-long-slot .tt-subject {
  font-size: 16px !important;
  line-height: 1.15 !important;
}

.tt-card.tt-mode-week .tt-cell.is-long-slot .tt-teacher,
.tt-card.tt-mode-week .tt-cell.is-long-slot .tt-room {
  margin-top: 4px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
}

.tt-card.tt-mode-week .tt-cell.is-long-slot .tt-lesson-time {
  margin-top: 8px !important;
  font-size: 12px !important;
  letter-spacing: .01em !important;
}

.tt-tooltip {
  position: fixed !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: min(420px, calc(100vw - 32px)) !important;
  min-width: 0 !important;
  max-width: 420px !important;
  padding: 16px 18px !important;
  border-radius: 14px !important;
  background: rgba(15, 23, 42, .98) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: normal !important;
  box-shadow: 0 22px 54px rgba(15, 23, 42, .36) !important;
  z-index: 999999 !important;
  pointer-events: none !important;
}

.tt-tooltip.is-visible {
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
}

.tt-lesson:hover .tt-tooltip.tt-tooltip-source,
.tt-tooltip.tt-tooltip-source {
  display: none !important;
}

.tt-tooltip.tt-floating-tooltip {
  display: none !important;
}

.tt-tooltip.tt-floating-tooltip.is-visible {
  display: flex !important;
}

.tt-tooltip strong {
  font-size: 15px !important;
  line-height: 1.3 !important;
}

.tt-tooltip span {
  font-size: 13px !important;
  line-height: 1.4 !important;
}

.tt-lesson.has-closure-note {
  border: 2px solid rgba(245, 158, 11, .96) !important;
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, .16),
    0 10px 22px rgba(15, 23, 42, .14),
    0 0 0 3px rgba(245, 158, 11, .14) !important;
}

.tt-lesson.has-closure-note:hover {
  box-shadow:
    inset 0 -1px 0 rgba(0, 0, 0, .16),
    0 16px 30px rgba(15, 23, 42, .20),
    0 0 0 4px rgba(245, 158, 11, .18) !important;
}

.tt-closure-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 0 7px !important;
  padding: 5px 9px !important;
  border: 1px solid rgba(251, 146, 60, .42) !important;
  border-radius: 999px !important;
  background: rgba(255, 247, 237, .97) !important;
  color: #9a3412 !important;
  font-size: 10px !important;
  line-height: 1 !important;
  font-weight: 950 !important;
  letter-spacing: .01em !important;
  box-shadow: 0 2px 8px rgba(124, 45, 18, .10) !important;
}

.tt-closure-tooltip-line {
  margin-top: 3px !important;
  padding-top: 6px !important;
  border-top: 1px solid rgba(255, 255, 255, .18) !important;
  color: #fde68a !important;
  font-weight: 850 !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-cell.is-long-slot,
.tt-card.tt-mode-semester .tt-week-pair .tt-cell.is-long-slot {
  min-height: 76px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-cell.is-long-slot .tt-lesson,
.tt-card.tt-mode-semester .tt-week-pair .tt-cell.is-long-slot .tt-lesson {
  min-height: 76px !important;
  height: auto !important;
  padding: 6px 4px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-closure-badge,
.tt-card.tt-mode-semester .tt-week-pair .tt-closure-badge {
  margin-bottom: 3px !important;
  padding: 3px 5px !important;
  font-size: 6.5px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-break,
.tt-card.tt-mode-double .tt-week-pair .tt-break-space,
.tt-card.tt-mode-semester .tt-week-pair .tt-break,
.tt-card.tt-mode-semester .tt-week-pair .tt-break-space {
  min-height: 12px !important;
  height: 12px !important;
}

.tt-card.tt-mode-double .tt-week-pair .tt-break,
.tt-card.tt-mode-semester .tt-week-pair .tt-break {
  font-size: 7px !important;
}

@media (max-width: 1280px) {
  .tt-card.tt-mode-double .tt-week-pair,
  .tt-card.tt-mode-semester .tt-week-pair {
    grid-template-columns: 1fr !important;
  }

  .tt-card.tt-mode-double .tt-week-pair > .tt-week .tt-grid,
  .tt-card.tt-mode-semester .tt-week-pair > .tt-week .tt-grid {
    grid-template-columns:
      48px
      repeat(var(--tt-days), minmax(0, 1fr))
      48px !important;
    gap: 5px !important;
    padding: 9px !important;
  }

  .tt-card.tt-mode-double .tt-week-pair .tt-subject,
  .tt-card.tt-mode-semester .tt-week-pair .tt-subject {
    font-size: 10px !important;
  }

  .tt-card.tt-mode-double .tt-week-pair .tt-teacher,
  .tt-card.tt-mode-double .tt-week-pair .tt-room,
  .tt-card.tt-mode-double .tt-week-pair .tt-type,
  .tt-card.tt-mode-double .tt-week-pair .tt-lesson-time,
  .tt-card.tt-mode-semester .tt-week-pair .tt-teacher,
  .tt-card.tt-mode-semester .tt-week-pair .tt-room,
  .tt-card.tt-mode-semester .tt-week-pair .tt-type,
  .tt-card.tt-mode-semester .tt-week-pair .tt-lesson-time {
    font-size: 8.5px !important;
  }

  .tt-card.tt-mode-double .tt-week-pair .tt-closure-badge,
  .tt-card.tt-mode-semester .tt-week-pair .tt-closure-badge {
    padding: 3px 6px !important;
    font-size: 7.5px !important;
  }
}

@media (max-width: 720px) {
  .tt-card.tt-mode-double .tt-week-pair > .tt-week,
  .tt-card.tt-mode-semester .tt-week-pair > .tt-week,
  .tt-week-single > .tt-week {
    overflow-x: auto !important;
  }

  .tt-grid,
  .tt-card.tt-mode-double .tt-week-pair > .tt-week .tt-grid,
  .tt-card.tt-mode-semester .tt-week-pair > .tt-week .tt-grid {
    min-width: 820px !important;
    grid-template-columns:
      52px
      repeat(var(--tt-days), minmax(110px, 1fr))
      52px !important;
  }
}
