/*
 * itinerary.css — styling for the leg/day itinerary view (U3), rendered by
 * site/js/itinerary.js into #itinerary.
 *
 * Layout for the #itinerary / #map split is out of scope here (U6's
 * responsive.css); this file only styles the itinerary's own content.
 */

.itinerary-header {
  margin-bottom: 0.75rem;
}

.itinerary-header h2 {
  margin: 0 0 0.15rem;
  font-size: 1.1rem;
}

.itinerary-header__subtitle {
  margin: 0;
  color: #555;
  font-size: 0.9rem;
}

.itinerary-empty {
  color: var(--color-warn-text);
  background: var(--color-warn-bg);
  border: 1px solid var(--color-warn-border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
}

.leg-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.leg {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.leg-summary {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: none;
  background: #f7f7f7;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.leg-summary:hover {
  background: #f0f0f0;
}

.leg-summary__order {
  font-size: 0.75rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.leg-summary__name {
  font-weight: 600;
  flex: 1 1 auto;
}

.leg-summary__dates {
  font-size: 0.85rem;
  color: #555;
}

.leg-summary__day-count {
  font-size: 0.8rem;
  color: #777;
}

.leg-summary__chevron {
  transition: transform 0.15s ease;
  color: #888;
}

.leg-summary[aria-expanded="true"] .leg-summary__chevron {
  transform: rotate(90deg);
}

.leg-description {
  padding: 0.5rem 0.75rem 0;
}

.leg-description__text {
  margin: 0 0 0.25rem;
  font-size: 0.9rem;
}

.leg-description__base-area {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #555;
}

.leg-open-questions {
  margin: 0 0.75rem 0.5rem;
  padding: 0.5rem 0.65rem;
}

.leg-open-questions__label {
  margin: 0 0 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.leg-open-questions ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
}

.leg-days {
  border-top: 1px solid #eee;
  padding: 0.5rem 0.75rem 0.75rem;
}

.day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.day {
  border: 1px solid #e3e3e3;
  border-left: 4px solid #ccc;
  border-radius: 4px;
  padding: 0.6rem 0.75rem;
  scroll-margin-top: 1rem;
}

.day--today {
  border-left-color: #2f7a3d;
  background: #f1faf2;
}

.day--nearest {
  border-left-color: #7a6a1f;
  background: #fdf9ec;
}

/* Applied by site/js/sync.js (U5) when a mapped stop is selected on the
   map and this day is linked to it via overnight_stop_id. Cleared and
   reapplied on every new map selection — only one selection's worth of
   highlighting is visible at a time. */
.day--map-selected {
  border-left-color: #1f5c8a;
  background: #eaf3fb;
  box-shadow: 0 0 0 2px rgba(31, 92, 138, 0.35);
}

.day--map-selected .today-badge {
  background: #1f5c8a;
}

.day__header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.day__date-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.day__weekday {
  font-size: 0.75rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.day__date {
  font-weight: 600;
}

.today-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: #2f7a3d;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
}

.day--nearest .today-badge {
  background: #7a6a1f;
}

.day__plan,
.day__lodging,
.day__notes {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.day__notes {
  color: #555;
  font-style: italic;
}

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-badge--reserved,
.status-badge--confirmed {
  color: #1f5c2e;
  background: #e6f4e9;
  border-color: #bfe0c6;
}

.status-badge--draft,
.status-badge--target {
  color: var(--color-warn-text);
  background: var(--color-warn-bg);
  border-color: var(--color-warn-border);
}

.status-badge--planned-not-reserved,
.status-badge--partially-reserved {
  color: #7a4a1f;
  background: #fdecdc;
  border-color: #f0bf9d;
}

.gap-flag {
  margin: 0.35rem 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.85rem;
  color: var(--color-error-text);
  background: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  border-radius: 4px;
}

.gap-flag--open-questions {
  color: var(--color-warn-text);
  background: var(--color-warn-bg);
  border-color: var(--color-warn-border);
}

.gap-flag--open-questions ul {
  margin: 0;
  padding-left: 1.1rem;
}

.reservation-list,
.day__stop {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #ddd;
}

.reservation-list__heading,
.stop-detail__name {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.reservation-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.reservation {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
}

.reservation__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.15rem;
}

.reservation__name {
  font-weight: 600;
}

.reservation__dates,
.reservation__location,
.reservation__notes {
  margin: 0.1rem 0;
  color: #444;
}

.reservation__cancellation {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #666;
}

.reservation__cancellation-label {
  margin: 0 0 0.1rem;
  font-weight: 600;
}

.reservation__cancellation-list {
  margin: 0;
  padding-left: 1.1rem;
}

.stop-detail__head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stop-detail__category {
  font-size: 0.8rem;
  color: #777;
  text-transform: capitalize;
}

.stop-detail__notes {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.stop-detail__features {
  list-style: none;
  margin: 0.35rem 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.stop-detail__feature {
  font-size: 0.75rem;
  background: #eef3f8;
  color: #2a4a63;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
}

.stop-detail__attributes {
  margin: 0.4rem 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.15rem 0.6rem;
  font-size: 0.85rem;
}

.stop-detail__attributes dt {
  color: #666;
}

.stop-detail__attributes dd {
  margin: 0;
}

.stop-detail__rules {
  margin: 0.4rem 0;
  font-size: 0.85rem;
}

.stop-detail__rules-label {
  margin: 0 0 0.15rem;
  font-weight: 600;
}

.stop-detail__rules ul {
  margin: 0;
  padding-left: 1.1rem;
}
