/*
 * journal: design brief (mckennaiimushrooms.com)
 * 1. Concept: a scientific journal issue and specimen catalogue devoted to one cultivar. The home page is the
 *    contents page of an issue; every article is a short paper.
 * 2. Type: STIX Two Text (scholarly serif, text and titles, true italic) + Barlow Semi Condensed 500/600
 *    (technical labels, tables, numbers). Self-hosted woff2, latin + latin-ext.
 * 3. Palette: white paper #ffffff, abstract tint #f2f6f5, ink #141414, grey #545a5c, rule #cfd6d5, one teal #0b6767.
 * 4. Layout signature: tabular contents index (no., paper + abstract, reading time, sources), Figure 1 plate,
 *    abstract box, numbered sections (1, 1.1), captioned tables, superscript citations and a numbered reference list.
 * 5. Finishing detail: double journal rules (heavy over hairline) and products as catalogue entries "Cat. DS-2778".
 */

@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/stix-normal-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(fonts/stix-normal-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(fonts/stix-italic-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 400 700; font-display: swap;
  src: url(fonts/stix-italic-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/barlow-sc-500-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(fonts/barlow-sc-500-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/barlow-sc-600-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Barlow Semi Condensed"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(fonts/barlow-sc-600-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #ffffff;
  --tint: #f2f6f5;
  --ink: #141414;
  --grey: #545a5c;
  --rule: #cfd6d5;
  --teal: #0b6767;
  --serif: "STIX Two Text", "Times New Roman", serif;
  --sans: "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.6;
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: "kern", "liga";
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; font-family: var(--sans); z-index: 10; }
.skip:focus { left: 8px; }

.label {
  font-family: var(--sans); font-weight: 600; font-size: .78rem; line-height: 1.3;
  letter-spacing: .12em; text-transform: uppercase; color: var(--teal); margin: 0 0 .5rem;
  font-variant-numeric: lining-nums;
}

/* ---- masthead: heavy rule over hairline, like a journal page head ---- */
.masthead { border-top: 6px solid var(--ink); }
.runninghead {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px;
  margin: 0; padding: 8px 0 7px; border-bottom: 1px solid var(--ink);
  font-family: var(--sans); font-weight: 500; font-size: .8rem; letter-spacing: .04em; color: var(--grey);
  font-variant-numeric: lining-nums;
}
.runninghead i { font-family: var(--serif); letter-spacing: 0; }
.mast-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); position: relative; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.35rem; line-height: 1.1; letter-spacing: -.005em; }
.primary { display: none; }
.primary a, .menu a { font-family: var(--sans); font-weight: 600; font-size: .95rem; color: var(--ink); text-decoration: none; }
.n { font-variant-numeric: lining-nums tabular-nums; color: var(--teal); margin-right: .4em; }
.primary a[aria-current], .menu a[aria-current] { color: var(--teal); }
.primary a:hover { color: var(--teal); }
.menu summary {
  list-style: none; cursor: pointer; font-family: var(--sans); font-weight: 600; font-size: .85rem;
  letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--ink); padding: 6px 12px;
}
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--ink); color: var(--paper); }
.menu nav {
  position: absolute; right: 0; top: 100%; z-index: 5; background: var(--paper);
  border: 1px solid var(--ink); border-top-width: 3px; min-width: 250px; padding: 6px 16px;
}
.menu a { display: block; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.menu a:last-child { border-bottom: 0; }

/* ---- home: issue opening ---- */
.issue { display: grid; gap: 28px; padding: 28px 0 32px; border-bottom: 1px solid var(--ink); }
.issue h1 { font-weight: 600; font-size: 2.1rem; line-height: 1.12; letter-spacing: -.012em; margin: 0 0 22px; max-width: 18ch; }
.abstract { background: var(--tint); border-top: 2px solid var(--ink); padding: 16px 18px 18px; }
.abstract p { margin: 0; }
.abstract p + p { margin-top: .7rem; }
.abstract .label { margin-bottom: .4rem; }
.abstract .keywords { font-size: .95rem; color: var(--grey); }
.abstract .keywords .label { display: inline; margin-right: .5em; color: var(--ink); }
.plate { margin: 0; }
.plate img { border: 1px solid var(--rule); }
.plate figcaption, .fig figcaption, .caption {
  font-family: var(--sans); font-weight: 500; font-size: .9rem; line-height: 1.45; color: var(--grey);
  font-variant-numeric: lining-nums;
}
.plate figcaption { margin-top: 10px; max-width: 60ch; }
.plate figcaption strong, .fig figcaption strong, .caption strong { color: var(--ink); font-weight: 600; }
.plate figcaption i { font-family: var(--serif); }

/* ---- home: contents index ---- */
.contents { padding: 30px 0 34px; border-bottom: 1px solid var(--ink); }
.contents-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.contents-head h2 { margin: 0; font-weight: 600; font-size: 1.6rem; letter-spacing: -.005em; }
.contents-head p { margin: 0; font-family: var(--sans); font-size: .9rem; color: var(--grey); font-variant-numeric: lining-nums; }
.index { width: 100%; border-collapse: collapse; }
.index thead { display: none; }
.index tr { display: grid; grid-template-columns: 3rem 1fr; grid-template-areas: "no paper" "no meta"; column-gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.index td { padding: 0; }
.index .no { grid-area: no; font-family: var(--sans); font-weight: 600; font-size: 1.5rem; line-height: 1; color: var(--teal); font-variant-numeric: lining-nums tabular-nums; padding-top: 4px; }
.index .paper { grid-area: paper; }
.index .paper a { display: block; font-weight: 600; font-size: 1.2rem; line-height: 1.25; color: var(--ink); text-decoration: none; }
.index .paper a:hover { color: var(--teal); text-decoration: underline; }
.index .desc { display: block; margin-top: 5px; font-size: 1rem; line-height: 1.5; color: var(--grey); max-width: 68ch; }
.index td.num { display: inline; font-family: var(--sans); font-weight: 500; font-size: .85rem; color: var(--grey); font-variant-numeric: lining-nums tabular-nums; }
.index tr td.num:nth-child(3) { grid-area: meta; padding-top: 6px; }
.index tr td.num:nth-child(4) { grid-area: meta; padding-top: 6px; padding-left: 7.5rem; }
.index .k { color: var(--teal); }

.home-body { padding: 30px 0 48px; display: grid; gap: 8px; }

/* ---- paper ---- */
.paper-page { padding-bottom: 56px; }
.paper-head { padding: 30px 0 22px; border-bottom: 1px solid var(--ink); }
.paper-head h1 { font-weight: 600; font-size: 2rem; line-height: 1.14; letter-spacing: -.012em; margin: 0 0 14px; max-width: 26ch; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-family: var(--sans); font-weight: 500; font-size: .9rem; color: var(--grey); font-variant-numeric: lining-nums; }
.meta span + span::before { content: ""; display: inline-block; width: 4px; height: 4px; background: var(--teal); margin-right: 18px; vertical-align: middle; position: relative; left: -2px; }
.paper-grid { display: grid; gap: 24px; padding-top: 24px; }
.toc { border-top: 2px solid var(--ink); padding-top: 10px; }
.toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0; font-family: var(--sans); font-weight: 500; font-size: .95rem; line-height: 1.35; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 1.6rem 1fr; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.toc li::before { content: counter(toc); color: var(--teal); font-weight: 600; font-variant-numeric: lining-nums; }
.toc li.refs-link::before { content: "R"; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--teal); text-decoration: underline; }
.paper-body { min-width: 0; }
.paper-body .abstract { margin-bottom: 30px; }

/* ---- prose ---- */
.prose { max-width: 68ch; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05em; }
.prose h2 { font-weight: 600; font-size: 1.45rem; line-height: 1.25; margin: 2.1em 0 .6em; padding-top: .75em; border-top: 1px solid var(--rule); letter-spacing: -.005em; }
.prose h3 { font-weight: 600; font-size: 1.15rem; margin: 1.6em 0 .4em; }
.prose.numbered { counter-reset: sec; }
.prose.numbered h2 { counter-increment: sec; counter-reset: sub; }
.prose.numbered h2::before { content: counter(sec) "."; display: inline-block; min-width: 1.6em; font-family: var(--sans); font-weight: 600; color: var(--teal); font-variant-numeric: lining-nums; }
.prose.numbered h3 { counter-increment: sub; }
.prose.numbered h3::before { content: counter(sec) "." counter(sub); margin-right: .55em; font-family: var(--sans); font-weight: 600; color: var(--teal); font-variant-numeric: lining-nums; }
.prose ul { padding-left: 1.2em; }
.prose ol { padding-left: 1.5em; }
.prose li { margin-bottom: .4em; padding-left: .2em; }
.prose li::marker { color: var(--teal); font-family: var(--sans); font-weight: 600; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--teal); color: var(--grey); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose code { font-family: var(--sans); font-size: .95em; }
.cite { font-family: var(--sans); font-weight: 600; font-size: .68em; line-height: 0; vertical-align: super; margin-left: 1px; font-variant-numeric: lining-nums; }
.cite a { text-decoration: none; padding: 0 1px; }
.cite a:hover { text-decoration: underline; }

/* captions and tables */
.prose .caption { margin: 1.8em 0 .5em; padding-top: 8px; border-top: 2px solid var(--ink); }
.prose .caption + .table { margin-top: 0; }
.table { overflow-x: auto; margin: 1.4em 0 1.8em; border-bottom: 2px solid var(--ink); }
.prose .table { max-width: none; }
table { border-collapse: collapse; width: 100%; }
.table table { font-family: var(--sans); font-weight: 500; font-size: .95rem; line-height: 1.4; font-variant-numeric: lining-nums tabular-nums; }
.table th { text-align: left; font-weight: 600; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); padding: 8px 14px 8px 0; border-bottom: 1px solid var(--ink); vertical-align: bottom; }
.table td { padding: 9px 14px 9px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table td:first-child { font-weight: 600; color: var(--ink); }
.table td em { font-family: var(--serif); font-size: 1.05em; }
.fig { margin: 2em 0; }
.fig img { border: 1px solid var(--rule); }
.fig figcaption { margin-top: 10px; }
.prose figure:not(.fig) { margin: 1.6em 0; }

/* references */
.references { max-width: 68ch; margin-top: 2.6em; padding-top: 12px; border-top: 2px solid var(--ink); }
.references h2 { margin: 0 0 12px; font-weight: 600; font-size: 1.25rem; }
.references ol { margin: 0; padding: 0; list-style: none; counter-reset: ref; }
.references li { counter-increment: ref; display: grid; grid-template-columns: 2.2rem 1fr; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 1rem; line-height: 1.45; }
.references li::before { content: counter(ref) "."; font-family: var(--sans); font-weight: 600; color: var(--teal); font-variant-numeric: lining-nums; }
.references li:target { background: var(--tint); }
.references a { display: block; font-family: var(--sans); font-weight: 500; font-size: .88rem; overflow-wrap: anywhere; }
.ref-label em { font-style: italic; }

/* ---- catalogue entries (products) ---- */
.products, .product-feature { display: grid; gap: 12px; margin: 1.4em 0 1.8em; max-width: 68ch; }
.entry { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--rule); border-left: 3px solid var(--teal); text-decoration: none; color: var(--ink); background: var(--paper); }
.entry:hover { border-color: var(--ink); border-left-color: var(--teal); }
.entry-img img { width: 96px; height: 96px; object-fit: contain; background: #fff; }
.entry-text { display: grid; gap: 3px; min-width: 0; }
.entry-no { font-family: var(--sans); font-weight: 600; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); font-variant-numeric: lining-nums; }
.entry-name { font-weight: 600; font-size: 1.02rem; line-height: 1.25; }
.entry-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-family: var(--sans); font-weight: 500; font-size: .88rem; color: var(--grey); font-variant-numeric: lining-nums; }
.entry-price { color: var(--ink); font-weight: 600; }

/* about page mascot */
.prose figure:not(.fig) img[src*="mascot"] { width: 120px; }

/* ---- footer ---- */
.footer { border-top: 6px solid var(--ink); margin-top: 0; }
.footer-grid { display: grid; gap: 22px; padding: 26px var(--gutter) 34px; }
.footer-col p { margin: 0; font-family: var(--sans); font-weight: 500; font-size: .92rem; line-height: 1.5; color: var(--grey); }
.footer-col p.label { margin-bottom: .45rem; color: var(--teal); }
.footer-col a { color: var(--ink); }
.publisher { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.publisher img { width: 64px; height: 64px; }

/* ---- wider screens ---- */
@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .issue h1 { font-size: 2.6rem; }
  .paper-head h1 { font-size: 2.5rem; }
  .index tr { grid-template-columns: 3.5rem 1fr 6.5rem 5.5rem; grid-template-areas: none; padding: 18px 0; }
  .index .no, .index .paper { grid-area: auto; }
  .index tr td.num:nth-child(3), .index tr td.num:nth-child(4) { grid-area: auto; display: block; padding: 6px 0 0; text-align: right; font-size: .95rem; }
  .index .k { display: none; }
  .index thead { display: block; }
  .index thead tr { padding: 10px 0 8px; border-bottom: 1px solid var(--ink); }
  .index th { padding: 0; text-align: left; font-family: var(--sans); font-weight: 600; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); }
  .index th.num { text-align: right; }
  .products { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1.2fr 1fr; gap: 32px; }
}
@media (min-width: 1000px) {
  .primary { display: flex; flex-wrap: wrap; gap: 4px 22px; }
  .menu { display: none; }
  .issue { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; align-items: start; padding: 40px 0 44px; }
  .issue h1 { font-size: 3rem; }
  .home-body { grid-template-columns: 3fr 9fr; gap: 48px; }
  .home-body .side { padding-top: 4px; border-top: 2px solid var(--ink); align-self: start; padding-top: 10px; }
  .home-body .prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
  .paper-grid { grid-template-columns: 3fr 9fr; gap: 48px; padding-top: 32px; }
  .paper-side { position: relative; }
  .toc { position: sticky; top: 24px; }
  .paper-head { padding: 44px 0 26px; display: grid; grid-template-columns: 3fr 9fr; column-gap: 48px; }
  .paper-head .label { padding-top: 14px; }
  .paper-head h1, .paper-head .meta { grid-column: 2; }
  .paper-head h1 { font-size: 2.85rem; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print { .masthead nav, .menu, .footer { display: none; } }
