/* The month calendar and the chosen day's times (slot-calendar.js), shared by the
   public booking page and admin New session. Colours come from the website palette
   (site.css); the fallbacks are the same colours, for pages without it (admin). */

.slot-groups {
  display: grid;
  gap: 0;
}

.time-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.time-option {
  border: 1.5px solid var(--line, #8a8270);
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0.65rem 0.5rem;
  background: var(--surface, #ffffff);
  color: var(--ink, #183042);
  font-size: 0.9rem;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.time-option:hover {
  border-color: var(--green, #2a5442);
}

.time-option:focus-visible {
  outline: 3px solid var(--gold, #ba8a4e);
  outline-offset: 3px;
}

.time-option[aria-pressed="true"] {
  border-color: var(--forest, #2a5442);
  background: var(--forest, #2a5442);
  color: var(--cream, #f4efe6);
  box-shadow: none;
}

.calendar {
  max-width: 24rem;
  margin-top: 1rem;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.calendar-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.calendar-nav {
  width: 2.75rem;
  height: 2.75rem;
  border: 1.5px solid var(--line, #8a8270);
  border-radius: 50%;
  background: var(--surface, #ffffff);
  color: var(--navy, #183042);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.calendar-nav:hover:not(:disabled) {
  border-color: var(--navy, #183042);
  background: var(--cream-2, #eae2d3);
}

.calendar-nav:focus-visible,
.calendar-day:focus-visible {
  outline: 3px solid var(--gold, #ba8a4e);
  outline-offset: 3px;
}

.calendar-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.3rem;
}

.calendar-weekday {
  padding: 0.25rem 0;
  text-align: center;
  color: var(--muted, #3b4d58);
  font-size: 0.78rem;
  font-weight: 700;
}

.calendar-day {
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #7d7563;
  font-size: 0.95rem;
}

button.calendar-day {
  border-color: var(--forest, #2a5442);
  background: var(--surface, #ffffff);
  color: var(--navy, #183042);
  font-weight: 800;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

/* Admin: a day that can be chosen but has none of the usual free times */
button.calendar-day:not(.has-times) {
  border-style: dashed;
  border-color: var(--line, #8a8270);
  font-weight: 600;
}

button.calendar-day:hover {
  border-color: var(--navy, #183042);
  background: var(--cream-2, #eae2d3);
}

button.calendar-day[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--forest, #2a5442);
  background: var(--forest, #2a5442);
  color: var(--cream, #f4efe6);
}

.calendar-hint {
  margin: 0.9rem 0 0;
  color: var(--muted, #3b4d58);
  font-size: 0.92rem;
}

.day-times {
  max-width: 24rem;
  margin-top: 1rem;
}

.day-times h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.skeleton-cell {
  min-height: 2.75rem;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--cream-2, #eae2d3) 25%, var(--paper, #fbf8f2) 50%, var(--cream-2, #eae2d3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-title {
  width: 9rem;
  height: 1.6rem;
  margin: 0.55rem 0 1.2rem;
  border-radius: 6px;
  background: var(--cream-2, #eae2d3);
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-cell {
    animation: none;
  }
}

/* Phones: the times sit below the calendar. Wider screens: side by side. */
.slot-layout {
  display: block;
}

@media (min-width: 48.01rem) {
  .slot-layout {
    display: grid;
    grid-template-columns: 24rem minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }

  .slot-layout .day-times {
    margin-top: 1rem;
  }
}

@media (max-width: 42rem) {
  .time-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
