@import url('ranks-landscape.css');

/* Ranked hours (screens/ranked-hours-view.js): the Open now light, the
   opening time with its countdown, and Count me in. */

/* Laid over the top of its button, so lighting it never moves anything. */
.has-hours-light {
  position: relative;
}

.hours-light {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -60%);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.5;
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--ok);
  background: var(--bg-0);
  border: 1px solid color-mix(in srgb, var(--ok) 55%, transparent);
  border-radius: 999px;
  pointer-events: none;
}

.hours-light[hidden] {
  display: none;
}

.hours-light__dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: hours-glow 2.4s ease-in-out infinite;
}

@keyframes hours-glow {
  50% {
    opacity: 0.45;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion='full']) .hours-light__dot {
    animation: none;
  }
}

:root[data-motion='reduced'] .hours-light__dot {
  animation: none;
}

/* Two lines, always: when, then the countdown and the count. Their height
   is kept even when empty, so the buttons below never move. */
.hours-line {
  display: grid;
  align-content: center;
  min-height: calc(2 * 1.4em);
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.4;
  text-align: center;
  color: var(--text-dim);
}

.hours-line__when {
  color: var(--text);
}

.hours-line[data-state='open'] .hours-line__when {
  color: var(--ok);
}

.hours-line__coming:not(:empty)::before {
  content: ' · ';
}

.hours-line[data-state='none'] {
  visibility: hidden;
}

/* Counted in: quieter, and says so. */
.hours-count[aria-pressed='true'] {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 55%, transparent);
}

/* The menu's line shares the status line's place (menu.js), one line high. */
.menu__status-slot {
  display: grid;
}

.menu__status-slot > * {
  grid-area: 1 / 1;
}

.hours-menu-line {
  margin: 0;
  align-self: center;
  font-size: var(--text-sm);
  text-align: center;
  color: var(--text-dim);
}

.hours-menu-line[data-state='open'] {
  color: var(--ok);
}

.hours-menu-line[hidden] {
  display: none;
}

/* Narrow screens: smaller, so even the longest line stays on one line. */
@media (max-width: 420px) {
  .hours-menu-line {
    font-size: var(--text-xs);
  }
}

/* Ranked hours' Open now light rides beside the Ranked word, inside its button,
   so lighting it never moves another item (ranked-hours.css draws the light). */
.menu__item .hours-light {
  position: static;
  transform: none;
  margin-left: var(--space-3);
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0.04em;
  font-weight: 600;
}
