/* Going to a Tribunal: an optional second choice, the kind of case.
   It works like the state tiles above it. Choosing a topic shows, straight away,
   where that kind of case starts (when it is not always the tribunal) and adds
   short notes to the steps. Choosing never hides the general steps.
   CSS does the showing and hiding, so it also works without JavaScript. */

.trb-topics { margin: 20px 0 0; padding: 0; border: 0; min-inline-size: 0; }
.trb-topics legend { margin: 0 0 8px; padding: 0; font-size: 14px; font-weight: 600; color: var(--text-soft); }
.trb-topics__opt { margin-inline-start: 6px; font-weight: 400; }
.trb-topics__list { display: flex; flex-wrap: wrap; gap: 6px; }
.trb-topic {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  border: 2px solid var(--border); background: var(--surface-raised); color: var(--text);
  font-size: 15px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.trb-topic input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.trb-topic:hover { border-color: var(--line); }
.trb-topic:has(input:checked) { border-color: var(--copper); background: var(--copper); color: #FFFFFF; }
.trb-topic:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Where a kind of case starts, when that depends on the details */
.trb-route {
  max-width: 72ch; margin: 20px 0 0; padding: 14px 18px 16px;
  border: 1px solid var(--border); border-left: 4px solid var(--copper); background: var(--surface-raised);
}
.trb-route__title { margin: 0; font: 600 20px/1.3 var(--display); letter-spacing: -0.01em; color: var(--text); }
.trb-route > p { margin: 6px 0 0; font-size: 16px; line-height: 1.6; color: var(--text); }
.trb-route__list { margin: 10px 0 0; padding: 0; list-style: none; }
.trb-route__list li { margin: 0; padding: 10px 0 0; font-size: 16px; line-height: 1.6; color: var(--text); }
.trb-route__list li + li { margin-top: 10px; border-top: 1px solid var(--rule); }
.trb-route__list b { display: block; font-weight: 600; }
.trb-route__list li p { margin: 0; }
.trb-route__list li p + p { margin-top: 6px; }
/* Which cases the steps below cover: the last thing read before them */
.trb-route p.trb-route__steps { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font-weight: 600; }

/* The line that says which steps have notes */
.trb-case-sum p { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: var(--text-soft); }

/* A note inside a step */
.trb-case-note { margin: 12px 0 0; padding: 2px 0 2px 12px; border-inline-start: 3px solid var(--copper); }
.trb-case-note p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text); }
.trb-case-note p.trb-case-note__for { font-size: 14px; font-weight: 600; }
.trb-case-note p:not(.trb-case-note__for) + p { margin-top: 6px; }

.trb-route a, .trb-case-note a { color: var(--text); font-weight: 600; text-decoration: underline; text-underline-offset: .17em; }
.trb-route a:focus-visible, .trb-case-note a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.reading-relaxed :is(.trb-route, .trb-case-note, .trb-case-sum) {
  line-height: var(--lh-body); letter-spacing: var(--ls-body); word-spacing: var(--ws-body);
}

.case-print-label { display: none; }

/* Without :has() the choice cannot show anything, so it is not offered:
   the general steps for every state show instead. */
.trb-topics, .trb [data-c] { display: none; }
@supports selector(:has(*)) {
  .trb-topics { display: block; }
  .trb:has(#c-general:checked) [data-c="general"],
  .trb:has(#c-renting:checked) [data-c="renting"],
  .trb:has(#c-money:checked) [data-c="money"],
  .trb:has(#c-guardianship:checked) [data-c="guardianship"],
  .trb:has(#c-government:checked) [data-c="government"],
  .trb:has(#c-discrimination:checked) [data-c="discrimination"] { display: revert; }
  /* Tasmanian renting disputes start with the Commissioner or the court, never TASCAT,
     so TASCAT's steps, hearings, time limits and contacts would mislead. They come back
     with General steps. */
  .trb:has(#st-tas:checked):has(#c-renting:checked) :is(.trb-layout, #apply-for, #hearing, #late, #tribunal-contact) { display: none !important; }
}

@media (forced-colors: active) {
  .trb-route, .trb-case-note { border-color: CanvasText; }
}
