:root {
  --paper: #ffffff;
  --ink: #000000;
  --muted: #555555;
  --rule: #d9d9d9;
  --leaf: #1d4e89;
  --leaf-tint: #e8eff8;
  --amber: #8a5a00;
  --amber-tint: #fbf1dc;
  --rust: #8c2f1b;
  --rust-tint: #f8e7e2;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}
a { color: var(--leaf); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }
.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: 0.5rem 1rem; z-index: 10; }

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-head { border-bottom: 3px solid var(--ink); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 2rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.6rem; letter-spacing: -0.01em; }
.brand svg { width: 2.4rem; height: 2.4rem; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; font-family: var(--sans); font-size: 0.95rem; margin-right: auto; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--leaf); }
.langs { display: flex; gap: 0.25rem; font-family: var(--sans); font-size: 0.9rem; }
.langs a { color: var(--ink); text-decoration: none; padding: 0.3rem 0.6rem; border: 1px solid var(--rule); border-radius: 2px; }
.langs a[aria-current="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.langs a:hover { border-color: var(--ink); }

/* Article */
main { padding: 2.5rem 0 4rem; }
.article { max-width: var(--measure); }
.article h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.checked { font-family: var(--sans); font-size: 0.9rem; color: var(--muted); margin: 0 0 2rem; }
.article h2 { font-size: 1.5rem; line-height: 1.25; margin: 2.75rem 0 0.75rem; letter-spacing: -0.01em; }
.article p, .article ul, .article ol { margin: 0 0 1.1rem; }
.article li { margin-bottom: 0.4rem; }
.article .answer {
  font-size: 1.3rem;
  line-height: 1.5;
  padding: 1.25rem 0;
  margin: 0 0 1.5rem;
  border-top: 3px solid var(--leaf);
  border-bottom: 1px solid var(--rule);
}
.article .sources li { font-size: 0.95rem; overflow-wrap: anywhere; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0 2rem; max-width: 100%; }
.article .table-wrap { width: min(calc(100vw - 2.5rem), 60rem); }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.92rem; line-height: 1.4; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.9rem 0.65rem 0; border-bottom: 1px solid var(--rule); }
thead th { border-bottom: 2px solid var(--ink); font-weight: 600; }
tbody tr > :first-child { font-weight: 600; }

/* Related */
.related { max-width: var(--measure); margin-top: 3.5rem; padding-top: 1.25rem; border-top: 3px solid var(--ink); }
.related h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }

/* Home */
.home h1 { font-size: clamp(2.2rem, 6.5vw, 4.25rem); line-height: 1.04; letter-spacing: -0.03em; margin: 0 0 1rem; max-width: 16ch; }
.home .lede { max-width: 38rem; font-size: 1.25rem; margin: 0 0 2rem; }
.hemp { max-width: 44rem; margin: 0 0 1.5rem; padding: 0.9rem 1.1rem; background: var(--leaf-tint); border-left: 4px solid var(--leaf); font-size: 1.05rem; line-height: 1.55; }
.sheet { border: 2px solid var(--ink); }
.sheet table { font-size: 0.95rem; }
.sheet th, .sheet td { padding: 0.8rem 1rem; }
.sheet tbody tr:last-child > * { border-bottom: 0; }
.sheet caption { caption-side: bottom; text-align: left; padding: 0.7rem 1rem; font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--rule); }
.status { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 2px; font-weight: 600; }
.status small { display: block; font-weight: 400; font-size: 0.85rem; padding-top: 0.15rem; }
.s-ok { background: var(--leaf-tint); color: var(--leaf); }
.s-cond { background: var(--amber-tint); color: var(--amber); }
.s-risk, .s-ban { background: var(--rust-tint); color: var(--rust); }
.note { display: block; font-size: 0.85rem; color: var(--muted); padding-top: 0.2rem; }

.guides { margin-top: 4rem; display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 1rem 3rem; }
.guides h2 { font-size: 1.5rem; margin: 0; line-height: 1.2; }
.guides ul { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--ink); }
.guides li { padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.guides li a { font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.guides li a:hover { color: var(--leaf); text-decoration: underline; }
.guides li p { margin: 0.25rem 0 0; color: var(--muted); font-size: 1rem; max-width: 40rem; }

/* Footer */
.site-foot { border-top: 3px solid var(--ink); font-family: var(--sans); font-size: 0.9rem; padding: 2rem 0 3rem; }
.site-foot .adult { font-family: var(--serif); font-size: 1.05rem; max-width: 44rem; margin: 0 0 1.25rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; }
.site-foot a { color: var(--ink); }

/* Status colours: green clear rules, amber disputed, grey zone, red risk or ban */
.s-grey { background: #ececec; color: #3a3a3a; }
.sheet td.plain { font-size: 0.88rem; color: #333; min-width: 9rem; }
.sheet td.thc-legal { background: #d2efe9; color: #0b5b51; font-weight: 600; }
.sheet td.thc-tol { background: #ebf7f4; color: #0b5b51; }
.legend .thc-legal { background: #1b8f80; } .legend .thc-tol { background: #93d3c7; }
.legend.thc { margin-top: 0.6rem; }

/* Home: kicker, tile map, legend */
.kicker { font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--leaf); font-weight: 600; margin: 0 0 0.75rem; }
.atlas { margin: 0 0 2.5rem; }
.atlas h2 { font-size: 1.15rem; margin: 0 0 0.9rem; }
.tiles { display: grid; grid-template-columns: repeat(10, minmax(0, 3.6rem)); grid-auto-rows: auto; column-gap: 0.3rem; row-gap: 0.3rem; padding-bottom: 0.5rem; }
/* Pointy-top hexagons, like the rings of the CBD molecule; rows overlap by a quarter of the height */
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; aspect-ratio: 0.866 / 1; margin-bottom: -28.87%; padding: 0 0.3rem; text-align: center; text-decoration: none; font-family: var(--sans); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); transition: transform .12s ease, filter .12s ease; }
.tile b { font-size: 1.5rem; line-height: 1; letter-spacing: -0.02em; }
.tile span { font-size: 0.78rem; line-height: 1.2; font-weight: 600; }
a.tile:hover { transform: scale(1.06); filter: brightness(0.94); color: inherit; position: relative; z-index: 1; }
a.tile.s-ok:hover { color: var(--leaf); } a.tile.s-cond:hover { color: var(--amber); } a.tile.s-risk:hover, a.tile.s-ban:hover { color: var(--rust); }
.legend { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend i { width: 0.95rem; height: 0.95rem; border-radius: 2px; display: inline-block; }
.legend .s-ok { background: var(--leaf); } .legend .s-cond { background: #d99a1e; } .legend .s-grey { background: #9b9b9b; } .legend .s-risk { background: var(--rust); }

/* Guide cards */
.guides { display: block; margin-top: 3.5rem; }
.guides h2 { margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 3px solid var(--ink); }
.guides ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; border-top: 0; }
.guides li { padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--rule); border-top: 4px solid var(--leaf); border-radius: 3px; background: var(--paper); transition: box-shadow .12s ease; }
.guides li:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.guides li a { font-size: 1.1rem; line-height: 1.3; }
.guides li p { font-size: 0.95rem; line-height: 1.5; }

/* Home: guide hub, four group cards, description in a popup */
.hub { margin-top: 3.5rem; }
.hub h2 { font-size: 1.5rem; margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 3px solid var(--ink); }
.hub .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.hub .card { border: 1px solid var(--rule); border-top: 4px solid var(--leaf); border-radius: 3px; padding: 0.9rem 1.1rem 1rem; background: var(--paper); }
.hub .countries { grid-column: 1 / -1; }
.hub h3 { display: flex; align-items: center; gap: 0.5rem; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.hub h3::before { content: ""; width: 0.8rem; height: 0.92rem; background: var(--leaf); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.hub ul { list-style: none; margin: 0; padding: 0; }
.hub li { position: relative; padding: 0.3rem 0; }
.hub li a { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.hub li a:hover, .hub li a:focus-visible { color: var(--leaf); text-decoration: underline; }
.hub .countries ul { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.hub li.lead { flex-basis: 100%; padding-bottom: 0.4rem; }
.hub li.chip { padding: 0; }
.hub li.chip a { display: inline-block; font-size: 0.95rem; padding: 0.3rem 0.75rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--leaf-tint); }
.hub li.chip a:hover { border-color: var(--leaf); }
.hub .pop { display: none; position: absolute; left: 0; top: 100%; z-index: 5; width: min(22rem, 80vw); margin-top: 0.2rem; padding: 0.7rem 0.85rem; background: #fff; border: 1px solid var(--rule); border-left: 3px solid var(--leaf); border-radius: 3px; box-shadow: 0 6px 18px rgba(0,0,0,.12); font-size: 0.9rem; line-height: 1.45; color: var(--muted); pointer-events: none; }
.hub .pop b { display: block; color: var(--ink); margin-bottom: 0.25rem; }
.hub .card:last-child .pop, .hub li.chip:nth-last-child(-n+4) .pop { left: auto; right: 0; }
@media (hover: hover) { .hub li:hover .pop { display: block; } }
.hub li a:focus-visible + .pop { display: block; }

/* Article: short answer box, zebra tables, inline links */
.article .answer { background: var(--leaf-tint); border: 0; border-left: 4px solid var(--leaf); padding: 1.1rem 1.25rem; border-radius: 0 3px 3px 0; }
.article tbody tr:nth-child(even) { background: #f6f6f4; }
.article p a, .article li a, .article td a { text-decoration-thickness: 1px; }
.related ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 1.5rem; }

@media (max-width: 44rem) {
  .tiles { column-gap: 0.2rem; row-gap: 0.2rem; grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .tile { padding: 0 0.15rem; gap: 0.1rem; }
  .tile b { font-size: 1.15rem; }
  .tile span { font-size: 0.62rem; }
  .article .answer { font-size: 1.12rem; }
}

@media (max-width: 44rem) {
  body { font-size: 1.0625rem; }
  .guides { grid-template-columns: 1fr; }
  .hub .cards { grid-template-columns: 1fr; }
  .sheet { border-left: 0; border-right: 0; margin: 0 -1.25rem; }
  .sheet table { min-width: 34rem; }
}
@media print {
  .site-head, .site-foot, .related { display: none; }
}

/* Pedalwatt: rules table on the home page */
.sheet td.plain { min-width: 10rem; }
.sheet small { display: block; color: var(--muted); font-size: 0.82rem; padding-top: 0.15rem; }
.region { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sheet tr.group th { background: #f6f6f4; font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hub h3::before { clip-path: circle(50%); }
.hub .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 44rem) { .hub .cards { grid-template-columns: 1fr; } }
