/* AusSci · How are traits passed on? (Year 10): the "Why would that be?" boxes, the Explain it cards, the simulations'
   drawings and controls, and the try-it cards. Drawings are on a light plate with fixed colours in light
   and dark mode alike. Every colour in a drawing also has its word, so colour is never the only key. */

/* ---------- drawings ---------- */
.dia { display: block; width: 100%; height: auto; font-family: 'Atkinson Next', system-ui, sans-serif; touch-action: manipulation; }
.plate { background: #fbfbf6; border: 1px solid #d8ded9; border-radius: 4px; color: #15231d; }
.dia text { fill: #15231d; pointer-events: none; }
.d-small { font-size: 11.5px; fill: #15231d; font-weight: 700; }
.dia text.d-lab, .dia text.d-lab-s, .dia text.d-lab-b, .dia text.d-big, .dia text.d-lab-w, .dia text.d-ital, .dia text.d-ital-s { paint-order: stroke; stroke: #fbfbf6; stroke-width: 3.4px; stroke-linejoin: round; }
.dia text.d-ital { font-size: 18px; font-weight: 700; font-style: italic; }
.dia text.d-ital-s { font-size: 13px; font-weight: 700; font-style: italic; fill: #2c3a34; }
.dia text.d-lab { font-size: 15px; font-weight: 700; }
.dia text.d-lab-s { font-size: 13px; font-weight: 700; fill: #2c3a34; }
.dia text.d-lab-b { font-size: 16px; font-weight: 800; }
.dia text.d-big { font-size: 26px; font-weight: 800; }
.dia text.d-lab-w { font-size: 14px; font-weight: 800; fill: #ffffff; stroke: rgba(21, 35, 29, 0.78); stroke-width: 3px; }
.dia text.d-lab-ws { font-size: 12.5px; font-weight: 700; fill: #ffffff; paint-order: stroke; stroke: rgba(15, 27, 51, 0.85); stroke-width: 3px; stroke-linejoin: round; }
.art { position: relative; width: 100%; }
.art-cv { display: block; width: 100%; height: auto; border-radius: 4px; background: #fbfbf6; }
.art .art-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; overflow: visible; touch-action: manipulation; }
@media (max-width: 640px) { .dia text.d-lab { font-size: 14px; } .dia text.d-lab-b { font-size: 15px; } .dia text.d-lab-s { font-size: 12.5px; } .dia text.d-big { font-size: 22px; } }

/* ---------- the Explain it cards ---------- */
.link { border: 2px solid var(--y-stripe); border-radius: 8px; padding: 0.9rem 1.1rem 1rem; background: var(--box); max-width: 46rem; }
.link.is-done { box-shadow: inset 0.35rem 0 0 var(--ok); }
.link .play-tag { margin-bottom: 0.5rem !important; }
.link-recap { margin: 0 0 0.6rem; max-width: 42rem; font-weight: 700; color: var(--ink-2); }
.link-q { font-size: 1.111rem; margin: 0 0 0.7rem; max-width: 42rem; }
.link-part { border-top: 1px dashed var(--rule); padding-top: 0.7rem; margin-top: 0.7rem; max-width: 42rem; }
.link-part:not(.is-open) .link-list { opacity: 0.55; }
.link-h { font-weight: 800; margin: 0 0 0.5rem; }
.link-num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--ink); font-size: 0.833rem; font-weight: 800; margin-right: 0.35rem; }
.link-part.is-done .link-num { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.link-list { list-style: none; margin: 0 0 0.2rem; padding: 0; display: grid; gap: 0.45rem; }
.link-opt { display: block; width: 100%; text-align: left; white-space: normal; line-height: 1.4; padding: 0.5rem 0.8rem; }
.link-opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.link-part.is-done .link-opt[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.link-opt:disabled { cursor: not-allowed; }
.link-opt[aria-pressed="true"]:disabled { opacity: 1; }
.link-fb { margin: 0.55rem 0 0; font-weight: 700; color: var(--ink-2); }
.link-fb:empty { display: none; }
.link-part.is-done .link-fb { color: var(--ok); }
.link-sum { margin: 0.9rem 0 0; padding: 0.6rem 0.8rem; border-left: 0.35rem solid var(--ok); background: var(--paper); font-weight: 700; max-width: 42rem; }
.link-sum[hidden] { display: none; }
.link-book { margin: 0.8rem 0 0; border-top: 1px dashed var(--rule); padding-top: 0.6rem; max-width: 42rem; }
@media (max-width: 640px) { .link { padding: 0.7rem 0.7rem 0.8rem; } .link-q { font-size: 1.056rem; } }

/* ---------- controls ---------- */
.ctl .label { margin-bottom: 0.3rem; }
.ctl + .ctl, .ctl + .lab-run, .ctl + .ih-about { margin-top: 0.6rem; }
.lab-run { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin-top: 0.6rem; }
.lab-run[hidden], .lab-run .btn[hidden], .ctl[hidden] { display: none; }
.seg { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.seg .btn { padding: 0.3rem 0.65rem; }
.seg .btn[aria-pressed="true"], .lab-run .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg .btn:disabled, .lab-run .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pick-ctl { margin-top: 0.8rem; border-top: 1px dashed var(--rule); padding-top: 0.7rem; }
.ih-about { margin: 0.6rem 0 0; max-width: 44rem; }
.ih-about:empty { display: none; }

/* ---------- a simulation: the drawing, with its readings ---------- */
.ih-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: 0.8rem; }
.ih-main { max-width: 52rem; }
.ih-box { padding: 0.25rem; }
.ih-read { margin: 0.45rem 0 0; font-size: 0.944rem; font-weight: 700; color: var(--ink-2); }
.ih-status { min-height: 2.6em; font-size: 1.111rem; }
.ih-todo { margin: 0; color: var(--ink-3); }
.ih-todo:empty { display: none; }

/* ---------- the try-it cards ---------- */
.tryit { border: 2px solid var(--y-stripe); border-radius: 6px; padding: 0.9rem 1.1rem 1rem; max-width: 46rem; background: var(--box); }
.play-tag { display: inline-block; font-size: 0.722rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--paper); background: var(--ink); border-radius: 3px; padding: 0.1rem 0.45rem; margin: 0 0 0.45rem !important; }
.tryit p { margin: 0 0 0.5rem; }
.ch-list { margin: 0.4rem 0 0.6rem; padding: 0; list-style: none; display: grid; gap: 0.5rem; counter-reset: ch; }
.ch { border: 1px solid var(--rule); background: var(--paper); border-radius: 4px; padding: 0.55rem 0.75rem 0.5rem 2.6rem; position: relative; counter-increment: ch; }
.ch::before { content: counter(ch); position: absolute; left: 0.6rem; top: 0.5rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; font-weight: 800; font-size: 0.833rem; }
.ch.is-done { border-color: var(--ok); box-shadow: inset 0.3rem 0 0 var(--ok); }
.ch.is-done::before { content: '\2713'; border-color: var(--ok); background: var(--ok); color: var(--paper); }
.ch-t { font-weight: 800; margin: 0 0 0.25rem !important; }
.ch-note { display: inline-block; font-size: 0.722rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; border: 1.5px solid var(--ink-2); color: var(--ink-2); border-radius: 3px; padding: 0 0.35rem; margin-right: 0.2rem; vertical-align: 0.12em; }
.ch-hint summary { cursor: pointer; font-weight: 700; color: var(--ink-2); font-size: 0.944rem; }
.ch-hint p { margin: 0.3rem 0 0.2rem !important; }
.ch-done { margin: 0.2rem 0 0 !important; font-weight: 700; color: var(--ok); }
.ch-done:empty { display: none; }
.ch-count { font-weight: 800; }
.ch-talk { border-top: 1px dashed var(--rule); padding-top: 0.55rem; }

/* ---------- safety notes on a screen ---------- */
.care { border: 2px solid #c8323a; border-radius: 8px; padding: 0.7rem 0.9rem; background: var(--box); max-width: 46rem; margin: 1rem 0; }
.care p { margin: 0; }

/* ---------- the method box on screen 1 ---------- */
.method { border: 1px dashed var(--ink-3); border-radius: 4px; padding: 0.9rem 1.1rem; max-width: 46rem; background: var(--soft); }
.method p { margin: 0; }

/* ---------- the worked examples ---------- */
.we { border: 2px solid var(--y-stripe); border-radius: 8px; padding: 0.9rem 1.1rem 1rem; background: var(--box); max-width: 46rem; }
.we.is-done { box-shadow: inset 0.35rem 0 0 var(--ok); }
.we .play-tag { margin-bottom: 0.5rem !important; }
.we-recap { margin: 0 0 0.6rem; font-weight: 700; color: var(--ink-2); max-width: 42rem; }
.we-item { border-top: 1px dashed var(--rule); padding-top: 0.7rem; margin-top: 0.7rem; max-width: 42rem; }
.we-item[data-item="ex"] { border-top: 0; padding-top: 0; margin-top: 0; }
.we-item:not(.is-open)[data-item="part"] .we-ask, .we-item:not(.is-open)[data-item="own"] .we-ask { display: none; }
.we-h { font-weight: 800; margin: 0 0 0.4rem; }
.we-num { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--ink-3); margin-right: 0.5rem; font-size: 0.833rem; }
.we-item.is-done .we-num { background: var(--ok); border-color: var(--ok); color: var(--paper); }
.we-q { margin: 0 0 0.5rem; }
.we-steps { margin: 0 0 0.3rem; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.we-step { margin: 0; padding: 0.45rem 0.7rem; border-left: 0.3rem solid var(--rule); background: var(--paper); }
.we-step[hidden] { display: none; }
.we-step.is-given { border-left-color: var(--ink-3); }
.we-ask.is-done { border-left-color: var(--ok); }
.we-ask-q { margin: 0 0 0.45rem; }
.we-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.we-opt { display: block; width: 100%; text-align: left; white-space: normal; line-height: 1.4; padding: 0.45rem 0.75rem; }
.we-opt[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.we-ask.is-done .we-opt[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.we-opt:disabled { cursor: not-allowed; }
.we-opt[aria-pressed="true"]:disabled { opacity: 1; }
.we-fb { margin: 0.45rem 0 0; font-weight: 700; color: var(--ink-2); }
.we-fb:empty { display: none; }
.we-ask.is-done .we-fb { color: var(--ok); }
.we-act { margin: 0.5rem 0 0; }
.we-act .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.we-sum { margin: 0.7rem 0 0; font-weight: 800; color: var(--ok); }
.we-sum:empty { display: none; }
@media (max-width: 640px) { .we { padding: 0.7rem 0.7rem 0.8rem; } }

/* ---------- the First Nations box on screen 7 ---------- */
.fn-box { border: 1px solid var(--rule); border-left: 0.35rem solid var(--ink-3); border-radius: 4px; padding: 0.8rem 1rem; max-width: 46rem; background: var(--box); margin: 1rem 0; }
.fn-box .label { margin-bottom: 0.35rem; }
.fn-box p:last-child { margin-bottom: 0; }

/* ---------- the table on screen 8 ---------- */
.table-wrap { overflow-x: auto; max-width: 46rem; margin: 1rem 0; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.944rem; }
table.data caption { text-align: left; font-weight: 700; font-size: 0.889rem; color: var(--ink-2); padding-bottom: 0.35rem; }
table.data th, table.data td { text-align: left; vertical-align: top; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); }
table.data thead th { font-size: 0.833rem; color: var(--ink-3); }
table.data tbody th { font-weight: 800; }
.ctl[hidden], [data-grp][hidden], [data-optgrp][hidden] { display: none; }

/* ---------- the base slider on screen 8 ---------- */
.ctl-range { margin-top: 0.6rem; }
.ctl-range label { display: block; font-size: 0.889rem; font-weight: 700; margin-bottom: 0.2rem; }
.ctl-range output { font-weight: 800; color: var(--y-deep); margin-left: 0.25rem; }
.ctl-range input[type="range"] { width: 100%; max-width: 36rem; accent-color: var(--accent); min-height: 2rem; }

/* on a phone the table's rows stack, each cell with its column's name (the roles keep it a table for screen readers) */
@media (max-width: 640px) {
  table.data, table.data tbody, table.data tr, table.data th, table.data td { display: block; width: auto; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.data tbody tr { border-bottom: 1px solid var(--rule); padding: 0.5rem 0; }
  table.data tbody th, table.data tbody td { border-bottom: 0; padding: 0.15rem 0; }
  table.data td::before { content: attr(data-label) ": "; font-weight: 700; color: var(--ink-2); }
}
