/* Site-wide additions for the server-rendered pages (owner: site team). Loaded after the page CSS
   from design/prototype (public/css, synced, never edited). Served at /static/site/app.css.
   1. Cookie Settings dialog and the banner extras: the "SHARED?" parts of
      design/prototype/css/pages/cookie-settings.css, needed on every page (the dialog opens from the
      footer everywhere).
   2. Review aids shown only off production: DRAFT wording outlines, notes for the solicitor in legal
      documents, the environment bar. Production never renders their markup; staging shows the
      outlines and the bar only with DRAFT_MARKERS=on (content/domain/site-flags.ts). */

/* ---------- 1. Cookie banner + Cookie Settings dialog (from cookie-settings.css) ---------- */
.cookie-banner .row { margin-block: var(--space-4) 0; }
.cookie-banner__links { display: flex; align-items: center; justify-content: center; gap: var(--space-3); margin-top: var(--space-4) !important; font-size: 14px; }
.cookie-banner__links a { color: var(--color-mint); font-weight: 600; text-underline-offset: 3px; }
.cookie-banner__links span { color: var(--color-text-muted); }

.cookie-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 520px; margin: 0 auto;
  padding: var(--space-5); border-radius: var(--radius-lg); border: var(--border-card);
  background: var(--color-surface); color: var(--color-text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}
dialog.cookie-dialog { position: fixed; inset: 0; margin: auto; width: calc(100% - 2 * var(--space-4)); height: fit-content; max-height: calc(100dvh - 2 * var(--space-4)); overflow: auto; }
dialog.cookie-dialog:not([open]) { display: none; }
dialog.cookie-dialog::backdrop { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cookie-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.cookie-dialog__head h2 { font-size: 34px; }
.icon-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); border: var(--border-line); background: transparent; color: var(--color-white); cursor: pointer; }
.icon-btn:hover { border-color: var(--color-mint); color: var(--color-mint); }
.icon-btn svg { width: 20px; height: 20px; }
.cookie-dialog__intro { font-size: 14px; color: var(--color-text-muted); margin: 0; }
.cookie-cats { list-style: none; margin: var(--space-4) 0; padding: 0; display: grid; gap: var(--space-3); }
.cookie-cat { padding: var(--space-4); border-radius: var(--radius-md); border: var(--border-line); background: var(--color-black); }
.cookie-cat__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.cookie-cat h3 { font-family: var(--font-body); font-size: 16px; font-weight: 700; letter-spacing: 0; line-height: 1.3; margin: 0; }
.cookie-cat p { margin: var(--space-2) 0 0; font-size: 14px; color: var(--color-text-muted); }
.cookie-dialog__choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-4); }
.cookie-dialog__choices .btn { font-size: 18px; min-height: 46px; }
.cookie-dialog__choices .btn--equal { background: var(--color-white); color: #000; }
.cookie-dialog__foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3) var(--space-4); }
.cookie-dialog__foot .btn { min-height: 46px; font-size: 20px; padding: 0 var(--space-6); }
.cookie-dialog__foot a { font-size: 14px; font-weight: 600; color: var(--color-mint); text-underline-offset: 3px; }

.switch { display: inline-flex; align-items: center; gap: var(--space-2); }
.switch input {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0;
  width: 46px; height: 26px; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--color-line); border: 1px solid #8A918F; transition: background var(--motion-base);
}
.switch input::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--color-white); transition: transform var(--motion-base) var(--motion-ease); }
.switch input:checked { background: var(--color-mint); border-color: var(--color-mint); }
.switch input:checked::before { transform: translateX(20px); background: var(--color-mint-ink); }
.switch input:disabled { cursor: not-allowed; }
.switch__state { font-size: 12px; font-weight: 700; color: var(--color-mint); }

.status-chip { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-pill); border: 1px solid var(--color-text-faint); color: var(--color-text-muted); }
.status-chip--mint { border-color: rgba(0, 230, 161, 0.5); color: var(--color-mint); }

@media (min-width: 768px) {
  .cookie-dialog { padding: var(--space-6); }
}

/* ---------- 2. Review aids (development and staging only) ---------- */
/* Our wording awaiting James's approval (text/rich blocks with draft=true): the block leaves a hidden
   <ile-draft> after itself and its parent element is outlined; the block's own markup is untouched. */
ile-draft { display: none; }
:has(> ile-draft) { outline: 1px dashed rgba(255, 204, 0, 0.7); outline-offset: 3px; border-radius: 2px; }

/* Legal documents: notes for the solicitor/developer and our unapproved additions (never published
   in production: domain/legal-render.ts drops them, publishing refuses them). */
.legal-note { background: rgba(255, 204, 0, 0.16); color: #FFE27A; border-bottom: 1px dashed rgba(255, 204, 0, 0.8); padding: 0 0.15em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
[data-draft-note]:not(mark) { position: relative; outline: 1px dashed rgba(255, 204, 0, 0.7); outline-offset: 6px; border-radius: 4px; }
[data-draft-note]:not(mark)::before {
  content: "Draft: not for publication"; display: inline-block; margin-bottom: var(--space-2);
  padding: 2px 8px; border-radius: var(--radius-pill); background: rgba(255, 204, 0, 0.16); color: #FFE27A;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.legal-toc-note { color: #FFE27A; }
.legal-version-note { margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: var(--border-line); background: var(--color-surface); font-size: var(--type-small-size); color: var(--color-text-muted); }
.legal-version-note a { color: var(--color-mint); }

/* Environment bar: a slim strip in the normal flow above the sticky header (it scrolls away with the
   page), so it never covers content, the phone tab bar or the checkout. Was a fixed pill at the
   bottom until 09.10, which covered "Explore ILE+" on phones and the cooling-off box on desktop. */
.env-note {
  position: static; margin: 0; padding: 3px var(--space-4) 4px;
  background: #1A1505; border-bottom: 1px dashed rgba(255, 204, 0, 0.55);
  color: #FFE27A; font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: 0.04em; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.env-note__short { display: none; }
@media (max-width: 559.98px) { .env-note__long { display: none; } .env-note__short { display: inline; } }

@media print {
  :has(> ile-draft), [data-draft-note] { outline: 0; }
  .env-note, .cookie-banner, dialog.cookie-dialog { display: none !important; }
}
