/* Science Tweets: a calm science-TV programme guide. Bright paper white,
   deep ink, one tally-light red for "on air". Scoped under .sct. */

html:has(.sct),
body:has(.sct) {
  margin: 0;
  padding: 0;
  background: #f5f5f0;
  color: #12161c;
  color-scheme: light;
}

.sct {
  --paper: #f5f5f0;
  --card: #ffffff;
  --ink: #12161c;
  --ink-soft: #4a525d;
  --ink-faint: #7d8590;
  --rule: #dedfd8;
  --rule-strong: #12161c;
  --signal: #e2412b;
  --signal-ink: #b52f1c;
  --sky: #2f5bd3;
  --sans: "FF Meta", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: Charter, Georgia, ui-serif, serif;

  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

.sct a {
  color: inherit;
}

.sct :focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Flash area: float it as a toast over the guide */

body:has(.sct) #flash {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: 16px;
  left: 16px;
  max-width: 460px;
  margin-left: auto;
  pointer-events: none;
}

body:has(.sct) #flash > div {
  margin: 0;
  pointer-events: auto;
}

body:has(.sct) #flash > div > div {
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(18, 22, 28, 0.22);
}

body:has(.sct) #flash > div > div .text-\[18px\] {
  font-size: 16px;
  line-height: 1.5;
}

/* Bar */

.sct-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 32px;
}

.sct-home,
.sct-bar-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft) !important;
}

.sct-home:hover,
.sct-bar-follow:hover {
  color: var(--ink) !important;
}

/* Masthead: the bold moment */

.sct-masthead {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: end;
  gap: 48px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 32px 56px;
  border-bottom: 4px solid var(--rule-strong);
}

.sct-onair {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  padding: 6px 12px 6px 10px;
  border: 1.5px solid var(--signal);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal-ink);
}

.sct-onair-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--signal);
  animation: sct-pulse 2.4s ease-in-out infinite;
}

@keyframes sct-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.sct-masthead h1 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(64px, 11vw, 168px);
  line-height: 0.86;
  letter-spacing: -0.045em;
  color: var(--ink);
}

.sct-lede {
  margin: 0;
  max-width: 34em;
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
}

.sct-lede-small {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.sct-lede a,
.sct-lede-small a,
.sct-foot p a {
  text-decoration-line: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.sct-lede a:hover,
.sct-lede-small a:hover,
.sct-foot p a:hover {
  color: var(--signal-ink);
}

.sct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.sct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink) !important;
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sct-btn:hover {
  background: var(--ink);
  color: #fff !important;
}

.sct-btn-primary {
  background: var(--ink);
  color: #fff !important;
}

.sct-btn-primary:hover {
  background: var(--signal-ink);
  border-color: var(--signal-ink);
}

/* Guide */

.sct-guide-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 32px 6px;
}

.sct-guide-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

.sct-guide-head p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-faint);
}

.sct-guide {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px 24px;
}

.sct-day {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--rule);
}

.sct-guide .sct-day:first-child {
  border-top: 0;
}

.sct-day-head {
  align-self: start;
  position: sticky;
  top: 20px;
}

.sct-day-head h3 {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sct-day-weekday {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

.sct-day-date {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink-soft);
}

.sct-day-count {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.sct-episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  align-items: start;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sct-episode {
  min-width: 0;
  padding: 20px 20px 16px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(18, 22, 28, 0.04);
}

.sct-episode-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.sct-episode-no {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal-ink);
  font-variant-numeric: tabular-nums;
}

.sct-episode-kind {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #eef0ea;
  color: var(--ink-soft);
}

.sct-kind-paper {
  background: #e7edfb;
  color: #2547a8;
}

.sct-episode-title {
  margin: 10px 0 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.sct-episode-paper {
  margin: 6px 0 0;
}

.sct-episode-paper a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--sky) !important;
}

.sct-episode-paper a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sct-episode-embed {
  margin-top: 12px;
  min-width: 0;
}

.sct-episode-embed .twitter-tweet {
  margin: 0 auto !important;
  max-width: 100% !important;
}

/* Fallback while (or if) the X widget doesn't load */
.sct-episode-embed blockquote.twitter-tweet {
  padding: 14px 16px;
  border: 1px dashed var(--rule);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.sct-episode-embed blockquote.twitter-tweet a {
  display: inline-block;
  min-height: 40px;
  padding: 10px 0;
  line-height: 1.4;
  color: var(--sky);
}

.sct-empty {
  max-width: 1320px;
  margin: 0 auto;
  padding: 48px 32px 64px;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink-soft);
}

.sct-empty p {
  margin: 0;
}

/* Footer */

.sct-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  border-top: 4px solid var(--rule-strong);
  font-size: 15px;
  color: var(--ink-soft);
}

.sct-foot p {
  margin: 0;
}

.sct-foot-follow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink) !important;
}

.sct-foot-follow:hover {
  color: var(--signal-ink) !important;
}

/* Responsive */

@media (max-width: 960px) {
  .sct-masthead {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 32px;
  }

  .sct-day {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .sct-day-head {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
  }

  .sct-day-head h3 {
    flex-direction: row;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .sct-day-count {
    margin: 0;
  }
}

@media (max-width: 640px) {
  .sct-bar,
  .sct-masthead,
  .sct-guide-head,
  .sct-guide,
  .sct-empty,
  .sct-foot {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sct-bar-follow span {
    display: none;
  }

  .sct-bar-follow {
    min-width: 44px;
    justify-content: center;
  }

  .sct-masthead {
    padding-bottom: 36px;
  }

  .sct-lede {
    font-size: 17px;
  }

  .sct-day {
    padding: 24px 0;
  }

  .sct-day-weekday {
    font-size: 22px;
  }

  .sct-episode {
    padding: 16px 12px 12px;
  }

  .sct-episode-title {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sct-onair-dot {
    animation: none;
  }

  .sct *,
  .sct *::before,
  .sct *::after {
    transition: none !important;
  }
}
