/* The program guide, laid out like an early-2000s cable listings screen:
   branding and details top left, live picture top right, a time bar, and
   five color-coded rows with a yellow highlight. Sized in container units so
   it reads the same on a desktop tube and a phone. */

#guidewrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  background: #0a2256;
  color: #fff;
  font-family: 'Archivo', system-ui, sans-serif;
  container-type: size;
  user-select: none;
}

#gd-top { flex: 0 0 45%; display: flex; }

#gd-info {
  width: 59%;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #06163a;
}

#gd-brand {
  flex: 0 0 40%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 3cqw;
  padding: 0 3cqw;
  background: linear-gradient(180deg, #2f58a8, #1b3a7e);
  border-bottom: 2px solid #06163a;
}
.gd-logo {
  font-weight: 500;
  font-size: 9.5cqh;
  letter-spacing: -0.02em;
  color: #eef3ff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}
.gd-listings {
  font-weight: 600;
  font-size: 5cqh;
  line-height: 1.12;
  color: #fff;
}
.gd-listings b { font-weight: 700; }
.gd-badge {
  background: #d42b22;
  color: #fff;
  font-weight: 900;
  font-size: 4.6cqh;
  line-height: 0.95;
  text-align: center;
  padding: 0.7cqh 1.2cqw;
  border-radius: 0.8cqh;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.85);
}

#gd-detail {
  flex: 1;
  position: relative;
  padding: 1.6cqh 3cqw;
  background: linear-gradient(180deg, #6a8dcc 0%, #3c62ab 55%, #2c519c 100%);
  overflow: hidden;
}
#gd-title {
  color: #ffe04d;
  font-weight: 700;
  font-size: 5.2cqh;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 15cqw;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
#gd-ch {
  position: absolute;
  right: 3cqw;
  top: 1.6cqh;
  font-weight: 700;
  font-size: 5cqh;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}
#gd-time { font-weight: 600; font-size: 4.6cqh; text-shadow: 0 1px 0 rgba(0,0,0,0.4); }
#gd-desc {
  font-weight: 500;
  font-size: 4.3cqh;
  line-height: 1.12;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

#gd-timebar {
  flex: 0 0 9%;
  display: grid;
  grid-template-columns: 21% 1fr 1fr 1fr 4%;
  align-items: center;
  background: linear-gradient(180deg, #143a7c, #0a2256);
  border-top: 2px solid #3f67b5;
  border-bottom: 2px solid #06163a;
  font-weight: 600;
  font-size: 5cqh;
}
#gd-day { padding-left: 3cqw; white-space: nowrap; display: flex; align-items: center; gap: 1.2cqw; }
#gd-dayname { font-weight: 600; }
#gd-back, #gd-fwd { cursor: pointer; }
#gd-back.dim { opacity: 0.3; }
.gd-t { padding-left: 1.6cqw; border-left: 1px solid rgba(255,255,255,0.4); white-space: nowrap; }
.gd-arrow { text-align: center; }

/* the whole guide is draggable; the browser must not pan the page instead */
#guidewrap { touch-action: none; }

#gd-scroll {
  position: absolute;
  right: 0.3cqw;
  top: calc(54% + 4px);
  bottom: 4px;
  width: 0.9cqw;
  min-width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
  pointer-events: none;
}
#gd-thumb {
  position: absolute;
  left: 0;
  right: 0;
  min-height: 8px;
  border-radius: 2px;
  background: rgba(255,255,255,0.7);
  transition: top 0.15s;
}

#gd-rows {
  flex: 1;
  display: grid;
  grid-template-rows: repeat(5, 1fr);
  gap: 2px;
  background: #06163a;
  min-height: 0;
}

.gr { display: grid; grid-template-columns: 21% 1fr; gap: 2px; min-height: 0; }
.gr-ch {
  display: flex;
  align-items: center;
  padding-left: 3cqw;
  background: linear-gradient(180deg, #b9d4f2, #92b7e2);
  color: #0b1f45;
  font-weight: 700;
  font-size: 5cqh;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
.gr.cur .gr-ch { background: linear-gradient(180deg, #eaf2fc, #c2d8f1); }

.gr-cells {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 4.2%;
  gap: 2px;
  min-width: 0;
}
.gc {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 1.6cqw;
  background: #1c3f86;
  color: #fff;
  font-weight: 600;
  font-size: 5cqh;
  cursor: pointer;
}
.gc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc.tail { padding: 0; }
.gc.sports { background: #1d7a3d; }
.gc.movies { background: #582b90; }
.gc.kids { background: #7eaee3; color: #0b1f45; }
.gc.music { background: #146e7c; }
.gc.special { background: #2d4f96; }
.gc.docu { background: #7a5412; }
.gc.reality { background: #9b3a1c; }
.gc.late { background: #3a2f7a; }
.gc.sel {
  background: #f7f19f;
  color: #0b1f45;
  box-shadow: inset 0 0 0 2px #fffbd0;
}
