/* Photographs of real substances. Cards are text-first: the picture may not
   be uploaded yet, and the card has to read properly without it. */

.hdwk .subs-pending {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  font-size: 14px;
}

.hdwk .subs-group { margin-bottom: 28px; }

.hdwk .subs-group__h {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--teal);
  margin: 0 0 12px;
}

.hdwk .subs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.hdwk .subs-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal2);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.hdwk .subs-card__img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--soft);
}

.hdwk .subs-card__body { padding: 13px 15px 14px; }

.hdwk .subs-card__name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--teal);
  margin: 0 0 8px;
}

.hdwk .subs-card__formula {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.hdwk .subs-card__line { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.hdwk .subs-card__line:last-of-type { margin-bottom: 0; }

.hdwk .subs-card__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* The credit is a licence obligation, so it is small but never hidden. */
.hdwk .subs-card__credit {
  margin: 11px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
  word-break: break-word;
}

.hdwk .subs-card__credit a { color: var(--muted); }

.hdwk .subs-foot {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* The decision tree. One question at a time, big targets, and the trail of
   what you chose kept on screen so the route is visible rather than
   remembered. Hidden until substances.js takes over — see that file. */
.hdwk .subs-tree {
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal2);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 20px 22px 18px;
  margin: 0 0 22px;
}

.hdwk .subs-tree__step {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.hdwk .subs-tree__q {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.25;
  color: var(--teal);
  margin: 0 0 16px;
}

.hdwk .subs-tree__opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.hdwk .subs-tree__opt {
  min-height: 44px;
  padding: 13px 16px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.hdwk .subs-tree__opt:hover { border-color: var(--teal2); background: var(--soft); }
.hdwk .subs-tree__opt:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* The route taken, not decoration — a student who lands on the wrong leaf
   can see which choice sent them there. */
.hdwk .subs-tree__trail {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
  min-height: 1.2em;
}

.hdwk .subs-tree__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* The offer that stands in place of the tree until someone wants it. Sized
   and coloured as the tree's own buttons so it reads as the same control. */
.hdwk .subs-tree__offer { margin: 0 0 18px; }

.hdwk .subs-tree__begin,
.hdwk .subs-tree__again,
.hdwk .subs-tree__all {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--teal);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.hdwk .subs-tree__begin:hover,
.hdwk .subs-tree__again:hover,
.hdwk .subs-tree__all:hover { border-color: var(--teal2); background: var(--soft); }
.hdwk .subs-tree__begin:focus-visible,
.hdwk .subs-tree__again:focus-visible,
.hdwk .subs-tree__all:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
