/* app/assets/stylesheets/sessions.css */

.hourly-forecast {
  --wind-max: 40;
  /* margin-top: 20px; */
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #1f2937;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */

  border: 1px solid #dddddd;
  border-radius: 1rem;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.hourly-forecast__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  padding: 1rem;
}

.hourly-forecast__table thead th:not(:first-child),
.hourly-forecast__table tbody td {
  width: 21px !important;
  /* width: 0px !important; */
  min-width: 21px;
  max-width: 21px;
}

.hourly-forecast__table thead th:first-child {
  width: 130px;
  height: 21px;
}

.hourly-forecast__table tbody th {
  width: 130px;
}

/* Labels & headers */
.hourly-forecast__label {
  background: #f8fafc;
  font-weight: 600;
  height: 21px;
  padding: 0 8px;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
  font-size: 10px;
  line-height: 21px;
  vertical-align: middle;
}

.hourly-forecast__header {
  background: #f1f5f9;
  font-weight: 600;
  text-align: center;
  height: 21px !important;
  width: 21px !important;
  min-width: 21px;
  max-width: 21px;
  min-height: 21px;
  max-height: 21px;
  padding: 0;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  font-size: 10px;
  line-height: 21px;
  vertical-align: middle;
  box-sizing: border-box;
  overflow: hidden;
  aspect-ratio: 1;
}

/* Cells */
.hourly-forecast__cell {
  height: 21px !important;
  width: 21px !important;
  min-width: 21px;
  max-width: 21px;
  min-height: 21px;
  max-height: 21px;
  padding: 0;
  text-align: center;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  transition: background-color 0.3s ease;
  font-size: 11px;
  line-height: 21px;
  vertical-align: middle;
  box-sizing: border-box;
  overflow: hidden;
  aspect-ratio: 1;
}

.hourly-forecast__table tbody tr:last-child th,
.hourly-forecast__table tbody tr:last-child td {
  border-bottom: none;
}

.hourly-forecast__table thead th:last-child,
.hourly-forecast__table tbody th:last-child,
.hourly-forecast__table tbody td:last-child {
  border-right: none;
}

.hourly-forecast__cell--wind,
.hourly-forecast__cell--temp {
  font-weight: 600;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Mobile: larger square cells */
@media (max-width: 768px) {
  .hourly-forecast__table thead th:not(:first-child),
  .hourly-forecast__table tbody td {
    width: 40px !important;
    min-width: 40px;
    max-width: 40px;
  }

  .hourly-forecast__header {
    width: 40px !important;
    min-width: 40px;
    max-width: 40px;
    /* height: 40px !important;
    min-height: 40px;
    max-height: 40px; */
    font-size: 12px;
    line-height: 40px;
  }

  .hourly-forecast__cell {
    width: 40px !important;
    min-width: 40px;
    max-width: 40px;
    /* height: 40px !important;
    min-height: 40px;
    max-height: 40px; */
    font-size: 13px;
    line-height: 40px;
  }

  .hourly-forecast__label {
    /* height: 40px;
    line-height: 40px; */
    font-size: 11px;
  }
}

/* Spot show page: table scrolls horizontally edge-to-edge */
.spots--show .forecast__hourly {
  margin-left: calc(-1 * var(--spacing-md, 1rem));
  margin-right: calc(-1 * var(--spacing-md, 1rem));
}

.spots--show .hourly-forecast {
  border-radius: 0;
  border-left: none;
  border-right: none;
}

.spots--show .hourly-forecast__table {
  width: auto;
}