/* =========================================================================
   Chairday legal documents, help articles and the cookie consent banner.
   Additions to the Daylight kit; tokens only, so both themes work.
   The cookie banner partial links this file itself, so it works inside any
   layout on any host (chairday.io, business sites).
   ========================================================================= */

/* ---------- Legal document page ---------- */
.cd-legal-page { min-width: 0; }
.cd-legal-aside { display: none; }
@media (min-width: 1024px) {
  .cd-legal-layout { --cd-aside: 260px; }
  .cd-legal-aside { display: block; }
  .cd-legal-aside .cd-sticky { --cd-sticky-top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
}
.cd-legal-toc { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 0.875rem; line-height: 1.4; }
.cd-legal-toc a { color: var(--cd-text); font-weight: 500; }

/* Long-form text: the kit's .cd-prose plus tables, notes and forms */
.cd-legal h2 { scroll-margin-top: 88px; }
.cd-legal h3 { scroll-margin-top: 88px; }
.cd-legal table, .cd-help table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.cd-legal th, .cd-legal td, .cd-help th, .cd-help td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--cd-border); overflow-wrap: anywhere; }
@media (max-width: 479.98px) { .cd-legal th, .cd-legal td, .cd-help th, .cd-help td { padding: 6px 6px; font-size: 0.875rem; } }
.cd-legal thead th, .cd-help thead th { font: 700 0.75rem/1.3 var(--cd-font-ui); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cd-text-muted); }
.cd-legal-note {
  padding: 10px 14px; border-left: 3px solid var(--cd-warning); border-radius: 0 10px 10px 0;
  background: var(--cd-warning-soft); color: var(--cd-text); font-size: 0.9375rem;
}
.cd-legal-callout, .cd-help-note {
  padding: 12px 16px; border-radius: var(--cd-radius-md); background: var(--cd-surface-2); border: 1px solid var(--cd-border);
}
.cd-help-tip { padding: 12px 16px; border-radius: var(--cd-radius-md); background: var(--cd-info-soft); }
.cd-legal-form {
  padding: 20px; border: 1.5px dashed var(--cd-border-strong); border-radius: var(--cd-radius-lg); background: var(--cd-surface);
}
.cd-legal-fill { display: inline-block; min-width: 14em; border-bottom: 1px solid var(--cd-text-muted); color: var(--cd-text-muted); }
.cd-help-steps { padding-left: 1.4em; }
.cd-help-steps > li + li { margin-top: 0.6em; }
.cd-legal-editor { min-height: 420px; font-size: 0.8125rem; line-height: 1.5; }

/* ---------- Cookie consent banner ---------- */
:root { --cd-consent-h: 300px; }
@media (min-width: 768px) { :root { --cd-consent-h: 170px; } }
body:has(> .cd-consent) { padding-bottom: var(--cd-consent-h); }
html:has(.cd-consent) { scroll-padding-bottom: calc(var(--cd-consent-h) + 16px); }

.cd-consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 0 0 env(safe-area-inset-bottom);
}
.cd-has-bottombar .cd-consent { bottom: calc(88px + env(safe-area-inset-bottom)); }
.cd-consent__inner {
  display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); align-items: center;
  margin: 0 auto; padding: 16px var(--cd-gutter) 18px; max-width: 1040px;
  background: var(--cd-surface); color: var(--cd-text);
  border: 1px solid var(--cd-border-strong); border-bottom: 0; border-radius: 20px 20px 0 0; box-shadow: var(--cd-shadow-3);
}
@media (min-width: 768px) {
  .cd-consent { padding: 0 16px calc(16px + env(safe-area-inset-bottom)); }
  .cd-consent__inner { grid-template-columns: minmax(0, 1fr) auto; padding: 18px 22px; border-bottom: 1px solid var(--cd-border-strong); border-radius: 20px; }
}
.cd-consent__text { display: flex; flex-direction: column; gap: 4px; font-size: 0.9375rem; line-height: 1.45; }
.cd-consent__title { font: 700 1.0625rem/1.3 var(--cd-font-display); }
.cd-consent__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cd-consent__actions .cd-btn { --cd-btn-px: 10px; font-size: 0.9375rem; white-space: normal; }
@media (min-width: 768px) { .cd-consent__actions { grid-template-columns: repeat(3, auto); } .cd-consent__actions .cd-btn { --cd-btn-px: 18px; white-space: nowrap; } }

.cd-consent-form .cd-consent__actions { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 480px) { .cd-consent-form .cd-consent__actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cd-consent-choice { padding: 12px 0; border-top: 1px solid var(--cd-border); }
.cd-consent-choice:first-of-type { border-top: 0; padding-top: 0; }
.cd-consent-choice .cd-switch__text b { display: block; font-size: 0.9375rem; }
.cd-consent-dialog { width: min(560px, calc(100vw - 32px)); }

@media print { .cd-consent, .cd-consent-dialog { display: none !important; } body:has(> .cd-consent) { padding-bottom: 0; } }
