/* ==========================================================================
   Listing page: the hours band (owner handoff 2026-11-19, "Business hours band", boards J1 / J1m; docs/IP-Reference.md section CG, registry L29)
   ==========================================================================
   Loaded by web/listing-detail.blade.php alone, after web.css, so no other page can be touched by it. Every selector starts from a class that exists only
   here (.listing-hours-band*). Colours, radii and spacing are tokens; the few numbers the boards draw that have NO token (the 20px side padding, the
   9px tile padding, the 36px row, the 2px line gap) are kept exactly as drawn and gathered in the custom properties just below.
   THE PAGE'S OWN LOOK WINS OVER THE BOARDS (owner 2026-11-20, from the live page; docs section CI): every corner here is the map's corner
   (--radius-md, 8px - the box and the tiles; the boards drew 16px and 10px), nothing casts a shadow, and the title is the page's section title - the
   same class as "Photo gallery" (web.css .listing-section__title: the h4 tokens in the ink), set in the partial, so this file gives it no font or colour.
   The ONE colour that is not a token: the boards' #f8f8f8 background (the handoff's open point 6). It is written as var(--surface-50, #f8f8f8) - the
   proposed token name - so the day the owner adds --surface-50 to tokens.css the band follows it, and until then the fallback is the boards' value.

   Two layouts, one markup: a row of seven tiles when the band is wide, a list of grouped rows when it is not. WIDE / NARROW IS DECIDED BY THE BAND'S OWN
   WIDTH (a container query on .listing-hours-band), not by the screen: the left column is 748px on a big screen, 548px beside the card on a small
   desktop, 720px on a tablet and as wide as the phone below that, and seven tiles with "12 pm - 5 pm" on one line need about 700px (the handoff's open
   point 1). A browser without container queries simply keeps the narrow list everywhere. */

.listing-hours-band {
  container-type: inline-size;
}

.listing-hours-band__box {
  --hours-band-bg: var(--surface-50, #f8f8f8); /* not a design-system token yet (open point 6) - proposed name: --surface-50 */
  --hours-pad-x: 20px;       /* the wide layout's side padding (boards J1) - no token */
  --hours-tile-pad-y: 9px;   /* above and below a tile's two lines - no token */
  --hours-row-height: 36px;  /* a row of the narrow list - no token */
  --hours-line-gap: 2px;     /* a tile's two lines, the narrow title and status, the narrow rows - no token */
  box-sizing: border-box;
  padding: var(--space-4, 16px);
  background: var(--hours-band-bg);
  border: 1px solid var(--border, #dedede);
  border-radius: var(--radius-md, 8px); /* the map's corner (web.css .listing-map-card #map_canvas_sidebar) - ListingHoursBandCssTest keeps the two the same */
  color: var(--ink, #44555b);
  font-family: var(--font-sans);
}

/* The title and the status: stacked on a narrow band, one row (title left, status right) on a wider one. */
.listing-hours-band__head {
  display: flex;
  flex-direction: column;
  gap: var(--hours-line-gap);
}
/* The title's size, weight, family and colour are the page's section title's (.listing-section__title, the class the partial gives it - the same as
   "Photo gallery"); only that class's 16px bottom margin is taken back here, because the title shares its row with the status. */
.listing-hours-band .listing-hours-band__title {
  margin: 0;
}
.listing-hours-band__status {
  margin: 0;
  font: 700 14px/20px var(--font-sans);
  color: var(--ink, #44555b);
}
.listing-hours-band__status--open {
  color: var(--success-text, #294a09);
}

/* The narrow layout: a list, one row per run of equal days. Also what an older listing with free-text hours always shows. */
.listing-hours-band__rows,
.listing-hours-band__text {
  display: flex;
  flex-direction: column;
  gap: var(--hours-line-gap);
  margin: var(--space-3, 12px) 0 0;
  padding: 0;
  list-style: none;
}
.listing-hours-band__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 16px);
  min-height: var(--hours-row-height);
  padding: 0 10px;
  border-radius: var(--radius-md, 8px);
}
.listing-hours-band__row--today {
  background: var(--badge-sponsored-bg, #e6eff7);
}
.listing-hours-band__row--text {
  justify-content: flex-start;
  font: 400 14px/20px var(--font-sans);
}
.listing-hours-band__row-day {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  font: 900 14px/20px var(--font-sans);
  color: var(--button-primary-active, #224b6d);
}
.listing-hours-band__row-time {
  font: 700 14px/20px var(--font-sans);
  color: var(--ink, #44555b);
  text-align: right;
}
.listing-hours-band__row--closed .listing-hours-band__row-time {
  font-weight: 400;
  color: var(--ink-muted, #757575);
}
.listing-hours-band__today-pill {
  padding: 0 var(--space-2, 8px);
  font: 700 12px/16px var(--font-sans);
  color: var(--brand-blue-dark, #295b84);
  background: var(--surface, #ffffff);
  border-radius: var(--radius-pill, 999px);
}

/* The wide layout's tiles are in the page too; the narrow band does not show them. */
.listing-hours-band__tiles {
  display: none;
}

@container (min-width: 480px) {
  .listing-hours-band__head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4, 16px);
  }
}

/* Wide: seven equal tiles, Monday to Sunday, 4px apart. A tile is two centred lines - the day's short name, then its hours on one line (a time with
   minutes that does not fit wraps inside the tile instead of being cut). Today's tile has the light-blue fill; a closed day says "Closed" in the
   regular weight and the muted ink; a day nobody listed shows a dash the same way. */
@container (min-width: 700px) {
  .listing-hours-band__box {
    padding: var(--space-4, 16px) var(--hours-pad-x) var(--hours-pad-x);
  }
  .listing-hours-band__rows {
    display: none;
  }
  .listing-hours-band__tiles {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: var(--space-1, 4px);
    margin: var(--space-3, 12px) 0 0;
    padding: 0;
    list-style: none;
  }
  .listing-hours-band__tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hours-line-gap);
    box-sizing: border-box;
    min-width: 0;
    padding: var(--hours-tile-pad-y) var(--space-1, 4px);
    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #dedede);
    border-radius: var(--radius-md, 8px); /* the same corner as the box and the map */
    text-align: center;
  }
  .listing-hours-band__tile--today {
    background: var(--badge-sponsored-bg, #e6eff7);
  }
  .listing-hours-band__tile-day {
    font: 900 14px/20px var(--font-sans);
    color: var(--button-primary-active, #224b6d);
  }
  .listing-hours-band__tile-time {
    font: 700 14px/20px var(--font-sans);
    color: var(--ink, #44555b);
  }
  .listing-hours-band__tile--closed .listing-hours-band__tile-time,
  .listing-hours-band__tile--unknown .listing-hours-band__tile-time {
    font-weight: 400;
    color: var(--ink-muted, #757575);
  }
}
