/* Hourly forecast, phone and desktop: the hours run left to right and the strip scrolls
   sideways (a seven-column table did not fit on a phone, and a tall list meant a lot of
   scrolling down). Each hour is a narrow column: time, icon, temperature, cloudiness,
   rain, chance of rain and wind, with their units. Screen only; the printed table is
   unchanged. */
@media screen {
  #hourlyTableBlock {
    overflow-x: hidden !important;
  }

  /* only the strip scrolls, not its box as well */
  #hourlyTableBlock .table-container {
    overflow-x: hidden !important;
  }

  #hourlyTable {
    display: block !important;
    box-sizing: border-box;
    max-width: 100%;
    width: 100% !important;
    min-width: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  /* the column names are replaced by the units next to the values */
  #hourlyTable thead {
    display: none !important;
  }

  #hourlyTable tbody {
    display: flex !important;
    flex-direction: row;
    gap: 8px;
    width: 100% !important;
    box-sizing: border-box;
    padding: 4px 13px 12px; /* the first card lines up with the first day card */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scroll-padding: 0 13px;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  #hourlyTable tbody tr {
    display: flex !important;
    flex: 0 0 90px;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    scroll-snap-align: start;
    background: rgba(10, 25, 60, 0.55) !important;
    border: 1px solid rgba(255, 215, 0, 0.35) !important;
    border-radius: 12px;
  }

  #hourlyTable tbody td {
    display: block !important;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    text-align: center !important;
  }

  #hourlyTable tbody td:nth-child(1) {
    font-size: 1.05rem;
    font-weight: 700;
  }

  /* the forecast cell dissolves so its parts can be ordered: icon under the time, the
     warning badge ("Strong wind") at the very bottom, so the temperatures of all cards line up
     (as in the day cards) */
  #hourlyTable tbody td:nth-child(1) { order: 1; }
  #hourlyTable tbody td:nth-child(2) { display: contents !important; }
  #hourlyTable tbody td:nth-child(2) > :not(.wx-warnings) { order: 2; }
  #hourlyTable tbody td:nth-child(3) { order: 3; }
  #hourlyTable tbody td:nth-child(4) { order: 4; }
  #hourlyTable tbody td:nth-child(5) { order: 5; }
  #hourlyTable tbody td:nth-child(6) { order: 6; }
  #hourlyTable tbody td:nth-child(7) { order: 7; }
  #hourlyTable tbody td:nth-child(2) > .wx-warnings { order: 8; margin-top: auto; }

  #hourlyTable tbody td:nth-child(3) {
    font-size: 1.45rem;
    font-weight: 700;
  }

  #hourlyTable tbody td:nth-child(3)::after {
    content: "°";
  }

  /* the four small values with their units */
  #hourlyTable tbody td:nth-child(n+4) {
    font-size: 0.8rem !important;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.92;
  }

  #hourlyTable tbody td:nth-child(4)::before { content: "☁ "; }
  #hourlyTable tbody td:nth-child(4)::after { content: "%"; }
  #hourlyTable tbody td:nth-child(5)::before { content: "💧 "; }
  #hourlyTable tbody td:nth-child(5)::after { content: " mm"; }
  #hourlyTable tbody td:nth-child(6)::before { content: "☔ "; }
  #hourlyTable tbody td:nth-child(7)::before { content: "💨 "; }
  #hourlyTable tbody td:nth-child(7)::after { content: " km/h"; }
  /* Bulgarian units, as in the table headers */
  :lang(bg) #hourlyTable tbody td:nth-child(5)::after { content: " мм"; }
  :lang(bg) #hourlyTable tbody td:nth-child(7)::after { content: " км/ч"; }

  /* the bar of the chance of rain is for the printed table */
  #hourlyTable .precip-prob-bar-container {
    display: none !important;
  }

  /* a warning badge ("Fog") sits under the icon; keep it inside the narrow column */
  #hourlyTable tbody td:nth-child(2) .wx-warnings {
    justify-content: center;
  }

  #hourlyTable tbody td:nth-child(2) .wx-warning {
    font-size: 0.65rem;
    padding: 1px 5px;
  }
}
