/* ═══════════════════════════════════════════════════════════════════════════
   /airplane-tracker/ — map chrome and aircraft sheet, in Pavlus colours.

   The behaviour (map.js, sheet.js, map-gestures.js) is copied verbatim from
   airplanetracker.com; only the paint is different. That site is a near-black
   instrument panel, this page is part of pavlus.com — cream, navy and gold, the
   same vocabulary as /ship-tracker/ — so every colour below is a restatement of
   an airplanetracker.com rule in this palette. If you change the markup in
   sheet.js, change it in both places.

   Palette is inherited from the page's own :root (--navy, --gold, --cream …),
   with fallbacks so this file is still legible if it is ever loaded alone.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── markers ───────────────────────────────────────────────────────────── */
.plane { transform-origin: 50% 50%; transition: none; }
.plane.is-gnd { opacity: .7; }

/* The selected aircraft keeps a ring, so it stays findable behind the sheet. */
.leaflet-marker-icon.is-sel .plane {
  filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 7px rgba(201,169,97,.95));
}
.leaflet-marker-icon.is-sel::after {
  content: ""; position: absolute; inset: -9px; border-radius: 50%;
  border: 2px solid var(--gold, #C9A961); animation: aptping 1.8s ease-out infinite;
}
@keyframes aptping {
  0%   { transform: scale(.7); opacity: .9; }
  100% { transform: scale(1.35); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .leaflet-marker-icon.is-sel::after { animation: none; opacity: .8; }
}

/* ── loading state ─────────────────────────────────────────────────────────
   Deliberately visible: the previous frame stays on screen while the next one
   loads, so a faint hint reads as "the map has stopped" rather than "the map is
   working" — the wrong impression to give someone who is waiting. */
.maploading {
  position: absolute; left: 50%; bottom: 22px; transform: translate(-50%, 8px);
  z-index: 680; pointer-events: none;
  display: flex; align-items: center; gap: 9px;
  background: var(--navy, #0A1F44); color: #fff;
  border: 1px solid rgba(201,169,97,.55); border-radius: 999px;
  padding: 9px 18px 9px 14px;
  font: 600 14px/1 var(--sans, 'Outfit', sans-serif);
  box-shadow: 0 10px 30px rgba(10,31,68,.4);
  opacity: 0; visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.maploading.on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.maploading-spin {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2.5px solid rgba(201,169,97,.3); border-top-color: var(--gold, #C9A961);
  animation: aptspin .7s linear infinite;
}
@keyframes aptspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .maploading-spin { animation-duration: 2.4s; } }
/* "Still trying" and "that failed, trying again" are different things to be
   told, and a spinner that never resolves is worse than either. */
.maploading.is-failed { border-color: rgba(200,60,40,.6); }
.maploading.is-failed .maploading-spin { border-color: rgba(200,60,40,.25); border-top-color: #c8392a; }

/* ── wheel hint ────────────────────────────────────────────────────────────
   Shown only when a plain wheel is rolled over the map, so the visitor learns
   the modifier instead of concluding the wheel is broken. */
.wheelhint {
  position: absolute; inset: 0; z-index: 650; display: flex;
  align-items: center; justify-content: center; pointer-events: none;
  background: rgba(10,31,68,.45); color: #fff;
  font: 600 16px var(--sans, 'Outfit', sans-serif);
  opacity: 0; transition: opacity .2s;
}
.wheelhint.on { opacity: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   AIRCRAFT SHEET — a bottom sheet on touch, a floating card on desktop.

   Not a Leaflet popup: a popup is small, anchored to a marker that is moving,
   covers the aircraft you just tapped, and on a phone is close to unusable.
   /ship-tracker/ can use popups because a ship's pin holds still for minutes at
   a time; an airliner crosses the popup's own width while you read it.
   ═══════════════════════════════════════════════════════════════════════════ */
.acs {
  position: fixed; z-index: 1200;
  background: #fff; color: var(--navy, #0A1F44);
  font-family: var(--sans, 'Outfit', sans-serif);
  border: 1px solid rgba(10,31,68,.08);
  box-shadow: 0 2px 6px rgba(10,31,68,.16), 0 18px 44px -12px rgba(10,31,68,.55);
  overscroll-behavior: contain;
}
.acs[hidden] { display: none; }

/* Desktop: a card at the bottom-left — the corner the zoom control owns on
   /ship-tracker/ is free here, because this map puts zoom on the right. */
@media (min-width: 861px) {
  .acs {
    left: 24px; bottom: 24px; width: 380px; max-height: min(560px, 72vh);
    border-radius: 16px; padding: 18px 20px 20px; overflow-y: auto;
    opacity: 0; transform: translateY(14px) scale(.98);
    transition: opacity .22s ease, transform .22s ease;
  }
  .acs.on { opacity: 1; transform: none; }
  .acs-grab { display: none; }
}

/* Touch: a true bottom sheet — thumb-reachable, swipe down to dismiss. */
@media (max-width: 860px) {
  .acs {
    left: 0; right: 0; bottom: 0;
    max-height: 78dvh; max-height: 78vh;
    border-radius: 20px 20px 0 0; border-bottom: 0;
    padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.32,.72,0,1);
  }
  .acs.on { transform: none; }
  .acs-grab {
    width: 40px; height: 4px; border-radius: 99px; background: #d8dde6;
    margin: 5px auto 11px;
  }
}
@media (prefers-reduced-motion: reduce) { .acs { transition: none; } }

.acs-x {
  position: absolute; top: 9px; right: 10px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-light, #F2F4F7); border: 1px solid #e4e8ef;
  color: var(--gray, #667085); font-size: 22px; line-height: 1; cursor: pointer;
}
.acs-x:hover { color: var(--navy, #0A1F44); background: #e8ecf3; }

.acs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-right: 42px; }
.acs-flight {
  display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; color: var(--navy, #0A1F44);
}
.acs-line { display: block; color: var(--gray, #667085); font-size: 14px; margin-top: 2px; }
/* Bronze, not --gold: at this size the lighter gold falls under the 4.5:1 floor
   on white. Same bronze the /ship-tracker/ popups use. */
.acs-status {
  flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: #8a6d1f; background: rgba(201,169,97,.16); border: 1px solid rgba(201,169,97,.5);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.acs-status.is-gnd { color: var(--gray, #667085); background: var(--gray-light, #F2F4F7); border-color: #e4e8ef; }

/* The route — the reason the sheet exists, so it gets the most room. */
.acs-route {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: 17px 0 6px;
}
.acs-end b {
  display: block; font-size: 32px; font-weight: 700; line-height: 1;
  letter-spacing: -.02em; color: var(--navy, #0A1F44);
}
.acs-end span {
  display: block; color: var(--gray, #667085); font-size: 12.5px; margin-top: 4px;
  max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acs-end.to { text-align: right; }
.acs-end.to span { margin-left: auto; }
.acs-track { text-align: center; }
.acs-bar { position: relative; height: 3px; border-radius: 3px; background: #e4e8ef; margin-bottom: 8px; }
.acs-done { position: absolute; inset: 0 auto 0 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold-dark, #b89440), var(--gold, #C9A961)); }
.acs-dot {
  position: absolute; top: 50%; width: 11px; height: 11px; margin-left: -5.5px;
  border-radius: 50%; background: var(--gold, #C9A961); transform: translateY(-50%);
  box-shadow: 0 0 0 4px rgba(201,169,97,.25);
}
.acs-track small { color: var(--gray, #667085); font-size: 11.5px; }
.acs-noroute {
  margin: 16px 0 4px; padding: 12px 14px; border-radius: 10px;
  background: var(--cream, #F8F6F1); border: 1px solid #ebe6da;
  color: #55617a; font-size: 13.5px;
}

.acs-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 17px; }
.acs-facts > div {
  background: var(--cream, #F8F6F1); border: 1px solid #ebe6da; border-radius: 10px;
  padding: 9px 8px; text-align: center; min-width: 0;
}
.acs-facts b {
  display: block; font-size: 15px; font-weight: 700; color: var(--navy, #0A1F44);
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acs-facts span {
  display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--gray, #667085); margin-top: 2px;
}

/* The contextual hotel offer — shown only once we know where the flight lands,
   which is the highest-intent moment this page has. Labelled as an ad, because
   it is one. */
.acs-offer {
  display: flex; align-items: center; gap: 12px; position: relative;
  margin-top: 15px; padding: 13px 14px;
  background: linear-gradient(135deg, rgba(201,169,97,.16), rgba(201,169,97,.06));
  border: 1px solid rgba(201,169,97,.45); border-radius: 12px;
  color: var(--navy, #0A1F44); text-decoration: none;
  transition: border-color .16s, background .16s, transform .12s;
}
.acs-offer:active { transform: scale(.985); }
.acs-offer:hover { border-color: var(--gold, #C9A961); background: linear-gradient(135deg, rgba(201,169,97,.24), rgba(201,169,97,.1)); }
.acs-offer-ico {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201,169,97,.22); color: #8a6d1f;
}
.acs-offer-txt { min-width: 0; flex: 1; }
.acs-offer-txt b { display: block; font-size: 15px; line-height: 1.25; }
.acs-offer-txt span { display: block; font-size: 12px; color: var(--gray, #667085); margin-top: 2px; line-height: 1.35; }
.acs-offer-go { flex: none; color: #8a6d1f; font-size: 19px; }
.acs-offer-tag {
  position: absolute; top: -7px; right: 10px;
  font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--navy, #0A1F44); background: var(--gold, #C9A961); border-radius: 3px; padding: 1px 5px;
}

/* Buttons are scoped to the sheet: pavlus.com has its own .btn and these must
   not answer to it, nor it to these. */
.acs-act { display: flex; gap: 8px; margin-top: 16px; }
.acs-act .btn {
  flex: 1; text-align: center; padding: 11px 14px; border-radius: 999px;
  font: 700 13.5px var(--sans, 'Outfit', sans-serif); cursor: pointer;
  background: var(--gold, #C9A961); color: var(--navy, #0A1F44) !important;
  border: 1.5px solid var(--gold, #C9A961); text-decoration: none;
}
.acs-act .btn:hover { background: var(--gold-dark, #b89440); border-color: var(--gold-dark, #b89440); }
.acs-act .btn-ghost {
  background: none; color: var(--navy, #0A1F44) !important; border-color: #d8dde6;
}
.acs-act .btn-ghost:hover { background: var(--gray-light, #F2F4F7); border-color: var(--navy, #0A1F44); }

@media (max-width: 380px) {
  .acs-facts { grid-template-columns: repeat(2, 1fr); }
  .acs-end b { font-size: 26px; }
}
