/* Version 2 of the Availability Overview (address /v2): a shorter top, and white lodge rows
   with the lodge's logo and place on the left and its collection's logo on the right. */

/* Top: the page name in the middle, a smaller GoBookingDirect logo on the right */
.v2 .top { padding-top: 10px; padding-bottom: 10px; }
.v2 .top .wrap { display: grid; grid-template-columns: 1fr auto 1fr; }
.v2 .top h1 { grid-column: 2; }
.v2 .offered { grid-column: 3; justify-self: end; gap: 2px; font-size: 11px; line-height: 14px; }
.v2 .offered img { width: 130px; }

/* Dates and period: one low row */
.v2 .controls { padding-top: 10px; padding-bottom: 10px; }
.v2 .controls .wrap { align-items: center; }
.v2 .controls form { flex-direction: row; align-items: center; gap: 12px; }
.v2 .controls input[type="date"], .v2 .controls button { height: 36px; }
.v2 .arrow { width: 36px; height: 36px; }
.v2 .views a { height: 34px; }
.v2 .updated { height: 36px; }
.v2 main { padding-top: 14px; }

/* The lodge's row: white with a grey line above and below. It stays as wide as the part of the grid
   in view, so the collection's logo is on the right however far the dates are scrolled. */
.v2 .scroll { container-type: inline-size; }
.v2 .band th { height: 72px; background: #fff; border-bottom: 1px solid var(--hairline); box-shadow: inset 0 1px 0 var(--hairline); }
.v2 .band-row { position: sticky; left: 0; width: 100cqw; max-width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; }
.v2 .band-name { position: static; padding: 0; min-width: 0; }
.v2 .band-logo { height: 52px; padding: 0; border-radius: 0; background: none; }
.v2 .band-client { flex: none; display: block; height: 52px; width: auto; }

@media (max-width: 760px) {
  .v2 .top .wrap { display: flex; justify-content: space-between; text-align: left; }
  .v2 h1 { width: auto; font-size: 18px; }
  .v2 .offered img { width: 110px; }
  .v2 .band th { height: 56px; }
  .v2 .band-logo, .v2 .band-client { height: 34px; }
  .v2 .band-name { gap: 8px; }
  .v2 .band-row { padding: 0 10px; gap: 8px; }
}

/* Numbers: light green where rooms are free, plain grey with no number where fully booked,
   and Saturdays and Sundays look like every other day */
.v2 { --free: #e0f1e2; }
.v2 h1 { font-size: 30px; line-height: 38px; }
.v2 th.day.weekend { background: #fff; }
.v2 tbody td, .v2 td.weekend { background: var(--free); border-bottom-color: #fff; }
.v2 td.last { background: var(--last); }
.v2 td.full { background: var(--full); font-size: 0; }
.v2 td.full small { font-size: 11px; }
.v2 tbody td.qty, .v2 td.unknown, .v2 tbody td.note { background: #fff; border-bottom-color: var(--soft); }
.v2 .key { background: var(--free); border-color: var(--free); }
.v2 .key.last { background: var(--last); border-color: var(--last); }
.v2 .key.full { background: var(--full); border-color: var(--full); font-size: 0; }
.v2 .key.held { background: #fff; border-color: var(--soft); }
@media (max-width: 760px) { .v2 h1 { font-size: 22px; line-height: 30px; } }
/* A wide collection logo never pushes the lodge's own logo out of its row */
.v2 .band-client { max-width: 48%; object-fit: contain; object-position: right center; }

/* On a computer the page itself scrolls (no scroll bar inside the grid); the title, the date controls
   and the row of dates stay at the top. In Month view the page also scrolls sideways. */
@media (min-width: 761px) {
  .v2 .frozen { position: sticky; top: 0; z-index: 40; width: var(--page-w, 100%); background: #fff; transform: translateX(var(--page-x, 0)); }
  .v2 .userbar { width: var(--page-w, 100%); transform: translateX(var(--page-x, 0)); }
  .v2 .scroll { overflow: visible; max-height: none; border-radius: 0; }
  .v2 thead th { top: var(--frozen-h, 120px); }
}

/* Each night is its own box: a white line between the days and between the room types */
.v2 tbody td:not(.qty):not(.note) { border-right: 2px solid #fff; border-bottom: 2px solid #fff; }

/* The dates on three lines: the day of the week, the day, the month */
.v2 thead th { height: 68px; }
.v2 th.day { line-height: 17px; }
.v2 th.day span { font-weight: 400; font-size: 12px; color: var(--muted); }
.v2 th.day b { display: block; font-size: 15px; font-weight: 600; }
.v2 th.day small { display: block; font-size: 12px; color: var(--muted); }
.v2 th.day.today span, .v2 th.day.today small { color: var(--held); }

/* White bold numbers in the boxes, on colours deep enough to read them; the Qty beside the room stays black */
.v2 { --free: #7aa65f; --last: #cc9632; }
.v2 tbody td:not(.qty):not(.note):not(.unknown) { color: #fff; font-size: 15px; font-weight: 700; }
.v2 tbody td small { color: #fff; }
.v2 .key { color: #fff; font-weight: 700; }
.v2 .key.held { color: var(--held); font-weight: 600; }
.v2 tbody td.full:not(.qty):not(.note):not(.unknown) { font-size: 0; }
.v2 tbody td.full small { font-size: 11px; color: var(--ink-2); }

/* The collection's logo sits beside the lodge's own logo, smaller, with a fine line between the two */
.v2 .band-row { justify-content: flex-start; }
.v2 .band-name { display: flex; align-items: center; gap: 14px; }
.v2 .band-client { height: 26px; max-width: 220px; padding-left: 14px; border-left: 1px solid var(--hairline); box-sizing: content-box; object-position: left center; }
@media (max-width: 760px) {
  .v2 .band-client { height: 18px; max-width: 110px; padding-left: 8px; }
  .v2 .band-name { gap: 8px; }
}

/* On a computer the grid is as wide as the window and no wider: the days share the room that is left.
   Month shows 28 days, so there the lodge's picture is narrower. Only a window too narrow for even
   small boxes scrolls sideways. */
@media (min-width: 761px) {
  .v2 table { table-layout: fixed; min-width: calc(var(--lodge-w) + var(--room-w) + var(--qty-w) + var(--days) * var(--day-min, 34px)); }
  .v2 thead th.day, .v2 tbody td { min-width: 0; }
  .v2.view-week { --days: 7; }
  .v2.view-2weeks { --days: 14; }
  .v2.view-month { --days: 28; --day-min: 22px; --lodge-w: 130px; }
  .v2.view-month thead .lodge-cell { padding: 0 10px; }
  .v2.view-month tbody td small { font-size: 9px; letter-spacing: -0.02em; }
}
/* A small window: a narrower picture still, and slightly smaller figures in Month, so they stay inside their boxes */
@media (min-width: 761px) and (max-width: 1150px) {
  .v2.view-month { --lodge-w: 84px; }
  .v2.view-month thead .lodge-cell { font-size: 9px; letter-spacing: 0.1em; }
  .v2.view-month tbody td:not(.qty):not(.note):not(.unknown):not(.full) { font-size: 13px; }
  .v2.view-month th.day span, .v2.view-month th.day small { font-size: 10px; }
  .v2.view-month th.day b { font-size: 13px; }
}

/* Month needs room for 28 days: on a window too narrow for them (tablets held upright, phones) it is not offered */
@media (max-width: 1023px) {
  .v2 .views a[data-view="month"] { display: none; }
}
/* A tablet held upright: 2 weeks still fits, with a narrower picture and slightly smaller dates */
@media (min-width: 761px) and (max-width: 1023px) {
  .v2.view-2weeks { --lodge-w: 80px; --day-min: 25px; }
  .v2.view-2weeks thead .lodge-cell { padding: 0 8px; font-size: 9px; letter-spacing: 0.1em; }
  .v2.view-2weeks th.day span, .v2.view-2weeks th.day small { font-size: 11px; }
}

/* The lodge's row: its logo, the collection's logo and the place are spread across the width of the
   three columns below it (lodge, room type, quantity). The row of headings above is unchanged. */
@media (min-width: 761px) {
  .v2 .band-row { padding: 0; }
  .v2 .band-name { box-sizing: border-box; width: calc(var(--lodge-w) + var(--room-w) + var(--qty-w)); padding: 0 16px; justify-content: space-between; }
  .v2 .band-name small { white-space: nowrap; }
  .v2 .band-client { flex: 0 1 auto; min-width: 0; }
  .v2 .band-move { margin-right: 0; }
}
/* Where those three columns are narrow (Month, a small window), a wide lodge logo gives way a little,
   so the collection's logo beside it stays readable */
@media (min-width: 761px) {
  .v2.view-month .band-logo img { max-width: 130px; }
}
@media (min-width: 761px) and (max-width: 1150px) {
  .v2.view-month .band-logo img, .v2.view-2weeks .band-logo img { max-width: 105px; }
  .v2.view-month .band-name small { font-size: 12px; }
}
@media (min-width: 761px) and (max-width: 1023px) {
  .v2 .band-name small { font-size: 12px; }
}

/* Edit mode: the handle for changing the order of the lodges sits at the right end of the lodge's row */
.v2 .band-row .band-move { flex: none; margin-left: auto; margin-right: 16px; }
@media (max-width: 760px) { .v2 .band-row .band-move { margin-right: 0; } }

/* No line between the lodge's logo and the collection's */
.v2 .band-client { border-left: 0; padding-left: 0; }

/* The handle for arranging the lodges, on the page itself: quiet until the row is pointed at */
.v2 .band-move { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--hairline); border-radius: 8px; background: #fff; color: var(--ink-2); }
.v2 .band-move .grip { display: grid; place-items: center; width: 30px; height: 30px; cursor: grab; }
.v2 .band-move .grip:active { cursor: grabbing; }
.v2 .band-move button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: none; color: inherit; cursor: pointer; }
.v2 .band-move button:hover:not(:disabled), .v2 .band-move .grip:hover { background: var(--steel-soft); }
.v2 .band-move button:disabled { opacity: 0.3; cursor: default; }
.v2 tbody.moving { opacity: 0.45; }
.v2:not(.editing) .band-move { border-color: transparent; color: var(--muted); }
.v2:not(.editing) .band:hover .band-move, .v2:not(.editing) .band-move:focus-within { border-color: var(--hairline); color: var(--ink-2); }
#order-reset { padding: 0; border: 0; background: none; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }
#order-reset[hidden] { display: none; }
/* Touch screens have no dragging by a handle: the arrows do it */
@media (max-width: 760px) { .v2 .band-move .grip { display: none; } .v2 .band-move button { width: 28px; height: 28px; } }
