/* ==========================================================================
   Pet Care by Ella — Availability page
   Lays out the shared explorer from availability.js (calendar first, the
   chosen day right below on phones, side by side when there is room) and
   the times-and-notice note. Role tokens only, so it follows dark mode.
   The start-time chips at the top are shared: book.html loads this file too.
   ========================================================================== */

/* ---------- Start-time chips (Availability and Book) ---------- */

/* Five to a row on a phone, more when there is room */
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr)); gap: .4rem; }
.time-chip {
  min-height: 44px;
  padding: .35rem .3rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.2;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, color .15s, border-color .15s;
}
.time-chip:hover { border-color: var(--text); }
.time-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.time-chip[data-slot="request"] { border-style: dashed; border-color: var(--control-border); }
.time-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); border-style: solid; color: var(--on-primary); }
/* Booked: crossed out on the same hatch as booked calendar days */
.time-chip[data-slot="booked"] {
  background: repeating-linear-gradient(135deg, transparent 0 5px, var(--hatch) 5px 6.5px), var(--bg);
  border-color: transparent;
  color: var(--text-3);
  text-decoration: line-through;
  cursor: not-allowed;
}
/* Too soon: faded, like days that can't be booked yet */
.time-chip[data-slot="past"], .time-chip[data-slot="unknown"] { background: transparent; border-color: transparent; color: var(--text-3); opacity: .55; cursor: default; }
.time-chip[aria-disabled="true"]:hover { border-color: transparent; }

/* ---------- Explorer ---------- */

[data-explore-panel] { align-content: start; }

/* Reserve the explorer's height while dates load, so nothing below jumps */
[data-availability-explorer].is-loading { min-height: 52rem; }
@media (min-width: 720px) { [data-availability-explorer].is-loading { min-height: 36rem; } }
.cal-skeleton { min-height: inherit; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); opacity: .55; }

/* 44px touch targets for the mode toggle and the month arrows */
[data-availability-explorer] .segmented label { min-height: 44px; }
[data-availability-explorer] .cal__nav button { width: 44px; height: 44px; }

/* Phones: a full-width toggle, and the month uses the whole column so every
   day is a comfortable tap target. The panel's request buttons go full width. */
@media (max-width: 719.98px) {
  [data-availability-explorer] .segmented { width: 100%; }
  [data-availability-explorer] > .card {
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
  }
  [data-explore-panel] .cluster > .btn { flex: 1 1 auto; }
}

/* Tablets (one month) and wide screens (two months): calendar on the left,
   the chosen day beside it. Between 980 and 1179px two months need the full
   width, so the panel stays underneath. */
@media (min-width: 720px) and (max-width: 979.98px), (min-width: 1180px) {
  [data-availability-explorer] {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: stretch;
  }
  [data-availability-explorer] > :first-child { grid-column: 1 / -1; }
  [data-explore-panel] .cluster > .btn { flex: 1 1 auto; }
}
@media (min-width: 1180px) {
  [data-availability-explorer] { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* The chosen day keeps its booked pattern, so it never reads as open */
[data-availability-explorer] .cal__day.is-start:is([data-state="booked"], [data-state="off"]) {
  background: repeating-linear-gradient(135deg, transparent 0 5px, var(--hatch) 5px 6.5px), var(--bg);
  border-color: var(--text);
  color: var(--text-2);
  text-decoration: line-through;
}
[data-availability-explorer] .cal__day.is-start:is([data-state="booked"], [data-state="off"]) .cal__peak { background: var(--star); }

/* ---------- Times and notice ---------- */

/* The legend under the calendar explains each day; this note only adds the
   start hours and notice. A time such as "7 PM" never splits across lines. */
.key__note { max-width: 34rem; }
[data-hours-first], [data-hours-last] { white-space: nowrap; }
