/* The AI charter page, over site.css: the charter as a sheet of paper signed by hand, the template with its kinds of
   organisation, how it is adopted, what policy.json holds of it. Logical properties only; classes start with cha-.
   A kind's own lines and its button show with the radio button chosen, through :has() alone, since the page runs no
   script but the theme's; without :has(), the lines for any organisation and its button stay. */

/* The promise, and the charter on paper */
.cha-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.cha-hero .site-hero-text { max-inline-size: none; }
.cha-paper { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.75rem 1.75rem 1.25rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--room); box-shadow: var(--site-float); rotate: -1.2deg; min-inline-size: 0; }
.cha-paper-title { font: 700 1.35rem/1.2 var(--display); }
.cha-paper ol { display: flex; flex-direction: column; gap: 0.7rem; counter-reset: part; }
.cha-paper li { counter-increment: part; display: flex; flex-direction: column; gap: 0.3rem; }
.cha-paper b { font-size: 0.85rem; font-weight: 600; }
.cha-paper b::before { content: counter(part) '. '; color: var(--ink-faint); }
.cha-paper i { display: block; block-size: 0.3rem; border-radius: 0.15rem; background: var(--room-2); }
.cha-paper i + i { inline-size: 70%; }
.cha-paper-signed { display: flex; align-items: flex-end; gap: 0.75rem; padding-block-start: 0.5rem; border-block-start: 1px solid var(--line); color: var(--ink-soft); font-size: 0.8125rem; }
.cha-paper-signed .felt-sign { inline-size: 7.5rem; block-size: 2.8rem; stroke-width: 2.4; }

/* The template: the kinds of organisation, the sheet, its blanks */
.cha-kinds { display: flex; flex-direction: column; gap: 0.6rem; margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.cha-kinds legend { padding: 0; margin-block-end: 0.6rem; color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.cha-choices { position: relative; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cha-choices input { position: absolute; opacity: 0; inline-size: 1px; block-size: 1px; pointer-events: none; }
.cha-choices label { display: inline-flex; align-items: center; min-block-size: 2.75rem; padding: 0 1rem; border-radius: 0.75rem; background: var(--room); color: var(--ink); font-size: 0.95rem; cursor: pointer; }
.cha-choices input:checked + label { background: var(--site-fill); color: var(--site-on-fill); }
.cha-choices input:focus-visible + label { outline: 2px solid var(--flame); outline-offset: 2px; }
.cha-sheet { display: flex; flex-direction: column; gap: 1.25rem; max-inline-size: 50rem; padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: 0.5rem; background: var(--room); box-shadow: var(--site-float); }
.cha-sheet h3 { font: 700 clamp(1.4rem, 3vw, 1.85rem)/1.2 var(--display); }
.cha-parts { display: flex; flex-direction: column; gap: 1.5rem; counter-reset: part; }
.cha-parts > li { counter-increment: part; display: flex; flex-direction: column; gap: 0.6rem; }
.cha-parts h4 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.cha-parts h4::before { content: counter(part) '. '; }
.cha-parts ul { display: flex; flex-direction: column; gap: 0.45rem; }
.cha-parts ul li { position: relative; padding-inline-start: 1.1rem; }
.cha-parts ul li::before { content: '–' / ''; position: absolute; inset-inline-start: 0; color: var(--ink-faint); }
.cha-blank { padding-inline: 0.2em; border-radius: 0.25em; background: var(--room-2); color: var(--ink-soft); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.cha-tag { display: inline-block; margin-inline-end: 0.5rem; padding: 0 0.45rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-soft); font-size: 0.75rem; font-weight: 600; line-height: 1.6; vertical-align: 0.1em; }
.cha-write { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.cha-write .button { padding: 0.65rem 1.3rem; font-size: 1rem; }
.cha-note { color: var(--ink-soft); max-inline-size: 46rem; }

/* One kind at a time: its lines, and its button in place of the one for any organisation. */
.cha-for, .cha-go:not(.is-any) { display: none; }
#cha-template:has(#cha-kind-association:checked) .is-association, #cha-template:has(#cha-kind-school:checked) .is-school,
#cha-template:has(#cha-kind-company:checked) .is-company, #cha-template:has(#cha-kind-public:checked) .is-public { display: block; }
#cha-template:has(#cha-kind-association:checked) .cha-go.is-association, #cha-template:has(#cha-kind-school:checked) .cha-go.is-school,
#cha-template:has(#cha-kind-company:checked) .cha-go.is-company, #cha-template:has(#cha-kind-public:checked) .cha-go.is-public { display: inline-flex; }
#cha-template:has(.cha-kinds input:not(#cha-kind-any):checked) .cha-go.is-any { display: none; }

/* Then, have it adopted */
.cha-steps { display: flex; flex-direction: column; gap: 0.85rem; counter-reset: step; }
.cha-steps li { counter-increment: step; display: flex; align-items: baseline; gap: 0.75rem; }
.cha-steps li::before { content: counter(step); display: grid; place-items: center; flex: none; inline-size: 1.7rem; block-size: 1.7rem; border-radius: 50%; background: var(--room-2); font-weight: 600; font-size: 0.85rem; }
.cha-next { display: flex; flex-direction: column; gap: 1.1rem; }
.cha-next dl { display: flex; flex-direction: column; gap: 0.75rem; margin: 0; }
.cha-next dl div { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); align-items: baseline; gap: 0.25rem 1rem; }
.cha-next dt { color: var(--ink-soft); font-size: 0.875rem; font-weight: 600; }
.cha-next dd { grid-column: 2; margin: 0; }

/* What policy.json holds of it */
.cha-holds { display: flex; flex-direction: column; gap: 1rem; margin: 0; }
.cha-holds div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1rem; padding-block-end: 1rem; border-block-end: 1px solid var(--line); }
.cha-holds dt { font-weight: 600; }
.cha-holds dd { margin: 0; }
.cha-holds dd:last-child { grid-column: 1 / -1; color: var(--ink-soft); }
.cha-holds code { padding: 0.1rem 0.45rem; border-radius: 0.4rem; background: var(--room); }
.cha-people { max-inline-size: 46rem; font-size: 1.05rem; }

/* The last word */
.cha-go-end { position: relative; }
.cha-go-end .felt-point { position: absolute; inset-inline-end: calc(100% + 0.75rem); inset-block-start: -1.5rem; inline-size: 5rem; block-size: 3.3rem; }

@media (max-width: 64rem) {
  .cha-hero { grid-template-columns: minmax(0, 1fr); }
  .cha-paper { max-inline-size: 26rem; }
}
@media (max-width: 30rem) {
  .cha-paper { rotate: none; }
  .cha-go-end .felt-point { display: none; }
}
@media (forced-colors: active) {
  .cha-choices input:checked + label { outline: 2px solid CanvasText; }
  .cha-blank, .cha-tag { border: 1px solid CanvasText; }
}
/* On paper, the charter alone, with the lines of every kind. */
@media print {
  .site-top, .site-foot, .site-skip, main > section:not(#cha-template), #cha-template > header, .cha-kinds, .cha-write, .cha-note { display: none; }
  .cha-for { display: block; }
  #cha-template, .cha-sheet { padding: 0; border: 0; box-shadow: none; background: none; }
}
