body {
  font-family: Arial, sans-serif;
  margin: 24px;
  color: #222;
}

h1, h2 {
  margin-bottom: 8px;
}

.updated {
  color: #666;
  margin-bottom: 24px;
}

.table-wrap {
  overflow-x: auto;
  margin-bottom: 32px;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
  margin-top: 12px;
}

th, td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: center;
  white-space: nowrap;
}

th:first-child, td:first-child {
  text-align: left;
  font-weight: bold;
  position: sticky;
  left: 0;
  background: white;
}

.status {
  font-weight: bold;
  color: white;
}

.available {
  background: #2e8b57;
}

.limited {
  background: #d9a441;
}

.full {
  background: #b33a3a;
}

.helper {
  color: #666;
  margin-top: -4px;
  margin-bottom: 8px;
}

.dow {
  display: block;
  font-size: 11px;
  color: #666;
  font-weight: normal;
}

.date-month {
  display: block;
  font-size: 11px;
}

.date-day {
  display: block;
  font-size: 14px;
  font-weight: bold;
}

.facility-detail {
  margin-bottom: 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px;
  background: #fafafa;
}

.facility-detail summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
}

.facility-detail[open] {
  background: white;
}

.some {
  background: #8fbf5f;
}

.facility-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-top: 28px;
}

.facility-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.facility-actions button {
  border: 1px solid #bbb;
  background: white;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: bold;
}

.facility-actions button:hover {
  background: #f2f2f2;
}

.site-count {
  color: #666;
  font-size: 14px;
  font-weight: normal;
}

.site-meta {
  display: block;
  color: #666;
  font-size: 11px;
  font-weight: normal;
  margin-top: 2px;
}

.table-wrap {
  max-height: 75vh;
  overflow: auto;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: white;
}

thead th:first-child {
  z-index: 4;
}

tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: white;
}

thead th:first-child {
  left: 0;
}

.master-table .facility-row {
  cursor: pointer;
}

.master-table .facility-row td {
  border-top: 2px solid #999;
}

.facility-name {
  background: #f7f7f7 !important;
}

.site-name {
  padding-left: 28px;
  background: white !important;
}

.toggle-icon {
  display: inline-block;
  width: 18px;
  margin-right: 4px;
}

.site-row td:first-child {
  font-weight: normal;
}

.master-table-wrap {
  max-height: 80vh;
}

.master-table .facility-row {
  cursor: pointer;
  font-size: 15px;
}

.master-table .facility-row td {
  border-top: 3px solid #777;
}

.facility-title {
  display: block;
  font-weight: bold;
}

.facility-name {
  background: #f1f1f1 !important;
}

.site-name {
  padding-left: 32px !important;
  background: #ffffff !important;
  font-size: 12px;
  color: #333;
}

.site-row td {
  font-size: 12px;
}

.site-row .status {
  font-size: 16px;
}

.weekend-col {
  box-shadow: inset 0 0 0 9999px rgba(0,0,0,0.04);
}

.new-month {
  border-left: 3px solid #555 !important;
}

.active-date {
  outline: 2px solid #111;
  outline-offset: -2px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 10px 0;
  font-size: 13px;
  color: #444;
}

.legend-box {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 4px;
  border: 1px solid #999;
}

.facility-actions {
  flex-wrap: wrap;
}

.facility-actions button {
  white-space: nowrap;
}

/* Status classes for richer availability model */
.available {
  background: #b7e4c7;
}

.reserved {
  background: #f4a6a6;
}

.first-come {
  background: #bde0fe;
}

.not-reservable {
  background: #d9d9d9;
}

.closed {
  background: #b8b8b8;
}

.unavailable {
  background: #f6d6a8;
}

.status {
  font-weight: bold;
  text-align: center;
}

.site-meta {
  font-size: 11px;
  color: #555;
  margin-top: 2px;
  line-height: 1.25;
}

.legend-box.first-come {
  background: #bde0fe;
}

.legend-box.reserved {
  background: #f4a6a6;
}

.legend-box.not-reservable {
  background: #d9d9d9;
}

.legend-box.closed {
  background: #b8b8b8;
}

/* Availability intensity scale for collapsed facility rows */
.available {
  background: #74c69d;
}

.some {
  background: #b7e4c7;
}

.limited {
  background: #ffd166;
}

.reserved {
  background: #f4a6a6;
}

.legend-box.available {
  background: #74c69d;
}

.legend-box.some {
  background: #b7e4c7;
}

.legend-box.limited {
  background: #ffd166;
}

.legend-box.reserved {
  background: #f4a6a6;
}

/* Keep sticky facility/site column readable without expanding too wide */
.availability-table th:first-child,
.availability-table td:first-child {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

/* Wrap long campsite metadata inside the sticky column */
.site-meta {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.25;
  max-width: 240px;
}

/* Keep site number and facility title readable */
.site-name strong,
.facility-title {
  white-space: normal;
  overflow-wrap: break-word;
}

/* Make date columns stay compact */
.availability-table th:not(:first-child),
.availability-table td:not(:first-child) {
  min-width: 58px;
  max-width: 58px;
  width: 58px;
  text-align: center;
}

/* Filter controls */
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #333;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
}

.filter-toggle input {
  margin: 0;
}

.filter-select {
  font-size: 13px;
  color: #333;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
}

.booking-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  color: #0645ad;
  text-decoration: underline;
}

.booking-link:hover {
  text-decoration: none;
}

/* Mobile table scaling for iframe/Squarespace use */
@media screen and (max-width: 767px) {
  body {
    font-size: 12px;
  }

  h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  h2 {
    font-size: 16px;
  }

  .updated,
  .legend,
  .facility-actions,
  .filter-toggle,
  .filter-select {
    font-size: 11px;
  }

  .facility-actions {
    gap: 6px;
  }

  .filter-toggle,
  .filter-select,
  .facility-actions button {
    padding: 5px 6px;
    font-size: 11px;
  }

  .availability-table {
    font-size: 11px;
  }

  .availability-table th:first-child,
  .availability-table td:first-child {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
  }

  .site-meta {
    max-width: 135px;
    font-size: 10px;
    line-height: 1.2;
  }

  .facility-title {
    font-size: 12px;
  }

  .site-count,
  .booking-link {
    font-size: 10px;
  }

  .site-name {
    padding-left: 18px !important;
    font-size: 10px;
  }

  .availability-table th:not(:first-child),
  .availability-table td:not(:first-child) {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    font-size: 10px;
  }

  .dow {
    font-size: 9px;
  }

  .date-month {
    font-size: 9px;
  }

  .date-day {
    font-size: 11px;
  }

  .status {
    font-size: 11px;
  }

  .table-wrap {
    max-height: 78vh;
  }
}

@media screen and (max-width: 480px) {
  .availability-table th:first-child,
  .availability-table td:first-child {
    width: 125px;
    min-width: 125px;
    max-width: 125px;
  }

  .site-meta {
    max-width: 112px;
    font-size: 9px;
  }

  .availability-table th:not(:first-child),
  .availability-table td:not(:first-child) {
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    font-size: 9px;
  }

  .facility-title {
    font-size: 11px;
  }

  .booking-link {
    font-size: 9px;
  }
}

/* More compact phone layout */
@media screen and (max-width: 480px) {
  .availability-table th:first-child,
  .availability-table td:first-child {
    width: 105px;
    min-width: 105px;
    max-width: 105px;
  }

  .site-meta {
    display: none;
  }

  .site-name {
    padding-left: 12px !important;
  }

  .availability-table th:not(:first-child),
  .availability-table td:not(:first-child) {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    font-size: 9px;
  }

  .facility-title {
    font-size: 10px;
  }

  .site-count,
  .booking-link {
    font-size: 9px;
  }

  .dow,
  .date-month {
    font-size: 8px;
  }

  .date-day {
    font-size: 10px;
  }
}

/* More compact phone layout */
@media screen and (max-width: 480px) {
  .availability-table th:first-child,
  .availability-table td:first-child {
    width: 105px;
    min-width: 105px;
    max-width: 105px;
  }

  .site-meta {
    display: none;
  }

  .site-name {
    padding-left: 12px !important;
  }

  .availability-table th:not(:first-child),
  .availability-table td:not(:first-child) {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    font-size: 9px;
  }

  .facility-title {
    font-size: 10px;
  }

  .site-count,
  .booking-link {
    font-size: 9px;
  }

  .dow,
  .date-month {
    font-size: 8px;
  }

  .date-day {
    font-size: 10px;
  }
}
