/* Nature scavenger hunt (/nature-scavenger-hunt/). Loaded after guide.css.
   Pieces the magpie template doesn't have: the 4 x 4 hunt grid (tap to mark found, lines light
   up), the two levels, and the one-page A4 print. Page colour: quenda ochre (--c). */

/* Quick facts: four even items */
@media (min-width: 760px) {
  .sh-qf { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* The sheet (screen) */
.sh-sheet { max-width: 820px; margin-top: 28px; }
.sh-print-head, .sh-print-help { display: none; }
.sh-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; padding: 16px 0 20px; border-top: 3px solid var(--ink); }
.sh-fields label { display: grid; gap: 2px; min-width: 0; }
.sh-fields label:first-child { grid-column: 1 / -1; }
.sh-fields span { font-stretch: 75%; font-weight: 700; font-size: 14px; color: var(--ink2); }
.sh-fields input { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1.5px solid var(--ink); border-radius: 0; padding: 6px 0; }
.sh-fields input:focus { outline: none; box-shadow: 0 2px 0 0 var(--blue); }

/* Score: count, meter, message */
.sh-status { border-top: 3px solid var(--ink); padding: 12px 0 16px; }
.sh-count { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.sh-count b { font-stretch: 75%; font-weight: 820; font-size: 56px; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sh-count span { font-stretch: 75%; font-weight: 650; font-size: 15px; color: var(--ink2); }
.sh-meter { height: 10px; margin: 10px 0 10px; background: var(--lime); box-shadow: inset 0 0 0 1px var(--hair); }
.sh-meter b { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--c); transition: width .45s var(--ease); }
.sh-msg { margin: 0; font-size: 16.5px; min-height: 1.5em; }
.sh-status.is-line .sh-msg, .sh-status.is-all .sh-msg { font-weight: 700; }
.sh-status.is-all .sh-count b { color: var(--c); }

/* The grid: 4 x 4 specimen labels */
.sh-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.sh-grid li { min-width: 0; }
.sh-sq {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  width: 100%; height: 100%; min-height: 96px; padding: 7px 6px 8px; text-align: left;
  font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--ink); border-radius: 2px;
  cursor: pointer; -webkit-tap-highlight-color: transparent; overflow: hidden;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease), box-shadow .2s var(--ease);
}
.sh-n { font-stretch: 75%; font-weight: 800; font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--c); transition: color .2s var(--ease); }
.sh-t { font-stretch: 88%; font-weight: 760; font-size: 13.5px; line-height: 1.12; letter-spacing: -.005em; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
.sh-h { display: none; }
.sh-sq:hover { background: var(--lime); }
.sh-sq:active { transform: scale(.95); }
.sh-sq:focus-visible { outline-offset: 1px; }

/* Found: filled ochre, with a stamped tick */
.sh-sq[aria-pressed="true"] { background: var(--c); color: #fff; border-color: var(--c); }
.sh-sq[aria-pressed="true"] .sh-n { color: rgba(255,255,255,.75); }
.sh-sq::after {
  content: ""; position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid currentColor; opacity: 0; transform: scale(1.6) rotate(-14deg);
  background: no-repeat center / 12px 9px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Cpath d='M1 4.5 4.3 7.6 11 1' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3C/svg%3E");
  transition: opacity .18s var(--ease), transform .3s var(--ease);
}
.sh-sq[aria-pressed="true"]::after { opacity: 1; transform: scale(1) rotate(-14deg); }
/* Part of a finished row, column or diagonal */
.sh-sq.in-line { box-shadow: inset 0 0 0 3px var(--basalt); }
.sh-sq.is-pop { animation: sh-pop .5s var(--ease); }
@keyframes sh-pop { 30% { transform: scale(1.06); } }

@media (min-width: 600px) {
  .sh-grid { gap: 6px; }
  .sh-sq { min-height: 132px; padding: 10px 10px 11px; }
  .sh-n { font-size: 15px; }
  .sh-t { font-size: 17px; }
  .sh-h { display: block; font-stretch: 75%; font-weight: 600; font-size: 13.5px; line-height: 1.25; color: var(--ink2); transition: color .2s var(--ease); }
  .sh-sq[aria-pressed="true"] .sh-h { color: rgba(255,255,255,.85); }
  .sh-fields { grid-template-columns: 1.4fr 1fr 1.4fr; }
  .sh-fields label:first-child { grid-column: auto; }
}

.sh-rule { margin: 18px 0 0; font-size: 15.5px; line-height: 1.45; color: var(--ink2); max-width: 44em; }
.sh-rule b { color: var(--ink); font-weight: 750; }
.sh-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.sh-b2 {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-stretch: 75%; font-weight: 700; font-size: 17px; line-height: 1;
  color: var(--ink); background: transparent; border: 1.5px solid var(--ink); border-radius: 2px;
  padding: 14px 18px; cursor: pointer; transition: background-color .15s var(--ease), transform .15s var(--ease);
}
.sh-b2:hover { background: var(--lime); }
.sh-b2:active { transform: scale(.97); }
.sh-keep { margin: 14px 0 0; font-stretch: 75%; font-size: 14px; font-weight: 600; color: var(--ink2); max-width: 40em; }

/* Clues */
.sh-wa { font-size: 16px; color: var(--ink2); max-width: 30em; margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--hair2); }
.sh-clues li a:not(.src) { font-stretch: 75%; font-weight: 700; font-size: 15px; white-space: nowrap; }

/* Levels and tips */
.sh-levels { display: grid; gap: 22px; margin: 30px 0 0; }
.sh-level { border-top: 3px solid var(--ink); padding-top: 10px; }
.sh-level dt { font-stretch: 125%; font-weight: 860; font-size: 30px; line-height: 1; letter-spacing: -.025em; margin: 0 0 8px; display: flex; align-items: baseline; gap: 10px; }
.sh-level-n { font-stretch: 75%; font-weight: 800; font-size: 18px; letter-spacing: 0; color: var(--c); font-variant-numeric: tabular-nums; }
.sh-level dd { margin: 0; font-size: 16.5px; line-height: 1.45; max-width: 30em; }
.sh-tips { list-style: none; margin: 30px 0 0; padding: 0; border-top: 1px solid var(--hair2); max-width: 60em; }
.sh-tips li { position: relative; padding: 13px 0 14px 26px; border-bottom: 1px solid var(--hair2); font-size: 16.5px; line-height: 1.45; }
.sh-tips li::before { content: ""; position: absolute; left: 2px; top: 21px; width: 10px; height: 10px; background: var(--c); border-radius: 50%; }
.sh-tips b { font-weight: 750; }
.sh-next { margin: 26px 0 0; font-size: 17px; max-width: 40em; }
@media (min-width: 760px) {
  .sh-levels { grid-template-columns: 1fr 1fr; column-gap: 32px; max-width: 900px; }
  .sh-level dt { font-size: 36px; }
}

/* Rules: the help line under the do and don't lists */
.sh-help { margin: 30px 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.18); font-size: 16.5px; line-height: 1.5; max-width: 46em; }
.sh-help b { color: #fff; font-weight: 750; }
.sh-help a.tel { font-weight: 700; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .sh-sq, .sh-sq::after, .sh-n, .sh-h, .sh-meter b, .sh-b2 { transition: none !important; }
  .sh-sq.is-pop { animation: none; }
}

/* Print: only the hunt sheet, on one A4 page */
@media print {
  @page { size: A4 portrait; margin: 10mm 12mm; }
  html, body { background: #fff !important; color: #000 !important; }
  body > :not(main) { display: none !important; }
  main > article > :not(#hunt) { display: none !important; }
  #hunt { padding: 0 !important; background: #fff !important; }
  #hunt .wrap { padding: 0 !important; max-width: none !important; }
  #hunt .sec, #hunt .lede, .sh-status, .sh-acts, .sh-keep { display: none !important; }
  .sh-sheet { max-width: none; margin: 0; }
  .sh-print-head { display: block; border-bottom: 2pt solid #000; padding-bottom: 2mm; margin-bottom: 3mm; }
  .sh-print-t { margin: 0; font-stretch: 125%; font-weight: 860; font-size: 24pt; line-height: 1.05; letter-spacing: -.02em; }
  .sh-print-s { margin: 1.2mm 0 0; font-stretch: 75%; font-weight: 650; font-size: 9.5pt; }
  .sh-fields { grid-template-columns: 1.4fr 1fr 1.4fr; gap: 3mm 5mm; padding: 0 0 4mm; border-top: 0; }
  .sh-fields label:first-child { grid-column: auto; }
  .sh-fields span { font-size: 8.5pt; color: #000; }
  .sh-fields input { height: 7.5mm; padding: 0; font-size: 11pt; border-bottom: 1pt solid #000; }
  .sh-grid { gap: 0; border: 1pt solid #000; }
  .sh-sq { min-height: 0; height: 52mm; padding: 2.5mm 2.5mm 3mm; border: .75pt solid #000; border-radius: 0; background: #fff !important; color: #000 !important; box-shadow: none !important; justify-content: flex-start; gap: 2mm; }
  .sh-sq::after { opacity: 0 !important; }
  .sh-sq[aria-pressed="true"]::after { opacity: 1 !important; transform: none; border-color: #000; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 9'%3E%3Cpath d='M1 4.5 4.3 7.6 11 1' fill='none' stroke='%23000' stroke-width='2.2'/%3E%3C/svg%3E"); }
  .sh-n { font-size: 10pt; color: #000 !important; }
  .sh-t { font-size: 13pt; line-height: 1.1; }
  .sh-h { display: block; font-stretch: 75%; font-weight: 500; font-size: 9pt; line-height: 1.25; color: #000 !important; margin-top: auto; }
  .sh-rule { margin-top: 3.5mm; font-size: 9.5pt; line-height: 1.35; color: #000; max-width: none; }
  .sh-rule b { color: #000; }
  .sh-print-help { display: block; margin: 2.5mm 0 0; padding-top: 2mm; border-top: .75pt solid #000; font-stretch: 75%; font-size: 9.5pt; line-height: 1.35; }
  a[href]::after { content: none !important; }
}
