/* Passenger passport, part 2: the booklet (cover, data page with the frequent-flyer card, visa pages of stamps).
   The stamp itself, the arrival moment and the start screen entry are in airshow_passport_stamp.css. */
.pp-overlay {
  --pp-cover: #1D0D78;
  --pp-foil: #d6b86e;
  position: fixed;
  inset: 0;
  z-index: 2600;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 28px;
  background: rgba(7, 5, 26, 0.7);
  font-family: var(--airshow-ui-font-family, "Pretendard Variable", "Pretendard", sans-serif);
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 200ms ease;
}
.pp-overlay[hidden] { display: none; }
.pp-overlay.is-open { opacity: 1; }
.pp-overlay[data-cover="burgundy"] { --pp-cover: #5c1430; }
.pp-overlay[data-cover="forest"] { --pp-cover: #143f2f; }
.pp-overlay[data-cover="graphite"] { --pp-cover: #2a2c32; --pp-foil: #cdd2da; }
body.airshow-passport-open .tier-notice-overlay { z-index: 2700; }

.pp-book {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  box-sizing: border-box;
  /* An open passport: two ICAO ID-3 pages (88 x 125 mm) side by side, scaled to the window by
     airshow_passport_page.js (--pp-zoom). */
  aspect-ratio: 176 / 125;
  width: auto;
  height: 710px;
  zoom: var(--pp-zoom, 1);
  padding: 8px;
  perspective: 2000px;
  color: var(--pp-ink);
  transform: translateX(-25%) scale(0.97);
  transition: transform 260ms cubic-bezier(0.3, 0.7, 0.2, 1);
}
/* The cover board around the pages: only its right half shows while the booklet is shut. */
.pp-book::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: var(--pp-cover);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  clip-path: inset(0 0 0 50%);
  transition: clip-path 260ms cubic-bezier(0.3, 0.7, 0.2, 1);
}
.pp-overlay.is-opened .pp-book { transform: none; }
.pp-overlay.is-opened .pp-book::before { clip-path: inset(0); }
.pp-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  padding: 26px 32px 22px;
  overflow: hidden;
  /* Security paper: the crest as a watermark, fine guilloche waves and a rosette, fibres, and the faint tint drift
     of a passport's inner pages. */
  background:
    url("../../images/passport/page-crest.svg?v=c1828a66e6e2") center 54% / 62% auto no-repeat,
    url("../../images/passport/page-security.svg?v=644df3372c4b") center / cover no-repeat,
    linear-gradient(162deg, #e5f0e7 0%, #f6f0df 44%, #f6e7e3 74%, #e2edf1 100%);
}
.pp-data { border-radius: 6px 0 0 6px; box-shadow: inset -16px 0 18px -16px rgba(70, 50, 10, 0.32); opacity: 0; transition: opacity 200ms ease 120ms; }
.pp-visas { border-radius: 0 6px 6px 0; box-shadow: inset 16px 0 18px -16px rgba(70, 50, 10, 0.32); }
.pp-overlay.is-opened .pp-data { opacity: 1; }

.pp-cover {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  border-radius: 0 12px 12px 0;
  background: var(--pp-cover);
  color: var(--pp-foil);
  transform-origin: left center;
  backface-visibility: hidden;
  transition: transform 260ms cubic-bezier(0.4, 0, 0.2, 1);
}
.pp-overlay.is-opened .pp-cover { transform: rotateY(-180deg); pointer-events: none; }
.pp-cover-title { font-size: 30px; font-weight: 700; letter-spacing: 0.32em; text-transform: uppercase; }
.pp-crest { width: 110px; height: 110px; }
.pp-cover-brand { font-size: 16px; font-weight: 600; letter-spacing: 0.08em; }

.pp-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 2;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--pp-rule);
  border-radius: 8px;
  background: var(--pp-paper);
  color: var(--pp-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.pp-overlay:not(.is-opened) .pp-close { border-color: rgba(214, 184, 110, 0.5); background: transparent; color: var(--pp-foil); }
.pp-close:focus-visible,
.pp-page button:focus-visible { outline: 2px solid var(--pp-navy); outline-offset: 2px; }

.pp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pp-visas .pp-head { padding-right: 124px; }
.pp-head h2,
.pp-head h3 { margin: 0; font-size: 22px; font-weight: 750; }
.pp-no,
.pp-pageno { font-size: 13px; font-weight: 600; color: var(--pp-sub); white-space: nowrap; }
.pp-no b { color: var(--pp-ink); font-weight: 700; letter-spacing: 0.04em; }
.pp-holder { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: -6px 0 0; font-size: 14px; }
.pp-holder-label,
.pp-since { color: var(--pp-sub); font-weight: 600; }
.pp-holder b { font-size: 17px; font-weight: 750; }
.pp-since { margin-left: auto; font-size: 13px; }

/* Frequent-flyer card: the plastic card in a passenger's wallet, coloured by status. */
.pp-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: space-between;
  gap: 6px 14px;
  box-sizing: border-box;
  width: min(100%, 440px);
  min-height: 168px;
  padding: 18px 22px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2b5fc4, #163a86);
  color: #fff;
  box-shadow: 0 10px 22px rgba(20, 20, 50, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.pp-card[data-tier="silver"] { background: linear-gradient(135deg, #eceff3, #b3bac5); color: #1b2030; }
.pp-card[data-tier="gold"] { background: linear-gradient(135deg, #f0d791, #b48b38); color: #2a1c04; }
.pp-card[data-tier="platinum"] { background: linear-gradient(135deg, #575c66, #202228); color: #f0f2f6; }
.pp-card-brand { font-size: 13px; font-weight: 650; opacity: 0.8; }
.pp-card-tier { grid-row: 2; font-size: 34px; font-weight: 800; line-height: 1; }
.pp-card-miles { grid-row: 2; align-self: end; font-size: 15px; font-weight: 600; }
.pp-card-miles b { font-size: 22px; font-weight: 800; }
.pp-card-track { position: relative; grid-column: 1 / -1; display: block; height: 6px; margin-top: 10px; border-radius: 3px; background: color-mix(in srgb, currentColor 22%, transparent); }
.pp-card-track i { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.pp-card-track s { position: absolute; top: -3px; width: 2px; height: 12px; background: currentColor; opacity: 0.55; }
.pp-card-next { grid-column: 1 / -1; font-size: 13px; font-weight: 650; opacity: 0.85; }

/* Miles runs to six or seven figures: its column takes the room the narrower page no longer has. */
.pp-totals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); margin: 0; }
.pp-totals > div { display: grid; grid-template-rows: 1fr auto; gap: 4px; padding: 0 10px; border-left: 1px solid var(--pp-rule); }
.pp-totals > div:first-child { padding-left: 0; border-left: 0; }
.pp-totals dt { font-size: 12px; font-weight: 650; color: var(--pp-sub); }
.pp-totals dd { margin: 0; font-size: 23px; font-weight: 780; letter-spacing: -0.01em; white-space: nowrap; }

.pp-month { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 14px; border-radius: 8px; background: rgba(29, 13, 120, 0.07); font-size: 14px; }
.pp-month b { font-weight: 750; }
.pp-month span span + span::before { content: "·"; margin-right: 8px; color: var(--pp-sub); }
.pp-month > span { display: flex; flex-wrap: wrap; gap: 4px 8px; color: #3b3650; font-weight: 600; }

.pp-recent[hidden] { display: none; }
.pp-recent h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--pp-sub); }
.pp-recent ol { display: grid; margin: 0; padding: 0; list-style: none; }
.pp-recent li { display: grid; grid-template-columns: 90px 120px minmax(0, 1fr) auto; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--pp-rule); font-size: 14px; }
.pp-recent li:last-child { border-bottom: 1px solid var(--pp-rule); }
.pp-recent li b { font-weight: 750; }
.pp-recent-ac { overflow: hidden; color: var(--pp-sub); white-space: nowrap; text-overflow: ellipsis; }
.pp-recent-at { color: var(--pp-sub); font-weight: 600; }
.pp-covers { display: flex; align-items: center; gap: 12px; margin-top: auto; font-size: 13px; font-weight: 650; color: var(--pp-sub); }
.pp-covers > span:last-child { display: flex; align-items: center; gap: 4px; }
.pp-swatch { position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.pp-swatch i { position: absolute; inset: 6px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(214, 184, 110, 0.8); }
.pp-swatch[data-cover="navy"] i { background: #1D0D78; }
.pp-swatch[data-cover="burgundy"] i { background: #5c1430; }
.pp-swatch[data-cover="forest"] i { background: #143f2f; }
.pp-swatch[data-cover="graphite"] i { background: #2a2c32; box-shadow: inset 0 0 0 1.5px rgba(205, 210, 218, 0.8); }
.pp-swatch[aria-pressed="true"] i { outline: 2px solid var(--pp-ink); outline-offset: 2px; }
.pp-swatch[data-locked="1"] i { opacity: 0.45; }
.pp-covers .pp-tag { display: inline-flex; }
.pp-mrz { margin: 0; overflow: hidden; font-family: "Consolas", "Courier New", monospace; font-size: 15px; letter-spacing: 0.12em; color: rgba(28, 24, 52, 0.55); white-space: nowrap; }

.pp-stamps { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 12px 20px; min-height: 0; }
.pp-stamps.is-turning { animation: ppTurn 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.pp-stamps[data-dir="prev"].is-turning { animation-name: ppTurnBack; }
@keyframes ppTurn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes ppTurnBack { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }
.pp-slot { position: relative; display: grid; place-items: center; min-height: 0; }
/* Earlier visits: fainter impressions of the same stamp peeking out behind it (outline only, so words never clash). */
.pp-ghost { position: absolute; inset: 0; display: grid; place-items: center; transform: translate(-9px, -8px) rotate(-11deg); opacity: 0.28; }
.pp-ghost .ppstamp > span,
.pp-ghost .ppstamp > b { visibility: hidden; }
.pp-slot.is-new > .ppstamp { animation: ppFresh 220ms cubic-bezier(0.3, 1.4, 0.5, 1) 420ms backwards; }
@keyframes ppFresh { from { opacity: 0; transform: rotate(var(--tilt)) scale(1.45); } }
.pp-visits { position: absolute; right: 4%; bottom: 2%; color: var(--ink); font-size: 18px; font-weight: 700; font-style: italic; transform: rotate(-8deg); }
.pp-empty { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-content: center; justify-items: center; gap: 8px; text-align: center; color: var(--pp-sub); font-size: 14px; }
.pp-empty b { color: var(--pp-ink); font-size: 17px; }
/* The page's watermark crest already sits where the first stamp will land. */
.pp-empty-ring { display: none; }
.pp-nav { display: flex; justify-content: flex-end; gap: 8px; }
.pp-nav button { width: 48px; height: 40px; border: 1px solid var(--pp-rule); border-radius: 8px; background: transparent; color: var(--pp-ink); font: inherit; font-size: 22px; line-height: 1; cursor: pointer; }
.pp-nav button:not(:disabled):hover { background: rgba(29, 13, 120, 0.07); }
.pp-nav button:disabled { opacity: 0.35; cursor: default; }


/* Phone landscape (also the rotated app): the open booklet fills the screen; text 12px and taps 40px at least. */
html.airshow-mobile-runtime .pp-overlay { padding: max(6px, env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); }
html.airshow-mobile-runtime .pp-book { aspect-ratio: auto; width: 100%; height: 100%; padding: 5px; }
html.airshow-mobile-runtime .pp-page { gap: 6px; padding: 8px 12px 6px; }
html.airshow-mobile-runtime .pp-head h2,
html.airshow-mobile-runtime .pp-head h3 { font-size: 16px; }
html.airshow-mobile-runtime .pp-no,
html.airshow-mobile-runtime .pp-pageno,
html.airshow-mobile-runtime .pp-holder,
html.airshow-mobile-runtime .pp-since,
html.airshow-mobile-runtime .pp-holder b { font-size: 12px; }
html.airshow-mobile-runtime .pp-no > span:first-child,
html.airshow-mobile-runtime .pp-holder-label,
html.airshow-mobile-runtime .pp-mrz { display: none; }
html.airshow-mobile-runtime .pp-holder { margin: -3px 0 0; }
html.airshow-mobile-runtime .pp-card { width: 100%; min-height: 0; gap: 2px 10px; padding: 7px 12px 6px; border-radius: 10px; }
html.airshow-mobile-runtime .pp-card-brand,
html.airshow-mobile-runtime .pp-card-next,
html.airshow-mobile-runtime .pp-card-miles { font-size: 12px; }
html.airshow-mobile-runtime .pp-card-tier { font-size: 20px; }
html.airshow-mobile-runtime .pp-card-miles b { font-size: 16px; }
html.airshow-mobile-runtime .pp-card-track { height: 4px; margin-top: 3px; }
html.airshow-mobile-runtime .pp-card-track s { top: -2px; height: 8px; }
html.airshow-mobile-runtime .pp-totals > div { gap: 1px; padding: 0 5px; }
html.airshow-mobile-runtime .pp-totals dt { font-size: 12px; line-height: 1.15; overflow-wrap: anywhere; }
html.airshow-mobile-runtime .pp-totals dd { font-size: 16px; }
html.airshow-mobile-runtime .pp-month { gap: 0 8px; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
html.airshow-mobile-runtime .pp-month > span { gap: 0 6px; }
html.airshow-mobile-runtime .pp-month span span + span::before { margin-right: 5px; }
html.airshow-mobile-runtime .pp-recent h3 { margin-bottom: 1px; font-size: 12px; }
html.airshow-mobile-runtime .pp-recent li { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 8px; padding: 2px 0; font-size: 12px; }
html.airshow-mobile-runtime .pp-covers { gap: 4px; font-size: 12px; }
html.airshow-mobile-runtime .pp-swatch { width: 40px; height: 40px; }
html.airshow-mobile-runtime .pp-swatch i { inset: 9px; }
html.airshow-mobile-runtime .pp-stamps { grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
/* Stamps on a phone: word, code and city in 12px type at least; the date stays in the stamp's spoken label. */
html.airshow-mobile-runtime .pp-slot .ppstamp .ppstamp-word,
html.airshow-mobile-runtime .pp-slot .ppstamp .ppstamp-city { font-size: 12px; letter-spacing: 0; }
html.airshow-mobile-runtime .pp-slot .ppstamp .ppstamp-date { display: none; }
html.airshow-mobile-runtime .pp-slot .ppstamp .ppstamp-code { margin: 3px 0; }
html.airshow-mobile-runtime .pp-visits { font-size: 13px; }
html.airshow-mobile-runtime .pp-empty { gap: 4px; font-size: 12px; }
html.airshow-mobile-runtime .pp-empty b { font-size: 14px; }
html.airshow-mobile-runtime .pp-nav { gap: 6px; }
html.airshow-mobile-runtime .pp-nav button { width: 44px; height: 40px; font-size: 18px; border-radius: 6px; }
html.airshow-mobile-runtime .pp-close { top: 6px; right: 8px; height: 40px; padding: 0 12px; font-size: 13px; border-radius: 6px; }
html.airshow-mobile-runtime .pp-visas .pp-head { min-height: 32px; padding-right: 100px; }
html.airshow-mobile-runtime .pp-cover { gap: 10px; }
html.airshow-mobile-runtime .pp-cover-title { font-size: 18px; }
html.airshow-mobile-runtime .pp-crest { width: 64px; height: 64px; }
html.airshow-mobile-runtime .pp-cover-brand { font-size: 12px; }

/* Phone held upright (the start screen is not rotated): one page under the other, scrolled, no cover swing. */
@media (max-width: 600px) and (orientation: portrait) {
  html:not(.airshow-force-landscape) .pp-overlay { place-items: stretch; overflow-y: auto; }
  html:not(.airshow-force-landscape) .pp-book { grid-template-columns: 1fr; aspect-ratio: auto; width: 100%; height: auto; min-height: 100%; transform: none; }
  html:not(.airshow-force-landscape) .pp-book::before { clip-path: inset(0); }
  html:not(.airshow-force-landscape) .pp-cover { display: none; }
  html:not(.airshow-force-landscape) .pp-data { opacity: 1; border-radius: 6px 6px 0 0; box-shadow: inset 0 -16px 18px -16px rgba(70, 50, 10, 0.32); }
  html:not(.airshow-force-landscape) .pp-visas { border-radius: 0 0 6px 6px; box-shadow: inset 0 16px 18px -16px rgba(70, 50, 10, 0.32); }
  html:not(.airshow-force-landscape) .pp-book { align-self: start; align-content: start; min-height: 0; }
  html:not(.airshow-force-landscape) .pp-data .pp-head,
  html:not(.airshow-force-landscape) .pp-holder { padding-right: 100px; }
  html:not(.airshow-force-landscape) .pp-covers { margin-top: 2px; }
  html:not(.airshow-force-landscape) .pp-visas .pp-head { padding-right: 0; }
  html:not(.airshow-force-landscape) .pp-stamps { flex: none; grid-template-rows: repeat(2, 120px); }
  html:not(.airshow-force-landscape) .pp-recent li { grid-template-columns: auto auto minmax(0, 1fr); }
  html:not(.airshow-force-landscape) .pp-recent-at { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pp-overlay,
  .pp-book,
  .pp-book::before,
  .pp-data,
  .pp-cover { transition: none; }
  .pp-stamps.is-turning,
  .pp-slot.is-new > .ppstamp { animation: none; }
}
