/* Kubo Signs staff page. Colours, type and the hard ink borders come from the
   Karaoke Kubo design system (the same tokens as the website theme). */

@font-face {
  font-family: "Eastman Condensed Alt";
  src: url("fonts/EastmanCondensedAlt-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url("fonts/Montserrat-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url("fonts/Montserrat-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #eeedea;
  --paper: #fffaf0;
  --white: #fff;
  --ink: #2f2f2f;
  --ink-soft: #5a5a5a;
  --hairline: #d9d6cf;
  --blue: #0062ef;
  --blue-deep: #0046b2;
  --yellow: #feb131;
  --yellow-soft: #ffe3a6;
  --pink: #fbb0ce;
  --pink-soft: #ffe0ec;
  --night: #0f0f1c;
  --red: #b3261e;
  --green: #1a7f4b;

  --display: "Eastman Condensed Alt", "Arial Narrow", sans-serif;
  --body: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
  --pop: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.wordmark {
  font-family: var(--display);
  font-size: 2.5rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 4px 4px 0 0 var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 120ms var(--pop);
}
.btn:hover {
  transform: translate(-1px, -1px);
}
.btn:active {
  transform: translate(1px, 1px);
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-warm {
  background: var(--yellow);
}
.btn-danger {
  background: var(--white);
  color: var(--red);
}
.btn[disabled] {
  background: var(--hairline);
  color: var(--ink-soft);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.link {
  white-space: nowrap;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--blue-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-danger {
  color: var(--red);
}

/* ---------- Page frame ---------- */

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 16px 8px;
}
.top-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}
.today {
  color: var(--ink-soft);
  font-weight: 700;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px 96px;
}
.loading,
.empty {
  padding: 48px 0;
  color: var(--ink-soft);
}
.empty .btn {
  margin-top: 16px;
}

.screens {
  display: grid;
  gap: 56px 40px;
}
@media (min-width: 900px) {
  .screens {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* ---------- One screen ---------- */

.screen-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.screen-name {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

/* The TV on the lobby wall: the one loud thing on the page. */
.tv {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 12px;
  box-shadow: 7px 7px 0 0 var(--ink);
  background: #000;
}
.tv img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tv-idle {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 16px;
  background: var(--night);
  color: var(--yellow);
  font-family: var(--display);
  font-size: clamp(1.5rem, 7vw, 3rem);
  text-align: center;
  text-transform: uppercase;
}

.status {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 18px;
  font-weight: 700;
}
.status-dot {
  flex: none;
  align-self: center;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--hairline);
}
.status--live .status-dot {
  background: var(--green);
}
.status--updating .status-dot {
  background: var(--yellow);
}
.status--offline {
  color: var(--red);
}
.status--offline .status-dot {
  background: var(--red);
}
.status-detail {
  margin-left: 4px;
  color: var(--ink-soft);
  font-weight: 400;
}

.lineup {
  margin-top: 20px;
  border-top: 2px solid var(--ink);
}
.slot {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 6px 14px;
  padding: 16px 0;
  border-bottom: 2px solid var(--ink);
}
.slot-thumb {
  grid-row: span 2;
  align-self: start;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #000;
}
.slot-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.slot-label {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tag {
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--yellow);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}
.slot-fit {
  grid-column: 2;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  grid-column: 1 / -1;
  margin-top: 8px;
}
.day {
  padding: 5px 0 4px;
  border: 2px solid var(--hairline);
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}
.day--on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}
.day--today {
  box-shadow: 0 4px 0 0 var(--yellow);
}

.slot-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  grid-column: 1 / -1;
  margin-top: 12px;
}

.gap-warning {
  margin-top: 14px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow-soft);
  font-size: 0.9375rem;
}

.add-image {
  width: 100%;
  margin-top: 18px;
  box-shadow: none;
  border-style: dashed;
  background: transparent;
}

/* ---------- Under the screens ---------- */

.below {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}
.below-note {
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.library {
  margin-top: 40px;
}
.library summary {
  width: fit-content;
  font-family: var(--display);
  font-size: 1.5rem;
  text-transform: uppercase;
  cursor: pointer;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px 16px;
  margin-top: 16px;
}
.tile img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #000;
}
.tile-label {
  margin-top: 6px;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tile-meta {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

/* ---------- Sheet (the editing panel) ---------- */

.sheet {
  width: min(100%, 540px);
  max-width: none;
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  overflow-y: auto;
  border: 4px solid var(--ink);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--paper);
  color: var(--ink);
}
.sheet::backdrop {
  background: rgba(15, 15, 28, 0.6);
}
@media (min-width: 640px) {
  .sheet {
    margin: auto;
    border-bottom: 4px solid var(--ink);
    border-radius: 18px;
    box-shadow: 8px 8px 0 0 var(--ink);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet[open] {
    animation: rise 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  @keyframes rise {
    from {
      transform: translateY(24px);
      opacity: 0;
    }
  }
}
/* Padding lives on the body, so a click on the dialog itself is always the dimmed area. */
.sheet-body {
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .sheet-body {
    padding: 28px;
  }
}
.sheet-title:focus {
  outline: none; /* focused by script so the panel starts at the top; it isn't a tab stop */
}
.sheet-title {
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 1.05;
  text-transform: uppercase;
}
.sheet-lead {
  margin-top: 6px;
  color: var(--ink-soft);
}
.sheet-preview {
  width: 100%;
  margin-top: 16px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: #000;
}
.stack {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}
.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
}
.field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  font-weight: 400;
}
.field-help {
  color: var(--ink-soft);
  font-size: 0.875rem;
  font-weight: 400;
}
.address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
}
.day-toggle {
  min-height: 52px;
  padding: 0;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  background: var(--white);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}
.day-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}
.picker-note {
  min-height: 1.5em;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}
.sheet-actions .spacer {
  flex: 1;
}
.sheet-error,
.alert {
  padding: 10px 12px;
  border: 2px solid var(--red);
  border-radius: 8px;
  background: var(--white);
  color: var(--red);
  font-weight: 700;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px 12px;
  margin-top: 10px;
}
.choice {
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.choice img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #000;
}
.choice span {
  display: block;
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(calc(100% - 32px), 520px);
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 5px 5px 0 0 var(--ink);
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  transform: translateX(-50%);
}
.toast[hidden] {
  display: none;
}
.toast--error {
  background: var(--white);
  color: var(--red);
}
.toast-text {
  flex: 1;
}
.toast .link {
  color: var(--yellow);
  white-space: nowrap;
}

/* ---------- Login ---------- */

.door {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 16px;
}
.door-card {
  width: min(100%, 400px);
  padding: 28px 24px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 7px 7px 0 0 var(--ink);
  background: var(--paper);
}
.door-lead {
  margin-top: 6px;
  color: var(--ink-soft);
}
.door-card .alert {
  margin-top: 16px;
}
.door-card > .btn {
  margin-top: 20px;
}
