/* Downbeat Timeline — clean printable schedule */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #5c5c5c;
  --border: #e6e6e6;
  --header-bg: #f4f4f4;
  --header-border: #dcdcdc;
  --accent: #111111;
  --link: #0b57d0;
  --warn-bg: #fff8e6;
  --warn-border: #f0d090;
  --radius: 8px;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 15px;
}

.sheet-header {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-logo {
  height: 36px;
  width: auto;
  display: block;
}

.brand-text-logo {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.15rem;
}

.event-head {
  margin-bottom: 12px;
}

.event-title {
  margin: 0 0 6px;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.event-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 8px;
}

.btn-print {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
}

.btn-print:hover {
  border-color: #ccc;
}

.last-updated {
  font-size: 0.8rem;
  color: var(--muted);
}

.banner {
  max-width: 980px;
  margin: 16px auto 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--warn-border);
  background: var(--warn-bg);
  color: #5a4500;
  font-size: 0.9rem;
}

.sheet-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}

.timeline-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.timeline-table thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 14px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.timeline-table tbody td {
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.timeline-table tbody tr:last-child td {
  border-bottom: none;
}

.col-time {
  width: 74px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.col-length {
  width: 72px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.header-cell {
  padding: 10px 14px !important;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border) !important;
}

.header-label {
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--accent);
}

.detail-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.item-title,
.item-title-link {
  font-weight: 600;
  font-size: 0.98rem;
}

.item-title-link {
  color: var(--link);
  text-decoration: none;
}

.item-title-link:hover {
  text-decoration: underline;
}

.open-link {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--link);
  text-decoration: none;
  white-space: nowrap;
}

.open-link:hover {
  border-color: #cfcfcf;
}

.item-desc,
.item-info {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 720px;
}

.item-info {
  font-style: italic;
}

.empty-state {
  text-align: center;
  padding: 36px 16px !important;
  color: var(--muted);
}

.sheet-footer {
  max-width: 980px;
  margin: 32px auto 48px;
  padding: 0 20px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Landing + errors */

.landing-body,
.error-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.landing-card,
.error-card {
  max-width: 520px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  background: #fff;
}

.landing-card h1 {
  margin: 8px 0 12px;
  font-size: 1.35rem;
}

.error-card h1 {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

code {
  background: #f6f6f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Mobile: stack columns */

@media (max-width: 640px) {
  .timeline-table thead {
    display: none;
  }

  .timeline-table,
  .timeline-table tbody,
  .timeline-row {
    display: block;
    width: 100%;
  }

  .timeline-row--item {
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
  }

  .timeline-row--item td {
    display: block;
    width: 100%;
    border: none !important;
    padding: 4px 0 !important;
  }

  .timeline-row--item .col-time::before {
    content: "Time ";
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 8px;
  }

  .timeline-row--item .col-length::before {
    content: "Length ";
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    margin-right: 8px;
  }

  .timeline-row--header .header-cell {
    margin-top: 12px;
  }

  .col-time,
  .col-length {
    white-space: normal;
  }
}

/* Print */

@media print {
  body {
    background: #fff;
    font-size: 11pt;
    color: #000;
  }

  .timeline-table thead {
    display: table-header-group !important;
  }

  .timeline-table tbody,
  .timeline-row {
    display: table-row-group !important;
  }

  .timeline-row--item,
  .timeline-row--header {
    display: table-row !important;
  }

  .timeline-row td {
    display: table-cell !important;
  }

  .timeline-row--item td::before {
    content: none !important;
  }

  .print-hide {
    display: none !important;
  }

  .sheet-header {
    padding-top: 0;
    border-bottom-color: #000;
  }

  .toolbar .btn-print {
    display: none !important;
  }

  .timeline-table {
    border-color: #000;
    border-radius: 0;
  }

  .timeline-table thead th {
    background: #fff !important;
    color: #000 !important;
    border-bottom: 1px solid #000;
  }

  .timeline-table tbody td {
    border-bottom: 1px solid #ccc;
  }

  .banner {
    border-color: #000;
    background: #fff;
    color: #000;
  }

  .header-cell {
    background: #eee !important;
    border-bottom-color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .timeline-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .item-desc,
  .item-info {
    color: #333;
  }

  .open-link {
    border-color: #999;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .sheet-footer {
    display: none;
  }
}
