/* The Academy's "Do the work" pages and homes (academy_work/show, academy_homes/show; docs/idea/50): the Academy's
   paper (academy.css, .ac), phone first. The steps are a list until academy-steps connects (.stepping), then a deck
   that scrolls sideways and snaps (.deck). Lengths and trade words show in the reader's place (.pl-*, set by
   academy-place on the wrapper's data-units and data-dialect); with no place, both. Always light, like the Academy. */

.aw-wrap { max-width: 76rem; margin: 0 auto; padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2.5rem) 4rem; }
.aw h2 { margin: 0; }
.aw-crumbs { margin: 0 0 1rem; color: var(--muted); font-size: .8125rem; }
.aw-crumbs a { text-underline-offset: 2px; }

/* A place's units and words: both until one is picked */
.aw[data-units="metric"] .pl-len :is(.pl-i, .pl-both),
.aw[data-units="imperial"] .pl-len :is(.pl-m, .pl-both),
.aw[data-dialect="na"] .pl-word :is(.pl-uk, .pl-both),
.aw[data-dialect="uk"] .pl-word :is(.pl-na, .pl-both) { display: none; }

/* Masthead: the name, its line, the facts, and where you work */
.aw-mast { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; justify-content: space-between; padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 3px double var(--rule); }
.aw-mast > div { display: grid; gap: .45rem; max-width: 46rem; }
.aw-mast h1 { margin: 0; font-size: clamp(2.5rem, 8vw, 4.6rem); line-height: .95; letter-spacing: -.01em; }
.aw-in { color: var(--muted); }
.aw-lead { margin: 0; color: var(--muted); font-size: clamp(1.05rem, 2.4vw, 1.25rem); }
.aw-scope { margin: .35rem 0 0; color: var(--ink); font-size: .95rem; }
.aw-scope b { margin-right: .35rem; color: var(--coral-ink); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.aw-facts { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 0; }
.aw-facts span { padding: .2rem .7rem; border: 1.5px solid var(--hair); border-radius: 999px; background: #fffdf8; font-size: .875rem; font-weight: 700; }
.aw-place { display: grid; gap: .25rem; font-size: .8125rem; font-weight: 700; color: var(--muted); }
.aw-place select {
  min-height: 44px; min-width: 13rem; padding: .5rem 2.2rem .5rem .8rem; border: 2px solid var(--ink); border-radius: var(--radius-control, .625rem);
  background: #fffdf8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231d1f3a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right .8rem center;
  color: var(--ink); font: inherit; font-size: 1rem; font-weight: 700; appearance: none; cursor: pointer;
}

/* The body: steps, with the kit and the stop line beside them on a wide screen */
.aw-body { display: grid; gap: 1.25rem; }
@media (min-width: 60rem) { .aw-body { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; gap: 2rem; } }

.aw-steps { display: grid; gap: .75rem; padding: clamp(.75rem, 2vw, 1.25rem); border: 1.5px solid var(--hair); border-radius: 18px; background: #fffdf8; }
.aw-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.aw-count { font-weight: 800; font-size: .95rem; }
.aw-link { all: unset; padding: .55rem .1rem; color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: pointer; }
.aw-link:hover { color: var(--coral-ink); }
.aw-link:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 4px; }
.aw-steps:not(.stepping) .aw-js, .aw-steps:not(.deck) .aw-nav { display: none; }

.aw-track { display: grid; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.aw-step { display: grid; gap: .75rem; align-content: start; }
.aw-pic { margin: 0; overflow: hidden; border-radius: 14px; background: #f1e9d8; aspect-ratio: 4 / 3; }
.aw-pic svg, .aw-thumb svg { display: block; width: 100%; height: 100%; }
.aw-say { display: flex; gap: .75rem; align-items: baseline; margin: 0; font-size: clamp(1.15rem, 2.6vw, 1.4rem); font-weight: 700; line-height: 1.3; }
.aw-n {
  flex: none; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--coral); color: #fff;
  font-size: 1rem; font-weight: 800; transform: translateY(-.1em);
}
/* Every step at once, wide: the drawing beside its line */
@media (min-width: 40rem) {
  .aw-steps:not(.deck) .aw-step { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); align-items: center; gap: 1.25rem; }
}

/* One at a time: a deck that scrolls sideways and snaps */
.aw-steps.deck .aw-track {
  grid-auto-flow: column; grid-auto-columns: 100%; gap: 1rem; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 14px;
}
.aw-steps.deck .aw-track::-webkit-scrollbar { display: none; }
.aw-steps.deck .aw-step { scroll-snap-align: start; scroll-snap-stop: always; }
.aw-track:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.aw-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.aw-nav .ac-btn { min-width: 6.5rem; }
.aw-nav .ac-btn:disabled { opacity: .35; cursor: default; }
.aw-dots { display: flex; flex-wrap: wrap; justify-content: center; }
/* On a phone the dots get their own row above Back and Next. */
@media (max-width: 34rem) { .aw-nav { flex-wrap: wrap; } .aw-dots { order: -1; flex-basis: 100%; } }
.aw-dot { all: unset; display: grid; place-items: center; width: 26px; height: 44px; cursor: pointer; }
.aw-dot::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--hair); transition: background .2s, transform .2s; }
.aw-dot[aria-current="step"]::before { background: var(--coral); transform: scale(1.3); }
.aw-dot:focus-visible { outline: 3px solid var(--coral); border-radius: 6px; }

/* Beside the steps: the kit, and where to stop */
.aw-side { display: grid; gap: 1rem; }
.aw-kit, .aw-stop { display: grid; gap: .5rem; padding: 1.1rem 1.2rem; border-radius: 16px; }
.aw-kit { border: 1.5px solid var(--hair); background: #fffdf8; }
.aw-side h2 { font-family: var(--font-sans, Archivo, system-ui, sans-serif); font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.aw-kit h2 { color: var(--muted); }
.aw-kit h2:not(:first-child) { margin-top: .5rem; }
.aw-side ul { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
.aw-kit li { padding-left: 1.1rem; position: relative; }
.aw-kit li::before { content: ""; position: absolute; left: 0; top: .55em; width: .45rem; height: .45rem; border-radius: 2px; background: var(--teal); }
.aw-stop { border: 2px solid var(--coral); background: #fbe4da; margin-bottom: 1.25rem; }
.aw-stop h2 { color: var(--coral-ink); font-family: var(--font-sans, Archivo, system-ui, sans-serif); font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.aw-stop ul { display: grid; gap: .3rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 60rem) { .aw-stop ul { grid-template-columns: 1fr 1fr; column-gap: 2rem; } }
.aw-stop li { padding-left: 1.1rem; position: relative; font-weight: 600; }
.aw-stop li::before { content: "!"; position: absolute; left: 0; color: var(--coral-ink); font-weight: 900; }

/* Questions, closed until asked */
.aw-qs { display: grid; gap: .5rem; margin-top: 2rem; max-width: 50rem; }
.aw-qs h2 { margin-bottom: .25rem; font-size: clamp(1.6rem, 4vw, 2.2rem); }
.aw-q { border-bottom: 1.5px solid var(--hair); }
.aw-q summary { display: flex; justify-content: space-between; gap: 1rem; min-height: 44px; align-items: center; padding: .4rem 0; font-weight: 700; cursor: pointer; list-style: none; }
.aw-q summary::-webkit-details-marker { display: none; }
.aw-q summary::after { content: "+"; flex: none; color: var(--coral-ink); font-size: 1.4rem; line-height: 1; }
.aw-q[open] summary::after { content: "–"; }
.aw-q p { margin: 0 0 .9rem; color: var(--muted); }

/* The foot: sources, the audits, something wrong */
.aw-foot { display: grid; gap: .4rem; margin-top: 2.25rem; padding-top: 1rem; border-top: 1.5px solid var(--hair); color: var(--muted); font-size: .875rem; }
.aw-foot p { margin: 0; }
.aw-foot b { color: var(--ink); }
.aw-foot a { text-underline-offset: 2px; }

/* A reader's note */
.aw-note summary { list-style: none; width: fit-content; }
.aw-note summary::-webkit-details-marker { display: none; }
.aw-note-form { display: grid; gap: .75rem; max-width: 34rem; margin-top: .5rem; padding: 1rem; border: 1.5px solid var(--hair); border-radius: 14px; background: #fffdf8; color: var(--ink); }
.aw-field { display: grid; gap: .3rem; font-size: .875rem; font-weight: 700; }
.aw-field small { color: var(--muted); font-weight: 400; }
.aw-field :is(textarea, input) {
  width: 100%; min-height: 44px; padding: .6rem .75rem; border: 1.5px solid #cfc6b3; border-radius: var(--radius-control, .625rem);
  background: #fff; color: var(--ink); font: inherit; font-size: 1rem; font-weight: 400; box-sizing: border-box;
}
.aw-field :is(textarea, input):focus-visible { outline: 3px solid var(--coral); outline-offset: 1px; border-color: var(--ink); }
.aw-note-acts { display: flex; justify-content: flex-end; }
.aw-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Homes: shelves of work pages and stories */
.aw-shelf { display: grid; gap: 1rem; margin-top: 2rem; }
.aw-shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }
.aw-shelf-head > div { display: grid; gap: .2rem; }
.aw-shelf h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.05; }
.aw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.aw-cards:has(.aw-tile) { grid-template-columns: repeat(auto-fill, minmax(min(10rem, 45%), 1fr)); gap: .75rem; }
.aw-tile .aw-card-say b { font-size: 1.15rem; }
@media (max-width: 30rem) { .aw-tile .aw-card-say small { display: none; } }
.aw-card a, .aw-tile a { display: grid; height: 100%; overflow: hidden; border: 1.5px solid var(--hair); border-radius: 16px; background: #fffdf8; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.aw-card a:hover, .aw-tile a:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgba(29, 31, 58, .5); }
.aw-thumb { display: block; aspect-ratio: 4 / 3; background: #f1e9d8; }
.aw-card-say { display: grid; gap: .3rem; align-content: start; padding: .9rem 1rem 1.1rem; }
.aw-card-say b { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; line-height: 1.1; }
.aw-card-say small { color: var(--muted); font-size: .9rem; }
.aw-tile img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.aw-empty { display: grid; gap: .6rem; justify-items: start; padding: 1.25rem; border: 2px dashed #d8cfbb; border-radius: 16px; }
.aw-empty p { margin: 0; font-weight: 700; }
.aw-empty .aw-note summary { list-style: none; }
.aw-work-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.aw-trades { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.aw-trades a { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem 1rem; border: 2px solid var(--ink); border-radius: var(--radius-control, .625rem); font-weight: 700; text-decoration: none; }
.aw-trades a:hover { background: var(--ink); color: var(--paper); }

@media (prefers-reduced-motion: reduce) { .aw-card a, .aw-tile a, .aw-dot::before { transition: none; } }

@media print {
  .aw-place, .aw-nav, .aw-bar, .aw-note, .aw-crumbs { display: none !important; }
  .aw-steps.deck .aw-track { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; }
  .aw-step { grid-template-columns: 12rem 1fr; align-items: center; break-inside: avoid; }
  .aw-q { break-inside: avoid; }
  .aw-q p { display: block; }
}
