/* New components for the Become-a-Ham page.
   Only Chris's design tokens (from ara.css :root) are used here, so this page follows his theme. */

/* ---------- "All pages" drawer ---------- */
html:has(dialog[open]) { overflow: hidden; }
.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(22rem, 88vw); height: 100dvh; max-height: none;
  padding: 0; border: 0; border-left: 1px solid var(--border);
  background: var(--surface); color: var(--foreground);
}
.drawer::backdrop { background: oklch(12% .02 256 / .65); backdrop-filter: blur(2px); }
.drawer-inner { height: 100%; overflow-y: auto; padding: 1rem; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.drawer-title { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; }
.drawer-close {
  display: inline-grid; place-items: center; min-width: 2.75rem; min-height: 2.75rem;
  border: 1px solid var(--border); border-radius: .5rem; background: transparent;
  color: var(--muted-foreground); cursor: pointer;
}
.drawer-close:hover { background: var(--accent); color: var(--foreground); }
.drawer-close:focus-visible, .drawer-link:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.drawer-list { list-style: none; margin: 0; padding: 0; }
.drawer-list li { border-bottom: 1px solid var(--border); }
.drawer-link {
  display: flex; align-items: center; min-height: 2.75rem; padding: .25rem .75rem;
  border-radius: .5rem; font-weight: 600; color: var(--muted-foreground);
}
.drawer-link:hover { background: var(--accent); color: var(--foreground); }
.drawer-link[aria-current="page"] { background: color-mix(in oklab, var(--primary) 18%, transparent); color: var(--foreground); }

/* ---------- Upcoming exam sessions (shown only when data/sessions.json has future dates) ---------- */
.exam-dates { margin-top: 2rem; }
.exam-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .75rem; }
.exam-item { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius); padding: .875rem 1rem; }
.exam-when { font-family: var(--font-mono); font-weight: 600; font-size: .95rem; color: var(--highlight); }
.exam-where { margin-top: .25rem; font-weight: 600; color: var(--foreground); }
.exam-notes { margin-top: .25rem; font-size: .95rem; color: var(--muted-foreground); }

/* ---------- Shared card look (matches ara.radio's rounded-xl border bg-card cards) ---------- */
.license, .resource, .next-card {
  border: 1px solid var(--border); background: var(--card);
  border-radius: calc(var(--radius) + 4px); padding: 1.1rem 1.25rem;
}

/* ---------- License classes ---------- */
.license-grid, .next-grid { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .875rem; }
@media (min-width: 48rem) { .license-grid, .next-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.license-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: var(--foreground); }
.license-sub { margin-top: .15rem; font-size: .9rem; color: var(--muted-foreground); }
.license-meta {
  display: inline-block; margin-top: .75rem; padding: .2rem .5rem;
  border: 1px solid color-mix(in oklab, var(--primary) 40%, transparent);
  background: color-mix(in oklab, var(--primary) 10%, transparent);
  border-radius: .375rem; font-family: var(--font-mono); font-size: .8rem; font-weight: 600; color: var(--highlight);
}
.license-text { margin-top: .75rem; font-size: .975rem; line-height: 1.6; color: var(--muted-foreground); }

/* ---------- Step-by-step path ---------- */
.steps { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: 1.25rem; counter-reset: none; }
.step { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .9rem; align-items: start; }
.step-num {
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 999px;
  border: 1px solid var(--primary); background: color-mix(in oklab, var(--primary) 14%, transparent);
  font-family: var(--font-mono); font-weight: 600; color: var(--highlight);
}
.step-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--foreground); padding-top: .35rem; }
.step-text { margin-top: .25rem; line-height: 1.65; color: var(--muted-foreground); }

/* ---------- Study resources ---------- */
.resource-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 40rem) { .resource-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.resource-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.resource-name { font-weight: 700; color: var(--foreground); text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 4px; }
.resource-name:hover { color: var(--highlight); }
.resource-text { margin-top: .4rem; font-size: .95rem; line-height: 1.6; color: var(--muted-foreground); }
/* Free = blue, Paid = neutral grey: distinguishable without relying on red/green. */
.tag { flex-shrink: 0; padding: .1rem .5rem; border-radius: 999px; font-family: var(--font-mono); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.tag-free { border: 1px solid var(--primary); color: var(--highlight); background: color-mix(in oklab, var(--primary) 12%, transparent); }
.tag-paid { border: 1px solid var(--border); color: var(--muted-foreground); background: var(--surface-raised); }

/* ---------- Next steps ---------- */
.next-card { display: flex; flex-direction: column; }
.next-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--foreground); }
.next-text { margin-top: .4rem; flex: 1; font-size: .95rem; line-height: 1.6; color: var(--muted-foreground); }
.next-cta { margin-top: 1rem; align-self: flex-start; }

/* ---------- Q&A diagrams (inline SVG; every colour comes from a token) ---------- */
.diagram { display: block; width: 100%; max-width: 34rem; height: auto; margin: 1.25rem auto .25rem; }
.dg-ground { fill: var(--surface-raised); stroke: var(--border); stroke-width: 2; }
.dg-base { stroke: var(--border); stroke-width: 2; fill: none; }
.dg-tower { stroke: var(--highlight); stroke-width: 3; stroke-linecap: round; fill: none; }
.dg-tip { fill: var(--highlight); }
.dg-icon { fill: var(--card); stroke: var(--highlight); stroke-width: 2.5; }
.dg-hub { fill: color-mix(in oklab, var(--primary) 16%, var(--card)); stroke: var(--primary); stroke-width: 2.5; }
.dg-up { stroke: var(--highlight); stroke-width: 3; }
.dg-up-head { fill: var(--highlight); }
.dg-down { stroke: var(--primary); stroke-width: 3; }
.dg-down-head { fill: var(--primary); }
.dg-dash { stroke: var(--muted-foreground); stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
.dg-x { stroke: var(--muted-foreground); stroke-width: 3; stroke-linecap: round; }
.dg-badge { fill: var(--primary); }
.dg-badge-text { fill: var(--primary-foreground); font-family: var(--font-mono); font-size: 15px; font-weight: 700; }
.dg-label { fill: var(--foreground); font-family: var(--font-sans); font-size: 17px; font-weight: 600; }
.dg-small { fill: var(--muted-foreground); font-family: var(--font-mono); font-size: 15px; }
.dg-legend { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.dg-legend li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .6rem; align-items: start; }
.dg-num {
  display: grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-top: .15rem; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground); font-family: var(--font-mono); font-size: .8rem; font-weight: 700;
}
.dg-legend strong { color: var(--foreground); font-weight: 600; }
/* Phones: the diagram scales to ~60%, so enlarge its text to stay at 11px+ on screen. */
@media (max-width: 30rem) {
  .dg-label { font-size: 21px; }
  .dg-small, .dg-badge-text { font-size: 20px; }
}
