/* The guide's layout. Colors and fonts are variables, set in theme.css (each
   channel's guide can bring its own; see guide/themes/). */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: dark; background-color: var(--bg-deep); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.018) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%) fixed;
  background-color: var(--bg);
  color: var(--text);
  font: 400 16px/1.45 var(--body);
}

a { color: var(--cyan); }

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }

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

/* Masthead ----------------------------------------------------------- */

.masthead {
  background: linear-gradient(180deg, var(--masthead-top) 0%, var(--panel) 100%);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.35);
}

.masthead-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  font: 400 clamp(22px, 5vw, 34px)/1 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.logo-top {
  color: var(--text);
  text-shadow: 3px 3px 0 var(--logo-shadow);
}

.logo-tv {
  padding: 4px 8px 2px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink-on-gold);
  box-shadow: 3px 3px 0 var(--logo-shadow);
}

.clock { text-align: right; }

.clock-time {
  display: block;
  font: 400 clamp(20px, 4.5vw, 30px)/1 var(--display);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.clock-date {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Sections ------------------------------------------------------------ */

main { padding-top: 20px; }

.section-title {
  margin: 28px 0 12px;
  font: 400 15px/1 var(--display);
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
}

.banner {
  margin: 0;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: rgb(255 77 109 / 0.15);
  border: 1px solid rgb(255 77 109 / 0.5);
  color: #ffd6de;
}

.placeholder {
  margin: 0;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

/* Now on ------------------------------------------------------------ */

.now-card {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.3);
}

.now-card.no-image { grid-template-columns: minmax(0, 1fr); }

.now-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--bg-deep);
}

.now-image.poster { aspect-ratio: 2 / 3; max-height: 260px; width: auto; justify-self: start; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--live);
  color: #fff;
  font: 700 11px/1.2 var(--body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.live-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: blink 1.6s steps(2, start) infinite;
}

@keyframes blink { to { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .live-badge::before { animation: none; }
}

.now-show {
  margin: 0;
  font: 700 clamp(24px, 5vw, 32px)/1.1 var(--body);
}

.episode-line {
  margin: 6px 0 0;
  font-weight: 500;
  color: var(--text);
}

.code {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--panel-edge);
  color: var(--cyan);
  font-size: 0.82em;
  font-weight: 500;
  white-space: nowrap;
  vertical-align: 0.08em;
}

.overview {
  margin: 10px 0 0;
  color: var(--muted);
}

.progress {
  margin-top: 16px;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-deep);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width 1s linear;
}

.now-times {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Listings ------------------------------------------------------------ */

.listings {
  list-style: none;
  margin: 0;
  padding: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--panel-edge);
}

.day-divider {
  padding: 8px 14px;
  background: var(--gold);
  color: var(--ink-on-gold);
  font: 400 13px/1.2 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.listing {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: stretch;
  background: var(--row);
}

.listing:nth-child(even) { background: var(--row-alt); }

.listing + .listing { border-top: 1px solid rgb(255 255 255 / 0.06); }

.listing + .listing .slot { box-shadow: inset 0 1px 0 rgb(0 0 0 / 0.35); }

.slot {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--ink-on-gold);
  font: 400 15px/1.1 var(--display);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.listing-body {
  padding: 12px 14px;
  min-width: 0;
}

.listing-show {
  margin: 0;
  font: 700 18px/1.2 var(--body);
}

.listing .episode-line { margin-top: 3px; font-size: 15px; }

.listing .overview {
  margin-top: 6px;
  font-size: 14px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  cursor: pointer;
}

.listing .overview.expanded {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.listing-meta {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.thumb {
  width: 132px;
  height: 100%;
  min-height: 74px;
  max-height: 110px;
  object-fit: cover;
  align-self: center;
  margin: 10px 12px 10px 0;
  border-radius: 5px;
  background: var(--bg-deep);
}

/* Footer ------------------------------------------------------------- */

.footer {
  padding-top: 24px;
  /* Clear Android's gesture bar when the installed app draws edge to edge. */
  padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
  font-size: 14px;
}

.footer p { margin: 8px 0; }

.tune-in {
  display: inline-block;
  margin-right: 8px;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink-on-gold);
  font: 400 14px/1 var(--display);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.tune-in:hover, .tune-in:focus-visible { background: var(--gold-hover); }

.credit { font-size: 12px; }

.calendar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }

.calendar-link { font-weight: 500; }

.copy-link {
  padding: 5px 10px;
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font: 500 13px/1.2 var(--body);
  cursor: pointer;
}

.copy-link:hover, .copy-link:focus-visible { border-color: var(--gold); }

#calendar-hint { flex-basis: 100%; font-size: 12px; }

/* Narrow screens ----------------------------------------------------- */

@media (max-width: 640px) {
  .now-card { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 14px; }
  .now-image.poster { max-height: 200px; }
  .listing { grid-template-columns: 76px minmax(0, 1fr); }
  .slot { font-size: 13px; }
  .thumb { display: none; }
  .clock-date { font-size: 11px; }
}
