/* Qissa legal pages. Static, print-friendly. The only script (legal.js) builds
   the contents rail from the headings already on the page; with it off the
   pages read exactly the same, minus the rail.
   Palette from design/tokens.json: midnight ink #11142F on bone ground #F5EFE0,
   one gold accent rule #D9A63F (decorative hairline only, never text). */

* {
  box-sizing: border-box;
}

html {
  background: #F5EFE0;
}

body {
  margin: 0;
  padding: 0 0 2rem;
  background: #F5EFE0;
  color: #11142F;
  font-family: Charter, "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.7;
}

/* reading column, centered inside the full-bleed night bands */
main, footer.site .inner {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ---------- night-register site header, shared look with the landing ---------- */
header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.9rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(17, 20, 47, 0.94);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid rgba(217, 166, 63, 0.3);
  margin-bottom: 2.75rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  text-decoration: none;
  color: #F5EFE0;
}
a.wordmark .wm-urdu {
  font-family: "Noto Nastaliq Urdu", "Geeza Pro", serif;
  font-size: 1.15rem;
  line-height: 2;
  color: #D9A63F;
}

nav.site-nav {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9375rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
nav.site-nav a {
  color: rgba(245, 239, 224, 0.72);
  text-decoration: none;
}
nav.site-nav a { transition: color 0.2s ease; }
nav.site-nav a:hover { color: #F5EFE0; }
nav.site-nav a[aria-current="page"] { color: #D9A63F; }
nav.site-nav a:focus-visible { outline: 2px solid #D9A63F; outline-offset: 2px; }

h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 0 0 0.375rem;
}

p.meta {
  font-size: 0.9375rem;
  margin: 0 0 2.25rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2.75rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(17, 20, 47, 0.14);
}
/* headings land below the sticky header when jumped to */
h2[id], h3[id] { scroll-margin-top: 5.5rem; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- contents rail (built by legal.js, wide screens only) ---------- */
nav.toc { display: none; }
@media (min-width: 1180px) {
  nav.toc {
    display: block;
    position: fixed;
    top: 6.75rem;
    left: max(1.5rem, calc(50% - 21rem - 16.5rem));
    width: 13.5rem;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.8125rem;
    line-height: 1.4;
  }
  nav.toc .toc-title {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(17, 20, 47, 0.55);
  }
  nav.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid rgba(17, 20, 47, 0.16); }
  nav.toc li { margin: 0; }
  nav.toc a {
    display: block;
    padding: 0.32rem 0 0.32rem 0.85rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: rgba(17, 20, 47, 0.62);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
  }
  nav.toc a:hover { color: #11142F; }
  nav.toc a[aria-current="true"] { color: #11142F; font-weight: 500; border-left-color: #D9A63F; }
}

h3 {
  font-size: 1.0625rem;
  margin: 2rem 0 0.5rem;
}

p, ul, ol {
  margin: 0 0 1rem;
}

ul, ol {
  padding-left: 1.375rem;
}

li {
  margin-bottom: 0.375rem;
}

a {
  color: #11142F;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid #11142F;
  outline-offset: 2px;
}

.table-scroll {
  overflow-x: auto;
  margin: 1rem 0 1.25rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9375rem;
  line-height: 1.5;
}

th, td {
  border: 1px solid rgba(17, 20, 47, 0.35);
  padding: 0.5rem 0.625rem;
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 700;
}

.pending {
  font-style: italic;
}

.urdu {
  font-family: "Noto Nastaliq Urdu", "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: 1.15em;
}

footer.site {
  margin-top: 3.5rem;
  padding: 2rem 0 2.25rem;
  background: #11142F;
  color: rgba(245, 239, 224, 0.72);
  border-top: 1px solid rgba(217, 166, 63, 0.3);
  font-size: 0.9375rem;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

footer.site p {
  margin: 0 0 0.5rem;
}
footer.site a {
  color: rgba(245, 239, 224, 0.82);
  text-decoration: none;
}
footer.site a:hover { color: #F5EFE0; text-decoration: underline; text-underline-offset: 2px; }
footer.site .foot-base {
  margin-top: 0.75rem;
  color: rgba(245, 239, 224, 0.5);
  font-size: 0.8125rem;
}

/* ---------- contact form (support.html) ----------
   A night panel on the paper page, the same face as the home page's form
   (site.css .waitlist-panel): midnight ground, gold hairline, bone text,
   gold button. Fields are 58px tall, the button 60px, each choice a 44pt
   target or more; inputs are 18px so iOS never zooms. */
.contact-panel {
  margin: 1.25rem 0 0.5rem;
  padding: 1.75rem 1.6rem 1.5rem;
  border: 1px solid rgba(217, 166, 63, 0.55);
  border-radius: 22px;
  background: linear-gradient(180deg, #1B1F44, #11142F);
  color: #F5EFE0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 24px 50px -30px rgba(17, 20, 47, 0.7);
}
.contact-form { position: relative; }
.cf-field + .cf-field { margin-top: 1.1rem; }
.cf-field label {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.4;
  font-weight: 600;
  color: #F5EFE0;
}
.cf-optional { font-weight: 400; color: rgba(245, 239, 224, 0.55); }
.cf-field input,
.cf-field textarea {
  display: block;
  width: 100%;
  min-height: 58px;
  margin: 0.5rem 0 0;
  padding: 14px 18px;
  border: 1px solid rgba(217, 166, 63, 0.55);
  border-radius: 14px;
  background: rgba(12, 14, 36, 0.55);
  color: #F5EFE0;
  caret-color: #D9A63F;
  font-family: inherit;
  font-size: 18px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.cf-field textarea { min-height: 148px; resize: vertical; line-height: 1.55; }
.cf-field input::placeholder, .cf-field textarea::placeholder { color: rgba(245, 239, 224, 0.42); opacity: 1; }
.cf-field input:hover, .cf-field textarea:hover { border-color: #D9A63F; }
.cf-field input:focus, .cf-field textarea:focus { outline: none; border-color: #D9A63F; box-shadow: 0 0 0 3px rgba(217, 166, 63, 0.4); }
.cf-field input[aria-invalid="true"], .cf-field textarea[aria-invalid="true"] { border-color: #E9C77B; box-shadow: 0 0 0 3px rgba(233, 199, 123, 0.3); }
.cf-field input:-webkit-autofill,
.cf-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: #F5EFE0;
  -webkit-box-shadow: 0 0 0 100px #0C0E24 inset;
}
.cf-hint, .cf-error { margin: 0.5rem 0 0; font-size: 0.875rem; line-height: 1.5; color: rgba(245, 239, 224, 0.68); }
.cf-error { color: #E9C77B; font-weight: 500; }
.cf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-submit {
  display: block;
  width: 100%;
  min-height: 60px;
  margin-top: 1.4rem;
  padding: 17px 30px;
  border: 0;
  border-radius: 999px;
  background: #D9A63F;
  color: #11142F;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.cf-submit:hover { background: #E9C77B; box-shadow: 0 14px 38px -14px rgba(217, 166, 63, 0.7); }
.cf-submit:focus-visible { outline: 2px solid #F5EFE0; outline-offset: 4px; }
.cf-submit[disabled] { opacity: 0.7; cursor: progress; box-shadow: none; }
.cf-status { margin: 0; font-size: 1rem; line-height: 1.55; color: #F5EFE0; }
.cf-status:not(:empty) { margin-top: 1.1rem; padding-left: 0.9rem; border-left: 1px solid #D9A63F; }
.cf-consent { margin: 1.25rem 0 0; font-size: 0.875rem; line-height: 1.6; color: rgba(245, 239, 224, 0.68); }
.contact-panel a { color: #E9C77B; text-underline-offset: 3px; }
.contact-panel a:focus-visible { outline: 2px solid #D9A63F; }
.cf-done:focus { outline: none; }
.cf-done-head {
  margin: 0 0 0.6rem;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.75rem;
  line-height: 1.2;
  color: #E9C77B;
}
.cf-done p { margin: 0; font-size: 1.0625rem; line-height: 1.65; color: rgba(245, 239, 224, 0.75); }
.cf-done strong { color: #F5EFE0; font-weight: 500; overflow-wrap: anywhere; }

/* ---------- mobile: stop the nav overflowing, keep the reading gutter ---------- */
@media (max-width: 560px) {
  header.site {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.75rem 1.1rem 0.85rem;
    gap: 0.55rem;
  }
  a.wordmark { font-size: 1.1rem; }
  nav.site-nav {
    width: 100%;
    gap: 0.5rem 1.15rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
  }
  /* A sticky two-row header ate an eighth of a phone screen on every scroll.
     On a phone it scrolls away with the page, and each link gets a 44pt
     tap height (Apple HIG minimum) without looking any bigger. */
  header.site { position: static; padding-bottom: 0.35rem; }
  nav.site-nav { gap: 0 1.15rem; }
  nav.site-nav a, footer.site a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  main { padding-left: 1.1rem; padding-right: 1.1rem; }
  footer.site .inner { padding-left: 1.1rem; padding-right: 1.1rem; }
  h1 { font-size: 1.6rem; }
  .contact-panel { padding: 1.4rem 1.1rem 1.25rem; border-radius: 18px; }
}

@media print {
  html, body {
    background: #FFFFFF;
    color: #000000;
    max-width: none;
    font-size: 11pt;
  }
  header.site, footer.site {
    background: #FFFFFF;
    color: #000000;
    border-color: #000000;
  }
  nav.site-nav, nav.toc, .contact-panel {
    display: none;
  }
  header.site { position: static; }
  h2 { border-top: none; padding-top: 0; }
  a, a.wordmark, a.wordmark .wm-urdu, footer.site a, footer.site .foot-base {
    color: #000000;
  }
  .table-scroll {
    overflow-x: visible;
  }
}
