/* =========================================================
   Teilnehmer-Programm
   - Datum nur einmal pro Tag
   - Identische Zeiten werden als gemeinsamer Zeitblock geführt
   - Desktop: Zeit nur einmal je Parallelblock
   - Mobil/Tablet: ein gemeinsamer Kartenblock je Zeit
   ========================================================= */

.program-card {
  overflow: visible;
}

.program-days {
  display: grid;
  gap: 1.5rem;
}

.program-day {
  min-width: 0;
}

.program-day + .program-day {
  padding-top: 0.25rem;
}

.program-day-title {
  margin: 0 0 0.75rem;
  padding: 0 0 0.5rem;
  border-bottom: 2px solid rgba(var(--brand-secondary-rgb), 0.35);
  color: var(--pg-blue);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.program-empty {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  color: var(--text-muted);
}

.table-wrapper--program {
  width: 100%;
  max-width: 100%;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: auto;
}

.table--program {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed;
}

.table--program th,
.table--program td {
  min-width: 0;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
  vertical-align: top;
}

.table--program th:nth-child(1),
.table--program td.program-cell-time {
  width: 12%;
}

.table--program th:nth-child(2),
.table--program td.program-cell-group {
  width: 16%;
}

.table--program th:nth-child(3),
.table--program td.program-cell-title {
  width: 25%;
}

.table--program th:nth-child(4),
.table--program td.program-cell-location {
  width: 15%;
}

.table--program th:nth-child(5),
.table--program td.program-cell-details {
  width: 32%;
}

.table--program .program-cell-time strong {
  white-space: normal;
}

.table--program .program-cell-group strong,
.table--program .program-cell-title strong {
  color: var(--text);
}

.table--program .program-cell-group strong {
  font-weight: 800;
}

/* Die Programmtabelle verwendet bewusst kein Zebra-Muster. */
.table--program tbody tr,
.table--program tbody tr:nth-child(odd),
.table--program tbody tr:nth-child(even),
.table--program tbody td {
  background: #ffffff !important;
}

/* Leere Angaben bleiben tatsächlich leer; es werden keine Ersatztexte erzeugt. */
.table--program .program-cell--empty {
  color: transparent;
}

/* Parallele Einträge derselben Zeit erhalten eine feine optische Trennung. */
.table--program .program-item-row--parallel td {
  border-top: 1px dashed rgba(100, 116, 139, 0.24);
}

/*
 * Auf kleineren Notebooks und Tablets wird jeder Zeitblock zu genau einer Karte.
 * Mehrere parallele Einträge bleiben innerhalb dieser gemeinsamen Karte.
 */
@media (max-width: 1280px) {
  .table-wrapper--program {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .table--program {
    display: block !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }

  .table--program thead {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .table--program .program-time-group {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0;
    width: 100%;
    min-width: 0;
    margin-bottom: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: #ffffff !important;
    box-shadow: 0 0.4rem 1rem rgba(1, 13, 110, 0.06);
  }

  .table--program .program-time-group:last-child {
    margin-bottom: 0;
  }

  .table--program tr.program-item-row {
    display: grid !important;
    grid-template-columns: minmax(8.5rem, 0.72fr) minmax(0, 1.45fr);
    grid-template-areas:
      "time group"
      "time title"
      "time location"
      "time details";
    gap: 0.45rem 0.9rem;
    align-items: start;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
  }

  .table--program tr.program-item-row--parallel {
    grid-template-areas:
      ". group"
      ". title"
      ". location"
      ". details";
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
  }

  .table--program td {
    display: block !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    hyphens: auto;
    line-height: 1.35;
  }

  .table--program td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .table--program .program-cell-time {
    grid-area: time;
    align-self: start;
    color: var(--pg-blue);
    font-size: 0.92rem;
  }

  .table--program .program-cell-group {
    grid-area: group;
    font-size: 0.92rem;
  }

  .table--program .program-cell-title {
    grid-area: title;
    font-size: 1rem;
  }

  .table--program .program-cell-location {
    grid-area: location;
  }

  .table--program .program-cell-details {
    grid-area: details;
  }

  .table--program .program-cell-time::before {
    display: none;
  }

  .table--program .program-cell-time strong,
  .table--program .program-cell-title strong {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .table--program .program-cell--empty {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .program-days {
    gap: 1.15rem;
  }

  .program-day-title {
    margin-bottom: 0.65rem;
    font-size: 1rem;
  }

  .table--program .program-time-group {
    padding: 0.8rem 0.85rem;
  }

  .table--program tr.program-item-row,
  .table--program tr.program-item-row--parallel {
    grid-template-columns: 1fr;
    grid-template-areas:
      "time"
      "group"
      "title"
      "location"
      "details";
    gap: 0.42rem;
  }

  .table--program tr.program-item-row--parallel {
    grid-template-areas:
      "group"
      "title"
      "location"
      "details";
    margin-top: 0.7rem;
    padding-top: 0.7rem;
  }

  .table--program .program-cell-time {
    display: inline-block !important;
    justify-self: start;
    width: auto !important;
    padding: 0.28rem 0.55rem !important;
    border-radius: 999px;
    background: rgba(var(--brand-secondary-rgb), 0.12) !important;
    color: var(--pg-blue);
    font-size: 0.86rem;
  }

  .table--program .program-cell-title {
    font-size: 0.98rem;
    line-height: 1.3;
  }
}

/* Expliziter Dark Mode */
body.dark .program-day-title {
  color: #dbeafe;
  border-bottom-color: rgba(103, 232, 249, 0.3);
}

body.dark .program-empty {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

body.dark .table--program tbody tr,
body.dark .table--program tbody tr:nth-child(odd),
body.dark .table--program tbody tr:nth-child(even),
body.dark .table--program tbody td {
  background: transparent !important;
}

@media (max-width: 1280px) {
  body.dark .table--program .program-time-group {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.28);
  }

  body.dark .table--program td::before {
    color: #94a3b8;
  }

  body.dark .table--program .program-cell-time {
    color: #bae6fd;
  }

  body.dark .table--program .program-cell-group strong,
  body.dark .table--program .program-cell-title strong {
    color: #f8fafc;
  }

  body.dark .table--program tr.program-item-row--parallel {
    border-top-color: rgba(148, 163, 184, 0.22);
  }
}

@media (max-width: 760px) {
  body.dark .table--program .program-cell-time {
    background: rgba(0, 178, 254, 0.14) !important;
    color: #bae6fd;
  }
}

/* Automatischer System-Dark-Mode */
@media (prefers-color-scheme: dark) {
  body.app-body:not(.light) .program-day-title {
    color: #dbeafe;
    border-bottom-color: rgba(103, 232, 249, 0.3);
  }

  body.app-body:not(.light) .program-empty {
    background: rgba(15, 23, 42, 0.88);
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
  }

  body.app-body:not(.light) .table--program tbody tr,
  body.app-body:not(.light) .table--program tbody tr:nth-child(odd),
  body.app-body:not(.light) .table--program tbody tr:nth-child(even),
  body.app-body:not(.light) .table--program tbody td {
    background: transparent !important;
  }

  @media (max-width: 1280px) {
    body.app-body:not(.light) .table--program .program-time-group {
      background: rgba(15, 23, 42, 0.92) !important;
      border-color: rgba(148, 163, 184, 0.28);
      box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.28);
    }

    body.app-body:not(.light) .table--program td::before {
      color: #94a3b8;
    }

    body.app-body:not(.light) .table--program .program-cell-time {
      color: #bae6fd;
    }

    body.app-body:not(.light) .table--program .program-cell-group strong,
    body.app-body:not(.light) .table--program .program-cell-title strong {
      color: #f8fafc;
    }

    body.app-body:not(.light) .table--program tr.program-item-row--parallel {
      border-top-color: rgba(148, 163, 184, 0.22);
    }
  }

  @media (max-width: 760px) {
    body.app-body:not(.light) .table--program .program-cell-time {
      background: rgba(0, 178, 254, 0.14) !important;
      color: #bae6fd;
    }
  }
}

/* v2026.09.23-04: Programmpunkt vor Gruppe, identische Programmpunkte je Zeitblock nur einmal. */
.table--program th:nth-child(2),
.table--program td.program-cell-title {
  width: 25%;
}

.table--program th:nth-child(3),
.table--program td.program-cell-group {
  width: 16%;
}

.program-inline-link {
  color: var(--pg-blue);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

.program-inline-link:hover,
.program-inline-link:focus-visible {
  color: var(--brand-secondary);
}

@media (max-width: 1280px) {
  .table--program tr.program-item-row {
    grid-template-areas:
      "time title"
      "time group"
      "time location"
      "time details";
  }

  .table--program tr.program-item-row--parallel {
    grid-template-areas:
      ". title"
      ". group"
      ". location"
      ". details";
  }
}

@media (max-width: 760px) {
  .table--program tr.program-item-row,
  .table--program tr.program-item-row--parallel {
    grid-template-areas:
      "time"
      "title"
      "group"
      "location"
      "details";
  }

  .table--program tr.program-item-row--parallel {
    grid-template-areas:
      "title"
      "group"
      "location"
      "details";
  }
}

body.dark .program-inline-link {
  color: #7dd3fc;
}
