/* Urdu (RTL) support and the phrase card. Uses tokens from tokens.css. */
html[dir="rtl"] body { font-family: "Noto Nastaliq Urdu", serif; line-height: 1.9; }
html[dir="rtl"] .pc-ur,
html[dir="rtl"] .pc-driver-ur { font-family: "Noto Nastaliq Urdu", serif; }
html[dir="rtl"] .dock,
html[dir="rtl"] .features { direction: rtl; }

.pc {
  color: #f3ebdd;
  background: var(--glass-soft, rgba(24, 20, 17, 0.86));
  border: 1px solid var(--line, rgba(243, 235, 221, 0.16));
  border-radius: 12px;
  padding: 16px;
  max-width: 560px;
}
.pc-title { margin: 0 0 10px; font-size: 1.25rem; }
.pc-search {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: #15120f;
  color: inherit;
  border: 1px solid var(--line, rgba(243, 235, 221, 0.16));
  border-radius: 8px;
}
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pc-item { padding: 10px 0; border-bottom: 1px solid var(--line, rgba(243, 235, 221, 0.16)); }
.pc-ur { font-family: "Noto Nastaliq Urdu", serif; font-size: 1.9rem; line-height: 1.8; margin: 0; }
.pc-roman { margin: 0; font-style: italic; opacity: 0.9; }
.pc-en { margin: 2px 0 6px; font-size: 0.9rem; opacity: 0.7; }
.pc-review { margin: 0 0 6px; font-size: 0.85rem; color: var(--accent, #e9a23b); }
.pc-empty { opacity: 0.8; }

.pc-driver {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #15120f;
  color: #f3ebdd;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px;
  text-align: center;
}
.pc-driver-ur { font-family: "Noto Nastaliq Urdu", serif; font-size: clamp(2.4rem, 9vw, 4.5rem); line-height: 1.9; margin: 0; }
.pc-driver-roman { font-size: 1.2rem; margin: 0; opacity: 0.85; }

@media (max-width: 480px) {
  .pc { padding: 12px; }
  .pc-ur { font-size: 1.6rem; }
}

/* landing page: language toggle and the phrase-card modal (wired by the lead) */
.lang-btn { font: inherit; color: inherit; background: none; border: 1px solid var(--line-2, rgba(243,235,221,.32)); border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.lang-btn[lang="ur"] { font-family: "Noto Nastaliq Urdu", serif; line-height: 1.2; }
.pc-modal { position: fixed; inset: 0; z-index: 50; background: rgba(10,8,6,.6); display: grid; place-items: center; padding: 16px; overflow: auto; }
.pc-modal > :first-child { width: min(640px, 100%); max-height: calc(100dvh - 96px); overflow: auto; background: var(--glass, rgba(24,20,17,.94)); border: 1px solid var(--line, rgba(243,235,221,.16)); border-radius: 14px; padding: 16px; }
.pc-close { margin-top: 10px; font: inherit; color: #15120f; background: #e9a23b; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
/* phrase card controls: styled on every page (home has no .chip of its own), 44 px targets */
.pc { font-family: var(--font-ui); }
.pc-title { font: 600 1.4rem var(--f-title); letter-spacing: .08em; }
.pc-place, .pc-search { display: block; width: 100%; box-sizing: border-box; min-height: 44px; margin-bottom: 10px; padding: 0 12px;
  font: 400 .95rem var(--font-ui); color: var(--cream); background: #15120f; border: 1px solid var(--line-2); border-radius: 8px; }
.pc-place option { background: #15120f; color: var(--cream); }
.pc .pc-show, .pc-driver .chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; font: 500 .9rem var(--font-ui);
  color: var(--cream); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; }
.pc .pc-show:hover, .pc-driver .chip:hover { border-color: var(--saffron); color: var(--saffron); }
.pc-close { min-height: 44px; font-weight: 600; }

/* ---- right-to-left fixes for the Play page, trip kit, planner, story flights and dialogs ---- */
/* Nastaliq for Urdu letters, each page's own face for Latin ones (English place names, data quotes stay as they are) */
html[dir="rtl"] {
  --font-ui: "Schibsted Grotesk", "Noto Nastaliq Urdu", system-ui, sans-serif;
  --font-text: "Literata", "Noto Nastaliq Urdu", serif;
  --f-title: "Cormorant SC", "Noto Nastaliq Urdu", serif;
  --f-sub: "Cormorant Garamond", "Noto Nastaliq Urdu", serif;
}
html[dir="rtl"] #labels { direction: ltr; }                            /* map labels are English names with "m 3,890" heights */
html[dir="rtl"] .play-choice { text-align: right; }
html[dir="rtl"] .play-sharebox { direction: rtl; text-align: right; }
html[dir="rtl"] .pn-track, html[dir="rtl"] .pv-stage { direction: ltr; }   /* photo carousel: scrolling maths is left-to-right */
html[dir="rtl"] * { letter-spacing: normal !important; }                /* tracking pulls the joined Arabic-script letters apart */
html[dir="rtl"] .cartouche h1 .w { margin-right: 0; margin-left: .3em; }
html[dir="rtl"] .pn-name, html[dir="rtl"] .sheet .plan-title, html[dir="rtl"] .sf-n { line-height: 1.75; }   /* Nastaliq runs tall; keeps the title clear of what follows */
html[dir="rtl"] .sheet .lp-hits button { text-align: right; }
@media (max-width: 700px) {
  html[dir="rtl"] .dockwrap::after { right: auto; left: 0; border-radius: 999px 0 0 999px; background: linear-gradient(270deg, rgba(24, 20, 17, 0), var(--glass) 82%); }   /* the dock scrolls toward the left */
  html[dir="rtl"] .dockwrap .dock { padding: 5px 12px 5px 6px; }
}
@media (min-width: 701px) {
  html[dir="rtl"] .topright { align-items: flex-start; }               /* the light pill and popovers stay under the right-hand end of the controls row */
}
html[dir="rtl"] dialog h2, html[dir="rtl"] .modal-card h2 { line-height: 1.8; }   /* wrapped Nastaliq headings must not overlap their own lines */
