/* The shared design system, part 2: components (issue #421). The parts cfs.eco and dendrofile.com both use.
   Load after tokens.css. Each site adds its own site.css for what only it uses; ops/site-system/test_system.py fails
   on any class here that neither site's pages use. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink-2);
       font: 400 var(--fs-1)/1.65 var(--text); font-optical-sizing: auto;
       text-rendering: optimizeLegibility; overflow-x: hidden; }
@media (min-width: 900px) { body { font-size: var(--fs-2); } }
img { max-width: 100%; height: auto; display: block; }

a { color: var(--fir); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover, a:focus-visible { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
p a, li a { text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--fir); outline-offset: 3px; border-radius: var(--radius); }

h1, h2, h3 { color: var(--ink); font-family: var(--display); font-weight: 500; margin: 0; }
h1 { font-size: var(--fs-5); line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: var(--fs-4); line-height: 1.12; text-wrap: balance; }
h3 { font-size: var(--fs-3); line-height: 1.2; }
p { margin: 0 0 var(--s-4); max-width: var(--measure); }
h2 + p { margin-top: var(--s-4); }
.eyebrow { font: 400 var(--fs-0)/1.4 var(--caps); letter-spacing: var(--track-caps); text-transform: lowercase;
           color: var(--fir); margin: 0 0 var(--s-4); }
.lede { font-size: var(--fs-2); color: var(--ink-2); }
@media (min-width: 900px) { .lede { font-size: 1.3125rem; } }
.caption { font-size: var(--fs-0); color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--fir); color: var(--on-fir); padding: var(--s-3) var(--s-4); z-index: 10; }
.skip:focus { left: var(--gutter); }

.wrap { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* Masthead: the site's mark, small, and the main navigation. The home link is at least 48 by 48 (finding 9). */
.masthead { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent);
            -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: var(--hair); }
.masthead .wrap { display: flex; align-items: center; gap: var(--s-4); min-height: 64px; }
.home { display: flex; align-items: center; justify-content: center; gap: var(--s-3); color: var(--ink);
        min-height: var(--target); min-width: var(--target); }
.home:hover, .home:focus-visible { text-decoration: none; }
nav { margin-left: auto; display: flex; gap: var(--s-1); }
nav a { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--s-3);
        font: 400 .95rem/1 var(--caps); letter-spacing: .1em; text-transform: lowercase; color: var(--ink-2);
        white-space: nowrap; }
nav a:hover, nav a:focus-visible { color: var(--fir); text-decoration: none; }
nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--fir); }
@media (max-width: 560px) {
  nav { gap: 0; }
  nav a { padding: 0 var(--s-2); font-size: .85rem; letter-spacing: .04em; }
}

/* Buttons: rectangular, like a label on a specimen drawer. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--target);
       padding: 0 var(--s-5); border: 1px solid var(--fir); border-radius: var(--radius);
       font: 400 1rem/1 var(--caps); letter-spacing: .1em; text-transform: lowercase;
       transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.btn:hover, .btn:focus-visible { text-decoration: none; }
.btn-solid { background: var(--fir); color: var(--on-fir); }
.btn-solid:hover, .btn-solid:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-line { color: var(--fir); }
.btn-line:hover, .btn-line:focus-visible { background: var(--lichen); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }

/* Tree rings: a mask, so the colour follows the theme. */
.rings { position: absolute; pointer-events: none; aspect-ratio: 1; background: var(--rings); opacity: var(--rings-alpha);
         -webkit-mask: url("img/rings.svg") center / contain no-repeat, radial-gradient(circle, #000 52%, transparent 70%);
         -webkit-mask-composite: source-in;
         mask: url("img/rings.svg") center / contain no-repeat, radial-gradient(circle, #000 52%, transparent 70%);
         mask-composite: intersect; }

/* Hero: a title page. */
.hero { position: relative; overflow: hidden; padding: var(--s-8) 0 var(--s-8); border-bottom: var(--hair); }
.hero .rings { width: min(1100px, 150vw); right: -75%; top: 24rem; }
.hero-in { position: relative; display: grid; gap: var(--s-5); align-items: center; }
.hero h1 { margin-bottom: var(--s-5); }
.hero .lede { margin-bottom: 0; }
.hero .actions { margin-top: var(--s-5); }
@media (min-width: 900px) {
  .hero { padding: var(--s-9) 0; }
  .hero-in { grid-template-columns: 5fr 6fr; gap: var(--s-8); }
  .hero .rings { right: -18%; top: -45%; }
}

section { padding: var(--s-8) 0; }
@media (min-width: 900px) { section { padding: var(--s-9) 0; } }
.band { background: var(--paper-2); border-top: var(--hair); border-bottom: var(--hair); }

/* Inverted band: ink becomes paper. Re-declares the dark tokens locally. */
.ink-band { position: relative; overflow: hidden; background: var(--ink-band); color: #c2c1b6;
            --ink: #ecebe4; --ink-2: #c2c1b6; --ink-3: #9a998e; --rule: #3a3f35; --fir: #a9c9ad; --on-fir: #161613;
            --lichen: #243021; --rings: #a9c9ad; --rings-alpha: .12; --cedar: #dd9775; }
@media (prefers-color-scheme: dark) { .ink-band { border-top: var(--hair); border-bottom: var(--hair); } }
.ink-band .rings { width: min(900px, 140vw); left: -30%; bottom: -60%; }
.ink-band .wrap { position: relative; }
.line { display: grid; gap: var(--s-4); align-items: center; }
.line h2 { max-width: 22ch; }
.line p { margin: var(--s-2) 0 0; }
.line .actions { margin: 0; }
@media (min-width: 900px) { .line { grid-template-columns: 7fr 4fr; gap: var(--s-8); } }

/* A placeholder still waiting on a principal's answer, and the card it sits in. */
.chip { display: inline-block; font: 400 var(--fs-0)/1.5 var(--text); font-style: italic; color: var(--cedar);
        border: 1px dashed var(--cedar); border-radius: var(--radius); padding: 0 var(--s-2); }
.card { border: 1px solid var(--ink); border-radius: var(--radius); padding: var(--s-6); background: var(--paper); }
.card h3 { margin-bottom: var(--s-3); }
.card p { margin: 0; }

/* Three short points under a hero. */
.points { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--ink); }
.points li { padding: var(--s-5) 0; border-bottom: var(--hair); }
.points h3 { margin-bottom: var(--s-1); }
.points p { margin: 0; }
@media (min-width: 760px) {
  .points { grid-template-columns: repeat(3, 1fr); gap: 0 var(--s-7); }
  .points li { border-bottom: 0; }
}

/* A short list with a fir tick before each line. */
.ticks { list-style: none; margin: 0 0 var(--s-5); padding: 0; }
.ticks li { padding: var(--s-2) 0 var(--s-2) 1.6rem; position: relative; border-bottom: var(--hair); }
.ticks li::before { content: ""; position: absolute; left: .15rem; top: 1.05em; width: .7rem; height: 1px; background: var(--fir); }

/* Secondary pages: a short hero, then prose for search. */
.doc-hero { padding-bottom: var(--s-7); }
.doc-hero .wrap { position: relative; }
.doc-hero h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); max-width: 20ch; margin-bottom: var(--s-4); }
.doc-hero .rings { width: min(900px, 130vw); right: -30%; top: -60%; }
.prose { max-width: 46rem; }
.prose h2 { font-size: clamp(1.45rem, 3vw, 1.9rem); margin: var(--s-7) 0 var(--s-3); }
.prose h2:first-child, .prose .plate + h2 { margin-top: 0; }
.prose p, .prose li { max-width: none; }
.prose ul { margin: 0 0 var(--s-4); padding-left: 1.2rem; }
.prose li { margin-bottom: var(--s-2); }
.plate { width: 100%; max-width: 560px; height: auto; margin: 0 0 var(--s-7); border: var(--hair); }
.qa { border-top: var(--hair); padding: var(--s-5) 0; }
.qa h3 { font-size: 1.3rem; margin-bottom: var(--s-2); }
.qa p { margin: 0; }
.more { display: grid; gap: var(--s-6); align-items: start; }
.more h2 { max-width: 20ch; }
.more ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 var(--s-5); }
.more li a { display: inline-flex; align-items: center; min-height: var(--target); }
@media (min-width: 900px) { .more { grid-template-columns: 5fr 6fr; gap: var(--s-8); } }

/* Footer: the site's mark, one line, and its links. */
footer { padding: var(--s-7) 0 var(--s-8); border-top: 1px solid var(--ink); }
footer .wrap { display: grid; gap: var(--s-5); }
footer p { margin: 0; font-size: var(--fs-0); color: var(--ink-3); }
footer nav { margin: 0; flex-wrap: wrap; }
footer nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
footer nav a { display: inline-flex; align-items: center; min-height: var(--target); padding-left: 0; padding-right: var(--s-4); }
@media (min-width: 900px) { footer .wrap { grid-template-columns: auto 16rem 1fr; align-items: end; gap: var(--s-7); } }
