/* MOONLIGHT WORLD — Thomas edge appearance for THE DAILY SCHEDULE.
   Required artwork (transparent PNG):
   assets/images/thomas/thomas-left.png
   assets/images/thomas/thomas-right.png
*/

.schedule-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
}

/* The artwork sits in the side gutters and never intercepts pointer events. */
.thomas-appearance-layer {
  position: absolute;
  z-index: 3;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.schedule-thomas {
  position: absolute;
  bottom: 22px;
  display: block;
  width: clamp(170px, 13.8vw, 210px);
  max-height: min(460px, 76%);
  height: auto;
  object-fit: contain;
  object-position: bottom center;
  opacity: 0;
  visibility: hidden;
  filter: drop-shadow(0 15px 28px rgba(9, 5, 20, .48)) drop-shadow(0 0 22px rgba(170, 137, 255, .2));
  transition:
    transform .78s cubic-bezier(.2, .72, .18, 1),
    opacity .48s ease,
    visibility 0s linear .78s;
  will-change: transform, opacity;
}

.schedule-thomas--left {
  left: 0;
  transform: translate3d(-112%, 18px, 0) rotate(-3deg);
}

.schedule-thomas--right {
  right: 0;
  transform: translate3d(112%, 18px, 0) rotate(3deg);
}

.schedule-thomas.is-loaded {
  visibility: visible;
}

.schedule-stage.is-thomas-visible .schedule-thomas.is-loaded {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0);
  transition-delay: 0s;
}

/* Keep the timeline in the center column, leaving clear space for Thomas. */
.schedule-content {
  position: relative;
  z-index: 2;
  width: min(100%, 980px);
  margin-inline: auto;
  padding-bottom: 62px;
}

.thomas-appearance-toggle {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 15px;
  border: 1px solid rgba(200, 187, 255, .24);
  border-radius: 999px;
  color: #d9ccf2;
  background: rgba(29, 21, 48, .88);
  box-shadow: 0 8px 22px rgba(4, 2, 12, .2), inset 0 1px 0 rgba(255,255,255,.07);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  font: 800 9px/1 Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: .13em;
  white-space: nowrap;
  cursor: pointer;
  transform: translateX(-50%);
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.thomas-appearance-toggle:hover,
.thomas-appearance-toggle:focus-visible {
  color: #fff;
  border-color: rgba(200, 187, 255, .58);
  background: rgba(89, 62, 133, .72);
  box-shadow: 0 0 24px rgba(167, 139, 250, .2);
  outline: none;
}

.thomas-appearance-toggle:focus-visible {
  outline: 2px solid #c8bbff;
  outline-offset: 3px;
}

/* At tablet widths, move the transparent characters into a reserved bottom
   pocket so they cannot cover the time labels or activity text. */
@media (max-width: 1399px) {
  .schedule-content {
    width: 100%;
    padding-bottom: 206px;
  }

  .schedule-thomas {
    bottom: 0;
    width: clamp(132px, 16vw, 188px);
    max-height: 194px;
  }

  .schedule-thomas--left { left: 5px; }
  .schedule-thomas--right { right: 5px; }

  .schedule-thomas--left {
    transform: translate3d(-116%, 14px, 0) rotate(-3deg);
  }
  .schedule-thomas--right {
    transform: translate3d(116%, 14px, 0) rotate(3deg);
  }
  .schedule-stage.is-thomas-visible .schedule-thomas.is-loaded {
    transform: translate3d(0, 0, 0) rotate(0);
  }
}

@media (max-width: 760px) {
  .schedule-content { padding-bottom: 184px; }
  .schedule-thomas {
    width: clamp(100px, 28vw, 132px);
    max-height: 166px;
  }
  .thomas-appearance-toggle {
    bottom: 12px;
    min-height: 31px;
    padding: 7px 12px;
    font-size: 8px;
  }
}

@media (max-width: 390px) {
  .schedule-content { padding-bottom: 164px; }
  .schedule-thomas {
    width: 102px;
    max-height: 146px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .schedule-thomas,
  .thomas-appearance-toggle {
    transition: none !important;
  }
}
