/* ==========================================================================
   CRISIS LINE — long-form document pages (privacy policy, support).

   Loaded after site.css. A narrow measure on a lit panel, sitting on the same
   dark ground as the rest of the site, so the legal pages read as part of the
   game rather than as a PDF someone bolted on.
   ========================================================================== */

.doc { --measure: 50rem; }

/* Page head ------------------------------------------------------------- */
.doc__head {
  padding: 3.5rem 0 2.25rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 50% -40%, rgba(79, 163, 255, 0.14), transparent 60%),
    var(--bg);
}

.doc__head h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.doc__standfirst {
  margin: 1rem 0 0;
  max-width: 42rem;
  color: var(--dim);
  font-size: 1.05rem;
}

.doc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  font: 11px/1.8 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}
.doc__meta b { color: var(--text); font-weight: 600; }

/* Body ------------------------------------------------------------------ */
.doc__body {
  /* Vertical only: a `padding` shorthand here would wipe the side gutter
     that .wrap supplies, and the text would run to the screen edge. */
  padding-top: 2.75rem;
  padding-bottom: 1rem;
  font-size: 1.02rem;
}

.doc__body h2 {
  margin: 3rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.doc__body h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

.doc__body h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
}

.doc__body p { margin: 0 0 1.1rem; }
.doc__body strong { color: #F2F5FA; font-weight: 600; }
.doc__body ul { margin: 0 0 1.2rem; padding-left: 1.2rem; }
.doc__body li { margin-bottom: 0.55rem; }
.doc__body li::marker { color: var(--accent); }

/* Numbered clauses in the privacy policy get a mono index in the margin. */
.clause {
  margin: 0 0 1.4rem;
  padding-left: 2.6rem;
  position: relative;
}
.clause::before {
  content: attr(data-n);
  position: absolute;
  left: 0;
  top: 0.15rem;
  color: var(--accent);
  font: 12px/1.6 var(--mono);
  letter-spacing: 0.1em;
}

/* Tables: real data, so give them rules and let them scroll on a phone. */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.doc__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.doc__body th,
.doc__body td {
  padding: 0.7rem 0.95rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.doc__body th {
  color: var(--dim);
  font: 10px/1.6 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--panel-2);
}

.doc__body tbody tr:last-child td { border-bottom: 0; }
.doc__body td:first-child { color: #F2F5FA; }

/* The one call-out in the policy: don't type real personal information. */
.callout {
  margin: 0 0 1.5rem;
  padding: 1.1rem 1.3rem;
  border-left: 3px solid var(--gold);
  background: rgba(232, 180, 90, 0.07);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 0.75rem; }
.callout strong { color: var(--gold); }

/* At-a-glance card: the four things people actually want to know. -------- */
.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  margin: 0 0 2.5rem;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.glance div {
  padding: 1.1rem 1.15rem;
  background: var(--panel);
}
.glance dt {
  margin: 0 0 0.4rem;
  color: var(--dim);
  font: 10px/1.5 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.glance dd {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 600;
}
.glance dd.yes { color: var(--trust); }
.glance dd.no { color: var(--dim); }

/* Contact card ---------------------------------------------------------- */
.contact {
  margin: 0 0 2rem;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contact__addr {
  display: inline-block;
  margin: 0.75rem 0 0;
  font: 700 1.15rem/1.3 var(--mono);
  letter-spacing: 0.01em;
  word-break: break-all;
}
.contact p { margin: 0.9rem 0 0; color: var(--dim); font-size: 0.95rem; }

/* Support FAQ — native <details>, since the CSP forbids script. --------- */
.faq { margin: 0 0 1.75rem; }

.faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  margin-bottom: 0.6rem;
}
.faq details[open] { background: var(--panel-2); border-color: #2C3750; }

.faq summary {
  padding: 0.95rem 1.1rem 0.95rem 2.4rem;
  position: relative;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: "+";
  position: absolute;
  left: 1rem;
  top: 0.9rem;
  color: var(--accent);
  font: 700 15px/1.4 var(--mono);
}
.faq details[open] summary::before { content: "\2212"; }

.faq summary:hover { color: #FFFFFF; }

.faq__body {
  padding: 0 1.1rem 1.1rem 2.4rem;
  color: var(--dim);
}
.faq__body p { margin: 0 0 0.85rem; }
.faq__body p:last-child { margin-bottom: 0; }
.faq__body strong { color: var(--text); }

/* An error string quoted back to the player, in the app's own voice. */
.errline {
  display: inline-block;
  padding: 0.15em 0.5em;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--ink);
  color: var(--gold);
  font: 0.88em/1.6 var(--mono);
}

.doc__body .lifeline { margin: 0 0 2rem; }

@media (max-width: 40rem) {
  .doc__head { padding: 2.5rem 0 1.75rem; }
  .doc__body { padding-top: 2rem; }
  .clause { padding-left: 0; }
  .clause::before { position: static; display: block; margin-bottom: 0.25rem; }
}
