/* ═══════════════════════════════════════════════════════════════════
   media.css — the two shared image primitives built by media.js.
   Each is a fixed box with text behind the image (the flag emoji or
   the IATA code), so a failed image degrades to text, never to a gap.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Country flag ──────────────────────────────────────────────────── */
.flag {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 30px;
  flex: none;
  overflow: hidden;
  border-radius: 4px;
  background: rgb(var(--surface-muted));
  font-size: 18px;
  line-height: 1;
}

.flag img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hairline over the image edge, so light flags keep a visible outline. */
.flag::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(var(--fg) / 0.12);
  pointer-events: none;
}

.flag-text {
  font-family: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* ── Airline logo ──────────────────────────────────────────────────── */
/* White in both themes: the CDN's logos are drawn for a white ground,
   which is also how the portals show them. */
.logo {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  overflow: hidden;
  border: 1px solid rgb(var(--line));
  border-radius: var(--radius-sm);
  background: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #171717;
}

.logo img {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
  background: #fff;
}
