/* The flight search (homepage and /find-a-flight; markup from scripts/atlas-frame.mjs, behaviour in trip-search.js) and
   the airport picker (airports.js). A solid cloud plate, so every label and value reads at full contrast over the sky.
   Every control is at least 44px tall; fields are 17px (no zoom on phones); labels are sentence case. */

.trip { position: relative; z-index: 2; width: 100%; color: var(--atlas-ink); }
:where(.trip) fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Charter or Empty legs: two cards, each with one line of explanation */
.trip-modes { padding: clamp(18px, 2vw, 24px) clamp(18px, 2vw, 24px) 0; }
/* a legend sits on the fieldset border unless floated; floated, it lies inside the plate's padding like any heading */
.trip-legend { float: left; width: 100%; padding: 0; margin: 0 0 12px; font: var(--atlas-weight-title, 650) var(--atlas-t-body)/1.3 var(--atlas-text); color: var(--atlas-ink); }
.trip-legend + * { clear: both; }
.trip-mode-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.trip-mode { position: relative; display: block; cursor: pointer; }
.trip-mode input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.trip-mode > span { position: relative; display: grid; gap: 4px; align-content: start; min-height: 44px; height: 100%; padding: 14px 16px 15px 48px; border: 1px solid var(--atlas-rule-2); border-radius: var(--atlas-radius);
  background: var(--atlas-white); transition: border-color 200ms var(--atlas-ease), box-shadow 200ms var(--atlas-ease), background-color 200ms var(--atlas-ease); }
.trip-mode > span::before { content: ""; position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--atlas-ink-3); background: #fff; box-sizing: border-box; transition: border-width 160ms ease, border-color 160ms ease; }
.trip-mode b { font: var(--atlas-weight-title, 650) var(--atlas-t-body)/1.3 var(--atlas-text); color: var(--atlas-ink); }
.trip-mode small { font: 400 var(--atlas-t-small)/1.45 var(--atlas-text); color: var(--atlas-ink-2); }
.trip-mode:hover > span { border-color: var(--atlas-ink-3); }
.trip-mode input:checked + span { border-color: var(--atlas-zenith); box-shadow: inset 0 0 0 1px var(--atlas-zenith); background: var(--atlas-haze); }
.trip-mode input:checked + span::before { border: 6px solid var(--atlas-zenith); }
.trip-mode input:focus-visible + span { outline: 2px solid var(--atlas-azure); outline-offset: 2px; }

/* One way or Return */
.trip-type-row { display: flex; align-items: center; gap: 16px; min-height: 72px; padding: 14px clamp(18px, 2vw, 24px); }
.trip-type { display: inline-flex; padding: 3px; border: 1px solid var(--atlas-rule-2); border-radius: var(--atlas-radius); background: var(--atlas-white); }
.trip-type[hidden] { display: none; }
.trip-type label { position: relative; cursor: pointer; }
.trip-type input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.trip-type span { display: flex; align-items: center; justify-content: center; min-height: 44px; min-width: 7.5rem; padding: 0 18px; border-radius: 2px; font: 600 1rem/1 var(--atlas-text); color: var(--atlas-ink-2); transition: background-color 200ms var(--atlas-ease), color 200ms var(--atlas-ease); }
.trip-type input:checked + span { background: var(--atlas-zenith); color: #fff; }
.trip-type label:hover input:not(:checked) + span { background: var(--atlas-haze); color: var(--atlas-ink); }
.trip-type input:focus-visible + span { outline: 2px solid var(--atlas-azure); outline-offset: 2px; }
.trip-oneway { margin: 0; font: 500 1rem/1.4 var(--atlas-text); color: var(--atlas-ink-2); }

/* the fields: hairlines between cells (the grid's own gap shows the rule colour) */
.trip-fields { display: grid; gap: 1px; background: var(--atlas-rule); border-block: 1px solid var(--atlas-rule);
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.5fr) minmax(10.5rem, 1fr) minmax(7rem, 0.62fr); }
.trip-fields:has(.trip-return:not([hidden])) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(10.5rem, 1fr) minmax(10.5rem, 1fr) minmax(7rem, 0.62fr); }
.trip-fields .atlas-field { background: var(--atlas-cloud); min-width: 0; }
.trip-fields .atlas-field[hidden] { display: none; }
.trip-fields .atlas-field:focus-within { z-index: 3; }
.trip .atlas-field > span { color: var(--atlas-ink-2); }
@media (min-width: 740px) and (min-height: 651px) and (not (display-mode: standalone)) {
  html:not([data-app="installed"]) .trip .atlas-field > span { font-size: var(--atlas-t-small); }
}
.trip .atlas-field input[aria-invalid="true"] { color: var(--atlas-alert); }
.trip .atlas-field:has(input[aria-invalid="true"]) { box-shadow: inset 0 -2px 0 var(--atlas-alert); background: #fff; }

.trip-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px clamp(18px, 2vw, 24px) clamp(16px, 2vw, 22px); }
.trip-tz { display: flex; align-items: flex-start; gap: 8px; margin: 0; flex: 1 1 18rem; font: 400 var(--atlas-t-small)/1.45 var(--atlas-text); color: var(--atlas-ink-2); }
.trip-tz svg { width: 16px; height: 16px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.trip-error { flex: 1 1 100%; margin: 0; font: 600 1rem/1.45 var(--atlas-text); color: var(--atlas-alert); }
.trip-error:not(:empty) { padding: 10px 14px; border-left: 3px solid var(--atlas-alert); background: #fff; }
.trip-go { min-height: 52px; padding: 0 28px; margin-left: auto; }

@media (min-width: 900px) and (max-width: 1099px) {
  .trip-fields:has(.trip-return:not([hidden])) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .trip-fields:has(.trip-return:not([hidden])) > .atlas-field { grid-column: span 2; }
  .trip-fields:has(.trip-return:not([hidden])) > :is(.trip-from, .trip-to) { grid-column: span 3; }
}
@media (max-width: 899px) {
  .trip-fields, .trip-fields:has(.trip-return:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* one way: date and travellers share a row; return: date and return date, then travellers across */
  .trip-fields:has(.trip-return:not([hidden])) .trip-pax { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
  .trip-mode-opts { grid-template-columns: 1fr; gap: 8px; }
  .trip-mode > span { padding: 12px 14px 13px 46px; }
  .trip-mode > span::before { top: 14px; left: 14px; }
  .trip-fields, .trip-fields:has(.trip-return:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trip-fields .trip-from, .trip-fields .trip-to { grid-column: 1 / -1; }
  .trip-fields .atlas-field { padding: 12px 16px 13px; }
  .trip-type { width: 100%; } .trip-type label { flex: 1; } .trip-type span { min-width: 0; }
  .trip-go { width: 100%; margin-left: 0; }
}

/* ---------- the airport picker ---------- */
.ap-list { position: absolute; z-index: 40; inset-inline: -1px; top: 100%; max-height: min(340px, 52vh); overflow-y: auto; overscroll-behavior: contain;
  margin: 2px 0 0; padding: 4px 0; list-style: none; background: var(--atlas-white); color: var(--atlas-ink); border: 1px solid var(--atlas-rule-2); border-radius: var(--atlas-radius); box-shadow: var(--atlas-shadow); }
.ap-list[hidden] { display: none; }
.ap-list li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; min-height: 48px; padding: 9px 16px; cursor: pointer; border-bottom: 1px solid var(--atlas-rule); overflow-wrap: anywhere; }
.ap-list li:last-child { border-bottom: 0; }
.ap-list li b { font: 650 1rem/1.3 var(--atlas-text); }
.ap-list li span { font: 400 1rem/1.35 var(--atlas-text); color: var(--atlas-ink); }
.ap-list li small { font: 400 var(--atlas-t-caption, 0.875rem)/1.35 var(--atlas-text); color: var(--atlas-ink-3); }
.ap-list li[aria-selected="true"], .ap-list li:hover { background: var(--atlas-haze); }
.ap-status { margin: 4px 0 0; font: 400 var(--atlas-t-caption, 0.875rem)/1.4 var(--atlas-text); color: var(--atlas-ink-3); }
.ap-status[hidden] { display: none; }

/* First trip without membership: the offer beside the booking action (scripts/atlas-frame.mjs search). */
.trip-first { flex: 1 0 100%; margin: 0; padding-top: 12px; border-top: 1px solid var(--atlas-rule); font: 400 var(--atlas-t-small)/1.5 var(--atlas-text); color: var(--atlas-ink-2); }
.trip-first b { color: var(--atlas-ink); font-weight: 600; }
.trip-first a { color: var(--atlas-blue-ink, var(--atlas-ink)); text-decoration: underline; text-underline-offset: 0.2em; white-space: nowrap; display: inline-block; padding: 6px 0; }
@media (pointer: coarse) { .trip-first a { padding: 12px 0; } }
