/* The Explorers Club (/ks3/explorers): scoped under .pg-explorers. */
.pg-explorers {
  .hero { padding-block: 10px 80px; }
  .hero .wrap { display: grid; grid-template-columns: 1fr .9fr; gap: 30px; align-items: center; }
  .hero h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); margin: 14px 0 12px; }
  .hero p { max-width: 46ch; margin: 0 0 12px; }
  .hero .dog { width: 100%; max-width: 480px; margin-left: auto; }
  @media (max-width: 760px) { .hero .wrap { grid-template-columns: 1fr; } .hero .dog { max-width: 320px; margin-inline: auto; } }
}

/* the treasure hunts */
.pg-explorers {
  .hunts { padding-block: 60px 80px; }
  .hunts .lede { margin: 8px 0 26px; max-width: 60ch; }
  .cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .card { position: relative; background: #fffdf6; padding: 22px 22px 24px; box-shadow: 0 8px 20px rgba(40,25,5,.16); border-top: 8px solid var(--coral); }
  .card[data-status="done"] { border-top-color: var(--s-science); }
  .card[data-status="locked"] { border-top-color: #b9a68a; background: #f1e8d8; color: #7a6a55; box-shadow: none; }
  .card .num { position: absolute; right: 16px; top: -22px; width: 44px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; padding-top: .15em;
               background: var(--navy); color: var(--label); font: 400 1.3rem/1 var(--f-label); box-shadow: 0 3px 0 rgba(0,0,0,.2); }
  .card[data-status="locked"] .num { background: #b9a68a; }
  .card .kicker { font: 400 .8rem/1 var(--f-label); letter-spacing: .08em; color: #8a6f4c; margin: 0 0 6px; }
  .card h3 { font: 400 1.35rem/1.1 var(--f-slab); margin: 0 0 12px; }
  .card p { margin: 0 0 12px; font-size: .95rem; }
  .card .pic { display: block; width: 120px; margin: 4px auto 14px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
  .card .hintbtn { cursor: pointer; border: 0; background: none; padding: 0; font: 700 1.15rem/1.1 var(--f-hand); color: var(--coral); text-decoration: underline; text-underline-offset: 3px; }
  .card .hint { font: 700 1.15rem/1.25 var(--f-hand); color: #5b3a1a; background: #f6ecd4; padding: 8px 12px; transform: rotate(-.8deg); }
  .card .stamp { font-size: .95rem; --torn-bg: var(--s-science); color: #fff; transform: rotate(-4deg); margin-bottom: 10px; }
  .card .got { display: flex; justify-content: center; margin: 4px 0 12px; }
  .card .got img { width: 110px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
  .alldone { margin: 28px 0 0; font: 700 1.4rem/1.2 var(--f-hand); color: #5b3a1a; }
  .restart { display: block; margin-top: 22px; cursor: pointer; border: 0; background: none; padding: 0; font: inherit; font-size: .88rem; color: #8a6f4c; text-decoration: underline; }
  @media (max-width: 860px) { .cards { grid-template-columns: 1fr; gap: 34px; } }
}

/* clue lists, finds and the certificate form */
.pg-explorers {
  .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); row-gap: 40px; }
  .card h4 { font: 400 .78rem/1 var(--f-label); letter-spacing: .08em; color: #8a6f4c; margin: 14px 0 4px; }
  .card .pics { display: flex; justify-content: center; gap: 10px; margin: 4px 0 14px; }
  .card .pics img { width: 120px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.25)); }
  .clues { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 8px; }
  .clues li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: .95rem; }
  .clues .box { width: 22px; height: 22px; margin-left: 6px; border: 2px solid #b9a68a; background: #fff; }
  .clues .tick { width: 34px; height: 34px; object-fit: contain; }
  .clues li.found span { color: #5d7a3e; text-decoration: line-through; text-decoration-color: rgba(93,122,62,.5); }
  .clues li.hidden span { color: #a8977f; font-style: italic; }
  .clues li.hidden .box { border-style: dashed; }
  .sofar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
  .sofar img { width: 54px; height: 54px; object-fit: contain; }
  .card .count { font: 700 1.2rem/1 var(--f-hand); color: var(--coral); }
  .card .summary { font-weight: 600; }
  .card .unit { font-size: .85rem; color: #6b5230; }
  .finds { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 12px; }
  .finds li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }
  .finds img { width: 56px; height: 56px; object-fit: contain; }
  .finds .where { font: 400 .7rem/1 var(--f-label); letter-spacing: .06em; color: #8a6f4c; }
  .finds p { margin: 4px 0 0; font-size: .88rem; }
  .merits { margin-top: 16px; padding-top: 14px; border-top: 2px dashed #e2d3b6; }
  .merits form { display: grid; gap: 10px; }
  .merits form p { margin: 0; font-size: .85rem; color: #6b5230; }
  .merits label { display: grid; gap: 4px; font: 400 .8rem/1 var(--f-label); letter-spacing: .05em; color: var(--ink); }
  .merits input { font: 400 1rem/1.2 var(--f-body); padding: 8px 10px; border: 2px solid #d8c7a6; background: #fff; color: var(--ink); }
  .merits input:focus { outline: 3px solid var(--sky); border-color: var(--navy); }
  .merits .btn { justify-self: start; }
  .merits .note { margin: 8px 0 0; font-size: .88rem; }
  .merits .note.warn { color: #b0402a; font-weight: 600; }
}

/* the link to the Knowledge Organiser Practice website */
.pg-explorers {
  .practice { padding-block: 70px 80px; }
  .practice .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
  .practice h2 { color: var(--label); margin: 14px 0 12px; }
  .practice p { color: #dfe4f4; max-width: 58ch; margin: 0 0 14px; }
  .practice .btn { margin-top: 6px; }
  .kosheet { position: relative; display: block; margin: 8px 0 26px; max-width: 560px; background: #fffdf6; padding: 10px 10px 12px; transform: rotate(-1deg);
             box-shadow: 0 12px 26px rgba(0,0,0,.4); text-decoration: none; color: var(--ink); transition: transform .2s; }
  .kosheet:hover, .kosheet:focus-visible { transform: rotate(0) scale(1.02); outline: none; }
  .kosheet img { display: block; width: 100%; height: auto; }
  .kosheet .cap { display: block; margin-top: 8px; font-size: .85rem; line-height: 1.35; }
  .kosheet .tape { position: absolute; z-index: 2; top: -12px; left: 18%; width: 90px; height: 24px; background: rgba(216,165,54,.75); transform: rotate(4deg); }
  .practice .more { margin-top: 18px; font-size: .9rem; color: #b9c3e3; }
  .practice .more b { color: var(--mustard); font-weight: 600; }
  /* three snapshots of the games, taped on at angles and overlapping */
  .snaps { position: relative; min-height: 640px; }
  .snap { position: absolute; display: block; width: 52%; background: #fffdf6; padding: 10px 10px 12px; box-shadow: 0 12px 26px rgba(0,0,0,.4);
          text-decoration: none; color: var(--ink); transition: transform .2s; }
  .snap img { display: block; width: 100%; height: auto; }
  .snap .cap { display: grid; gap: 2px; margin-top: 8px; font-size: .82rem; line-height: 1.3; }
  .snap .cap b { font: 400 .95rem/1.1 var(--f-label); letter-spacing: .03em; color: var(--navy); }
  .snap .tape { position: absolute; z-index: 2; top: -12px; left: 50%; width: 90px; height: 24px; margin-left: -45px; background: rgba(216,165,54,.75); transform: rotate(-3deg); }
  .snap.s0 { left: 0; top: 0; transform: rotate(-4deg); z-index: 1; }
  .snap.s1 { right: 0; top: 56px; transform: rotate(3deg); z-index: 2; }
  .snap.s2 { left: 22%; top: 296px; transform: rotate(-1.5deg); z-index: 3; }
  .snap:hover, .snap:focus-visible { transform: rotate(0) scale(1.04); z-index: 5; outline: none; }
  @media (max-width: 860px) {
    .practice .wrap { grid-template-columns: 1fr; }
    .snaps { min-height: 0; display: grid; gap: 22px; }
    .snap, .snap.s0, .snap.s1, .snap.s2 { position: relative; left: auto; right: auto; top: auto; width: auto; }
  }
}

/* the reading ladder, and the card for the book that's open */
.pg-explorers {
  .reading { padding-block: 70px 80px; }
  .reading .lede { margin: 8px 0 0; max-width: 60ch; }
  .readhead { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
  .quote { display: grid; grid-template-columns: 90px 1fr; gap: 18px; align-items: start; max-width: 440px; }
  /* the tail points left, at Ada's face, rather than down */
  .quote .bubble { margin-top: 6px; }
  .quote .bubble::after { left: -16px; top: 18px; bottom: auto; border-width: 9px 17px 9px 0; border-color: transparent #fffdf6 transparent transparent; }
  .quote img { width: 90px; }
  .ladder { display: grid; gap: 14px; margin-top: 20px; }
  .rung { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: stretch; }
  .rung > b { display: grid; place-items: center; font: 400 1.05rem/1.1 var(--f-label); color: #fff; text-align: center; padding: 6px; }
  .rung.y7 > b { background: color-mix(in srgb, var(--teal) 70%, #fff); } .rung.y8 > b { background: var(--mustard); } .rung.y9 > b { background: var(--hach-blue); }
  .rung.on > b { box-shadow: inset 0 0 0 4px var(--coral); }
  .rung.on > b::after { content: "YOUR YEAR"; display: block; font-size: .62rem; letter-spacing: .08em; margin-top: 4px; }
  .books { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
  .book { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; background: #fffdf6; padding: 9px 12px; box-shadow: 0 2px 6px rgba(0,0,0,.08); text-decoration: none; color: inherit; transition: transform .15s;
          cursor: pointer; border: 0; font: inherit; text-align: left; width: 100%; }
  .book:focus-visible { outline: 3px dashed var(--coral); outline-offset: 2px; }
  .book:hover { transform: translateY(-2px); }
  .book .spine { height: 66px; background: var(--c); display: grid; place-items: center; box-shadow: inset -5px 0 0 rgba(0,0,0,.15); }
  .book .spine img { width: 38px; height: 38px; object-fit: contain; }
  .book b { display: block; font-size: .9rem; line-height: 1.2; }
  .book i { font-style: normal; font-size: .78rem; color: #6d5638; }
  .book small { display: block; font: 400 .66rem/1.2 var(--f-label); letter-spacing: .04em; color: var(--c); margin-top: 3px; }
  .draft { font-size: .82rem; color: #6d5638; margin-top: 14px; }

  /* book card */
  & dialog.bookdlg { border: 0; padding: 0; background: transparent; width: min(780px, calc(100vw - 24px)); max-width: none; }
  & dialog.bookdlg::backdrop { background: rgba(15, 20, 45, .6); }
  .bk { display: grid; grid-template-columns: 250px 1fr; gap: 26px; background: #fffdf6; padding: 24px; box-shadow: 0 20px 40px rgba(0,0,0,.35); position: relative; border-top: 12px solid var(--c); }
  .bk .x { position: absolute; top: 8px; right: 10px; cursor: pointer; border: 0; background: none; font: 400 1.1rem/1 var(--f-label); color: #8a6f4c; padding: 6px 8px; }
  .cover { position: relative; aspect-ratio: 2 / 3; background: var(--c) url(/img/bg_kraft.webp) center/400px; background-blend-mode: multiply; box-shadow: 8px 10px 0 rgba(0,0,0,.12), inset 10px 0 0 rgba(0,0,0,.18), inset 13px 0 0 rgba(255,255,255,.15);
           display: grid; grid-template-rows: auto 1fr auto; justify-items: center; padding: 22px 16px 16px 26px; transform: rotate(-2deg); }
  .cover .tape { top: -12px; left: 36%; transform: rotate(-4deg); }
  .cover .t { font: 400 1.25rem/1.1 var(--f-slab); text-align: center; --torn-bg: var(--label); }
  .cover img { align-self: center; width: 72%; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
  .cover .au { font: 700 1.3rem/1 var(--f-hand); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
  .bk .rl { font: 400 .76rem/1 var(--f-label); letter-spacing: .08em; color: var(--c); }
  .bk h2 { font: 400 1.9rem/1.05 var(--f-slab); margin: 8px 0 4px; padding-right: 30px; }
  .bk .by { font-size: .95rem; color: #6d5638; margin: 0 0 14px; }
  .bk h3 { font: 400 .76rem/1 var(--f-label); letter-spacing: .08em; color: #8a6f4c; margin: 14px 0 6px; }
  .bk p { margin: 0; }
  .bk .link { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; background: color-mix(in srgb, var(--c) 12%, #fffdf6); border-left: 6px solid var(--c); padding: 10px 12px; }
  .bk .link img { width: 64px; height: 64px; object-fit: contain; }
  .bk .link b { display: block; font: 400 .76rem/1.2 var(--f-label); letter-spacing: .04em; color: var(--c); }
  .bk .link span { font-size: .92rem; }
  .bk .acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
  .bk .acts a { text-decoration: none; }
  .bk .note { font-size: .78rem; color: #8a6f4c; margin-top: 14px; }
  @media (max-width: 640px) { .bk { grid-template-columns: 1fr; } .cover { width: 60%; margin: 0 auto; } }
  @media (max-width: 900px) { .readhead { grid-template-columns: 1fr; } }
  @media (max-width: 560px) { .rung { grid-template-columns: 70px 1fr; } }
}
