/* ==========================================================================
   DEPARTURES BOARD — the closing call-to-action at the top of the footer.
   "Where to next?" + an airport split-flap board whose letters flip to the
   next destinations every few seconds.
   Logic: js/sections/footer.js     Cities: content/texts.js → footer.cities
   ========================================================================== */

.depart {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: clamp(32px, 5vw, 72px);
  padding-bottom: clamp(56px, 7vw, 88px); margin-bottom: clamp(48px, 6vw, 72px);
  border-bottom: 1px solid color-mix(in srgb, var(--cream) 10%, transparent);
}
.depart__kicker { display: inline-flex; align-items: center; gap: 10px; font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
[dir="rtl"] .depart__kicker { letter-spacing: 0; font-size: .95rem; }
.depart__kicker svg { width: 22px; height: 14px; fill: var(--orange); transform: scaleX(var(--dir)); }
.depart__title { margin: 16px 0 0; font-size: clamp(2.6rem, 6vw, 5.2rem); font-weight: 700; line-height: 1; letter-spacing: -.035em; color: var(--text-on-dark); }
[dir="rtl"] .depart__title { letter-spacing: 0; line-height: 1.3; }
.depart__title em { font-style: normal; color: var(--orange); }

/* ---------- The board ---------- */
.board {
  --flap-top:    color-mix(in srgb, var(--navy) 75%, #000);   /* upper half of each flap  */
  --flap-bottom: color-mix(in srgb, var(--navy-dark) 70%, #000); /* lower half of each flap */
  padding: 18px 20px 12px; border-radius: 22px;
  background: color-mix(in srgb, var(--navy-dark) 80%, #000);
  border: 1px solid color-mix(in srgb, var(--cream) 10%, transparent);
  box-shadow: 0 40px 80px -40px #000, inset 0 1px 0 color-mix(in srgb, var(--cream) 8%, transparent);
}
.board__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; }
.board__title { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-logo); font-size: .78rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--orange); }
[dir="rtl"] .board__title { font-family: var(--font-headings); letter-spacing: 0; font-size: .95rem; }
.board__title svg { width: 22px; height: 14px; fill: currentColor; transform: scaleX(var(--dir)) rotate(-12deg); }
.board__clock { font-family: var(--font-numbers); font-size: .9rem; font-weight: 700; color: var(--text-on-dark); font-variant-numeric: tabular-nums; direction: ltr; }

.board__row {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 9px 0; border-top: 1px dashed color-mix(in srgb, var(--cream) 9%, transparent);
}

/* ---------- One split-flap ----------
   Each box has 4 halves: a fixed top + bottom, and two moving halves that
   fold down (top falls away, new bottom swings in) — like a real airport board. */
.flap { display: inline-flex; gap: 3px; direction: ltr; }
.flap__char, .flap__word {
  --flap-h: 32px;
  position: relative; display: inline-block; height: var(--flap-h);
  border-radius: 5px; color: var(--cream);
  font-family: var(--font-numbers); font-weight: 700; font-size: 1rem; text-transform: uppercase;
  box-shadow: 0 2px 4px #0006;
  perspective: 220px;
}
.flap__char { width: 23px; text-align: center; font-variant-numeric: tabular-nums; }
.flap--time .flap__char { color: var(--orange-light); }
.flap--city { display: flex; min-width: 0; direction: inherit; }
.flap__word { width: 100%; text-align: start; font-size: .92rem; letter-spacing: .06em; }
.flap__word { font-family: var(--font-body); font-weight: 700; }
[dir="rtl"] .flap__word { letter-spacing: 0; }

.fl { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.fl i { position: absolute; left: 0; right: 0; height: var(--flap-h); line-height: var(--flap-h); font-style: normal; white-space: nowrap; }
.flap__word .fl i { padding: 0 12px; overflow: hidden; text-overflow: ellipsis; }
.fl--top, .fl--flip-top       { top: 0;    background: var(--flap-top);    border-radius: 5px 5px 0 0; transform-origin: 50% 100%; }
.fl--bottom, .fl--flip-bottom { bottom: 0; background: var(--flap-bottom); border-radius: 0 0 5px 5px; transform-origin: 50% 0; }
.fl--top i, .fl--flip-top i       { top: 0; }
.fl--bottom i, .fl--flip-bottom i { bottom: 0; }
.fl--flip-top, .fl--flip-bottom { z-index: 2; will-change: transform; }
.fl--flip-bottom { transform: rotateX(90deg); }          /* hidden until it swings in */
.flap__char::after, .flap__word::after {                   /* the hinge line across the middle */
  content: ""; position: absolute; z-index: 3; left: 0; right: 0; top: 50%; height: 1px; background: #000a;
}

/* status pill */
.board__status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; color: var(--text-on-dark-soft); background: color-mix(in srgb, var(--cream) 6%, transparent); }
.board__status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.board__status.is-boarding { color: var(--navy); background: var(--orange); }
.board__status.is-boarding::before { animation: board-blink 1s steps(2) infinite; }
@keyframes board-blink { 50% { opacity: 0; } }

/* ---------- Smaller screens ---------- */
@media (max-width: 960px) { .depart { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .board { padding: 14px 12px 8px; }
  .board__row { gap: 6px; grid-template-columns: auto auto minmax(0, 1fr); }
  .board__status { display: none; }
  .flap { gap: 2px; }
  .flap__char { width: 17px; --flap-h: 28px; font-size: .82rem; }
  .flap__word { --flap-h: 28px; font-size: .8rem; }
  .flap__word .fl i { padding: 0 8px; }
}
