/* Tree test tool — participant-facing styles.
   System fonts only. No transitions on level changes (prefers-reduced-motion is
   respected implicitly, since no motion is used anywhere). */

:root {
  --brand-secondary: #625d9c;
  --radius-soft: 10px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  color: #1a1a1a;
  background: #ffffff;
}

#app {
  position: relative;
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.logo {
  display: block;
  height: 2.5rem;
  width: auto;
  margin: 0 0 1.5rem;
}

/* Link to admin.html — not participant-facing, see the comment above it in
   index.html. Positioned level with the logo, opposite side. Only shown before
   the study starts; CSS-only so deleting the link needs no app.js change. */
.admin-link {
  position: absolute;
  top: 1.5rem;
  right: 1rem;
  font-size: 0.9rem;
  color: var(--brand-secondary);
}

#app:has(#screen-task-intro:not([hidden]), #screen-task:not([hidden]), #screen-complete:not([hidden])) .admin-link {
  display: none;
}
h1, h2 {
  line-height: 1.25;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
}

p {
  margin: 0 0 1rem;
  overflow-wrap: break-word;
}

.progress {
  font-size: 1rem;
  color: #444444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.task-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* Sets the task apart from the tree below it. Deliberately a neutral tint,
   nothing that could read as right/wrong feedback. */
.task-panel {
  background: #f4f3f9;
  border-radius: var(--radius-soft);
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
}

.task-panel p:last-child {
  margin-bottom: 0;
}

.task-text-intro {
  font-size: 1.6rem;
  line-height: 1.4;
  margin: 1.5rem 0 2rem;
}

.privacy-notice {
  padding: 0.75rem 1rem;
  border: 1px solid #666666;
  border-radius: var(--radius-soft);
  background: #f4f4f4;
}

/* Buttons */

button {
  font: inherit;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  border-radius: var(--radius-soft);
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.65em 1.25em;
  margin: 0.25rem 0.5rem 0.25rem 0;
  border-radius: var(--radius-pill);
}

.chevron {
  width: 0.9em;
  height: 0.9em;
  flex-shrink: 0;
}

/* Purple, not the brand red: in testing, participants read a red button as
   "your answer was wrong". White on #625d9c is 5.89:1 (passes AA). */
.button-primary {
  background: var(--brand-secondary);
  color: #ffffff;
  border: 2px solid var(--brand-secondary);
  font-size: 1.2rem;
  font-weight: 700;
}

.button-primary:hover {
  filter: brightness(0.9);
}

.button-secondary {
  background: #ffffff;
  color: var(--brand-secondary);
  border: 2px solid var(--brand-secondary);
}

.button-secondary:hover {
  background: #f4f3f9;
}

:focus-visible {
  outline: 3px solid var(--brand-secondary);
  outline-offset: 2px;
}

/* Level list — plain ul/button drill-down, not an ARIA tree widget */

.button-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.button-list li {
  margin: 0 0 0.5rem;
}

.button-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4em;
  width: 100%;
  text-align: left;
  padding: 0.75em 1em;
  background: #ffffff;
  border: 2px solid #444444;
  color: #1a1a1a;
}

.button-list button:hover {
  background: #f0f0f0;
  border-color: var(--brand-secondary);
}

.button-list button[aria-pressed="true"] {
  background: var(--brand-secondary);
  border-color: var(--brand-secondary);
  color: #ffffff;
}

.button-list button[aria-pressed="true"]:hover {
  filter: brightness(0.9);
}

.task-actions {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #cccccc;
}

/* Breadcrumb */

#breadcrumb-nav {
  margin-top: 0;
}

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.95rem;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.breadcrumb-list li:not(:first-child)::before {
  content: "/";
  color: #666666;
}

.breadcrumb-list button {
  min-height: 32px;
  min-width: auto;
  padding: 0.15em 0.4em;
  background: transparent;
  border: none;
  color: var(--brand-secondary);
  text-decoration: underline;
}

.breadcrumb-list button:hover {
  background: #f0f0f0;
}

/* Visually hidden but announced by assistive technology */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Small screens: usable at 320px width without horizontal scrolling */

@media (max-width: 22rem) {
  #app {
    padding: 1rem 0.75rem 3rem;
  }
}
