/* Travel dates calendar — paints the month grid that travel-calendar.js builds.
   Loaded after visual-journey.css so the band sits inside the same dark shell
   as the monthly table below it. Nothing here leaks outside #travelCalendar. */

#travelCalendar {
  --tc-line: #35554f;
  --tc-ink: #f4fffb;
  --tc-soft: #aee8d6;
  --tc-mute: #b8cbc4;
  margin: 18px 0 26px;
  border: 1px solid #6e9d9059;
  border-radius: 12px;
  background: #0d2227cc;
  padding: clamp(12px, 1.6vw, 18px);
  color: var(--tc-ink);
}

/* ── Month header ─────────────────────────────────────────────────────── */

#travelCalendar .tc-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

#travelCalendar .tc-nav {
  width: 44px;
  height: 44px;
  border: 1px solid #6e9d90;
  border-radius: 8px;
  background: #07181c;
  color: var(--tc-ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

#travelCalendar .tc-nav:hover:not(:disabled) { border-color: #7bead3; background: #0f2c30; }
#travelCalendar .tc-nav:disabled { opacity: .35; cursor: default; }

#travelCalendar .tc-title {
  margin: 0 !important;
  text-align: center;
  display: grid;
  gap: 2px;
}

#travelCalendar .tc-title strong {
  color: var(--tc-ink);
  font-size: clamp(1.125rem, 2.1vw, 1.5rem);
  font-weight: 500;
  line-height: 1.4;
}

#travelCalendar .tc-title span {
  color: var(--tc-soft);
  font-size: .8125rem;
  line-height: 1.6;
}

/* ── Day grid ─────────────────────────────────────────────────────────── */

#travelCalendar .tc-weekdays,
#travelCalendar .tc-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

#travelCalendar .tc-weekdays {
  margin-bottom: 4px;
}

#travelCalendar .tc-weekdays span {
  padding: 4px 0;
  color: var(--tc-soft);
  font-size: .75rem;
  letter-spacing: .06em;
  text-align: center;
  line-height: 1.6;
}

#travelCalendar .tc-grid {
  border: 1px solid var(--tc-line);
  border-radius: 8px;
  overflow: hidden;
}

#travelCalendar .tc-week {
  position: relative;
  grid-template-rows: 26px;
  grid-auto-rows: 22px;
  padding-bottom: 10px;
  border-top: 1px solid var(--tc-line);
}

#travelCalendar .tc-week:first-child { border-top: 0; }

/* The day columns are a background layer, so a bar can run straight over the
   grid lines without a cell clipping it. */
#travelCalendar .tc-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((var(--col) - 1) * (100% / 7));
  width: calc(100% / 7);
  border-right: 1px solid var(--tc-line);
}

#travelCalendar .tc-cell:nth-child(7) { border-right: 0; }
#travelCalendar .tc-cell.is-outside { background: #07181c66; }

#travelCalendar .tc-num {
  grid-row: 1;
  grid-column: var(--col);
  align-self: center;
  padding-inline: 8px;
  color: var(--tc-mute);
  font-size: .8125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

#travelCalendar .tc-num.is-outside { opacity: .4; }

/* ── Journey bars ─────────────────────────────────────────────────────── */

#travelCalendar .tc-bar {
  grid-row: var(--row);
  grid-column: var(--col) / span var(--span);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 18px;
  margin: 1px 0;
  padding-inline: 8px;
  border-radius: 2px;
  background: var(--tc-bar-bg, #3d6b64);
  color: #eafff8;
  font-size: .75rem;
  line-height: 1;
  text-decoration: none;
  transition: filter .2s ease;
}

/* Only the real start and end of a journey get a cap, so a bar that carries
   on into the next week reads as continuing rather than as two trips. */
#travelCalendar .tc-bar.is-open { border-start-start-radius: 9px; border-end-start-radius: 9px; margin-left: 3px; }
#travelCalendar .tc-bar.is-close { border-start-end-radius: 9px; border-end-end-radius: 9px; margin-right: 3px; }

#travelCalendar .tc-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#travelCalendar a.tc-bar:hover { filter: brightness(1.18); }
#travelCalendar a.tc-bar:focus-visible { outline: 2px solid #7bead3; outline-offset: 2px; }

#travelCalendar .status-confirmed { --tc-bar-bg: #1f7a5e; }
#travelCalendar .status-available { --tc-bar-bg: #2f8f76; }
#travelCalendar .status-final-call { --tc-bar-bg: #a8702c; }
#travelCalendar .status-planned { --tc-bar-bg: #456e77; }
#travelCalendar .status-on-trip { --tc-bar-bg: #2f6f9f; }
#travelCalendar .status-full { --tc-bar-bg: #4a5b58; }

#travelCalendar .tc-more {
  grid-row: var(--row);
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  justify-self: start;
  margin: 2px 0 0 6px;
  border: 0;
  border-radius: 2px;
  padding: 2px 8px;
  background: none;
  color: var(--tc-soft);
  font: inherit;
  font-size: .75rem;
  line-height: 1.4;
  text-decoration: underline;
  cursor: pointer;
}

#travelCalendar .tc-more:hover { color: #7bead3; }

#travelCalendar .tc-collapse {
  margin-top: 10px;
  border: 1px solid #6e9d90;
  border-radius: 8px;
  padding: 8px 14px;
  min-height: 40px;
  background: #07181c;
  color: var(--tc-soft);
  font: inherit;
  font-size: .8125rem;
  line-height: 1.5;
  cursor: pointer;
}

#travelCalendar .tc-collapse:hover { border-color: #7bead3; color: #7bead3; }

/* ── Legend, agenda and notes ─────────────────────────────────────────── */

#travelCalendar .tc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 12px 0 0 !important;
  font-size: .75rem !important;
  line-height: 1.6 !important;
}

#travelCalendar .tc-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--tc-mute);
}

#travelCalendar .tc-key::before {
  content: '';
  width: 14px;
  height: 8px;
  border-radius: 4px;
  background: var(--tc-bar-bg, #3d6b64);
}

#travelCalendar .tc-note,
#travelCalendar .tc-empty {
  margin: 10px 0 0 !important;
  color: var(--tc-mute) !important;
  font-size: .8125rem !important;
  line-height: 1.7 !important;
}

#travelCalendar .tc-agenda {
  display: none;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

#travelCalendar .tc-item + .tc-item { margin-top: 8px; }

#travelCalendar .tc-item a {
  display: grid;
  gap: 2px;
  border: 1px solid var(--tc-line);
  border-left: 3px solid var(--tc-bar-bg, #3d6b64);
  border-radius: 8px;
  padding: 12px 14px;
  background: #13282c;
  color: inherit;
  text-decoration: none;
}

#travelCalendar .tc-item b { color: var(--tc-ink); font-size: .9375rem; font-weight: 500; line-height: 1.5; }
#travelCalendar .tc-item span { color: var(--tc-soft); font-size: .8125rem; line-height: 1.6; }
#travelCalendar .tc-item small { color: var(--tc-mute); font-size: .75rem; line-height: 1.6; }

/* ── Narrow screens ───────────────────────────────────────────────────── */

/* Seven columns of labelled bars stop being readable well before a phone, so
   the grid keeps only the shape of the month and the list carries the taps. */
@media (max-width: 720px) {
  #travelCalendar .tc-week { grid-template-rows: 24px; grid-auto-rows: 10px; }
  #travelCalendar .tc-bar { height: 7px; padding: 0; }
  #travelCalendar .tc-bar span { display: none; }
  #travelCalendar .tc-num { padding-inline: 4px; font-size: .75rem; }
  #travelCalendar .tc-more { font-size: .6875rem; }
  #travelCalendar .tc-agenda { display: block; }
}
