/**
 * Compact row layout for the asset reservations block on tool pages.
 *
 * Higher specificity (body prefix) overrides the legacy inline <style>
 * card-grid CSS injected from the view footer.
 */

body .block-views-blockreservatioubs-asset-reservations-block .view-content {
  display: block;
  flex-wrap: initial;
  gap: 0;
  justify-content: initial;
}

body .block-views-blockreservatioubs-asset-reservations-block .views-row {
  flex: initial;
  max-width: none;
  min-width: 0;
  padding-bottom: 0.5rem;
  display: block;
}

body .block-views-blockreservatioubs-asset-reservations-block .views-row + .views-row {
  margin-top: 0.5rem;
}

.mh-reservation-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.65rem 0.9rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-left: 4px solid #ced4da;
  border-radius: 6px;
  transition: box-shadow 0.15s ease-in-out;
}

.mh-reservation-row:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mh-reservation-row__icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  color: #6c757d;
  font-size: 1rem;
}

.mh-reservation-row__main {
  min-width: 0;
}

.mh-reservation-row__when {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  font-weight: 600;
  color: #212529;
  line-height: 1.25;
}

.mh-reservation-row__date {
  font-weight: 600;
}

.mh-reservation-row__time {
  font-weight: 500;
  color: #495057;
}

.mh-reservation-row__relative {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: #e9ecef;
  color: #495057;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mh-reservation-row__meta {
  margin-top: 0.15rem;
  font-size: 0.9rem;
  color: #6c757d;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  line-height: 1.3;
}

.mh-reservation-row__meta a {
  color: #495057;
  text-decoration: none;
  border-bottom: 1px dotted #adb5bd;
}

.mh-reservation-row__meta a:hover {
  color: #212529;
  border-bottom-color: #495057;
}

.mh-reservation-row__divider {
  color: #adb5bd;
}

.mh-reservation-row__badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff3cd;
  color: #664d03;
  border: 1px solid #ffe69c;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mh-reservation-row__badge--cancelled {
  background: #f8d7da;
  color: #842029;
  border-color: #f5c2c7;
}

.mh-reservation-row__badge--yours {
  background: #cfe2ff;
  color: #084298;
  border-color: #b6d4fe;
}

.mh-reservation-row__action {
  align-self: center;
  white-space: nowrap;
}

.mh-reservation-row__action a {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #495057;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  text-decoration: none;
  transition: background-color 0.15s ease-in-out;
}

.mh-reservation-row__action a:hover {
  background: #e9ecef;
  color: #212529;
}

/* Today: subtle accent left border. */
.mh-reservation-row--today {
  border-left-color: #0d6efd;
  background: #f5f9ff;
}

.mh-reservation-row--today .mh-reservation-row__relative {
  background: #cfe2ff;
  color: #084298;
}

/* Happening now: stronger accent. */
.mh-reservation-row--now {
  border-left-color: #198754;
  background: #f0fdf4;
}

.mh-reservation-row--now .mh-reservation-row__icon {
  background: #d1e7dd;
  color: #0f5132;
  border-color: #badbcc;
}

.mh-reservation-row--now .mh-reservation-row__relative {
  background: #198754;
  color: #fff;
}

/* Past (ended): muted. */
.mh-reservation-row--past {
  opacity: 0.65;
  border-left-color: #adb5bd;
}

.mh-reservation-row--past .mh-reservation-row__relative {
  background: #e9ecef;
  color: #6c757d;
}

@media (max-width: 576px) {
  .mh-reservation-row {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .mh-reservation-row__action {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

/* 7-day availability strip above the reservation list. */
.mh-reservation-timeline {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 0.85rem;
}

.mh-reservation-timeline__day {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.2;
}

.mh-reservation-timeline__day--weekend {
  background: #fafbfc;
}

.mh-reservation-timeline__day--today {
  border-color: #0d6efd;
  background: #f5f9ff;
  box-shadow: inset 0 0 0 1px #0d6efd;
}

.mh-reservation-timeline__label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #495057;
}

.mh-reservation-timeline__dow {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: #6c757d;
}

.mh-reservation-timeline__day--today .mh-reservation-timeline__dow {
  color: #0d6efd;
}

.mh-reservation-timeline__date {
  font-weight: 600;
  color: #343a40;
}

.mh-reservation-timeline__bar {
  position: relative;
  height: 6px;
  background: #e9ecef;
  border-radius: 999px;
  overflow: hidden;
  margin: 2px 2px;
}

.mh-reservation-timeline__block {
  position: absolute;
  top: 0;
  height: 100%;
  background: #6c757d;
  border-radius: 999px;
}

.mh-reservation-timeline__day--today .mh-reservation-timeline__block {
  background: #0d6efd;
}

.mh-reservation-timeline__count {
  font-size: 0.7rem;
  color: #6c757d;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mh-reservation-timeline__day--booked .mh-reservation-timeline__count {
  color: #495057;
}

.mh-reservation-timeline__day--booked.mh-reservation-timeline__day--today .mh-reservation-timeline__count {
  color: #0d6efd;
}

@media (max-width: 576px) {
  .mh-reservation-timeline {
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
  }
  .mh-reservation-timeline__day {
    padding: 4px 2px;
    font-size: 0.65rem;
  }
  .mh-reservation-timeline__date {
    font-size: 0.7rem;
  }
}
