/* ---------- Static pages: about, methodology, FAQ, contact, terms, privacy, cookies, imprint ----------
 * One layout for the text pages of the site (Django: one template per page, built from these
 * blocks). The switch between the pages of the group, the head (kicker, title, lead, the date of
 * the last change and a draft mark), a sticky table of contents beside the article, numbered
 * sections, and the blocks of the sections: callout, cards, steps, glossary, FAQ, form, consent
 * rows and facts. The pages that follow close the page. Every block is in components/static.html. */

.dp-page { display: grid; gap: 22px; }
main.dp-page { padding-top: 24px; padding-bottom: 48px; }

/* ---- Switch between the pages of the group ---- */
.dp-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.dp-switch a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid var(--line); color: var(--text); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }
.dp-switch a .icon { color: var(--color-primary); font-size: 13px; }
.dp-switch a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.dp-switch a[aria-current="page"] { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 14%, transparent); color: var(--color-primary); }
.dp-switch-sep { width: 1px; margin: 4px 4px; background: var(--line); }
.dp-switch { margin-bottom: 6px; }

/* ---- Head ---- */
.dp-head { display: grid; gap: 12px; }
.dp-head > :not(.dp-switch) { max-width: 860px; }
.dp-kicker { margin: 0; color: var(--muted); font-size: 10px; letter-spacing: .08em; }
.dp-kicker .accent { color: var(--color-primary); }
.dp-head h1 { margin: 0; font-size: clamp(30px, 3.8vw, 46px); font-weight: 700; line-height: 1.06; letter-spacing: -.025em; }
.dp-lead { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.dp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; }
.dp-meta strong { color: var(--text); font-weight: 600; }
.dp-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px dashed var(--color-warning-text); color: var(--color-warning-text); }

/* ---- Body: the contents beside the article ---- */
.dp-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: start; }
.dp-toc { position: sticky; top: 16px; display: grid; gap: 4px; padding: 14px 0; }
.dp-toc-title { margin: 0 16px 6px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .08em; }
.dp-toc ol { display: grid; margin: 0; padding: 0; list-style: none; }
.dp-toc ol a { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; padding: 6px 16px; border-left: 2px solid transparent; color: var(--muted); font-size: 13px; line-height: 1.35; }
.dp-toc ol a span { color: var(--color-primary); font-family: var(--font-mono); font-size: 10px; line-height: 1.8; }
.dp-toc ol a:hover { color: var(--text); }
.dp-toc ol a[aria-current="true"] { border-left-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 8%, transparent); color: var(--text); }
.dp-toc-foot { display: grid; gap: 4px; margin: 8px 16px 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.dp-toc-foot a { justify-self: start; color: var(--color-primary); font-family: var(--font-mono); font-size: 10px; letter-spacing: .05em; }
.dp-toc details > summary { display: none; }

.dp-article { display: grid; gap: 34px; min-width: 0; max-width: 860px; }
.dp-section { display: grid; gap: 14px; scroll-margin-top: 16px; }
.dp-section > h2 { display: flex; align-items: baseline; gap: 12px; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.dp-num { color: var(--color-primary); font-family: var(--font-mono); font-size: 12px; font-weight: 500; }
.dp-section h3 { margin: 6px 0 0; font-size: 15px; font-weight: 600; }
.dp-section p, .dp-section li { color: var(--muted); font-size: 15px; line-height: 1.7; }
.dp-section p { margin: 0; }
.dp-section p strong, .dp-section li strong { color: var(--text); font-weight: 600; }
.dp-section a:not([class]) { color: var(--color-primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--color-primary) 40%, transparent); text-underline-offset: 3px; }
.dp-list { display: grid; gap: 6px; margin: 0; padding-left: 20px; }
.dp-list li::marker { color: var(--color-primary); }
.dp-section code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); color: var(--text); font-family: var(--font-mono); font-size: 12px; }
.dp-placeholder { padding: 1px 6px; border: 1px dashed var(--color-warning-text); color: var(--color-warning-text); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; }

/* ---- Callout: info, tip, warning, draft ---- */
.dp-callout { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px 12px; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--color-primary); background: color-mix(in srgb, var(--color-primary) 6%, var(--panel)); }
.dp-callout > .icon { grid-row: span 2; color: var(--color-primary); font-size: 20px; }
.dp-callout strong { color: var(--text); font-size: 14px; font-weight: 600; }
.dp-callout p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.dp-callout.is-tip { border-left-color: var(--color-success); background: color-mix(in srgb, var(--color-success) 6%, var(--panel)); }
.dp-callout.is-tip > .icon { color: var(--color-success); }
.dp-callout.is-warning, .dp-callout.is-draft { border-left-color: var(--color-warning-text); background: color-mix(in srgb, var(--color-warning-text) 6%, var(--panel)); }
.dp-callout.is-warning > .icon, .dp-callout.is-draft > .icon { color: var(--color-warning-text); }
.dp-callout.is-draft { border-style: dashed; border-left-style: solid; }

/* ---- Cards: principles or links, two or three in a row ---- */
.dp-cards { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.dp-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 6px 12px; align-content: start; padding: 14px 16px; color: var(--text); }
.dp-card .panel-icon { grid-row: span 2; width: 36px; height: 36px; }
.dp-card .panel-icon .icon { font-size: 18px; }
.dp-card strong { font-family: var(--font-heading); font-size: 15px; font-weight: 600; }
.dp-card span:last-child { color: var(--muted); font-size: 13px; line-height: 1.55; }
a.dp-card:hover { border-color: var(--color-primary); }
a.dp-card:hover strong { color: var(--color-primary); }
.dp-card.is-no .panel-icon { border-color: color-mix(in srgb, var(--color-warning-text) 50%, var(--line)); color: var(--color-warning-text); }

/* ---- Steps: a process, numbered, one line between them ---- */
.dp-steps { display: grid; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.dp-steps li { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 14px; padding-bottom: 18px; counter-increment: step; }
.dp-steps li::before { content: counter(step, decimal-leading-zero); grid-row: span 3; display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--color-primary); background: var(--panel); color: var(--color-primary); font-family: var(--font-mono); font-size: 12px; }
.dp-steps li::after { content: ""; position: absolute; top: 40px; bottom: 0; left: 20px; width: 1px; background: var(--line); }
.dp-steps li:last-child { padding-bottom: 0; }
.dp-steps li:last-child::after { display: none; }
.dp-steps strong { padding-top: 3px; color: var(--text); font-size: 15px; font-weight: 600; }
.dp-steps p { font-size: 14px; }
.dp-step-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; }
.dp-step-meta a { color: var(--color-primary); }

/* ---- Glossary: a term, its scale and what it means ---- */
.dp-terms { display: grid; margin: 0; border: 1px solid var(--line); }
.dp-terms > div { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 8px 22px; padding: 14px 16px; }
.dp-terms > div + div { border-top: 1px solid var(--line); }
.dp-terms dt { display: grid; gap: 6px; align-content: start; color: var(--text); font-weight: 600; }
.dp-terms dt small { color: var(--muted); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .05em; }
.dp-terms dd { display: grid; gap: 6px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.dp-terms dd em { color: var(--text); font-style: normal; }
.dp-scale { display: flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; }
.dp-scale i { flex: 0 0 80px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--track), var(--color-primary)); }
.dp-bands { display: grid; grid-template-columns: 3fr 6fr 6fr 5fr; gap: 2px; max-width: 200px; color: var(--muted); font-family: var(--font-mono); font-size: 7px; letter-spacing: .04em; }
.dp-bands i { padding-top: 4px; border-top: 3px solid var(--track); font-style: normal; white-space: nowrap; }
.dp-bands i:nth-child(2) { border-top-color: color-mix(in srgb, var(--color-primary) 35%, var(--track)); }
.dp-bands i:nth-child(3) { border-top-color: color-mix(in srgb, var(--color-primary) 70%, var(--track)); }
.dp-bands i:nth-child(4) { border-top-color: var(--color-primary); }

/* ---- FAQ: questions that open ---- */
.dp-faq { display: grid; border: 1px solid var(--line); }
.dp-faq details + details { border-top: 1px solid var(--line); }
.dp-faq summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; color: var(--text); font-size: 15px; font-weight: 600; list-style: none; cursor: pointer; }
.dp-faq summary::-webkit-details-marker { display: none; }
.dp-faq summary::after { content: "+"; color: var(--color-primary); font-family: var(--font-mono); font-size: 18px; font-weight: 400; }
.dp-faq details[open] summary::after { content: "−"; }
.dp-faq summary:hover { color: var(--color-primary); }
.dp-faq details > div { display: grid; gap: 8px; padding: 0 16px 16px; }
.dp-faq details > div p { font-size: 14px; }

/* ---- Form ---- */
.dp-form { display: grid; gap: 16px; padding: 18px; }
.dp-field { display: grid; gap: 6px; min-width: 0; }
.dp-field > label, .dp-field > legend, .dp-field > .dp-label { margin: 0; padding: 0; color: var(--text); font-size: 13px; font-weight: 600; }
.dp-field > label small, .dp-field > legend small, .dp-field > .dp-label small { margin-left: 6px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .05em; }
fieldset.dp-field { margin: 0; padding: 0; border: 0; }
.dp-input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-bright); border-radius: 2px; background: var(--panel); color: var(--text); font: inherit; font-size: 14px; }
.dp-input:focus { border-color: var(--color-primary); outline: 2px solid color-mix(in srgb, var(--color-primary) 30%, transparent); outline-offset: 0; }
textarea.dp-input { min-height: 150px; resize: vertical; line-height: 1.55; }
.dp-hint { display: flex; justify-content: space-between; gap: 12px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dp-hint .mono { flex: none; font-size: 9px; }
.dp-field.is-error .dp-input { border-color: var(--color-danger); }
.dp-field.is-error .dp-hint { color: var(--color-danger); }
.dp-types { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-types label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); color: var(--text); font-size: 13px; cursor: pointer; }
.dp-types label .icon { color: var(--color-primary); }
.dp-types input { position: absolute; opacity: 0; pointer-events: none; }
.dp-types label:has(input:checked) { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 14%, transparent); color: var(--color-primary); }
.dp-types label:has(input:focus-visible) { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.dp-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dp-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; color: var(--muted); font-size: 13px; line-height: 1.5; }
.dp-check input { margin-top: 3px; accent-color: var(--color-primary); }
/* The proof of work of the contact form: working, then done (data-state) */
.dp-pow { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin: 0; padding: 7px 12px; border: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .05em; }
.dp-pow .icon { color: var(--color-primary); font-size: 15px; }
.dp-pow[data-state="working"] .icon { animation: dp-pow-pulse 1s ease-in-out infinite; }
.dp-pow[data-state="done"] { border-color: var(--color-success); color: var(--color-success); }
.dp-pow[data-state="done"] .icon { color: var(--color-success); }
@keyframes dp-pow-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dp-pow[data-state="working"] .icon { animation: none; } }
/* The robot trap of the contact form: out of sight and out of the tab order, bots still fill it in */
.dp-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dp-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.dp-form-foot p { color: var(--muted); font-size: 12px; }
.dp-button { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; }
.dp-button:hover { background: var(--color-primary-hover); color: var(--accent-ink); }
.dp-button.is-ghost { background: transparent; color: var(--text); border-color: var(--line-bright); }
.dp-button.is-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }
.dp-sent { display: grid; justify-items: start; gap: 10px; padding: 22px; }
.dp-sent .panel-icon { width: 40px; height: 40px; border-color: var(--color-success); color: var(--color-success); }
.dp-sent .panel-icon .icon { font-size: 20px; }
.dp-sent h3 { margin: 0; font-size: 19px; }
.dp-sent p { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ---- Consent rows: a category of storage with a switch ---- */
.dp-consent { display: grid; border: 1px solid var(--line); }
.dp-consent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 20px; padding: 16px; }
.dp-consent-row + .dp-consent-row { border-top: 1px solid var(--line); }
.dp-consent-row h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.dp-consent-row p { grid-column: 1; font-size: 14px; }
.dp-consent-row .dp-table-wrap { grid-column: 1 / -1; }
.dp-tag { padding: 1px 6px; border: 1px solid var(--line); color: var(--muted); font-family: var(--font-mono); font-size: 8px; font-weight: 500; letter-spacing: .06em; }
.dp-tag.is-on { border-color: var(--color-success); color: var(--color-success); }
.dp-switch-input { grid-row: 1; grid-column: 2; position: relative; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; cursor: pointer; }
.dp-switch-input input { position: absolute; opacity: 0; }
.dp-switch-input i { position: relative; width: 38px; height: 20px; border: 1px solid var(--line-bright); border-radius: 10px; background: var(--track); transition: background-color .16s ease; }
.dp-switch-input i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .16s ease, background-color .16s ease; }
.dp-switch-input input:checked + i { border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary) 30%, var(--track)); }
.dp-switch-input input:checked + i::after { transform: translateX(18px); background: var(--color-primary); }
.dp-switch-input input:disabled + i { opacity: .55; }
.dp-switch-input input:focus-visible + i { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.dp-consent-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--panel); }

/* ---- Table: names, purpose, lifetime ---- */
.dp-table-wrap { overflow-x: auto; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dp-table th, .dp-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dp-table thead th { color: var(--muted); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .06em; }
.dp-table td { color: var(--muted); line-height: 1.5; }
.dp-table td:first-child { color: var(--text); font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
.dp-table tr:last-child td { border-bottom: 0; }

/* ---- Facts: key and value, a value may be still to be given ---- */
.dp-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.dp-facts div { display: grid; gap: 4px; padding: 12px 14px; background: var(--panel); }
.dp-facts dt { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; }
.dp-facts div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.dp-facts dd { margin: 0; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.45; }

/* ---- The pages that follow ---- */
.dp-next { display: grid; gap: 12px; }
.dp-next-title { margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .08em; }
.dp-next .dp-cards { --cols: 3; }

@media (max-width: 980px) {
  .dp-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .dp-toc { position: relative; padding: 0; }
  .dp-toc details > summary { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; color: var(--text); font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; list-style: none; cursor: pointer; }
  .dp-toc details > summary::-webkit-details-marker { display: none; }
  .dp-toc details > summary::after { content: "+"; color: var(--color-primary); font-size: 16px; }
  .dp-toc details[open] > summary::after { content: "−"; }
  .dp-toc details > div { padding-bottom: 12px; }
  .dp-toc-title { display: none; }
  /* The column count of a card grid is set inline (--cols), so the narrow layouts override
     the columns themselves */
  .dp-cards { grid-template-columns: repeat(min(var(--cols, 2), 2), minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .dp-cards { grid-template-columns: minmax(0, 1fr); }
  .dp-terms > div, .dp-row, .dp-facts { grid-template-columns: minmax(0, 1fr); }
  .dp-consent-row { grid-template-columns: minmax(0, 1fr); }
  .dp-switch-input { grid-row: auto; grid-column: 1; }
  .dp-lead { font-size: 15px; }
}
