/* Australian Cannabinoid Research Guide - single stylesheet.
   Design language: reference manual with a ladder spine. Indigo ink, raspberry signal,
   cool paper. Atkinson Hyperlegible (body) + Newsreader (headings). */
:root {
  --paper: #F3F3F8;
  --panel: #FFFFFF;
  --ink: #1B1F45;
  --ink-2: #3F4568;
  --indigo: #2A2F73;
  --indigo-2: #4B53B5;
  --link: #2B3AA8;
  --tint: #E3E4F3;
  --tint-2: #CDD0EA;
  --line: #C5C8E0;
  --berry: #A3245E;
  --berry-ink: #5E1237;
  --berry-tint: #F9E7EF;
  --rail: #1B1F45;
  --rail-ink: #E8E9F8;
  --rail-dim: #A9ADD6;
  --rail-line: #3A4090;
  --pink: #F29BBF;
  --f-body: "Atkinson Hyperlegible", system-ui, "Segoe UI", Arial, sans-serif;
  --f-head: "Newsreader", Georgia, "Times New Roman", serif;
  --gut: 1.25rem;
  --rail-w: 17.5rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.65;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: .18em; }
a:hover { color: var(--berry); }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 2px; border-radius: 2px; }
.skip { position: absolute; left: .5rem; top: -4rem; z-index: 50; background: var(--panel); color: var(--ink); padding: .6rem 1rem; border-radius: 4px; font-weight: 700; }
.skip:focus { top: .5rem; }

/* Notice strip */
.notice {
  margin: 0; padding: .55rem var(--gut); background: var(--berry-tint); color: var(--berry-ink);
  border-bottom: 1px solid #E5B4CA; font-size: .8125rem; line-height: 1.45;
  max-width: none;
}

/* Shell: mobile first */
.shell { display: block; }
.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rail {
  position: sticky; top: 0; z-index: 20; background: var(--rail); color: var(--rail-ink);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: .7rem var(--gut); max-height: 100vh; overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: .65rem; color: #fff; text-decoration: none;
  font-family: var(--f-head); font-size: 1.15rem; line-height: 1.15; font-weight: 600; letter-spacing: .005em;
}
.brand:hover { color: var(--pink); }
.brand .mark { flex: none; }
.brand { flex: 1 1 0; min-width: 0; }
.menu-btn { flex: none; margin-left: .75rem; }
.menu-btn {
  cursor: pointer; padding: .45rem .9rem; border: 2px solid var(--rail-line); border-radius: 6px;
  color: var(--rail-ink); font-weight: 700; font-size: .95rem;
}
.menu-btn:hover { border-color: var(--pink); }
.nav-toggle:focus-visible ~ .rail .menu-btn { outline: 3px solid var(--pink); outline-offset: 2px; }
.nav-toggle:checked ~ .rail .menu-btn { background: var(--rail-line); }
.rail-nav { display: none; flex-basis: 100%; padding: 1rem 0 .5rem; }
.nav-toggle:checked ~ .rail .rail-nav { display: block; }
.rail .grp { margin: 1.1rem 0 .35rem; color: var(--rail-dim); font-size: .85rem; line-height: 1.3; }
.rail-nav ul { list-style: none; margin: 0 0 .25rem .4rem; padding: 0 0 0 1.15rem; border-left: 3px solid var(--rail-line); }
.rail-nav li { position: relative; margin: .1rem 0; }
.rail-nav li::before {
  content: ""; position: absolute; left: -1.15rem; top: 50%; width: .8rem; height: 3px; margin-top: -1.5px; background: var(--rail-line);
}
.rail-nav a {
  display: block; padding: .38rem .6rem; color: var(--rail-ink); text-decoration: none; border-radius: 5px; font-size: 1rem; line-height: 1.3;
}
.rail-nav a:hover { background: #2A3073; color: #fff; }
.rail-nav a[aria-current="page"] { background: #2E3480; color: #fff; font-weight: 700; }
.rail-nav li:has(> a[aria-current="page"])::before { background: var(--pink); height: 5px; margin-top: -2.5px; width: 1.15rem; }
.rail :focus-visible { outline-color: var(--pink); }

/* Content column */
.content { min-width: 0; }
main { padding: 1.75rem var(--gut) 0; max-width: 62rem; }
.page-head { margin-bottom: 1.5rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem .5rem; margin: 0 0 1rem; padding: 0; font-size: .875rem; color: var(--ink-2); }
.crumbs li + li::before { content: "\203A"; margin-right: .5rem; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
h1 {
  margin: 0 0 .9rem; font-family: var(--f-head); font-weight: 500; font-size: clamp(2.05rem, 6.2vw, 3.4rem);
  line-height: 1.07; letter-spacing: -.012em; color: var(--ink); max-width: 20ch; text-wrap: balance;
}
.lead { margin: 0; font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 38rem; }
.page-head.is-home { display: block; }
.hero-mark { display: none; }
.prose { max-width: 46rem; }
.prose > section, .prose > aside, .prose > .fig { margin-top: 2.5rem; }
.prose > section:first-child, .prose > aside:first-child { margin-top: 0; }
h2 { font-family: var(--f-head); font-weight: 600; font-size: 1.75rem; line-height: 1.2; margin: 0 0 .75rem; color: var(--ink); text-wrap: balance; }
.prose section > h2::before { content: ""; display: block; width: 2.75rem; height: 5px; border-radius: 3px; background: var(--berry); margin-bottom: .75rem; }
h3 { font-size: 1.1rem; line-height: 1.35; margin: 0 0 .3rem; }
p { margin: 0 0 1rem; max-width: 42rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; max-width: 42rem; }
li { margin: .35rem 0; }
li::marker { color: var(--indigo-2); }
strong { font-weight: 700; }

/* Components */
.note {
  background: var(--panel); border-left: 6px solid var(--indigo-2); border-radius: 0 8px 8px 0;
  padding: 1.1rem 1.25rem; max-width: 42rem;
}
.note.warn { background: var(--berry-tint); border-left-color: var(--berry); }
.note h2 { font-size: 1.3rem; margin-bottom: .5rem; }
.note > :last-child { margin-bottom: 0; }

.questions { margin-top: 1.5rem; }
.q { border-left: 10px solid var(--tint-2); padding: .15rem 0 .15rem 1.2rem; margin: 0 0 1.6rem; }
.q:nth-child(2) { border-left-color: var(--indigo-2); }
.q:nth-child(3) { border-left-color: var(--berry); }
.q h3 { font-family: var(--f-head); font-weight: 600; font-size: 1.45rem; line-height: 1.25; margin-bottom: .35rem; }
.q p:last-child { margin-bottom: 0; }

.routes { list-style: none; padding: 0; margin: 1.25rem 0 0; border-bottom: 1px solid var(--line); max-width: 42rem; }
.routes li { display: flex; flex-direction: column; gap: .1rem; margin: 0; padding: .85rem 0; border-top: 1px solid var(--line); }
.routes li span { color: var(--ink-2); }
.routes a { font-weight: 700; }

.steps { list-style: none; padding: 0; counter-reset: step; margin: 1.5rem 0; }
.steps li { position: relative; counter-increment: step; padding: 0 0 1.4rem 3.4rem; margin: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--indigo); color: #fff; font-family: var(--f-head); font-weight: 600; font-size: 1.15rem; line-height: 2.3rem; text-align: center;
}
.steps li::after { content: ""; position: absolute; left: 1.05rem; top: 2.5rem; bottom: .2rem; width: 3px; background: var(--tint-2); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps h3 { margin-top: .25rem; }
.steps p { margin-bottom: 0; }

.tablewrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: .975rem; line-height: 1.5; }
caption { text-align: left; padding: .8rem 1rem; font-weight: 700; color: var(--ink); }
th, td { text-align: left; vertical-align: top; padding: .7rem 1rem; border-top: 1px solid var(--line); }
thead th { background: var(--tint); color: var(--ink); font-size: .9rem; }
tbody th { font-weight: 700; width: 24%; }
tbody tr:nth-child(even) { background: #F7F7FB; }
.tablewrap:focus-visible { outline-offset: 0; }

.where { margin: 1.25rem 0 0; max-width: 42rem; }
.where dt { font-weight: 700; padding-top: .9rem; border-top: 1px solid var(--line); }
.where dd { margin: .2rem 0 .9rem; }

.sources { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: 42rem; border-bottom: 1px solid var(--line); }
.sources li { margin: 0; padding: 1rem 0; border-top: 1px solid var(--line); }
.sources a { font-weight: 700; font-size: 1.1rem; }
.sources .host { display: block; font-size: .85rem; color: var(--ink-2); margin-top: .05rem; }
.sources p { margin: .4rem 0 0; }

.flags { list-style: none; padding: 0; }
.flags li { position: relative; padding-left: 1.5rem; }
.flags li::before { content: ""; position: absolute; left: .15rem; top: .65em; width: .6rem; height: .6rem; background: var(--berry); transform: rotate(45deg); }

.fig { margin-left: 0; margin-right: 0; }
.fig-art { max-width: 27rem; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.fig svg { display: block; width: 100%; height: auto; font-family: var(--f-body); }
.fig figcaption { max-width: 27rem; margin-top: .6rem; font-size: .9rem; line-height: 1.5; color: var(--ink-2); }

.gloss { margin: 1.25rem 0 0; max-width: 42rem; }
.gloss dt { font-family: var(--f-head); font-weight: 600; font-size: 1.3rem; line-height: 1.25; padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line); scroll-margin-top: 5rem; }
.gloss dd { margin: .25rem 0 0; }
.az { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; }
.az a { display: inline-block; min-width: 2.2rem; text-align: center; padding: .2rem .5rem; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); font-weight: 700; text-decoration: none; }
.az a:hover { background: var(--tint); }

.next { margin-top: 3.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); max-width: 46rem; }
.next h2 { font-size: 1.25rem; margin-bottom: .75rem; }
.next ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; max-width: none; }
.next li { margin: 0; }
.next a { display: inline-block; padding: .65rem 1rem; background: var(--indigo); color: #fff; border-radius: 6px; font-weight: 700; text-decoration: none; }
.next a:hover { background: var(--berry); color: #fff; }

/* Footer */
.site-foot { margin-top: 3.5rem; padding: 1.75rem var(--gut) 2.25rem; background: var(--tint); border-top: 4px solid var(--indigo); font-size: .925rem; line-height: 1.55; }
.site-foot p { max-width: 46rem; }
.foot-urgent { background: var(--berry-tint); border-left: 5px solid var(--berry); padding: .7rem 1rem; color: var(--berry-ink); }
.site-foot nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: 0; margin: 0 0 1rem; }
.site-foot nav li { margin: 0; }
.copy { margin-bottom: 0; color: var(--ink-2); }

/* Redirect stubs */
.stub-main { max-width: 36rem; margin: 0 auto; padding: 3rem var(--gut); }
.stub-notice { font-size: .85rem; color: var(--ink-2); margin-top: 2rem; }

/* Wider screens */
@media (min-width: 40em) {
  .routes li { flex-direction: row; gap: 1.5rem; }
  .routes li span { flex: 1 1 55%; }
  .routes li a { flex: 1 1 45%; }
  .where { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); column-gap: 1.5rem; }
  .where dt { margin: 0; }
  .where dd { margin: 0; padding: .9rem 0; border-top: 1px solid var(--line); }
}
@media (min-width: 64em) {
  :root { --gut: 3.25rem; }
  .shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); align-items: start; }
  .rail { position: sticky; top: 0; height: 100vh; max-height: none; flex-direction: column; align-items: stretch; justify-content: flex-start; flex-wrap: nowrap; padding: 1.75rem 1.4rem; }
  .menu-btn { display: none; }
  .rail-nav { display: block; flex-basis: auto; padding-top: 1.25rem; }
  .brand { font-size: 1.3rem; }
  main { padding-top: 3rem; }
  .page-head { margin-bottom: 2.5rem; }
  .page-head.is-home { display: flex; gap: 3rem; align-items: flex-start; justify-content: space-between; }
  .hero-mark { display: block; flex: none; width: 7.5rem; height: auto; margin-top: .5rem; }
  .lead { font-size: 1.35rem; }
  .site-foot { padding-left: 3.25rem; padding-right: 3.25rem; }
}

/* One orchestrated moment: the three rungs on the home page grow in */
@media (prefers-reduced-motion: no-preference) {
  .hero-mark path:nth-child(n+2) { transform-box: fill-box; transform-origin: left center; animation: rung .9s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-mark path:nth-child(3) { animation-delay: .18s; }
  .hero-mark path:nth-child(4) { animation-delay: .36s; }
  @keyframes rung { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}
